- You can purchase the shipment object you created in the last step. This is useful when you want to find the best rate and service level for your shipment.
- You can purchase a label without a shipment object in a single call. This is useful when you what to immediately create your label.
HTTP Method
POSTURL
Purchase from created Shipment
This is a flow where we first create a shipment object (and get rates for a given shipment). Then, we purchase a label for the providedrate.
Request Payload
| Parameter | Description |
|---|---|
| rate* | ‘object_id’ of the rate object we get in the create shipments call response. |
| parcels | Array of parcels Example with 2 parcels |
| label_file_type | Allowed values:PDF, PDF_A4, PDF_A6, PDF_4x6, PDF_4x8, PDF_SINGLE_8X11, PDF_2.3x7.5, PNG, PNG_2.3x7.5, ZPLII |
Multiple parcels payload example
Example
Request Sample
cURL
Response Sample
Purchase label in one call
This is a flow where we create a shipment object from the request payload and return label for it in one call. This is useful if you already know which carrier and service you want to use.Request Payload
| Parameter | Description |
|---|---|
| shipment* | Refer to the Shipment object. |
| carrier_account* | object_id of the carrier account to be used for purchasing this label. This carrier account object_id is available when an account is created. |
| servicelevel_token* | Name of the service level to use. For APG must be one of the following:epacketepacket_pluseparcel_premiumapg_eparcel_expedited These are case sensitive. |
| label_file_type* | Allowed values:PDFPDF_A4PDF_A6PDF_4x6PDF_4x8PDF_SINGLE_8X11PDF_2.3x7.5PNGPNG_2.3x7.5ZPLII |
Shipment
| Parameter | Description |
|---|---|
| address_from* | Refer to the Address object |
| address_to* | Refer to the Address object |
| parcels* | List of Parcel objects. Refer Parcel object |
| extra | Refer to the Extra object |
Example
Request sample for label creation with single call
cURL