Amazon External Fulfillment Shipments API Use-Case Guide

Terminology

  • SP-API: Selling Partner API

  • EF-API: External Fulfilment API (also referred as SmartConnect API)

  • Location: Amazon location identifier

  • Order: Customer purchase transaction that contains one or more items sold through the Amazon marketplace.

  • Shipment: Collection of ordered items that will be delivered together to the customer. Multiple shipments can be created from a single order when ordered items are sourced from different fulfillment locations/sellers.

  • Package: Physical container that holds items being shipped to a customer. A single shipment may contain multiple packages. E.g., A dining table shipped in 3 packages: tabletop, legs, hardware (also known as Multi Piece Shipments [MPS])

  1. What is the External Fulfilment API?

    The external fulfilment API (also known as SmartConnect API) enables selling partners to fetch customer orders across multiple fulfilment programs (Eg. Seller Flex, Easy Ship, Pharmacy, MLF) and process them using a standard set of APIs.

    Additionally, selling partner can also manage their inventory updates and reconcile their returns using same set of APIs.

    External Fulfilment offer 3 APIs –

    a) Inventory APIs – to update inventory;
    b) Shipment API – to fetch customer orders and process them; and
    c) Returns API – to get return details.

    These are Synchronous and Rest APIs. Currently External Fulfilment supports 8 different fulfilment programs within Amazon.

  2. How to identify Program (Easy Ship/Self Ship/Seller Flex) in External Fulfilment APIs?

    Sellers can identify program in getShipments or getShipment API with combination of below attributes:


    API Attribute Value Program
    getShipments/getShipment channelName MFN Easy Ship
    shippingType Marketplace
    channelName MFN Self-Ship
    shippingType Self
    channelName FBA Seller Flex
    shippingType Marketplace
  3. Understanding shipment processing workflow

    1. 3.1 Shipment Processing Workflow: All selling partners working with external fulfilment APIs are expected to adhere to a workflow for processing a shipment. This workflow steps and the corresponding API operations are documented below.
      The workflow is illustrated below:

      Key: Each rounded rectangle in the workflow indicates a wait state in the workflow, while each arrow indicates an API call that triggers some change in the workflow.

    2. 3.2 Workflow Steps: A brief overview of the various steps of the workflow are given below.

      Note: These workflow steps are needed to process shipment via APIs. However, selling partners may need additional steps in on ground operations (Inbounding, order Picking, Manifest etc). These steps are not in scope of APIs operations.

      1. Get shipments: Client gets a list of all the shipment for a location.

      2. Process Shipment: Client confirm or reject fulfilment of the shipment. Currently partial confirmation of the shipment is not supported.

      3. Create Packages: Client provides details about the packages that will be used for fulfilling the shipment. This includes any required information such as dimensions, weights, IMEI/serial number, Hazmat label details, etc.

      4. Retrieve Shipping Options: Clients invoke this API to retrieve a list of shipping Options that marketplace/channel provides for the pickup of the package.
        This API will return a list of shipping options and allows the seller to choose from the list. The API returns empty successful response, If the marketplace/channel does not allow for a shipping option to be selected. Eg. For FBA Onsite, Seller Flex and Multi Seller Flex orders, it returns an empty response as the pickup is performed at a pre-determined slot.

      5. Generate Invoice: Client invoke this API to generate and retrieve the Invoice/P-Slip or both (as applicable) for a shipment. The API will return the invoice as a file that can be printed. If the marketplace doesn’t support generating a tax invoice, only packing-slip will be returned. This API is not supported for Easy Ship channel in WW marketplaces (except IN marketplace) [Supported format is PDF.].

      6. Update Package: After generating the invoice, it is possible that the selling partners may need to change some information about the packed items such as the IMEI serial number or package dimensions. They can invoke this API for the same.

      7. Generate Ship Labels: Client invoke this API to generate and retrieve the ship-label from the transportation carrier. The API will return the ship-label as a file that can be printed. [Supported formats are PNG and ZPL].

      8. Update Package Status: Once the shipment has been physically handed over to carrier, callers invoke this API indicate that the shipment has been successfully shipped.

      This completes the shipment workflow and the shipment is now in closed state.

    3. 3.3 Shipment Statuses: Every shipment has a status associated with it. The status of the shipment indicates the step in the workflow that the shipment is in. Below is a description of each of these status values.

      1. CREATED: This status indicated the order is created in Amazon External FulFillment. Applicable only for MFN channels.

      2. ACCEPTED: Based on the inventory availability in Amazon External FulFillment of all the SKUs in a particular shipment, the Amazon Yojaka system will mark a shipment in this status for further processing by the connector application.

      3. UNFULFILLABLE: If inventory is unavailable in Smart Connect and was updated via some other system then order drops to smart connect will be marked Unfulfillable. Applicable only for MFN channels.

      4. CONFIRMED: This status indicates that the connector has confirmed a shipment by invoking the process-shipment API.

      5. PACKAGE_CREATED: This status indicates that the connector has provided the package information to the Amazon Yojaka product by invoking the create-packages API.

      6. PICKUP_SLOT_RETRIEVED: A shipment will be in this status once the connector has invoked the retrieve-Shipping-Options API for a shipment API.

      7. INVOICE_GENERATED: This status indicates that the connector has invoked the generate-invoice API for the shipment.

      8. SHIPLABEL_GENERATED: Once the connector invokes the generate-ship-label API for a shipment, the shipment will be in this status.

      9. SHIPPED: This status indicates that the shipment has been shipped to carrier (client updates the package status manually by invoking update-package-status API or via logistics scan events). This is a terminal status in the shipment processing workflow.

      10. DELIVERED: This status indicates that the shipment is delivered to the customer.

      11. CANCELLED: This status indicates the shipment has been cancelled either by the connector or by the marketplace. This is a terminal status.

    4. 3.4 API Call flow: Below is an Ideal API operation sequence to successfully process shipments -

    5. Step Method API Call Order Status (Previous) Order Status (Updated) Operation Description
      1 GET getShipments / getShipment ACCEPTED - Retrieve list of orders for processing / Retrieve details for a given order
      2 POST processShipment ACCEPTED CONFIRMED Confirm order for processing
      3 POST createPackages CONFIRMED PACKAGE_CREATED Provide package dimensions, weights, IMEI/Serial number, Hazmat label details, etc.
      4 GET retrieveShippingOptions CONFIRMED PICKUP_SLOT_RETRIEVED Retrieve carrier shipping options
      5 POST generateInvoice PICKUP_SLOT_RETRIEVED INVOICE_GENERATED Generate Invoice/P-Slip PDF document. This API is not supported for Easy Ship channel in WW marketplaces (except IN marketplace), such clients can skip this API call.
      6 PUT generateShipLabels INVOICE_GENERATED SHIPLABEL_GENERATED Generate Shipping Label PNG/ZPL (Single Piece Shipment [SPS]) or only ZPL (Multi Piece Shipments [MPS])
      7 PUT updatePackageStatus SHIPLABEL_GENERATED SHIPPED Update order status as "SHIPPED" (Optional).
  4. Tutorial 1: Getting list of shipments for various statuses

    This tutorial shows you how to get the list of shipments for any status. This is the first API operation to begin order processing for any seller.

    1. 4.1 Retrieve All shipments (getShipments API)

      Call the getShipments API to fetch list of all shipments for processing (or checking current shipment status), following the below steps. The API response will provide order metadata containing details required for order processing.

      Usage Plan:

      Rate (requests per second) : 1

    2. Query Parameters:

      Name Description Type
      marketplaceId The marketplace identifier associated with the location. Amazon marketplaces - https://developer-docs.amazon.com/sp-api/docs/marketplace-ids String
      channelName The identifier for the marketplace channel where the order needs to be retrieved. Valid values are FBA, MFN String
      lastUpdatedAfter Shipments whose latest update is after the specified date/time are included in the response. This field should be in the ISO8601 date/time format. Date (date-time)
      lastUpdatedBefore Shipments whose latest update is before the specified date/time are included in the response. This field should be in the ISO8601 date/time format. Date (date-time)
      maxResults Specify the number of shipments to be included in the response (Max allowed 100). If omitted, this parameter defaults to 10. Integer (int32)
      paginationToken The nextToken value returned from a previous call to get shipments (url encoded). Use this to retrieve the next page of shipments. String
      locationId Amazon location identifier for which shipments are to be retrieved, this value is unique to a physical location. This identifier value is shared by Amazon External Fulfillment team during onboarding process. String
      status* Required Retrieves only those shipments which are in the specified status. The most common use-case would be to fetch all new shipments which would be in the ACCEPTED status. Valid values are CREATED, ACCEPTED, UNFULFILLABLE, CONFIRMED, PACKAGE_CREATED, PICKUP_SLOT_RETRIEVED, INVOICE_GENERATED, SHIPLABEL_GENERATED, SHIPPED, DELIVERED and CANCELLED String

      Request Example

      curl -X GET "https://sellingpartnerapi-na.amazon.com/externalFulfillment/2024-09-11/shipments?locationId=&status=&lastUpdatedAfter=&lastUpdatedBefore=&maxResults=&nextToken"

      Note: shipmentId is the key id for seller facing processes, identified as “id” in below API response. A single customer order can be split into several shipments and assigned to different seller/locations.

      Response Sample:

      [
          {
              "invoiceInfo": {
                  "invoiceId": "$metadata.invoiceInfo.invoiceId"
              },
              "shippingInfo": {
                  "shipToAddress": {
                      "postalCode": "34500"
                  },
                  "expectedShippingDateTime": "2025-01-13T14:05:00Z",
                  "expectedShippingDateTimeInUTC": "2025-01-13T11:05:00Z",
                  "recommendedShipMethod": "MNG_STD_DOM",
                  "shippingType": "Marketplace",
                  "recommendedPackages": [
                      {
                          "weight": {
                              "value": 1000,
                              "weightUnit": "G"
                          },
                          "dimensions": {
                              "length": {
                                  "dimensionUnit": "CM",
                                  "value": 0.99999999898
                              },
                              "width": {
                                  "dimensionUnit": "CM",
                                  "value": 0.99999999898
                              },
                              "height": {
                                  "dimensionUnit": "CM",
                                  "value": 0.99999999898
                              }
                          }
                      }
                  ]
              },
              "marketplaceAttributes": {
                  "marketplaceId": "A1805IZSGTT6HS",
                  "channelName": "MFN"
              },
              "shipmentRequirements": {
                  "pSlipRequirement": "DISALLOWED"
              },
              "lineItems": [
                  {
                      "pieceType": "SINGLE",
                      "shipmentLineItemId": "1",
                      "charges": [
                          {
                              "totalTax": {
                                  "charge": {
                                      "netAmount": {
                                          "value": 0,
                                          "currencyCode": "ANG"
                                      },
                                      "discountAmount": {
                                          "value": 0,
                                          "currencyCode": "ANG"
                                      },
                                      "baseAmount": {
                                          "value": 0,
                                          "currencyCode": "ANG"
                                      }
                                  },
                                  "type": ""
                              },
                              "totalCharge": {
                                  "netAmount": {
                                      "value": 1.99,
                                      "currencyCode": "ANG"
                                  },
                                  "discountAmount": {
                                      "value": 0,
                                      "currencyCode": "ANG"
                                  },
                                  "baseAmount": {
                                      "value": 1.99,
                                      "currencyCode": "ANG"
                                  }
                              },
                              "baseCharge": {
                                  "netAmount": {
                                      "value": 1.99,
                                      "currencyCode": "ANG"
                                  },
                                  "discountAmount": {
                                      "value": 0,
                                      "currencyCode": "ANG"
                                  },
                                  "baseAmount": {
                                      "value": 1.99,
                                      "currencyCode": "ANG"
                                  }
                              },
                              "chargeType": "product"
                          }
                      ],
                      "numberOfUnits": 1,
                      "complianceAttributes": {
                          "serialNumberRequirement": "DISALLOWED",
                          "hazmatLabelsRequirement": "DISALLOWED",
                          "countryOfOriginRequirement": "DISALLOWED"
                      },
                      "giftAttributes": {
                          "giftWrapRequirement": "DISALLOWED",
                          "giftMessagePresence": "ABSENT"
                      },
                      "merchantSku": "GD_Rest_Test",
                  }
              ],
              "charges": [
                  {
                      "totalTax": {
                          "charge": {
                              "netAmount": {
                                  "value": 0,
                                  "currencyCode": "ANG"
                              },
                              "discountAmount": {
                                  "value": 0,
                                  "currencyCode": "ANG"
                              },
                              "baseAmount": {
                                  "value": 0,
                                  "currencyCode": "ANG"
                              }
                          },
                          "type": ""
                      },
                      "totalCharge": {
                          "netAmount": {
                              "value": 0,
                              "currencyCode": "ANG"
                          },
                          "discountAmount": {
                              "value": -19.95,
                              "currencyCode": "ANG"
                          },
                          "baseAmount": {
                              "value": 19.95,
                              "currencyCode": "ANG"
                          }
                      },
                      "baseCharge": {
                          "netAmount": {
                              "value": 0,
                              "currencyCode": "ANG"
                          },
                          "discountAmount": {
                              "value": -19.95,
                              "currencyCode": "ANG"
                          },
                          "baseAmount": {
                              "value": 19.95,
                              "currencyCode": "ANG"
                          }
                      },
                      "chargeType": "shipping"
                  }
              ],
              "locationId": "DEFAULT",
              "partyInfoList": [],
              "id": "U6GsCjSJX",
              "lastUpdatedDateTime": "2025-01-09T17:19:20Z",
              "shipmentInfo": {
                  "numberOfUnits": 1,
                  "priority": "HIGH",
                  "buyerOrderId": "171-3218244-3405116",
                  "shipmentType": "NEW"
              },
              "status": "ACCEPTED",
              "creationDateTime": "2025-01-09T13:12:34Z"
          }
      ]
    3. 4.2 Retrieve Single shipment detail (getShipment API)

      Invoke the getShipment API to fetch details of a specified shipment for order processing.

      Usage Plan:

      Rate (requests per second) : 1

      Parameters

      Path parameters

      Name Description Type
      shipmentId* Required The id of the shipment to be retrieved. Shipment Id is returned as "Id" in getShipments API. String

      Request example

      curl -X GET "https://sellingpartnerapi-na.amazon.com/externalFulfillment/2024-09-11/shipments/{shipmentId}"

      Response Sample:

      {
          "invoiceInfo": {
              "invoiceId": "$metadata.invoiceInfo.invoiceId"
          },
          "shippingInfo": {
              "shipToAddress": {
                  "postalCode": "34500"
              },
              "expectedShippingDateTime": "2025-01-13T14:05:00Z",
              "expectedShippingDateTimeInUTC": "2025-01-13T11:05:00Z",
              "recommendedShipMethod": "MNG_STD_DOM",
              "shippingType": "Marketplace",
              "recommendedPackages": [
                  {
                      "weight": {
                          "value": 1000,
                          "weightUnit": "G"
                      },
                      "dimensions": {
                          "length": {
                              "dimensionUnit": "CM",
                              "value": 0.99999999898
                          },
                          "width": {
                              "dimensionUnit": "CM",
                              "value": 0.99999999898
                          },
                          "height": {
                              "dimensionUnit": "CM",
                              "value": 0.99999999898
                          }
                      }
                  }
              ]
          },
          "marketplaceAttributes": {
              "marketplaceId": "A1805IZSGTT6HS",
              "channelName": "MFN"
          },
          "shipmentRequirements": {
              "pSlipRequirement": "DISALLOWED"
          },
          "lineItems": [
              {
                  "pieceType": "SINGLE",
                  "shipmentLineItemId": "1",
                  "charges": [
                      {
                          "totalTax": {
                              "charge": {
                                  "netAmount": {
                                      "value": 0,
                                      "currencyCode": "ANG"
                                  },
                                  "discountAmount": {
                                      "value": 0,
                                      "currencyCode": "ANG"
                                  },
                                  "baseAmount": {
                                      "value": 0,
                                      "currencyCode": "ANG"
                                  }
                              },
                              "type": ""
                          },
                          "totalCharge": {
                              "netAmount": {
                                  "value": 1.99,
                                  "currencyCode": "ANG"
                              },
                              "discountAmount": {
                                  "value": 0,
                                  "currencyCode": "ANG"
                              },
                              "baseAmount": {
                                  "value": 1.99,
                                  "currencyCode": "ANG"
                              }
                          },
                          "chargeType": "product"
                      }
                  ],
                  "numberOfUnits": 1,
                  "complianceAttributes": {
                      "serialNumberRequirement": "DISALLOWED",
                      "hazmatLabelsRequirement": "DISALLOWED",
                      "countryOfOriginRequirement": "DISALLOWED"
                  },
                  "giftAttributes": {
                      "giftWrapRequirement": "DISALLOWED",
                      "giftMessagePresence": "ABSENT"
                  },
                  "merchantSku": "GD_Rest_Test",
              }
          ],
          "locationId": "DEFAULT",
          "partyInfoList": [],
          "id": "U6GsCjSJX",
          "lastUpdatedDateTime": "2025-01-09T17:19:20Z",
          "shipmentInfo": {
              "numberOfUnits": 1,
              "priority": "HIGH",
              "buyerOrderId": "171-3218244-3405116",
              "shipmentType": "NEW"
          },
          "status": "ACCEPTED",
          "creationDateTime": "2025-01-09T13:12:34Z"
      }
  5. Tutorial 2: Processing a shipment using external fulfilment shipments API

    This tutorial shows you how to process a shipment using the external fulfilment shipments API.

    1. 5.1 Prerequisites

      To successfully complete this tutorial, you must have:

      1. Authorization from the selling partner for whom you are making calls. See the Selling Partner API Developer Guide for more information.

      2. You have the shipmentId (s) to be processed.

    2. 5.2 Steps

      • Step 1. Acknowledge the shipment

      • Step 2. Create packages for the shipment

      • Step 3. Get the shipping options for the shipment

      • Step 4. Generate the invoice for the shipment

      • Step 5: [Optional] Update Package

      • Step 6. Generate and retrieve the shipLabel for the shipment

      • Step 7: [Optional] Update Package status

    3. Step 1. Acknowledge the shipment

      Call the processShipment API to confirm the shipment which is to be processed by passing the following path, query and header parameters.

      Note - Key ID is shipmentId which is from previous section (getShipment API)

      Usage Plan:

      Rate (requests per second) : 1

      Path parameters

      Name Description Type Required
      shipmentId The id of the shipment which is to be confirmed for fulfilment. String Yes

      Header parameters

      Name Description Type Required
      x-amz-access-token The LWA access token for authorizing the request. String Yes

      Query parameters

      Name Description Type Required
      operation Intended operation to confirm order for fulfillment or reject. String Enum value: [CONFIRM, REJECT]

      Body parameters

      body - The request schema for the reject shipment line items.

      Name Description Type Required
      referenceId A unique identifier for every shipment rejection raised by the caller String, not null Yes, Only for Reject Operation
      Lineitems.lineitem.Id The identifier of the line item from the shipment which is being confirmed/rejected by the seller String Yes, Only for Reject Operation
      Lineitems.lineitem.Quantity Number of line item Integer Yes, Only for Reject Operation
      Lineitems.reason The reason for the rejection of line item in case it is being rejected. Enum: OUT_OF_STOCK String Yes, Only for Reject Operation

      Request Example

      curl -X POST "https://sellingpartnerapi-na.amazon.com/externalFulfillment/shipments/2021-01-06/shipments/{shipmentId}?operation="

      Response Example

      {}

      Step 2. Create packages for the shipment

      Create packages for the shipment which is to be processed by passing the following path, header and body parameters in the createPackages API. Client to provide details about the packages that will be used for fulfilling the order. Callers provide any required information such as dimensions, weights, IMEI/serial number, Hazmat label details, etc.


      Key ID is shipmentId obtained in first section. Seller can create package with their own defined box dimension (seller can have predefined list in their code), or with the recommended box dimensions (which is based on catalog dimension) as part of getShipment API response.

      Usage Plan:

      Rate (requests per second) : 1

      Path parameters

      Name Description Type Required
      shipmentId The id of the shipment which is to be confirmed for fulfilment. String Yes

      Header parameters

      Name Description Type Required
      x-amz-access-token The LWA access token for authorizing the request String Yes

      Body parameters: Refer to API documentation for Body Parameters.

      Request example

      curl -X POST "https://sellingpartnerapi-na.amazon.com/externalFulfillment/shipments/2021-01-06/shipments/{shipmentId}/packages"

      Request Body Sample

      {
          "packages": [
              {
                  "dimensions": {
                      "length": {
                          "dimensionUnit": "CM",
                          "value": 0.99999999898
                          },
                      "width": {
                          "dimensionUnit": "CM",
                          "value": 0.99999999898
                          },
                      "height": {
                          "dimensionUnit": "CM",
                          "value": 0.99999999898
                          }
                  },
                  "id": "package_1",
                  "weight": {
                      "value": 1000,
                      "weightUnit": "g"
                  },
                  "hazmatlabels": [],
                  "packageLineItems": [
                      {
                          "packageLineItem": {
                              "id": "1"
                          },
                          "quantity": 1,
                          "serialNumbers": []
                      }
                  ]
              }
          ]
      }

      Response example

      {}

      Step 3. Get the shipping options for the shipment

      Call the retrieveShippingOptions API for the shipment which is to be processed by passing the path, query and header parameters provided below. Clients invoke this API next to retrieve a list of shipping Options that marketplace/channel provides for the pickup of the package of a shipment. This API will return a list of shippingOptions, if the marketplace/channel provides transportation and allows the seller to choose a shippingOption. For Seller Flex channel, it is No-Op call (200 null response).

      Usage Plan:

      Rate (requests per second) : 1

      Query parameters

      Name Description Type Required
      shipmentId The id of the shipment whose shipping options needs to retrieved. String Yes
      packageId The id of the package for which available shipping option needs to be retrieved. String Yes

      Header parameters

      Name Description Type Required
      x-amz-access-token The LWA access token for authorizing the request. String Yes

      Request example

      curl -X GET "https://sellingpartnerapi-na.amazon.com/externalFulfillment/shipments/2021-01-06/shippingOptions?shipmentId="

      Response example:

      {
          "shippingOptions": [
              {
                  "shippingOptionId": "ABDGYEBDVGUZTYWU==",
                  "shipBy": "MARKETPLACE",
                  "carrierName": "ATS",
                  "pickupWindow": {
                      "startTime": "1736793268",
                      "endTime": 1736793268
                  }
              },
              {
                  "shippingOptionId": "ABDGYEBDVGUZTYWU==",
                  "shipBy": "MARKETPLACE",
                  "carrierName": "ATS",
                  "pickupWindow": {
                      "startTime": 1736793268,
                      "endTime": 1736793268
                  }
              }
          ]
      }

      Step 4. Generate and retrieve the invoice for the shipment

      Callers invoke generateInvoice API to generate the invoice for the order. The API will return the invoice as encoded base64 text that can be decoded and converted to PDF for printing. Once the invoice has been generated successfully for a shipment/order, Callers can also invoke retriveInvoice API with same parameters as generateInvoice to retrieve previously generated invoice.
      This API is not supported for Easy Ship channel in WW marketplaces (except IN marketplace)

      Usage Plan:

      Rate (requests per second) : 1

      Path parameters

      Name Description Type Required
      shipmentId The id of the shipment whose invoice is to be generated and retrieved. String Yes

      Header parameters

      Name Description Type Required
      x-amz-access-token The LWA access token for authorizing the request. String Yes

      Request example (for both generate and retrieve invoice)

      curl -X POST "https://sellingpartnerapi-na.amazon.com/externalFulfillment/shipments/2021-01-06/shipments/{shipmentId}/invoice"

      Response Schema: (for both generate and retrieve invoice)

      {
          The response schema for the generateInvoice and retrieveInvoice operations.
          Required: document
          "document": {
              The invoice content.
              "format": string,
      
              The media type of the file.
              Enum: PDF, PNG, PLAIN_TEXT
              
              "content": string  // Base 64 encoded file contents.
          }
      }

      Response Sample:

      {
          "document": {
              "format": "PLAIN_TEXT",
              "content": "SlZCRVJpMHhMalFLSmFxcnJLMEtNU0F3SUc5aWFnbzhQQW92UTNKbFlYUnZjaUFvUVhCaFkyaGxJRVpQVUNCV1pYSnphVzl1SURJdU1Ta0tMMUJ5YjJSMVkyVnlJQ2hCY0dGamFHVWdSazlRSUZabGNuTnBiMjRnTWk0eEtRb3ZRM0psWVhScGIyNUVZWFJsSUNoRU9qSXdNalF3TVRFeE1UQXlOREl4V2lrS1BqNEtaVzVrYj"
          }
      }

      Step 4.1 Steps to convert the base64 invoice contents to PDF

      • Step 1: Retrieve the base64 encoded invoice using generateInvoice/retrieveInvoice APIs.

      • Step 2: Decode the bae64 encoded string to text.

      • Step 3: Convert base64 text received in step 2 to PDF.

      Step 5: Update Package [Optional]

      After generating the invoice, it is possible that the selling partners need to change some information about the packed items such as the IMEI serial number or package dimensions. Callers invoke updatePackage (Optional) API for the same, the operations move the order status to “PACKAGE_CREATED” status. Call this API with the following parameters to update the details about the packages that will be used to fulfill the specified shipment.

      Usage Plan:

      Rate (requests per second) : 1

      Path parameters

      Name Description Type Required
      shipmentId The id of the shipment for which package attributes needs to be updated. String Yes
      packageId The id of the package for which information is being updated. String Yes

      Header parameters

      Name Description Type Required
      x-amz-access-token The LWA access token for authorizing the request String Yes

      Body parameters: Refer to API documentation for Body Parameters.

      Request example

      curl -X PUT "https://sellingpartnerapi-na.amazon.com/externalFulfillment/shipments/2021-01-06/shipments/{shipmentId}/packages/{packageId}"

      Request Body Sample

      {
          "dimensions": {
              "length": {
                  "dimensionUnit": "CM",
                  "value": 15.399999971032
              },
              "width": {
                  "dimensionUnit": "CM",
                  "value": 15.799999972664
              },
              "height": {
                  "dimensionUnit": "CM",
                  "value": 20.599999989188
              }
          },
          "id": "package_1",
          "weight": {
              "value": 300,
              "weightUnit": "grams"
          },
          "hazmatLabels": [],
          "packageLineItems": [
              {
                  "packageLineItem": {
                      "id": "1"
                  },
                  "quantity": 1,
                  "serialNumbers": []
              }
          ]
      }

      Response example

      {}

      Step 6. Generate the ship labels for the shipment

      Callers invoke generateShipLabels API to generate and retrieve the ship-label for package(s) of an order from the transportation carrier. For Easy Ship channel, callers can invoke this API to regenerate and retrieve the ship-label from the transportation carrier as well. This is done to reschedule the pick-up slot for an Easy ship order.

      Note: Once the ship label has been generated successfully for an Easy Ship and Seller Flex shipment, callers can again invoke this API call to retrieve previously generated ship label. (e.g., In case of print failure, storage issue etc.)

      Usage Plan:

      Rate (requests per second) : 1

      Path parameters

      Name Description Type Required
      shipmentId* The id of the shipment whose ship label needs to be generated and retrieved. String Yes

      Query parameters

      Name Description Type Required
      shippingOptionId The id of the shipping-option that the seller chooses to ship the package. Required only for MFN channel. String No
      operation* The operationType associated with current invocation. Valid values: GENERATE, REGENERATE String Yes

      Header parameters

      Name Description Type Required
      x-amz-access-token The LWA access token for authorizing the request. String Yes

      Body parameters

      Name Description Type Required
      body Contains tracking details about the shipping.

      The body should contain:
      • packageIds: Array ["packageId1"]
      • courierSupportedAttributes: (only required for MFN-Self ship channel, optional for Easy Ship)
        • carrierName (String): Name of the carrier
        • trackingId (String): The tracking number of the package
      Object Yes (packageIds required, courierSupportedAttributes conditional)

      Query parameters

      Name Description Type Required
      shippingOptionId The id of the shippingOption for which a ship-label is to be generated/retrieved. String No
      operation The operation which says it is generation or regeneration of label. Valid values are GENERATE, REGENERATE String Yes

      Request example

      curl -X POST "https://sellingpartnerapi-na.amazon.com/externalFulfillment/shipments/2021-01-06/shipments/{shipmentId}/shipLabels?shippingOptionId=&operation="

      Request Body Sample

      {
          "packageIds": [
              "packageId1"
          ]
      }

      Response Sample (for both generate and retrieve Ship Label):

      {
          "packageShipLabelList": [
              {
                  "fileData": {
                      "format": "ZPL",
                      "presignedURL": "http://s3.amazonaws.com/[bucket_name]/"
                  },
                  "packageId": "package_1",
                  "shipLabelMetadata": {
                      "carrierName": "DHL",
                      "trackingId": "ABC12345678",
                      "pickupWindow": {
                          "startTimestamp": 1234,
                          "endTimestamp": 1235
                      }
                  },
                  "isErrored": false
              }
          ]
      }

      Step 7: Update Package Status

      Callers can invoke updatePackageStatus API to mark order as SHIPPED.

      Note: For India, UAE, Turkey and Saudi Arabia Seller Flex program / Easy Ship program this is an optional API call as Amazon will automatically update the status as SHIPPED after the shipment is scanned at by the Amazon Logistics partner during order pickup. If the selling partner also chooses to mark these orders as shipped at their end, they should expect a duplicate request exception in case the order is already scanned by delivery associate.

      Usage Plan:

      Rate (requests per second) : 1

      Header parameters

      Name Description Type Required
      x-amz-access-token The LWA access token for authorizing the request. String Yes

      Path parameters

      Name Description Type Required
      shipmentId* The id of the shipment for which package information is being updated. String Yes

      Query parameters

      Name Description Type Required
      status* Valid values are SHIPPED String Yes

      Request example

      curl -X PATCH "https://sellingpartnerapi-na.amazon.com/externalFulfillment/shipments/2021-01-06/shipments/{shipmentId}/packages?status="

      Response example

      {}