Sample API Call using Amazon
Include required information when shipping with Amazon carrier services in your calls to Shipium's APIs.
About shipping with Amazon
Both Amazon carrier services, Ship With Amazon (SWA) and Vendor Direct Fulfillment (VDF), require that additional fields be included in your API calls. This document provides sample calls to Shipium's Carrier and Method Selection & Label Generation API with the required fields for SWA and VDF.
Ship With Amazon
The following JSON example is a call request to Shipium's Carrier and Method Selection & Label Generation API with the required fields for Amazon - Ship With Amazon included. This example is for a single-parcel shipment; for multi-parcel shipments, the fields included in shipmentParameters would instead be included in multiParcelShipmentParameters.
While not all fields in the example are required, they are suggested for a request to determine the carrier service method for a shipment and also retrieve a shipment label. The labelParameters object must be defined when generating a label. Address requirements vary by carrier, so Shipium suggests supplying as much information as possible. You can find guidance for address variations in Non-U.S. Address Formats.
Fields not defined in the table following this sample request are described in the request fields table in the API documentation.
{
"currencyCode": "usd",
"generateLabel": true,
"labelParameters": {
"currencyCode": "usd",
"includeLabelImagesInResponse": true,
"labelFormats": [
"zpl"
],
"eligibleForManifest": true
},
"shipmentParameters": {
"shippedDateTime": "2024-04-06T18:30:55.558Z",
"orderedDateTime": "2024-04-03T18:30:55.558Z",
"testMode": true,
"destinationAddress": {
"countryCode": "US",
"postalCode": "87121",
"addressType": "commercial",
"city": "Albuquerque",
"name": "Wile E. Coyote",
"phoneNumber": "888-555-1234",
"state": "NM",
"street1": "123 Main St.",
"street2": "Suite 42"
},
"shipFromAddress": {
"countryCode": "US",
"postalCode": "17901",
"city": "Pottsville",
"state": "PA",
"street1": "401 N. Centre St."
},
"orderSourceName": "amazon",
"carrierProcessingId": "PO1234",
"orderItemQuantities": [
{
"hazmatInfo": {
"packingInstructionCode": "967"
},
"itemWeight": {
"weightUnit": "lb",
"weight": 50
},
"productId": "ET-14-4000",
"quantity": 2
}
],
"packagingType": {
"packagingMaterial": "box",
"packagingWeight": {
"weight": 13,
"weightUnit": "oz"
},
"linearDimensions": {
"length": 15,
"width": 10,
"height": 5,
"linearUnit": "in"
}
},
"totalWeight": {
"weight": 13,
"weightUnit": "oz"
}
}
}When shipping with Amazon - Ship With Amazon, you must include the required fields listed in the following table, flagged as required specifically for Ship With Amazon (SWA), in your API call. The other fields marked as required are needed for any request call to Shipium's Carrier and Method Selection & Label Generation API. Optional (but suggested) fields not specifically related to SWA are included in the sample call request above but are not in defined in the following table. They are described in the request fields table in the API documentation. Conditional fields are described below.
Required fields
Request field | Details |
|---|---|
| Type: String |
| Type: String |
| Type: String |
| Type: String (enumeration) |
| Type: String |
| Type: String |
| Type: String |
| Type: Number (float) |
| Type: String (enumeration) |
Conditional fields
Request field | Details |
|---|---|
| Type: String |
| Type: String (enumeration) |
| Type: String |
| Type: Integer (int32) |
| Type: String |
| Type: Number (float) |
| Type: Number (float) |
| Type: Number (float) |
| Type: String (enumeration) |
Optional fields
Request field | Details |
|---|---|
| Type: Boolean |
| Type: String |
| Type: Boolean |
| Type: String (enumeration) |
| Type: Boolean |
Vendor Direct Fulfillment
The following JSON example is a call request to Shipium's Carrier and Method Selection & Label Generation API with the required fields for Amazon - Vendor Direct Fulfillment included. This example is for a single-parcel shipment; for multi-parcel shipments, the fields included in shipmentParameters would instead be included in multiParcelShipmentParameters.
While not all fields in the example are required, they are suggested for a request to determine the carrier service method for a shipment and also retrieve a shipment label. The labelParameters object must be defined when generating a label. Address requirements vary by carrier, so Shipium suggests supplying as much information as possible. You can find guidance for address variations in Non-U.S. Address Formats.
Fields not defined in the table following this sample request are described in the request fields table in the API documentation.
{
"currencyCode": "usd",
"generateLabel": true,
"labelParameters": {
"currencyCode": "usd",
"includeLabelImagesInResponse": true,
"labelFormats": [
"zpl"
],
"eligibleForManifest": true
},
"shipmentParameters": {
"shippedDateTime": "2024-04-06T18:30:55.558Z",
"orderedDateTime": "2024-04-03T18:30:55.558Z",
"testMode": true,
"destinationAddress": {
"countryCode": "US",
"postalCode": "87121",
"addressType": "commercial",
"city": "Albuquerque",
"name": "Wile E. Coyote",
"phoneNumber": "888-555-1234",
"state": "NM",
"street1": "123 Main St.",
"street2": "Suite 42"
},
"shipFromAddress": {
"countryCode": "US",
"postalCode": "17901",
"city": "Pottsville",
"state": "PA",
"street1": "401 N. Centre St."
},
"carrierProcessingId": "PO1234",
"packageReferenceIdentifier": "package1",
"orderItemQuantities": [
{
"orderItemReferenceIdentifier": "someIdentifier",
"productId": "ET-14-4000",
"quantity": 2
}
],
"packagingType": {
"packagingMaterial": "box",
"packagingWeight": {
"weight": 13,
"weightUnit": "oz"
},
"linearDimensions": {
"length": 15,
"width": 10,
"height": 5,
"linearUnit": "in"
}
},
"totalWeight": {
"weight": 13,
"weightUnit": "oz"
}
}
}When shipping with Amazon - Vendor Direct Fulfillment, you must include the required fields listed in the following table, flagged as required specifically for Vendor Direct Fulfillment (VDF), in your API call. The other fields marked as required are needed for any request call to Shipium's Carrier and Method Selection & Label Generation API. Optional (but suggested) fields not specifically related to VDF are included in the sample call request above but are not in defined in the following table. They are described in the request fields table in the API documentation. Conditional fields are described below.
Required fields
Request field | Details |
|---|---|
| Type: String |
| Type: String |
| Type: String |
| Type: String (enumeration) |
| Type: String |
| Type: String |
| Type: String |
| Type: String |
| Type: Integer (int32) |
| Type: String |
| Type: Integer (int32) |
| Type: Number (float) |
| Type: String (enumeration) |
Conditional fields
Request field | Details |
|---|---|
| Type: String |
| Type: Number (float) |
| Type: Number (float) |
| Type: Number (float) |
| Type: String (enumeration) |
Optional fields
Request field | Details |
|---|---|
| Type: Boolean |
| Type: String |
| Type: Boolean |
| Type: String (enumeration) |
| Type: Boolean |
Updated 2 days ago
