### Amazon Shipping API Endpoints Reference Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/reference/getting-started A comprehensive list of available API endpoints for Amazon OAuth and Shipping services, including their paths and HTTP methods, designed to streamline integration for developers. ```APIDOC Amazon OAuth API: Obtain Shipping API Access Token: POST /auth/o2/token Amazon Shipping API: Shipping Rate API: POST /shipping/v2/shipments/rates Label Purchase Via Purchase Shipment API: POST /shipping/v2/shipments Label Purchase Via Smart Purchase API: POST /shipping/v2/oneClickShipment Shipment Tracking API: GET /shipping/v2/tracking Regenerate Shipping Label API: GET /shipping/v2/shipments/{shipmentId}/documents Cancel Shipment Label API: PUT /shipping/v2/shipments/{shipmentId}/cancel Obtain Delivery Counter Location API: GET /shipping/v2/accessPoints Submit Non-Delivery Report API: POST /shipping/v2/ndrFeedback Provide Additional Input API: GET /shipping/v2/shipments/additionalInputs/schema ``` -------------------------------- ### Provide Additional Input API Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/reference API endpoint to retrieve the schema for providing additional input for shipments. This allows for dynamic extension of shipment data. ```APIDOC GET /shipping/v2/shipments/additionalInputs/schema ``` -------------------------------- ### Amazon Shipping API: Sample GET Shipment Documents Request Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/tutorial-retrieve-previously-generated-shipment-documents Provides an example HTTP GET request to the `getShipmentDocuments` endpoint, demonstrating how to include path, query, and header parameters for retrieving shipping documents. ```HTTP GET https://sellingpartnerapi-eu.amazon.com/shipping/sandbox/v2/shipments/amzn1.dd2b0cec-b215-4504-b94d-d6469b0c4a63/documents?packageClientReferenceId=abcd&format=PNG&dpi=300 x-amzn-shipping-business-id: [x-amzn-shipping-business-id](https://developer-docs.amazon.com/amazon-shipping/docs/frequently-asked-questions#which-x-amzn-shipping-business-id-to-use-as-request-header-while-calling-shipping-v2-api) x-amz-access-token: Atza|IwEBIGorlXXX ``` -------------------------------- ### Label Purchase Via Smart Purchase API Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/reference API endpoint for purchasing shipping labels using a simplified, one-click process. This streamlines the label acquisition for common scenarios. ```APIDOC POST /shipping/v2/oneClickShipment ``` -------------------------------- ### Shipment Tracking API Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/reference API endpoint for tracking the status and location of shipments. This allows users to monitor their packages in transit. ```APIDOC GET /shipping/v2/tracking ``` -------------------------------- ### Example Amazon Shipping Rate Response Structure Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/tutorial-purchase-a-shipment-from-a-rate An example JSON structure representing a portion of the Amazon Shipping API response, detailing available value-added services, benefits, carrier information, promise windows, and itemized rate charges for a specific shipping option. ```json "supportedFileJoiningOptions": [ true ], "supportedPageLayouts": [ "RIGHT", "LEFT" ] } ], "size": { "length": 11.0, "unit": "INCH", "width": 8.5 } } ], "totalCharge": { "unit": "USD", "value": 16.32 } }, { "availableValueAddedServiceGroups": [ { "groupDescription": "Confirmation", "groupId": "VAS_GROUP_ID_CONFIRMATION", "isRequired": true, "valueAddedServices": [ { "cost": { "unit": "USD", "value": 5.9 }, "id": "SIGNATURE_CONFIRMATION", "name": "Signature confirmation" }, { "cost": { "unit": "USD", "value": 0.0 }, "id": "NO_CONFIRMATION", "name": "No confirmation" }, { "cost": { "unit": "USD", "value": 7.1 }, "id": "ADULT_SIGNATURE_CONFIRMATION", "name": "Adult signature confirmation" } ] } ], "benefits": { "excludedBenefits": [], "includedBenefits": [ "CLAIMS_PROTECTED", "OTDR_PROTECTED" ] }, "billedWeight": null, "carrierId": "UPS", "carrierName": "UPS", "paymentType": null, "promise": { "deliveryWindow": { "end": "2025-03-12T06:59:59Z", "start": "2025-03-12T06:59:59Z" }, "pickupWindow": { "end": null, "start": null } }, "rateId": "bbfe848b-23f2-4ec9-80cc-b8b3f1045f57", "rateItemList": [ { "rateItemCharge": { "unit": "USD", "value": 10.65 }, "rateItemID": "BASE_RATE", "rateItemNameLocalization": "Base Rate", "rateItemType": "MANDATORY" }, { "rateItemCharge": { "unit": "USD", "value": 0.0 }, "rateItemID": "IMPLIED_LIABILITY", "rateItemNameLocalization": "Included liability", "rateItemType": "MANDATORY" }, { "rateItemCharge": { "unit": "USD", "value": 5.9 }, "rateItemID": "SIGNATURE_CONFIRMATION", "rateItemNameLocalization": "Signature confirmation", "rateItemType": "OPTIONAL" }, { "rateItemCharge": { "unit": "USD", "value": 0.0 }, "rateItemID": "NO_CONFIRMATION", "rateItemNameLocalization": "No confirmation", "rateItemType": "INCLUDED" }, { "rateItemCharge": { "unit": "USD", "value": 7.1 }, "rateItemID": "ADULT_SIGNATURE_CONFIRMATION", "rateItemNameLocalization": "Adult signature confirmation", "rateItemType": "OPTIONAL" } ``` -------------------------------- ### Label Purchase Via Purchase Shipment API Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/reference API endpoint for purchasing shipping labels by providing complete shipment details. This is a standard method for label acquisition. ```APIDOC POST /shipping/v2/shipments ``` -------------------------------- ### Shipping Rate API Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/reference API endpoint to retrieve shipping rates based on specified shipment details. This allows users to calculate costs before purchasing labels. ```APIDOC POST /shipping/v2/shipments/rates ``` -------------------------------- ### Direct Integration Guides Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/index Guides for integrating directly with Amazon Shipping APIs, catering to sellers who are not part of the Amazon Marketplace and hybrid sellers. ```APIDOC Direct Integration Guides: - Direct Integration with Amazon Shipping APIs (not an Amazon Marketplace Seller) - Direct Integration with Amazon Shipping APIs (Hybrid Sellers - Amazon Marketplace Seller and Other Sales Channel) ``` -------------------------------- ### Obtain Shipping API Access Token Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/reference API endpoint to obtain an access token for authenticating with the Amazon Shipping API. This is the first step for secure API integration. ```APIDOC POST /auth/o2/token ``` -------------------------------- ### Sample Get Tracking API Response JSON Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/changelog/launch-announcement-amazon-shipping-tracking-enhancement-ww An example JSON payload representing a successful response from the Amazon Shipping Get Tracking API. It includes detailed event history with `eventCode`, `eventTime`, `shipmentType`, and `location` for each event, along with a `promisedDeliveryDate` and a `summary` containing `status` and `trackingDetailCodes` for both forward and return legs. The `shipmentType` and `trackingDetailCodes` are highlighted as new additions. ```json { "payload": { "alternateLegTrackingId": "UK0000313459", "eventHistory": [ { "eventCode": "ReadyForReceive", "eventTime": "2023-12-11T04:11:31Z", "shipmentType": "FORWARD", "location": {} }, { "eventCode": "PickupDone", "eventTime": "2023-12-11T17:01:39Z", "shipmentType": "FORWARD", "location": { "city": "Coalville", "countryCode": "GB", "postalCode": "LE67 1PB", "stateOrRegion": "Leicestershire" } }, { "eventCode": "Rejected", "eventTime": "2023-12-11T17:03:30Z", "shipmentType": "FORWARD", "location": { "city": "Coalville", "countryCode": "GB", "postalCode": "LE67 1PB", "stateOrRegion": "Leicestershire" } }, { "eventCode": "ReturnInitiated", "eventTime": "2023-12-11T17:03:30Z", "shipmentType": "RETURNS", "location": { "city": "Coalville", "countryCode": "GB", "postalCode": "LE67 1PB", "stateOrRegion": "Leicestershire" } }, { "eventCode": "Undeliverable", "eventTime": "2023-12-11T17:03:30Z", "shipmentType": "RETURNS", "location": { "city": "Coalville", "countryCode": "GB", "postalCode": "LE67 1PB", "stateOrRegion": "Leicestershire" } } ], "promisedDeliveryDate": "2023-12-14T20:00:00Z", "summary": { "status": "InTransit", "trackingDetailCodes": { "forward": [ "Rejected", " NotRequired" ], "returns": [ "Undeliverable", "Damaged" ] } }, "trackingId": "UK0123456789" } } ``` -------------------------------- ### User-Agent Header Examples for Selling Partner API Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/include-a-user-agent-header-in-all-requests Examples demonstrating various formats of the User-Agent header required for requests to the Selling Partner API, including pseudocode for the basic structure, a typical application usage example, and an advanced configuration with a host attribute for large selling partners. ```HTTP Header AppId/AppVersionId (Language=LanguageNameAndOptionallyVersion) ``` ```HTTP Header My Selling Tool/2.0 (Language=Java/1.8.0.221; Platform=Windows/10) ``` ```HTTP Header MyCompanyName/build1611 (Language=Perl; Host=jane.desktop.example.com) ``` -------------------------------- ### 3rd Party Partner Integration Guides Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/index Guides for third-party partners integrating with Amazon Shipping APIs, enabling both Amazon Marketplace sellers and other sales channel sellers. ```APIDOC 3rd Party Partner Integration Guides: - 3rd Party Partner Integration (Enabling Amazon Marketplace Seller and Other Sales Channel Sellers) - 3P Website Authorization Workflow for Amazon Shipping API - 3rd Party Partner Integrator (Enabling Other Sales Channel Sellers) ``` -------------------------------- ### Example Shipping Document and Charge Details (JSON) Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/tutorial-purchase-a-shipment-from-a-rate This JSON snippet demonstrates a structure that might be returned by a shipping API, detailing supported document printing options (DPIs, document types, file joining, page layouts), package size, and the total calculated charge for a shipment. ```JSON { "supportedDPIs": [], "supportedDocumentDetails": [ { "isMandatory": true, "name": "LABEL" } ], "supportedFileJoiningOptions": [ true ], "supportedPageLayouts": [ "RIGHT", "LEFT" ], "size": { "length": 11.0, "unit": "INCH", "width": 8.5 }, "totalCharge": { "unit": "USD", "value": 44.49 } } ``` -------------------------------- ### Configure LWA Credentials for Grantless Operations (Java) Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/connecting-to-the-selling-partner-api-using-a-generated-java-sdk Example Java code illustrating how to build `LWAAuthorizationCredentials` for grantless operations. This setup utilizes `clientId`, `clientSecret`, `withScopes` (specifying API scopes like Notifications API or Migration API), and the `endpoint`, omitting the `refreshToken`. ```Java import com.amazon.SellingPartnerAPIAA.LWAAuthorizationCredentials; import static com.amazon.SellingPartnerAPIAA.ScopeConstants.SCOPE_NOTIFICATIONS_API; import static com.amazon.SellingPartnerAPIAA.ScopeConstants.SCOPE_MIGRATION_API; LWAAuthorizationCredentials lwaAuthorizationCredentials = LWAAuthorizationCredentials.builder() .clientId("myClientId") .clientSecret("myClientSecret") .withScopes(SCOPE_NOTIFICATIONS_API, SCOPE_MIGRATION_API) .endpoint("https://api.amazon.com/auth/o2/token") .build(); ``` -------------------------------- ### Get Shipment Tracking API Request Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/amazon-shipping-apispostman_collection_dynamicsandbox This API call is used to retrieve tracking information for a shipment. It is a GET request that requires an 'x-amz-access-token' and an 'Accept' header. ```APIDOC HTTP Method: GET Endpoint: (Not fully specified in snippet, but for shipment tracking) Headers: x-amz-access-token: {{x-amz-access-token}} Accept: (Value not specified in snippet) ``` -------------------------------- ### Example Application Callback URI (Beta Workflow) Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/amazon-scpn-authorization-workflow An example URL demonstrating the parameters your application adds to the Amazon callback URI for a beta workflow, which includes the `version=beta` parameter to authorize an application in Draft state. ```HTTP https://amazon.com/apps/authorize/confirm/amzn1.sellerapps.app.2eca283f-9f5a-4d13-b16c-474EXAMPLE57?redirect_uri=https://d2yzyfnnpjylxu.cloudfront.net/landing.html&amazon_state=amazonstateexample&state=-37131022&version=beta ``` -------------------------------- ### Example Shipping Rate and Service Details (JSON) Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/tutorial-purchase-a-shipment-from-a-rate This JSON snippet illustrates a comprehensive shipping rate response, including available value-added services (like confirmation options), included/excluded benefits, billed weight, carrier information, delivery/pickup promises, a unique rate ID, and a detailed list of individual rate items with their charges and types. ```JSON { "availableValueAddedServiceGroups": [ { "groupDescription": "Confirmation", "groupId": "VAS_GROUP_ID_CONFIRMATION", "isRequired": true, "valueAddedServices": [ { "cost": { "unit": "USD", "value": 3.7 }, "id": "SIGNATURE_CONFIRMATION", "name": "Signature confirmation" }, { "cost": { "unit": "USD", "value": 0.0 }, "id": "DELIVERY_CONFIRMATION", "name": "Delivery confirmation" } ] } ], "benefits": { "excludedBenefits": [], "includedBenefits": [ "CLAIMS_PROTECTED", "OTDR_PROTECTED" ] }, "billedWeight": null, "carrierId": "USPS", "carrierName": "USPS", "paymentType": null, "promise": { "deliveryWindow": { "end": "2025-03-12T06:59:59Z", "start": "2025-03-12T06:59:59Z" }, "pickupWindow": { "end": null, "start": null } }, "rateId": "fabe407a-f401-4043-b043-a34de748e6c2", "rateItemList": [ { "rateItemCharge": { "unit": "USD", "value": 15.8 }, "rateItemID": "BASE_RATE", "rateItemNameLocalization": "Base Rate", "rateItemType": "MANDATORY" }, { "rateItemCharge": { "unit": "USD", "value": 0.0 }, "rateItemID": "TRANSACTION_FEE", "rateItemNameLocalization": "Transaction Fee", "rateItemType": "MANDATORY" }, { "rateItemCharge": { "unit": "USD", "value": 0.0 }, "rateItemID": "HIDDEN_POSTAGE", "rateItemNameLocalization": "Hidden postage", "rateItemType": "MANDATORY" }, { "rateItemCharge": { "unit": "USD", "value": 0.0 }, "rateItemID": "DECLARED_VALUE", "rateItemNameLocalization": "Declared value", "rateItemType": "MANDATORY" }, { "rateItemCharge": { "unit": "USD", "value": 3.7 }, "rateItemID": "SIGNATURE_CONFIRMATION", "rateItemNameLocalization": "Signature confirmation", "rateItemType": "OPTIONAL" } ] } ``` -------------------------------- ### Example Request Token JSON Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/tutorial-purchase-a-shipment-from-a-rate An example JSON snippet showing a `requestToken` value, typically returned by the `getRates` operation and used in subsequent API requests. ```JSON { "requestToken": "amzn1.rq.99200470481323.100" } ``` -------------------------------- ### Example: Authorize Application in Draft State (Beta) Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/website-authorization-workflow An example URL demonstrating how to construct the OAuth authorization URI to authorize an application that is currently in a Draft state, by including the 'version=beta' parameter. ```HTTP https://sellercentral.amazon.com/apps/authorize/consent?application_id=appidexample&state=stateexample&version=beta ``` -------------------------------- ### Retrieve Additional Inputs Schema (GET Request) Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/tutorial-purchase-a-shipment-from-a-rate This snippet demonstrates an example HTTP GET request to the Amazon Selling Partner API for Shipping v2. It targets the 'additionalInputs/schema' endpoint, requiring a 'requestToken' and 'rateId' as query parameters, along with an 'x-amz-access-token' in the header for authentication. ```HTTP GET https://sellingpartnerapi-eu.amazon.com/shipping/v2/shipments/additionalInputs/schema?requestToken=amzn1.rq.5cbe8664-285e-4bd5-8a70-db2ed9ba127e.101&rateId=9559ad41-c9da-12b3-abc9-5684e6a76be8 x-amz-access-token: Atza|IwEBIGorlXXX ``` -------------------------------- ### Sample API Request to Track Amazon Shipment Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/tutorial-track-a-shipment This code snippet provides a concrete example of an HTTP GET request to the Amazon Shipping API v2's `getTracking` endpoint. It demonstrates how to include the `carrierId` and `trackingId` as query parameters and how to set the `x-amzn-shipping-business-id` and `x-amzn-access-token` headers for authentication and business context. ```Text GET https://sellingpartnerapi-eu.amazon.com/shipping/v2/tracking?carrierId=AMZN_UK&trackingId=UK0123456789 x-amzn-shipping-business-id: [x-amzn-shipping-business-id](https://developer-docs.amazon.com/amazon-shipping/docs/frequently-asked-questions#which-x-amzn-shipping-business-id-to-use-as-request-header-while-calling-shipping-v2-api) x-amz-access-token: Atza|IwEBIGorlXXX ``` -------------------------------- ### Example Application Callback URI (Production Workflow) Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/amazon-scpn-authorization-workflow An example URL demonstrating the parameters your application adds to the Amazon callback URI for a production workflow, where the `version=beta` parameter is omitted, authorizing a published application. ```HTTP https://amazon.com/apps/authorize/confirm/amzn1.sellerapps.app.2eca283f-9f5a-4d13-b16c-474EXAMPLE57?redirect_uri=https://d2yzyfnnpjylxu.cloudfront.net/landing.html&amazon_state=amazonstateexample&state=-37131022 ``` -------------------------------- ### Get Tracking API Request (Amazon Shipping v2) Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/amazon-shipping-apispostman_collection_dynamicsandbox This API call retrieves tracking information for a given carrier and tracking ID. It's a GET request to the Amazon Shipping v2 tracking endpoint, typically used for monitoring shipment status. ```APIDOC { "auth": { "type": "noauth" }, "method": "GET", "header": [ { "key": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", "raw": "" }, "url": { "raw": "{{api-host}}/shipping/v2/tracking?carrierId=<>&trackingId=<>", "host": [ "{{api-host}}" ], "path": [ "shipping", "v2", "tracking" ], "query": [ { "key": "carrierId", "value": "<>" }, { "key": "trackingId", "value": "<>" } ] } } ``` -------------------------------- ### Initialize Sellers API Client with LWA Credentials (Java) Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/connecting-to-the-selling-partner-api-using-a-generated-java-sdk Example Java code to create an instance of the `SellersApi` client. This client is initialized using the previously configured `LWAAuthorizationCredentials` and the specific endpoint for the Selling Partner API, enabling subsequent calls to Sellers API operations. ```Java SellersApi sellersApi = new SellersApi.Builder() .lwaAuthorizationCredentials(lwaAuthorizationCredentials) .endpoint("https://sellingpartnerapi-na.amazon.com") .build(); ``` -------------------------------- ### Shipping API v2 Tutorials Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/index Step-by-step tutorials for various functionalities within the Amazon Shipping API v2, including purchasing shipments, tracking, and managing documents. ```APIDOC Shipping API v2 Tutorials: - Tutorial: Purchase a Shipment From a Rate - Tutorial: Use the SmartPurchase API to Generate Amazon Shipping Labels - Tutorial: Retrieve Previously Generated Shipment Documents - Tutorial: Track a Shipment - Tutorial: Cancel a Shipment - Tutorial: Purchase a Limited Quantity Dangerous Goods Shipment From a Rate - Tutorial: Purchase a Dangerous Goods Shipment for an Item Containing a Lithium Ion Battery From a Rate - Tutorial: Use the NDR Feedback API To Submit Non-Delivery Reports For Eligible Shipments ``` -------------------------------- ### Example Shipping Rate Response Structure Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/tutorial-purchase-a-shipment-from-a-rate This snippet showcases a typical JSON response from the Amazon Shipping API, detailing shipping options. It includes information about supported document details (like PACKSLIP and LABEL), package size, total charges, available value-added services (e.g., Signature confirmation, Delivery confirmation), and a breakdown of rate items (Base Rate, Transaction Fee). ```APIDOC "supportedDPIs": [], "supportedDocumentDetails": [ { "isMandatory": true, "name": "PACKSLIP" }, { "isMandatory": true, "name": "LABEL" } ], "supportedFileJoiningOptions": [ true ], "supportedPageLayouts": [ "LEFT" ] }, { "supportedDPIs": [], "supportedDocumentDetails": [ { "isMandatory": true, "name": "LABEL" } ], "supportedFileJoiningOptions": [ true ], "supportedPageLayouts": [ "RIGHT", "LEFT" ] } ], "size": { "length": 11.0, "unit": "INCH", "width": 8.5 } } ], "totalCharge": { "unit": "USD", "value": 15.8 } }, { "availableValueAddedServiceGroups": [ { "groupDescription": "Confirmation", "groupId": "VAS_GROUP_ID_CONFIRMATION", "isRequired": true, "valueAddedServices": [ { "cost": { "unit": "USD", "value": 3.7 }, "id": "SIGNATURE_CONFIRMATION", "name": "Signature confirmation" }, { "cost": { "unit": "USD", "value": 0.0 }, "id": "DELIVERY_CONFIRMATION", "name": "Delivery confirmation" } ] } ], "benefits": { "excludedBenefits": [], "includedBenefits": [ "CLAIMS_PROTECTED", "OTDR_PROTECTED" ] }, "billedWeight": null, "carrierId": "USPS", "carrierName": "USPS", "paymentType": null, "promise": { "deliveryWindow": { "end": "2025-03-12T06:59:59Z", "start": "2025-03-12T06:59:59Z" }, "pickupWindow": { "end": null, "start": null } }, "rateId": "7aebf0ff-6da9-4346-a213-3c0e7e557cb4", "rateItemList": [ { "rateItemCharge": { "unit": "USD", "value": 22.65 }, "rateItemID": "BASE_RATE", "rateItemNameLocalization": "Base Rate", "rateItemType": "MANDATORY" }, { "rateItemCharge": { "unit": "USD", "value": 0.0 }, "rateItemID": "TRANSACTION_FEE", "rateItemNameLocalization": "Transaction Fee", "rateItemType": "MANDATORY" }, { "rateItemCharge": { "unit": "USD", "value": 0.0 }, "rateItemID": "HIDDEN_POSTAGE", "rateItemNameLocalization": "Hidden postage", ``` -------------------------------- ### Example JSON for Amazon Shipping Print Options Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/tutorial-purchase-a-shipment-from-a-rate This JSON snippet illustrates the structure for defining supported print formats (e.g., ZPL, PDF) and their associated print options, such as supported DPIs, mandatory document details (LABEL, PACKSLIP, RECEIPT), file joining capabilities, and page layouts. It also specifies the size of the print output. ```JSON { "isMandatory": true, "name": "LABEL" } ], "supportedFileJoiningOptions": [ true ], "supportedPageLayouts": [ "LEFT" ] } ], "size": { "length": 6.0, "unit": "INCH", "width": 4.0 } }, { "format": "ZPL", "printOptions": [ { "supportedDPIs": [ 300 ], "supportedDocumentDetails": [ { "isMandatory": true, "name": "LABEL" } ], "supportedFileJoiningOptions": [ true ], "supportedPageLayouts": [ "LEFT" ] } ], "size": { "length": 6.0, "unit": "INCH", "width": 4.0 } }, { "format": "PDF", "printOptions": [ { "supportedDPIs": [], "supportedDocumentDetails": [ { "isMandatory": true, "name": "PACKSLIP" }, { "isMandatory": true, "name": "LABEL" } ], "supportedFileJoiningOptions": [ true ], "supportedPageLayouts": [ "LEFT" ] } ], "size": { "length": 6.0, "unit": "INCH", "width": 4.0 } }, { "format": "PDF", "printOptions": [ { "supportedDPIs": [], "supportedDocumentDetails": [ { "isMandatory": true, "name": "RECEIPT" }, { "isMandatory": true, "name": "LABEL" } ], "supportedFileJoiningOptions": [ true ], "supportedPageLayouts": [ "LEFT" ] }, { "supportedDPIs": [], "supportedDocumentDetails": [ { "isMandatory": true, "name": "PACKSLIP" }, { "isMandatory": true, "name": "LABEL" } ], "supportedFileJoiningOptions": [ true ], "supportedPageLayouts": [ "LEFT" ] }, { ``` -------------------------------- ### Example: Authorize Published Application Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/website-authorization-workflow An example URL demonstrating how to construct the OAuth authorization URI to authorize an application that has been published on the Selling Partner Appstore, without the 'version=beta' parameter. ```HTTP https://sellercentral.amazon.com/apps/authorize/consent?application_id=appidexample&state=stateexample ``` -------------------------------- ### Sample API Endpoint for Get Shipping Rates Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/tutorial-purchase-a-shipment-from-a-rate This snippet provides the HTTP method and URL for making a 'getRates' API request. It specifies a POST request to the Amazon Selling Partner API endpoint for shipping rates in the EU region, serving as a direct example for API integration. ```Text POST https://sellingpartnerapi-eu.amazon.com/shipping/v2/shipments/rates ``` -------------------------------- ### Example Selling Partner API PUT Request URI Construction Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/connecting-to-the-selling-partner-api This example demonstrates how to construct a complete Selling Partner API URI for a PUT request, including the base endpoint, path, and query parameters for marketplace and a specific date. It illustrates the structure of a typical API call. ```HTTP PUT https://sellingpartnerapi-na.amazon.com/fba/inbound/v0/shipments/shipmentId1/preorder/confirm?MarketplaceId=ATVPDKIKX0DER&NeedByDate=2020-10-10 ``` -------------------------------- ### JSON Examples of Shipping Carrier Services Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/tutorial-purchase-a-shipment-from-a-rate A collection of JSON objects, each illustrating the structure for a shipping carrier service. Each object includes `carrierId`, `carrierName`, `serviceId`, `serviceName`, and an array of `ineligibilityReasons` with `code` and `message` fields. These examples demonstrate typical data returned by a shipping service API. ```json [ { "carrierId": "YANWEN", "carrierName": "Yanwen", "ineligibilityReasons": [ { "code": "UNKNOWN", "message": "This shipping service does not deliver from the given source address to the destination address." } ], "serviceId": "YW_UNTRACKED_PACKET_GENERAL", "serviceName": "Yanwen YW Untracked Packet - General Cargo" }, { "carrierId": "YANWEN", "carrierName": "Yanwen", "ineligibilityReasons": [ { "code": "UNKNOWN", "message": "This shipping service does not deliver from the given source address to the destination address." } ], "serviceId": "YW_UNTRACKED_PACKET_SPECIAL", "serviceName": "Yanwen YW Untracked Packet - Special Cargo" }, { "carrierId": "YANWEN", "carrierName": "Yanwen", "ineligibilityReasons": [ { "code": "UNKNOWN", "message": "This shipping service does not deliver from the given source address to the destination address." } ], "serviceId": "Y_POST_ORDINARY_MAIL_GENERAL", "serviceName": "Yanwen Y-Post Ordinary Mail - General Cargo" }, { "carrierId": "YANWEN", "carrierName": "Yanwen", "ineligibilityReasons": [ { "code": "UNKNOWN", "message": "Not an eligible ship method for this order. Please check carrier's requirements for this ship method." } ], "serviceId": "Y_POST_ORDINARY_MAIL_SPECIAL", "serviceName": "Yanwen-Standard-CADDP-Special\n" }, { "carrierId": "YANWEN", "carrierName": "Yanwen", "ineligibilityReasons": [ { "code": "UNKNOWN", "message": "Not an eligible ship method for this order. Please check carrier's requirements for this ship method." } ], "serviceId": "Y_POST_REGISTER_MAIL_SPECIAL", "serviceName": "Yanwen-Standard-CADDP-General\n" }, { "carrierId": "YUN", "carrierName": "Yun Express", "ineligibilityReasons": [ { "code": "UNKNOWN", "message": "Not an eligible ship method for this order. Please check carrier's requirements for this ship method." } ], "serviceId": "YUN_CA_DIRECT_LINE_DDP", "serviceName": "Yun Express CA Direct Line DDP" }, { "carrierId": "YUN", "carrierName": "Yun Express", "ineligibilityReasons": [ { "code": "UNKNOWN", "message": "Not an eligible ship method for this order. Please check carrier's requirements for this ship method." } ], "serviceId": "YUN_CA_GENERAL_DIRECT_LINE_DDP", "serviceName": "Yun Express CA general cargo Direct Line DDP" }, { "carrierId": "YUN", "carrierName": "Yun Express", "ineligibilityReasons": [ { "code": "UNKNOWN", "message": "This shipping service does not deliver from the given source address to the destination address." } ], "serviceId": "YUN_CLOTHING_DIRECT_LINE", "serviceName": "Yun Express Global Clothing Direct Line" } ] ``` -------------------------------- ### Selling Partner API Static Sandbox Usage Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/the-selling-partner-api-sandbox This guide details the process for making calls to the Selling Partner API static sandbox, including how to identify and use the required parameters from the Swagger model to receive predefined mock responses. ```APIDOC Selling Partner API Static Sandbox: Purpose: Returns static, mocked responses based on pattern matching. Configuration Object: "x-amzn-api-sandbox": { "static": [...] } Usage Steps: 1. Check JSON model for request parameters: - Go to SHIPPING API documentation. - Open API folder, click Swagger model JSON file. - Search for "x-amzn-api-sandbox" object that contains a "static" array. - Extract request parameters from the "request" object within the static array. 2. Make static sandbox call: - Make call identical to production, but direct to sandbox endpoints. - Include extracted parameters from Step 1. - Ensure all required parameters (as per Swagger model) are included. - Expected response matches payload object contained in the static sandbox JSON object from Step 1. ``` -------------------------------- ### Sample Amazon Shipping Rate and Service Response JSON Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/tutorial-purchase-a-shipment-from-a-rate This JSON snippet provides an example of a partial response from the Amazon Shipping API, illustrating the structure for available label formats (e.g., PDF with specific print options), package size definitions, and detailed shipping rate information. It includes value-added services like signature confirmation with associated costs, carrier details (e.g., FedEx), and a breakdown of rate items such as base rates and optional charges. ```JSON ], "size": { "length": 6.0, "unit": "INCH", "width": 4.0 } }, { "format": "PDF", "printOptions": [ { "supportedDPIs": [], "supportedDocumentDetails": [ { "isMandatory": false, "name": "PACKSLIP" }, { "isMandatory": true, "name": "LABEL" } ], "supportedFileJoiningOptions": [ true ], "supportedPageLayouts": [ "LEFT" ] } ], "size": { "length": 11.0, "unit": "INCH", "width": 8.5 } } ], "totalCharge": { "unit": "USD", "value": 12.75 } }, { "availableValueAddedServiceGroups": [ { "groupDescription": "Confirmation", "groupId": "VAS_GROUP_ID_CONFIRMATION", "isRequired": true, "valueAddedServices": [ { "cost": { "unit": "USD", "value": 8.45 }, "id": "ADULT_SIGNATURE_CONFIRMATION", "name": "Adult signature confirmation" }, { "cost": { "unit": "USD", "value": 8.45 }, "id": "SIGNATURE_CONFIRMATION", "name": "Signature confirmation" }, { "cost": { "unit": "USD", "value": 0.0 }, "id": "NO_CONFIRMATION", "name": "No confirmation" } ] } ], "benefits": { "excludedBenefits": [], "includedBenefits": [ "CLAIMS_PROTECTED", "OTDR_PROTECTED" ] }, "billedWeight": null, "carrierId": "FEDEX", "carrierName": "FedEx", "paymentType": null, "promise": { "deliveryWindow": { "end": "2025-03-08T07:59:59Z", "start": "2025-03-08T07:59:59Z" }, "pickupWindow": { "end": null, "start": null } }, "rateId": "a48b8ca8-b5b8-4082-9889-de6e9b50262e", "rateItemList": [ { "rateItemCharge": { "unit": "USD", "value": 8.45 }, "rateItemID": "ADULT_SIGNATURE_CONFIRMATION", "rateItemNameLocalization": "Adult signature confirmation", "rateItemType": "OPTIONAL" }, { "rateItemCharge": { "unit": "USD", "value": 18.97 }, "rateItemID": "BASE_RATE", "rateItemNameLocalization": "Base Rate", "rateItemType": "MANDATORY" }, { "rateItemCharge": { "unit": "USD", "value": 0.0 }, "rateItemID": "IMPLIED_LIABILITY", ``` -------------------------------- ### Example HTTP 200 OK Success Response from SP-API Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/response-format An example of a successful HTTP 200 OK response from the Selling Partner API, showing the HTTP status line, standard headers, and a JSON payload containing confirmed dates for a typical API operation. ```HTTP HTTP/1.1 200 OK Content-Length: 368 Content-Type: application/json Date: Thu, 01 Jun 2020 22:23:31 GMT x-amzn-RequestId: 6875f61f-6aa1-11e8-98c6-9bExample { "payload": { "ConfirmedNeedByDate": "2020-04-23", "ConfirmedFulfillableDate": "2020-04-23" } } ``` -------------------------------- ### API Request Parameters for Get Shipping Rates Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/tutorial-purchase-a-shipment-from-a-rate This section details the various parameters required or optional when calling the 'getRates' operation. It includes essential fields like 'shipTo', 'shipFrom', 'packages', and 'channelDetails', along with their data types and descriptions, guiding developers on constructing a valid request body. ```APIDOC Parameters for getRates operation: shipTo: The address where the shipment will be delivered. For Amazon orders, shipTo information is pulled directly from the Amazon order. Type: Address. Required: Conditional. shipFrom: The address where the package will be picked up. Type: Address. Required: Yes. returnTo: The address where the package will be returned if it cannot be delivered. Type: Address. Required: No. shipDate: The ship date and time (the requested pickup). This defaults to the current date and time. Type: string (date-time). Required: No. shipperInstruction: This field describe shipper instruction. Type: ShipperInstruction. Required: No. packages: A list of packages to be shipped and package details. Type: PackageList. Required: Yes. valueAddedServices: A collection of supported value-added services. Type: ValueAddedServiceDetails. Required: No. taxDetails: A list of tax detail information. Type: TaxDetailList. Required: No. channelDetails: Shipment source channel related information. Type: ChannelDetails. Required: Yes. clientReferenceDetails: Object to pass additional information about the MCI Integrator shipper. Type: List of ClientReferenceDetail, ClientReferenceDetails. Required: No. shipmentType: Object to pass shipment type. Type: ShipmentType. Required: No. destinationAccessPointDetails: Object to pass Accesspoint id for counter delivery. Type: DestinationAccessPointDetails. Required: No. ``` -------------------------------- ### Example Amazon Shipping API Response for Label and Print Options Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/docs/tutorial-purchase-a-shipment-from-a-rate This JSON snippet illustrates a typical response structure from the Amazon Shipping API, detailing available label formats, print options, and associated charges. It includes information about mandatory document details, supported page layouts, and file joining options for different label sizes and formats (e.g., PDF). This structure is often returned when querying for shipping options or label generation capabilities. ```JSON { "payload": [ { "labelFormats": [ { "format": "ZPL", "printOptions": [ { "supportedDPIs": [], "supportedDocumentDetails": [ { "isMandatory": true, "name": "LABEL" } ], "supportedFileJoiningOptions": [ true ], "supportedPageLayouts": [ "LEFT" ] } ], "size": { "length": 6.0, "unit": "INCH", "width": 4.0 } }, { "format": "PDF", "printOptions": [ { "supportedDPIs": [], "supportedDocumentDetails": [ { "isMandatory": false, "name": "PACKSLIP" }, { "isMandatory": true, "name": "LABEL" } ], "supportedFileJoiningOptions": [ true ], "supportedPageLayouts": [ "LEFT" ] } ], "size": { "length": 11.0, "unit": "INCH", "width": 8.5 } } ], "totalCharge": { "unit": "USD", "value": 12.75 } } ], "requestToken": "amzn1.rq.8bb6a0a2-372f-4297-b9c6-6c9f59798617.101" } ``` -------------------------------- ### Submit Non-Delivery Report API Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/reference API endpoint to submit a report for non-delivery feedback. This is used to inform Amazon about issues with shipment delivery. ```APIDOC POST /shipping/v2/ndrFeedback ``` -------------------------------- ### Regenerate Shipping Label API Source: https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference/reference API endpoint to regenerate shipping labels for an existing shipment ID. This is useful for reprinting or re-accessing labels. ```APIDOC GET /shipping/v2/shipments/{shipmentId}/documents ```