API Documentation
  1. API Documentation - Version 3
API Documentation
  • API Documentation - Version 3
    • Getrate API
      POST
    • Purchase API
      POST
    • Get All Orders API
      POST
    • Get Order Detail API
      POST
    • Cancel Orders API
      POST
    • Get PodInfo API
      POST
    • Get Label API
      POST
    • Get TrackingInfo API
      POST
    • Create Manifest
      POST
    • Get Manifest
      POST
    • GetBreakdown
      POST
  1. API Documentation - Version 3

Getrate API

POST
/api/v3/shipment/rates

Change Log#

Version 2.1 - In get rate API#

1.
v2/shipment/rates response body added 3 more fields in each rates which is "success", "message", "details", if success is true, message and details will be null or undefined, vice versa.

Version 2.0 - In get rate API#

1.
"requestToken": "REQUEST_TOKEN_EXAMPLE", response is moving to rates. Each rate contain one requestToken
2.
"stateOrRegion","countryCode", "postalCode", "phoneNumber", "city" in shipTo are required now and "stateOrRegion" must be a state code such as “CA”.
3.
To use FedEx, you must now register your shipFrom address by contacting your manager. Additionally, the "postalCode" in the shipFrom address is required because it will be matched with the registered "postalCode".
4.
Weight: "POUND", "KILOGRAM"
5.
Dimensions: "INCH", "CENTIMETER"
6.
All number fields must be numerical values with a precision of two decimal places such as dimensions.length: 3.14.
7.
Purchase. Only amazon need rateId and requestedDocumentSpecification

Policy#

Our API integration permits a default transaction rate of up to 5 transactions per second (TPS). This rate limit is designed to maintain optimal service stability and performance for all users. It is essential that customers manage their API calls within this rate to avoid service disruptions. Exceeding this limit may result in temporary API access suspension, characterized by a HTTP 429 status code. Customers are responsible for implementing their own retry logic to handle such scenarios effectively. We encourage you to familiarize yourself with our API throttling measures and manage your API requests accordingly to ensure seamless service usage.
Reference:
https://developer-docs.amazon.com/amazon-shipping/docs/frequently-asked-questions#what-is-api-throttling-and-how-is-it-assigned-to-me

Request

Body Params application/json

