> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.returnhelper.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 建立 FBA指令

<Warning>
  此頁面由 AI 自動翻譯。API 技術規格以英文呈現為標準。如有任何疑問，請參閱[英文版本](/api-reference/fbainstruction/create-fba-instructions)。
</Warning>

建立一條或多條 FBA 指示——告知倉庫如何處理 FBA 庫存的指令：銷毀、召回、補貨、回庫、轉送至 FBA 或其他類型。每條指示對應特定的 FBA 運貨單項目；類型透過 `fbaInstructionHandlingCode` 設定。狀態變更經 webhook 推送——請參見 [Webhooks](/zh-Hant/webhooks) 中相關事件名稱。


## OpenAPI

````yaml post /api/Fba/FbaInstruction/create
openapi: 3.1.0
info:
  title: Return Helper API
  description: API documentation for Return Helper — covering User and Public endpoints.
  version: 1.0.0
servers:
  - url: https://api.returnshelper.com/uat/user
    description: Sandbox — User API
  - url: https://api.returnshelper.com/uat/public
    description: Sandbox — Public API
  - url: https://api.returnhelpercentre.com/v1/user
    description: Production — User API
  - url: https://api.returnhelpercentre.com/v1/public
    description: Production — Public API
  - url: https://api.returnhelperchina.com/user
    description: Production — User API (China)
security:
  - ApiKey: []
    ApiToken: []
paths:
  /api/Fba/FbaInstruction/create:
    post:
      tags:
        - FbaInstruction
      summary: Create FBA instructions
      operationId: ReturnUserApi_FbaInstruction_Create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFbaInstructionRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneralList_CreateFbaInstructionReply'
        '401':
          description: >-
            Authentication failed. Returned when the `x-rr-apikey` or
            `x-rr-apitoken` header is missing or invalid. The body uses the
            standard `ApiResponse` envelope with `meta.error.message` describing
            the auth failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      security:
        - ApiKey: []
          ApiToken: []
      servers:
        - url: https://api.returnshelper.com/uat/user
          description: Sandbox — User API
components:
  schemas:
    CreateFbaInstructionRequest:
      type: object
      properties:
        fbaInstructionHandlingCode:
          type: string
          description: FBA instruction handling code (e.g., REPLENISH, RECALL)
        fnskuList:
          type: array
          items:
            $ref: '#/components/schemas/CreateFbaInstructionSkuPayload'
          description: >-
            List of FBA SKUs to process. All items must belong to the same
            warehouse.
      required:
        - fbaInstructionHandlingCode
        - fnskuList
    GeneralList_CreateFbaInstructionReply:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/CreateFbaInstructionReply'
          description: List of created FBA instructions
    ApiResponse:
      type: object
      description: >-
        Universal response envelope. Successful responses include the business
        payload as additional top-level fields alongside `correlationId` and
        `meta`. Failed responses (auth errors, validation errors) only populate
        `correlationId` and `meta`, with `meta.errorCode` and `meta.error`
        describing the failure.
      properties:
        correlationId:
          type:
            - string
            - 'null'
          description: >-
            Unique correlation ID for tracing the request through Return Helper
            systems.
        meta:
          $ref: '#/components/schemas/ApiResponseMeta'
    CreateFbaInstructionSkuPayload:
      type: object
      properties:
        fnsku:
          type: string
          description: FBA SKU identifier (converted to uppercase)
        warehouseId:
          type: integer
          description: ID of the warehouse where the inventory is located
        quantity:
          type: integer
          description: Number of units to process
      required:
        - fnsku
        - warehouseId
        - quantity
    CreateFbaInstructionReply:
      type: object
      properties:
        fbaInstructionId:
          type: string
          format: uuid
        apiId:
          type: integer
          format: int32
        fbaInstructionNumber:
          type:
            - string
            - 'null'
        fbaInstructionHandlingCode:
          type:
            - string
            - 'null'
        handlingStatusCode:
          type:
            - string
            - 'null'
        quantity:
          type: integer
          format: int32
        warehouseId:
          type: integer
          format: int32
        warehouseApiId:
          type: integer
          format: int32
    ApiResponseMeta:
      type: object
      description: >-
        Application-level metadata for every API response. Inspect `status` and
        `errorCode` to detect soft-error responses (validation failures arrive
        as HTTP 200 with `meta.status: 400`).
      properties:
        status:
          type: integer
          description: >-
            Application-level status code. For successful operations this
            mirrors the HTTP status (e.g. 200). For validation failures it
            reports the logical status (e.g. 400) even though the wire HTTP
            status is 200.
        data:
          type: object
          additionalProperties:
            type: string
          description: Reserved free-form metadata key/value pairs. Usually empty.
        errorCode:
          type:
            - string
            - 'null'
          description: >-
            Machine-readable error code (e.g. `VALIDATION_FAILED`). Non-null
            only when the operation failed.
        error:
          type: object
          additionalProperties: true
          description: >-
            Field-level or message-level error detail keyed by request property
            name. Empty object on success.
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-rr-apikey
      description: Your API key
    ApiToken:
      type: apiKey
      in: header
      name: x-rr-apitoken
      description: Your API token — keep this private

````