API Integration Test Case Guide
This guide provides a comprehensive list of test cases that you should execute with Amazon Shipping carrier to ensure a successful API integration before going live.
Test Case ID: TC01 - Retrieve available shipping rates for a standard package
Click to expand
Pre-requisites:
Valid API credentials (either Sandbox or Production application).
Required access permissions: ‘Amazon Logistics’ role for OFF-Amazon usage or ‘Direct To Consumer’ role for Hybrid (both OFF-Amazon and/or ON-Amazon scenarios).
For ON-Amazon scenarion, the Amazon order must be associated with the same Seller Central account for which the token is generated.
Mandatory input parameters including ShipFrom, ShipTo address, package dimensions, and weight.
Test Steps:
Set the API endpoint to /shipping/v2/shipments/rates
Include the required headers:
x-amz-access-token: [Your Access Token]
x-amzn-shipping-business-id: AmazonShipping_US
Prepare the request body with the required shipping details.
Send a POST request to the endpoint.
{
"shipTo": {
"name": "Test Customer",
"companyName": "Test Company",
"addressLine1": "410 Terry Avenue North",
"stateOrRegion": "WA",
"postalCode": "98109",
"city": "SEATTLE",
"countryCode": "US",
"email": "[email protected]",
"phoneNumber": "1 206 2661000"
},
"shipFrom": {
"name": "Test Warehouse",
"addressLine1": "22001 84th Avenue S",
"stateOrRegion": "WA",
"postalCode": "98032",
"city": "Kent",
"countryCode": "US",
"email": "[email protected]",
"phoneNumber": "1 206 2661000"
},
"packages": [
{
"packageClientReferenceId": "I17F39E30CD2DBFD5",
"insuredValue": {
"unit": "USD",
"value": 1
},
"dimensions": {
"length": 2.75,
"width": 9.06,
"height": 11.19,
"unit": "INCH"
},
"weight": {
"unit": "POUND",
"value": 1.52
},
"items": [
{
"itemValue": {
"value": 26.99,
"unit": "USD"
},
"isHazmat": false,
"description": "Face cream",
"quantity": 1,
"itemIdentifier": "110052974366641",
"weight": {
"unit": "POUND",
"value": 1.52
}
}
]
}
],
"channelDetails": {
"channelType": "AMAZON",
"amazonOrderDetails": {
"orderId": "111-4518643-5289024"
}
}
}
{
"shipTo": {
"name": "Test Customer",
"companyName": "Test Company",
"addressLine1": "410 Terry Avenue North",
"stateOrRegion": "WA",
"postalCode": "98109",
"city": "SEATTLE",
"countryCode": "US",
"email": "[email protected]",
"phoneNumber": "1 206 2661000"
},
"shipFrom": {
"name": "Test Warehouse",
"addressLine1": "22001 84th Avenue S",
"stateOrRegion": "WA",
"postalCode": "98032",
"city": "Kent",
"countryCode": "US",
"email": "[email protected]",
"phoneNumber": "1 206 2661000"
},
"packages": [
{
"packageClientReferenceId": "I0003911112DB222",
"insuredValue": {
"unit": "USD",
"value": 1
},
"dimensions": {
"length": 2.75,
"width": 9.06,
"height": 11.19,
"unit": "INCH"
},
"weight": {
"unit": "POUND",
"value": 1.52
},
"items": [
{
"itemValue": {
"value": 10,
"unit": "USD"
},
"description": "Clothes",
"itemIdentifier": "T shirt",
"quantity": 1,
"weight": {
"unit": "POUND",
"value": 10
},
"isHazmat": false
}
]
}
],
"channelDetails": {
"channelType": "EXTERNAL"
}
}
Expected Results:
HTTP Status Code: 200 OK
Response contains a list of available shipping rates with service IDs and charges with unique rate ID.
Test Case ID: TC02 - Purchase a shipment using a selected rate
Click to expand
Pre-requisites:
Successful retrieval of shipping rates Rate ID and Request Token (as per TC01).
Selected Service ID from the available rates.
Mandatory input parameters including Rate ID and Request Token.
Test Steps:
Set the API endpoint to /shipping/v2/shipments
Include the required headers:
x-amz-access-token: [Your Access Token]
x-amzn-shipping-business-id: AmazonShipping_US
Prepare the request body with the required shipping details.
Send a POST request to the endpoint.
{
"requestToken": "amzn1.rq.91522686400750.100",
"rateId": "0f044b658afa09df9edeadb8268acefcbac58ae267f18c025f26f203",
"requestedDocumentSpecification": {
"format": "PDF",
"size": {
"width": 4,
"length": 6,
"unit": "INCH"
},
"dpi": 203,
"pageLayout": "DEFAULT",
"requestedDocumentTypes": [
"LABEL"
],
"requestedValueAddedServices": [
{
"id": "DELIVERY_CONFIRMATION"
},
{
"id": "CARRIER_PICKUP_CHARGE"
}
]
}
}
{
"requestToken": "amzn1.rq.91522686400750.100",
"rateId": "0f044b658afa09df9edeadb8268acefcbac58ae267f18c025f26f203",
"requestedDocumentSpecification": {
"format": "PDF",
"size": {
"width": 4,
"length": 6,
"unit": "INCH"
},
"dpi": 203,
"pageLayout": "DEFAULT",
"requestedDocumentTypes": [
"LABEL"
]
}
}
Expected Results:
HTTP Status Code: 200 OK
Response contains Shipment ID, Tracking ID and Package Document Details with label details in base64 format.
Test Case ID: TC03 - Cancel an existing shipment
Click to expand
Pre-requisites:
A valid Shipment ID from a previously created shipment (as per TC02).
The shipment must not have been shipped or cancelled previously.
Test Steps:
Set the API endpoint to /shipping/v2/shipments/{shipmentId}/cancel
Include the required headers:
x-amz-access-token: [Your Access Token]
x-amzn-shipping-business-id: AmazonShipping_US
Prepare the request body with the required shipping details.
Send a PUT request to the endpoint.
https://sellingpartnerapi-na.amazon.com/shipping/v2/shipments/amzn1.sid.testa29d00ba-bda0-5f7e-00b0-000d8e261b0a.101/cancel
Expected Results:
HTTP Status Code: 200 OK with empty payload.
Shipment cancellation is confirmed.
Test Case ID: TC04 - Purchase a shipment using OneClickShipment API
Click to expand
Pre-requisites:
Valid API credentials (either Sandbox or Production application).
Required access permissions: ‘Amazon Logistics’ role for OFF-Amazon usage or ‘Direct To Consumer’ role for Hybrid (both OFF-Amazon and/or ON-Amazon scenarios).
Mandatory input parameters including ShipFrom, ShipTo address, package dimensions, and weight.
Test Steps:
Set the API endpoint to /shipping/v2/oneClickShipment
Include the required headers:
x-amz-access-token: [Your Access Token]
x-amzn-shipping-business-id: AmazonShipping_US
Prepare the request body with the required shipping details.
Send a POST request to the endpoint.
{
"shipTo": {
"name": "Test Customer",
"companyName": "Test Company",
"addressLine1": "410 Terry Avenue North",
"stateOrRegion": "WA",
"postalCode": "98109",
"city": "SEATTLE",
"countryCode": "US",
"email": "[email protected]",
"phoneNumber": "1 206 2661000"
},
"shipFrom": {
"name": "Test Warehouse",
"addressLine1": "22001 84th Avenue S",
"stateOrRegion": "WA",
"postalCode": "98032",
"city": "Kent",
"countryCode": "US",
"email": "[email protected]",
"phoneNumber": "1 206 2661000"
},
"packages": [
{
"packageClientReferenceId": "I17F39E30CD2DBFD5",
"insuredValue": {
"unit": "USD",
"value": 1
},
"dimensions": {
"length": 2.75,
"width": 9.06,
"height": 11.19,
"unit": "INCH"
},
"weight": {
"unit": "POUND",
"value": 1.52
},
"items": [
{
"itemValue": {
"value": 26.99,
"unit": "USD"
},
"isHazmat": false,
"description": "Face cream",
"quantity": 1,
"itemIdentifier": "110052974366641",
"weight": {
"unit": "POUND",
"value": 1.52
}
}
]
}
],
"channelDetails": {
"channelType": "AMAZON",
"amazonOrderDetails": {
"orderId": "111-4518643-5289024"
}
},
"serviceSelection": {
"serviceId": [
"std-us-swa-mfn"
]
},
"labelSpecifications": {
"format": "PDF",
"size": {
"width": 4,
"length": 6,
"unit": "INCH"
},
"dpi": 300,
"pageLayout": "DEFAULT",
"needFileJoining": false,
"requestedDocumentTypes": [
"LABEL"
]
}
}
{
"shipTo": {
"name": "Test Customer",
"companyName": "Test Company",
"addressLine1": "410 Terry Avenue North",
"stateOrRegion": "WA",
"postalCode": "98109",
"city": "SEATTLE",
"countryCode": "US",
"email": "[email protected]",
"phoneNumber": "1 206 2661000"
},
"shipFrom": {
"name": "Test Warehouse",
"addressLine1": "22001 84th Avenue S",
"stateOrRegion": "WA",
"postalCode": "98032",
"city": "Kent",
"countryCode": "US",
"email": "[email protected]",
"phoneNumber": "1 206 2661000"
},
"packages": [
{
"dimensions": {
"length": 5,
"width": 5,
"height": 5,
"unit": "INCH"
},
"weight": {
"unit": "POUND",
"value": 10
},
"insuredValue": {
"value": 10,
"unit": "USD"
},
"isHazmat": false,
"sellerDisplayName": "New Shoes and Company",
"packageClientReferenceId": "Order-12345",
"items": [
{
"itemValue": {
"value": 10,
"unit": "USD"
},
"description": "Clothes",
"itemIdentifier": "T shirt",
"quantity": 1,
"weight": {
"unit": "POUND",
"value": 10
},
"isHazmat": false
}
]
}
],
"channelDetails": {
"channelType": "EXTERNAL"
},
"serviceSelection": {
"serviceId": [
"std-us-swa-mfn"
]
},
"labelSpecifications": {
"format": "PDF",
"size": {
"width": 4,
"length": 6,
"unit": "INCH"
},
"dpi": 300,
"pageLayout": "DEFAULT",
"needFileJoining": false,
"requestedDocumentTypes": [
"LABEL"
]
}
}
Expected Results:
HTTP Status Code: 200 OK
Response contains Shipment ID, Tracking ID and Package Document Details with label details in base64 format.
Test Case ID: TC05 - Retrieve available shipping rates for a standard package containing dangerous goods
Click to expand
Pre-requisites:
Valid API credentials (either Sandbox or Production application).
Required access permissions: ‘Amazon Logistics’ role for OFF-Amazon usage or ‘Direct To Consumer’ role for Hybrid (both OFF-Amazon and/or ON-Amazon scenarios).
Mandatory input parameters including Ship From, Ship To address, Package Dimensions, and Weight along with Dangerous Goods specific fields - Liquid Volume and Regulatory Details.
Test Steps:
Set the API endpoint to /shipping/v2/shipments/rates
Include the required headers:
x-amz-access-token: [Your Access Token]
x-amzn-shipping-business-id: AmazonShipping_US
Prepare the request body with the required shipping details.
Send a POST request to the endpoint.
{
"shipTo": {
"name": "Test Customer",
"companyName": "Test Company",
"addressLine1": "410 Terry Avenue North",
"stateOrRegion": "WA",
"postalCode": "98109",
"city": "SEATTLE",
"countryCode": "US",
"email": "[email protected]",
"phoneNumber": "1 206 2661000"
},
"shipFrom": {
"name": "Test Warehouse",
"addressLine1": "22001 84th Avenue S",
"stateOrRegion": "WA",
"postalCode": "98032",
"city": "Kent",
"countryCode": "US",
"email": "[email protected]",
"phoneNumber": "1 206 2661000"
},
"packages": [
{
"dimensions": {
"length": 12.99,
"width": 9.45,
"height": 5.91,
"unit": "INCH"
},
"weight": {
"unit": "KILOGRAM",
"value": 0.5
},
"items": [
{
"itemValue": {
"unit": "GBP",
"value": 13.99
},
"description": "Amazon Basic Care - Aloe Vera Hand Sanitizer",
"itemIdentifier": "69783225326731",
"quantity": 1,
"weight": {
"unit": "KILOGRAM",
"value": 0.15
},
"liquidVolume": {
"unit": "ML",
"value": 200
},
"dangerousGoodsDetails": {
"unitedNationsRegulatoryId": "UN1170",
"transportationRegulatoryClass": "3",
"packingGroup": "II"
},
"isHazmat": true
}
],
"insuredValue": {
"unit": "GBP",
"value": 13.99
},
"packageClientReferenceId": "SW17271398"
}
],
"channelDetails": {
"channelType": "AMAZON",
"amazonOrderDetails": {
"orderId": "026-1671542-1523528"
}
}
}
{
"shipTo": {
"name": "Test Customer",
"companyName": "Test Company",
"addressLine1": "410 Terry Avenue North",
"stateOrRegion": "WA",
"postalCode": "98109",
"city": "SEATTLE",
"countryCode": "US",
"email": "[email protected]",
"phoneNumber": "1 206 2661000"
},
"shipFrom": {
"name": "Test Warehouse",
"addressLine1": "22001 84th Avenue S",
"stateOrRegion": "WA",
"postalCode": "98032",
"city": "Kent",
"countryCode": "US",
"email": "[email protected]",
"phoneNumber": "1 206 2661000"
},
"packages": [
{
"dimensions": {
"length": 5,
"width": 5,
"height": 5,
"unit": "INCH"
},
"weight": {
"value": 2,
"unit": "POUND"
},
"insuredValue": {
"value": 400,
"unit": "USD"
},
"isHazmat": true,
"sellerDisplayName": "SellerName",
"packageClientReferenceId": "9a29650d-6a09-4bbe-9e52-ee3cb50baac9-1",
"items": [
{
"itemValue": {
"value": 400,
"unit": "USD"
},
"description": "S1",
"quantity": 1,
"itemIdentifier": "110052974366641",
"weight": {
"value": 2,
"unit": "POUND"
},
"isHazmat": true,
"dangerousGoodsDetails": {
"unitedNationsRegulatoryId": "UN3481",
"transportationRegulatoryClass": "9",
"packingInstruction": "PI966_SECTION_I"
}
}
]
}
],
"channelDetails": {
"channelType": "EXTERNAL"
}
}
Expected Results:
HTTP Status Code: 200 OK
Response contains a list of available shipping rates with service IDs and charges with unique Rate ID.
Test Case ID: TC06 - Purchase a shipment with additional features - seller name, delivery notes and scheduled ship date
Click to expand
Pre-requisites:
Valid API credentials (either Sandbox or Production application).
Required access permissions: Amazon Logistics role.
Must be an OFF amazon order.
Mandatory input parameters including ShipFrom, ShipTo address, package dimensions, and weight along with Seller Display name, Delivery Notes and Ship Date.
Test Steps:
Set the API endpoint to /shipping/v2/shipments/rates
Include the required headers:
x-amz-access-token: [Your Access Token]
x-amzn-shipping-business-id: AmazonShipping_US
Prepare the request body with the required shipping details.
Send a POST request to the endpoint.
{
"shipTo": {
"name": "Test Customer",
"companyName": "Test Company",
"addressLine1": "410 Terry Avenue North",
"stateOrRegion": "WA",
"postalCode": "98109",
"city": "SEATTLE",
"countryCode": "US",
"email": "[email protected]",
"phoneNumber": "1 206 2661000"
},
"shipFrom": {
"name": "Test Warehouse",
"addressLine1": "22001 84th Avenue S",
"stateOrRegion": "WA",
"postalCode": "98032",
"city": "Kent",
"countryCode": "US",
"email": "[email protected]",
"phoneNumber": "1 206 2661000"
},
"shipDate": "2025-03-23T09:00:00Z",
"shipperInstruction": {
"deliveryNotes": "Please ring the doorbell when you arrive"
},
"packages": [
{
"packageClientReferenceId": "I17F39E30CD2DBFD5",
"sellerDisplayName": "New Shoes and Company",
"insuredValue": {
"unit": "USD",
"value": 1
},
"dimensions": {
"length": 2.75,
"width": 9.06,
"height": 11.19,
"unit": "INCH"
},
"weight": {
"unit": "POUND",
"value": 1.52
},
"items": [
{
"itemValue": {
"value": 26.99,
"unit": "USD"
},
"isHazmat": false,
"description": "Face cream",
"quantity": 1,
"itemIdentifier": "110052974366641",
"weight": {
"unit": "POUND",
"value": 1.52
}
}
]
}
],
"channelDetails": {
"channelType": "AMAZON",
"amazonOrderDetails": {
"orderId": "111-4518643-5289024"
}
}
}
{
"shipTo": {
"name": "Test Customer",
"companyName": "Test Company",
"addressLine1": "410 Terry Avenue North",
"stateOrRegion": "WA",
"postalCode": "98109",
"city": "SEATTLE",
"countryCode": "US",
"email": "[email protected]",
"phoneNumber": "1 206 2661000"
},
"shipFrom": {
"name": "Test Warehouse",
"addressLine1": "22001 84th Avenue S",
"stateOrRegion": "WA",
"postalCode": "98032",
"city": "Kent",
"countryCode": "US",
"email": "[email protected]",
"phoneNumber": "1 206 2661000"
},
"shipDate": "2025-03-23T09:00:00Z",
"shipperInstruction": {
"deliveryNotes": "Please ring the doorbell when you arrive"
},
"packages": [
{
"dimensions": {
"length": 5,
"width": 5,
"height": 5,
"unit": "INCH"
},
"weight": {
"unit": "POUND",
"value": 10
},
"insuredValue": {
"value": 10,
"unit": "USD"
},
"isHazmat": false,
"sellerDisplayName": "New Shoes and Company",
"packageClientReferenceId": "Order-12345",
"items": [
{
"itemValue": {
"value": 10,
"unit": "USD"
},
"description": "Clothes",
"itemIdentifier": "T shirt",
"quantity": 1,
"weight": {
"unit": "POUND",
"value": 10
},
"isHazmat": false
}
]
}
],
"channelDetails": {
"channelType": "EXTERNAL"
},
"serviceSelection": {
"serviceId": [
"std-us-swa-mfn"
]
},
"labelSpecifications": {
"format": "PDF",
"size": {
"width": 4,
"length": 6,
"unit": "INCH"
},
"dpi": 300,
"pageLayout": "DEFAULT",
"needFileJoining": false,
"requestedDocumentTypes": [
"LABEL"
]
}
}
Expected Results:
HTTP Status Code: 200 OK
Response contains Shipment ID, Tracking ID and Package Document Details with label details in base64 format.
Promise Pickup Window and Delivery Window is adjusted according to the Ship Date.
Seller Display Name appears on the Tracking and Recipient notifications.
Delivery notes is visible to the Amazon Delivery Personnel during the parcel delivery attempt.
Test Case ID: TC07 - Purchase a shipment with label customization by including Seller Display Name and Package Client reference ID on the label
Click to expand
Pre-requisites:
Successful retrieval of shipping rates - Rate ID and Request Token (as per TC01).
Selected Service ID from the available rates.
Must be an OFF Amazon order.
Mandatory input parameters including Rate ID, Request Token, requested Label Customization attributes such as Package Client Reference ID and Seller Display Name.
Test Steps:
Set the API endpoint to /shipping/v2/shipments
Include the required headers:
x-amz-access-token: [Your Access Token]
x-amzn-shipping-business-id: AmazonShipping_US
Prepare the request body with the required shipping details.
Send a POST request to the endpoint.
{
"requestToken": "amzn1.rq.85432213067105.100",
"rateId": "75ec65c101bdb68ac979032268ba119ec17dda9a5e84312351bd9503a1bc058b1721804036099",
"requestedDocumentSpecification": {
"format": "PDF",
"size": {
"width": 4,
"length": 6,
"unit": "INCH"
},
"dpi": 203,
"pageLayout": "DEFAULT",
"needFileJoining": false,
"requestedDocumentTypes": [
"LABEL"
],
"requestedLabelCustomization": {
"requestAttributes": [
"PACKAGE_CLIENT_REFERENCE_ID",
"SELLER_DISPLAY_NAME"
]
}
}
}
Expected Results:
HTTP Status Code: 200 OK
Response contains Shipment ID, Tracking ID and Package Document Details with label details in base64 format.
Package Client Reference ID and Seller Display Name are displayed on the label.
Test Case ID: TC08 - Retrieve Shipping label for reprinting
Click to expand
Pre-requisites:
Successful generation of shipping label (as per TC02).
Valid Shipment ID for the shipment you want to retrieve documents for.
Mandatory parameters including valid Shipment ID, Package Client Reference ID, Label Format.
Test Steps:
Set the API endpoint to /shipping/v2/shipments/<ShipmentID>/documents?packageClientReferenceId=<ClientRefID>&format=<DOCFormat>
Include the required headers:
x-amz-access-token: [Your Access Token]
x-amzn-shipping-business-id: AmazonShipping_US
Prepare the request body with the required shipping details.
Send a GET request to the endpoint.
https://sellingpartnerapi-na.amazon.com/shipping/v2/shipments/amzn1.dtestcec-b215-4504-b94d-d64000004a63/documents?packageClientReferenceId=abcd&format=PNG&dpi=300
Expected Results:
HTTP Status Code: 200 OK
Response contains Shipment ID, Tracking ID and Package Document Details with label details in base64 format.
Test Case ID: TC09 - Retrieve tracking updates for a shipping label
Click to expand
Pre-requisites:
Successful generation of shipping label (as per TC02).
Valid Tracking ID for the shipment you want to retrieve tracking statuses for.
Test Steps:
Set the API endpoint to /shipping/v2/tracking? carrierId=<CarrierID>& trackingId=<TrackingID>
Include the required headers:
x-amz-access-token: [Your Access Token]
x-amzn-shipping-business-id: AmazonShipping_US
Prepare the request body with the required shipping details.
Send a GET request to the endpoint.
https://sellingpartnerapi-na.amazon.com/shipping/v2/tracking?carrierId=AMZN_US&trackingId=1582657452914
Expected Results:
HTTP Status Code: 200 OK
Response contains Promise Delivery Date, Tracking Summary and Event Statuses, Alternate Leg Tracking ID for return to origin parcels.
Test Case ID: TC10 - Retrieve a list of Access Points in proximity of input postal code using Deliver to Counter API
Click to expand
Pre-requisites:
Valid API credentials (either Sandbox or Production application).
Required access permissions: ‘Amazon Logistics’ role for OFF-Amazon usage or ‘Direct To Consumer’ role for Hybrid (both OFF-Amazon and/or ON-Amazon scenarios).
Applicable only for UK marketplace.
Test Steps:
Set the API endpoint to /shipping/v2/accessPoints
Include the required headers:
x-amz-access-token: [Your Access Token]
x-amzn-shipping-business-id: AmazonShipping_UK
countryCode: GB
postalCode:[Enter a post code]
Send a GET request to the endpoint.
https://sellingpartnerapi-eu.amazon.com/shipping/v2/accessPoints?accessPointTypes=HELIX&countryCode=GB&postalCode=HA98RS
Expected Results:
HTTP Status Code: 200 OK
Response contains a list of access points with Access Point ID.
Additional Use Cases for Review
This section outlines additional test cases to validate the API’s label printing capability, access control, throttling limits, and negative test scenarios. Ensure these tests are executed alongside the primary test cases for a thorough and robust API integration review.
API Authorization and Throttling Scenarios
Test Case ID: TC01: Exceeding default transaction per second(TPS) Limit
Click to expand
Input data
Use a script or tool to send 10 or more requests per second to the API.
Expected Results:
The API should return a 429 Too Many Requests or a specific throttling error message indicating the rate limit has been exceeded. Requests exceeding the limit should fail, while requests within the limit should succeed.
Rootcause and Resolution:
The issue occurs when API requests exceed the allowed TPS limit, resulting in throttling errors. To resolve this, implement an exponential backoff retry strategy with 3-4 attempts at incremental intervals (1s, 3s, 7s, 15s), ensuring efficient retries without overwhelming the server and use batching to limit API calls to a maximum of 10 requests per second.
Test Case ID: TC02: Access to the APIs is denied
Click to expand
Input data
Use a Client Secret that has not been rotated in the last 180 days, along with a valid Client ID and Refresh Token to invoke the token API ([GetToken API](https://api.amazon.co.uk/auth/o2/token)).
Expected Results:
The API returns an error
The LWA secret token you provided has expired
Rootcause and Resolution:
The issue arises if the 'client secret' in your developer portal is not rotated before its expiration date (expires every 180 days). To resolve this, follow the instructions provided in the developer portal or the automated email reminder, and ensure you update your API calls with the new 'client secret'.
Test Case ID: TC03: Accessing APIs with insufficient permissions
Click to expand
Input data
Use a developer account with only the 'Amazon Logistics' role to generate shipping labels through Amazon Shipping for orders that originate from the Amazon marketplace.
Expected Results:
The API returns an error
Your assigned role is not authorized to access Amazon Orders
Rootcause and Resolution:
The issue arises when the 'Direct-to-Consumer Shipping' role is not assigned to your developer profile. To fix it, follow the [instructions](https://developer-docs.amazon.com/amazon-shipping/docs/1p-on-amazon) on the developer portal to request and obtain approval for this restricted role.
Label Purchase Capability:
Test Case ID: TC01: Attempt to print labels without scheduled pickups in the shipper account
Click to expand
Input data
{
"shipTo": {
"name": "Test Customer",
"companyName": "Test Company",
"addressLine1": "410 Terry Avenue North",
"stateOrRegion": "WA",
"postalCode": "98109",
"city": "SEATTLE",
"countryCode": "US",
"email": "[email protected]",
"phoneNumber": "1 206 2661000"
},
"shipFrom": {
"name": "Test Warehouse",
"addressLine1": "22001 84th Avenue S",
"stateOrRegion": "WA",
"postalCode": "98032",
"city": "Kent",
"countryCode": "US",
"email": "[email protected]",
"phoneNumber": "1 206 2661000"
},
"packages": [
{
"packageClientReferenceId": "I17F39E30CD2DBFD5",
"insuredValue": {
"unit": "USD",
"value": 1
},
"dimensions": {
"length": 2.75,
"width": 9.06,
"height": 11.19,
"unit": "INCH"
},
"weight": {
"unit": "POUND",
"value": 1.52
},
"items": [
{
"itemValue": {
"value": 26.99,
"unit": "USD"
},
"isHazmat": false,
"description": "Face cream",
"quantity": 1,
"itemIdentifier": "110052974366641",
"weight": {
"unit": "POUND",
"value": 1.52
}
}
]
}
],
"channelDetails": {
"channelType": "AMAZON",
"amazonOrderDetails": {
"orderId": "111-4518643-5289024"
}
}
}
{
"shipTo": {
"name": "Test Customer",
"companyName": "Test Company",
"addressLine1": "410 Terry Avenue North",
"stateOrRegion": "WA",
"postalCode": "98109",
"city": "SEATTLE",
"countryCode": "US",
"email": "[email protected]",
"phoneNumber": "1 206 2661000"
},
"shipFrom": {
"name": "Test Warehouse",
"addressLine1": "22001 84th Avenue S",
"stateOrRegion": "WA",
"postalCode": "98032",
"city": "Kent",
"countryCode": "US",
"email": "[email protected]",
"phoneNumber": "1 206 2661000"
},
"packages": [
{
"packageClientReferenceId": "I17F39E30CD2DBFD5",
"insuredValue": {
"unit": "USD",
"value": 1
},
"dimensions": {
"length": 2.75,
"width": 9.06,
"height": 11.19,
"unit": "INCH"
},
"weight": {
"unit": "POUND",
"value": 1.52
},
"items": [
{
"itemValue": {
"value": 10,
"unit": "USD"
},
"description": "Clothes",
"itemIdentifier": "T shirt",
"quantity": 1,
"weight": {
"unit": "POUND",
"value": 10
},
"isHazmat": false
}
]
}
],
"channelDetails": {
"channelType": "AMAZON",
"amazonOrderDetails": {
"orderId": "111-4518643-5289024"
}
}
}
Expected Results:
The API returns an error
We apologize for the inconvenience. We cannot ship the order because there are no upcoming pickup slots available. Please adjust the pickup slot and retry. (Code: S-503)
Rootcause and Resolution:
The Amazon Shipping system requires scheduled pickups for your shipper account before allowing label generation, ensuring a planned collection for the packages you're creating labels for. Contact your Amazon account manager to enable pickup slots for your shipper account.
Test Case ID: TC02: Erroneous Package Dimension and Weight Input
Click to expand
Input data
...
"dimensions": {
"length": 200,
"width": 100,
"height": 100,
"unit": "INCH"
},
"weight": {
"unit": "POUND",
"value": 250
},
...
Expected Results:
The API returns an error
We apologize for the inconvenience. We cannot ship the order because the package
dimensions or weight are above the allowable limit. Please validate that
the package inputs are within the allowable limits and try again
Rootcause and Resolution:
The issue arises when the dimensions and weight included in the API request exceed the permitted limits. To address this, ensure the values in the request adhere to the allowed thresholds. Note: If the postcode is serviced by a third-party shipper (e.g., Royal Mail in the UK), be aware that additional limitations may apply, such as a maximum volume of 70,000 cubic cm.
Negative Test Scenarios
Test Case ID: TC01: Unable to generate Amazon shipping rates for an Amazon order due to invalid Amazon Order Item ID
Click to expand
Input data
Use an Amazon Order Item ID that is invalid or Order Item ID that is not associated with the corresponding Amazon order.
Expected Results:
The API returns an error
"Incorrect itemIdentifier was detected in the item list
Rootcause and Resolution:
The issue occurs when an incorrect or invalid Amazon Order Item ID is used. To resolve this, refer to the [[Order API](https://developer-docs.amazon.com/sp-api/docs/orders-api-v0-reference#get-ordersv0ordersorderidorderitems)] response (GET /orders/v0/orders/{orderId}/orderItems) to ensure the correct Order Item ID is used, matching it with the associated Amazon order.
Test Case ID: TC02: Unable to generate Amazon shipping rates due to expired Rate ID
Click to expand
Input data
Use a Shipping Rate ID and a Request Token that were generated over 10 minutes ago (as per TC01)
Expected Results:
The API returns an error
Error occurred while validating and enriching case entities The provided token
is expired with error code TOKEN_EXPIRED
Rootcause and Resolution:
Root Cause & Resolution: The shipment must be purchased within 10 minutes of the rate creation by the shipping service provider. If the request is made after this time limit, the token expires, resulting in an error response with the error code TOKEN_EXPIRED. To resolve this, retrieve the rates for the shipment again and complete the purchase within the valid time frame.
Updated 1 day ago