Example
{
    "accessToken": "",
    "mode": "sandbox",
    "shipDate": "2025-07-10T21:33:26Z",
    "shipTo": {
        "name": "{{$person.fullName(locale='en')}}",
        "companyName": "Batchship",
        "addressLine1": "318 BREA CANYON RD",
        "stateOrRegion": "CA",
        "city": "CITY OF INDUSTRY",
        "countryCode": "US",
        "postalCode": "91789",
        "email": "",
        "phoneNumber": "9999999999"
    },
    "shipFrom": {
        "name": "{{$person.fullName(locale='en')}}",
        "companyName": "Fulfillment Center",
        "addressLine1": "438 W Chestnut Avenue",
        "city": "Monrovia",
        "stateOrRegion": "CA",
        "countryCode": "US",
        "postalCode": "91016-1128",
        "email": "",
        "phoneNumber": ""
    },
    "packages": [
        {
            "sellerDisplayName": "APIAutomationSeller",
            "insuredValue": {
                "unit": "USD",
                "value": 12
            },
            "weight": {
                "unit": "POUND",
                "value": 2
            },
            "items": [
                {
                    "quantity": 1,
                    "itemValue": {
                        "unit": "USD",
                        "value": 10
                    },
                    "description": "SWA QA API Automation Items",
                    "weight": {
                        "unit": "POUND",
                        "value": 1
                    },
                    "itemIdentifier": "64618560956686",
                    "isHazmat": false,
                    "productType": "Rufus"
                }
            ],
            "isHazmat": false,
            "packageClientReferenceId": "SWA_US_SmartP_Test",
            "dimensions": {
                "unit": "INCH",
                "length": 3,
                "width": 3.14,
                "height": 3.14
            }
        }
    ]
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.batchship.com/api/v3/shipment/rates' \
--header 'Content-Type: application/json' \
--data-raw '{
    "accessToken": "",
    "mode": "sandbox",
    "shipDate": "2025-07-10T21:33:26Z",
    "shipTo": {
        "name": "{{$person.fullName(locale='\''en'\'')}}",
        "companyName": "Batchship",
        "addressLine1": "318 BREA CANYON RD",
        "stateOrRegion": "CA",
        "city": "CITY OF INDUSTRY",
        "countryCode": "US",
        "postalCode": "91789",
        "email": "",
        "phoneNumber": "9999999999"
    },
    "shipFrom": {
        "name": "{{$person.fullName(locale='\''en'\'')}}",
        "companyName": "Fulfillment Center",
        "addressLine1": "438 W Chestnut Avenue",
        "city": "Monrovia",
        "stateOrRegion": "CA",
        "countryCode": "US",
        "postalCode": "91016-1128",
        "email": "",
        "phoneNumber": ""
    },
    "packages": [
        {
            "sellerDisplayName": "APIAutomationSeller",
            "insuredValue": {
                "unit": "USD",
                "value": 12
            },
            "weight": {
                "unit": "POUND",
                "value": 2
            },
            "items": [
                {
                    "quantity": 1,
                    "itemValue": {
                        "unit": "USD",
                        "value": 10
                    },
                    "description": "SWA QA API Automation Items",
                    "weight": {
                        "unit": "POUND",
                        "value": 1
                    },
                    "itemIdentifier": "64618560956686",
                    "isHazmat": false,
                    "productType": "Rufus"
                }
            ],
            "isHazmat": false,
            "packageClientReferenceId": "SWA_US_SmartP_Test",
            "dimensions": {
                "unit": "INCH",
                "length": 3,
                "width": 3.14,
                "height": 3.14
            }
        }
    ]
}'

Responses

🟢200成功
application/json
Body

Example
{
    "success": true,
    "payload": {
        "rates": [
            {
                "requestToken": "REQUEST_TOKEN_EXAMPLE",
                "details": null,
                "success": true,
                "message": null,
                "carrierId": "AMZN_US",
                "carrierName": "Amazon Shipping",
                "rateId": "RATEID_EXAMPLE",
                "promise": {
                    "pickupWindow": {
                        "start": "2024-03-26T07:16:40.042Z",
                        "end": "2024-03-26T08:16:40.042Z"
                    },
                    "deliveryWindow": {
                        "start": "2024-03-27T09:16:40.042Z",
                        "end": "2024-03-27T09:16:40.042Z"
                    }
                },
                "totalCharge": {
                    "unit": "USD",
                    "value": "5.47"
                },
                "supportedDocumentSpecifications": [
                    {
                        "format": "PNG",
                        "size": {
                            "width": 4,
                            "length": 6,
                            "unit": "INCH"
                        },
                        "printOptions": [
                            {
                                "supportedDPIs": [
                                    300,
                                    203
                                ],
                                "supportedPageLayouts": [
                                    "DEFAULT"
                                ],
                                "supportedFileJoiningOptions": [
                                    false
                                ],
                                "supportedDocumentDetails": [
                                    {
                                        "name": "LABEL",
                                        "isMandatory": true
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "format": "ZPL",
                        "size": {
                            "width": 4,
                            "length": 6,
                            "unit": "INCH"
                        },
                        "printOptions": [
                            {
                                "supportedDPIs": [
                                    300,
                                    203
                                ],
                                "supportedPageLayouts": [
                                    "DEFAULT"
                                ],
                                "supportedFileJoiningOptions": [
                                    false
                                ],
                                "supportedDocumentDetails": [
                                    {
                                        "name": "LABEL",
                                        "isMandatory": true
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "format": "PDF",
                        "size": {
                            "width": 4,
                            "length": 6,
                            "unit": "INCH"
                        },
                        "printOptions": [
                            {
                                "supportedDPIs": [
                                    300,
                                    203
                                ],
                                "supportedPageLayouts": [
                                    "DEFAULT"
                                ],
                                "supportedFileJoiningOptions": [
                                    false
                                ],
                                "supportedDocumentDetails": [
                                    {
                                        "name": "LABEL",
                                        "isMandatory": true
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ],
        "ineligibleRates": null
    }
}
Modified at 2026-02-28 08:14:19
Next
Purchase API
Built with