Skip to content

ShipEngine API (1.1.202604070904)

ShipEngine's easy-to-use REST API lets you manage all of your shipping needs without worrying about the complexities of different carrier APIs and protocols. We handle all the heavy lifting so you can focus on providing a first-class shipping experience for your customers at the best possible prices.

Each of ShipEngine's features can be used by itself or in conjunction with each other to build powerful shipping functionality into your application or service.

Download OpenAPI description
Languages
Servers
Mock server
https://docs.shipstation.com/_mock/apis/shipengine/openapi/
https://api.shipengine.com/

Account

For additional information about the ShipEngine account.

Operations

Addresses

No matter your shipping volume, failed deliveries and address change surcharges cut into your bottom line and damage perception with customers. Our address validation services ensure your packages make it to the right place the first time. Learn how to leverage our address validation services here.

ShipEngine supports address validation for virtually every country on Earth, including the United States, Canada, Great Britain, Australia, Germany, France, Norway, Spain, Sweden, Israel, Italy, and over 160 others.

Operations

Batches

batches

Operations

Carrier Accounts

A carrier account is a connection to a shipping carrier that allows you to create labels, track packages, and more. You can connect your own carrier accounts to ShipEngine, or use one of our built-in carrier accounts. Learn more about carrier accounts here.

Operations

Carriers

carriers

Operations

Downloads

downloads

Operations

Insurance

insurance

Operations

Labels

Print shipping labels for any of the top global carriers in minutes—instead of weeks. Simply connect your existing carrier accounts in the API dashboard, and then begin creating labels.

Operations

LTL Shipping

Less-than-truckload (LTL) shipping API endpoints for managing freight shipments. Connect LTL carriers, request quotes, schedule pickups, and track freight shipments.

Operations

Mailing

Create mailing labels for USPS including NetStamps, mail labels, and envelopes.

Operations

Create netstamps

Request

Create one or more NetStamps. Each shipment in the request produces an individual stamp with row/column positioning via advanced_options.netstamps_options.

Security
api_key
Bodyapplication/jsonrequired
shipmentsArray of objects(shipment_request)non-emptyrequired

The shipments to create NetStamps labels for. All shipments must use the same carrier_id.

Each shipment must include advanced_options.netstamps_options with row and column to control stamp placement. Row/column combinations must be unique across shipments.

shipments[].​carrier_idstring(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$required

The carrier account that is billed for the shipping charges

Example: "se-28529731"
shipments[].​service_codestring(service_code)^[a-z0-9]+(_[a-z0-9-]+)* ?$required

A carrier service, such as fedex_ground, usps_first_class_mail, flat_rate_envelope, etc.

Example: "usps_first_class_mail"
shipments[].​external_order_idstring or null

ID that the Order Source assigned

shipments[].​itemsArray of objects(shipment_item)

Describe the packages included in this shipment as related to potential metadata that was imported from external order sources

Default []
shipments[].​tax_identifiersArray of objects or null(tax_identifier)
shipments[].​external_shipment_idstring or null<= 50 characters

A unique user-defined key to identify a shipment. This can be used to retrieve the shipment.

Warning: The external_shipment_id is limited to 50 characters. Any additional characters will be truncated.

shipments[].​shipment_numberstring or null<= 50 characters

A non-unique user-defined number used to identify a shipment. If undefined, this will match the external_shipment_id of the shipment.

Warning: The shipment_number is limited to 50 characters. Any additional characters will be truncated.

shipments[].​ship_datestring(date-time)(date)^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?...

An ISO 8601 string that represents a date, but not a specific time. The value may contain a time component, but it will be set to 00:00:00 UTC by ShipEngine.

Example: "2018-09-23T00:00:00.000Z"
shipments[].​ship_toobject(partial_shipping_address_to)required

Any residential or business mailing address, anywhere in the world.

Note: Either name or company_name must be set. Both may be specified, if relevant.

shipments[].​ship_to.​namestringnon-emptyrequired

The name of a contact person at this address. This field may be set instead of - or in addition to - the company_name field.

Example: "John Doe"
shipments[].​ship_to.​phonestringnon-empty

The phone number of a contact person at this address. The format of this phone number varies depending on the country.

Example: "+1 204-253-9411 ext. 123"
shipments[].​ship_to.​emailstring or null

Email for the address owner.

Example: "example@example.com"
shipments[].​ship_to.​company_namestring or nullnon-empty

If this is a business address, then the company name should be specified here.

Example: "The Home Depot"
shipments[].​ship_to.​address_line1stringnon-emptyrequired

The first line of the street address. For some addresses, this may be the only line. Other addresses may require 2 or 3 lines.

Example: "1999 Bishop Grandin Blvd."
shipments[].​ship_to.​address_line2string or nullnon-empty

The second line of the street address. For some addresses, this line may not be needed.

Example: "Unit 408"
shipments[].​ship_to.​address_line3string or nullnon-empty

The third line of the street address. For some addresses, this line may not be needed.

Example: "Building #7"
shipments[].​ship_to.​city_localitystringnon-emptyrequired

The name of the city or locality

Example: "Winnipeg"
shipments[].​ship_to.​state_provincestringnon-emptyrequired

The state or province. For some countries (including the U.S.) only abbreviations are allowed. Other countries allow the full name or abbreviation.

Example: "Manitoba"
shipments[].​ship_to.​postal_codestring(postal_code)non-emptyrequired

postal code

Example: "78756-3717"
shipments[].​ship_to.​country_codestring(country_code)= 2 characters
Example: "CA"
shipments[].​ship_to.​address_residential_indicatorstring(address_residential_indicator)

Indicates whether this is a residential address.

Default "unknown"
Enum"unknown""yes""no"
Example: "no"
shipments[].​ship_to.​instructionsstring or nullnon-empty

Additional text about how to handle the shipment at this address.

shipments[].​ship_to.​geolocationArray of objects
shipments[].​ship_fromobject(partial_shipping_address)

Any residential or business mailing address, anywhere in the world.

Note: Either name or company_name must be set. Both may be specified, if relevant.

shipments[].​warehouse_idstring or null(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$

The warehouse that the shipment is being shipped from. Either warehouse_id or ship_from must be specified.

Default null
Example: "se-28529731"
shipments[].​return_toobject(partial_shipping_address)

Any residential or business mailing address, anywhere in the world.

Note: Either name or company_name must be set. Both may be specified, if relevant.

shipments[].​is_returnboolean or null

An optional indicator if the shipment is intended to be a return. Defaults to false if not provided.

Default false
shipments[].​confirmationstring(delivery_confirmation)

The type of delivery confirmation that is required for this shipment.

Default "none"
Enum"none""delivery""signature""adult_signature""direct_signature""delivery_mailed""verbal_confirmation""delivery_code""age_verification_16_plus"
shipments[].​customsobject or null(international_shipment_options)

Customs information. This is usually only needed for international shipments.

Default null
shipments[].​advanced_optionsobject(advanced_shipment_options)

Advanced shipment options. These are entirely optional.

shipments[].​insurance_providerstring(insurance_provider)

The insurance provider to use for any insured packages in the shipment.

Default "none"
Enum"none""shipsurance""parcelguard""xcover""carrier""third_party"
shipments[].​order_source_codestring(order_source_name)

The order sources that are supported by ShipEngine

Enum"amazon_ca""amazon_us""brightpearl""channel_advisor""cratejoy""ebay""etsy""jane""groupon_goods""magento"
shipments[].​packagesArray of objects(package)non-emptyrequired

The packages in the shipment.

Note: Some carriers only allow one package per shipment. If you attempt to create a multi-package shipment for a carrier that doesn't allow it, an error will be returned.

shipments[].​packages[].​package_idstring(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$

A string that uniquely identifies this package type

Example: "se-28529731"
shipments[].​packages[].​package_codestring(package_code)[ 1 .. 50 ] characters^[a-z0-9]+(_[a-z0-9]+)*$

A package type, such as thick_envelope, small_flat_rate_box, large_package, etc. Use the code package for custom or unknown package types.

Example: "small_flat_rate_box"
shipments[].​packages[].​package_namestring

The name of the of the package type

shipments[].​packages[].​weightobject(weight)required

The package weight

shipments[].​packages[].​weight.​valuenumber>= 0required

The weight, in the specified unit

shipments[].​packages[].​weight.​unitstring(weight_unit)required

The possible weight unit values

Enum"pound""ounce""gram""kilogram"
shipments[].​packages[].​dimensionsobject(dimensions)

The package dimensions

shipments[].​packages[].​insured_valueobject(monetary_value)

The insured value of the package. Requires the insurance_provider field of the shipment to be set.

Default {"currency":"USD","amount":0}
shipments[].​packages[].​label_messagesobject(label_messages)

Custom messages to print on the shipping label for the package. These are typically used to print invoice numbers, product numbers, or other internal reference numbers. Not all carriers support label messages. The number of lines and the maximum length of each line also varies by carrier.

CarrierMax linesMax line length
USPS (Stamps.com)360
FedEx335 for the first line. 30 for additional lines.
UPS235
OnTrac225
shipments[].​packages[].​external_package_idstringnon-empty

An external package id.

shipments[].​packages[].​content_descriptionstring or null[ 1 .. 35 ] characters

A short description of the package content. Required for shipments moving to, from, and through Mexico.

Example: "Hand knitted wool socks"
shipments[].​packages[].​productsArray of objects(products)>= 0 items

Details about products inside packages (Information provided would be used on custom documentation)

Default []
shipments[].​comparison_rate_typestring or null

Calculate a rate for this shipment with the requested carrier using a ratecard that differs from the default. Only supported for UPS and USPS.

Example: "retail"
label_layoutstringrequired

The NetStamps layout to use.

Enum"netstamps_traditional""netstamps_standard""netstamps_alternate""netstamps_promotional""netstamps_themed""netstamps_photo_landscape""netstamps_photo_portrait""netstamps_photo_landscape_hs""netstamps_return_address""netstamps_roll_type_sd"
Example: "netstamps_traditional"
label_formatstring

The file format for the label.

Default "pdf"
Enum"pdf""png"
Example: "pdf"
display_schemestring(display_scheme)

The display format that the label should be shown in.

Default "label"
Enum"label""paperless""label_and_paperless"
test_labelboolean

Indicate if this label is being used only for testing purposes. If true, then no charge will be added to your account.

Default false
Example: true
label_download_typestring(label_download_type)

There are two different ways to download a label:

Label Download TypeDescription
urlYou will receive a URL, which you can use to download the label in a separate request. The URL will remain valid for 90 days.
inlineYou will receive the Base64-encoded label as part of the response. No need for a second request to download the label.
Default "url"
Enum"url""inline"
is_return_labelboolean

Indicates whether these are return labels.

Default false
Example: true
rma_numberstring or null

An optional Return Merchandise Authorization number for return labels.

Example: "asd12323"
charge_eventstring(label_charge_event)

The label charge event.

Enum"carrier_default""on_creation""on_carrier_acceptance"
outbound_label_idstring(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$

The label_id of the original label that the return label is for.

Example: "se-28529731"
validate_addressstring(validate_address)

The possible validate address values

Default "no_validation"
Enum"no_validation""validate_only""validate_and_clean"
label_image_idstring(image_id)>= 4 characters

The label image resource that was used to create a custom label image.

Example: "img_DtBXupDBxREpHnwEXhTfgK"
ship_to_service_point_idstring or null

A unique identifier for a carrier service point where the shipment will be delivered.

Example: "614940"
ship_from_service_point_idstring or null

A unique identifier for a carrier drop off point where a merchant plans to deliver packages.

Example: "614940"
curl -i -X POST \
  https://docs.shipstation.com/_mock/apis/shipengine/openapi/v1/mailing/netstamps \
  -H 'API-Key: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "shipments": [
      {
        "carrier_id": "se-28529731",
        "service_code": "usps_first_class_mail",
        "external_order_id": "string",
        "items": [],
        "tax_identifiers": [
          {
            "taxable_entity_type": "shipper",
            "identifier_type": "vat",
            "issuing_authority": "string",
            "value": "string"
          }
        ],
        "external_shipment_id": "string",
        "shipment_number": "string",
        "ship_date": "2018-09-23T00:00:00.000Z",
        "ship_to": {
          "name": "John Doe",
          "phone": "+1 204-253-9411 ext. 123",
          "email": "example@example.com",
          "company_name": "The Home Depot",
          "address_line1": "1999 Bishop Grandin Blvd.",
          "address_line2": "Unit 408",
          "address_line3": "Building #7",
          "city_locality": "Winnipeg",
          "state_province": "Manitoba",
          "postal_code": "78756-3717",
          "country_code": "CA",
          "address_residential_indicator": "no",
          "instructions": "string",
          "geolocation": [
            {
              "type": "what3words",
              "value": "cats.with.thumbs"
            }
          ]
        },
        "ship_from": {
          "name": "John Doe",
          "phone": "+1 204-253-9411 ext. 123",
          "email": "example@example.com",
          "company_name": "The Home Depot",
          "address_line1": "1999 Bishop Grandin Blvd.",
          "address_line2": "Unit 408",
          "address_line3": "Building #7",
          "city_locality": "Winnipeg",
          "state_province": "Manitoba",
          "postal_code": "78756-3717",
          "country_code": "CA",
          "address_residential_indicator": "no",
          "instructions": "string"
        },
        "warehouse_id": null,
        "return_to": {
          "name": "John Doe",
          "phone": "+1 204-253-9411 ext. 123",
          "email": "example@example.com",
          "company_name": "The Home Depot",
          "address_line1": "1999 Bishop Grandin Blvd.",
          "address_line2": "Unit 408",
          "address_line3": "Building #7",
          "city_locality": "Winnipeg",
          "state_province": "Manitoba",
          "postal_code": "78756-3717",
          "country_code": "CA",
          "address_residential_indicator": "no",
          "instructions": "string"
        },
        "is_return": false,
        "confirmation": "none",
        "customs": null,
        "advanced_options": {
          "bill_to_account": null,
          "bill_to_country_code": null,
          "bill_to_party": null,
          "bill_to_postal_code": null,
          "contains_alcohol": false,
          "delivered_duty_paid": false,
          "dry_ice": false,
          "dry_ice_weight": {
            "value": 0,
            "unit": "pound"
          },
          "non_machinable": false,
          "saturday_delivery": false,
          "fedex_freight": {
            "shipper_load_and_count": "string",
            "booking_confirmation": "string"
          },
          "use_ups_ground_freight_pricing": null,
          "freight_class": "77.5",
          "custom_field1": null,
          "custom_field2": null,
          "custom_field3": null,
          "origin_type": null,
          "additional_handling": null,
          "shipper_release": null,
          "collect_on_delivery": {
            "payment_type": "any",
            "payment_amount": {
              "currency": "string",
              "amount": 0
            }
          },
          "third_party_consignee": false,
          "dangerous_goods": false,
          "dangerous_goods_contact": {
            "name": "string",
            "phone": "string"
          },
          "windsor_framework_details": {
            "movement_indicator": "c2c",
            "not_at_risk": true
          },
          "license_number": "514785",
          "invoice_number": "IOC56888",
          "certificate_number": "784515",
          "fragile": true,
          "delivery_as_addressed": true,
          "return_after_first_attempt": true,
          "regulated_content_type": null,
          "netstamps_options": {
            "row": 1,
            "column": 1
          }
        },
        "insurance_provider": "none",
        "order_source_code": "amazon_ca",
        "packages": [
          {
            "package_id": "se-28529731",
            "package_code": "small_flat_rate_box",
            "package_name": "string",
            "weight": {
              "value": 0,
              "unit": "pound"
            },
            "dimensions": {
              "unit": "inch",
              "length": 0,
              "width": 0,
              "height": 0
            },
            "insured_value": {
              "currency": "USD",
              "amount": 0
            },
            "label_messages": {
              "reference1": null,
              "reference2": null,
              "reference3": null
            },
            "external_package_id": "string",
            "content_description": "Hand knitted wool socks",
            "products": []
          }
        ],
        "comparison_rate_type": "retail"
      }
    ],
    "label_layout": "netstamps_traditional",
    "label_format": "pdf",
    "display_scheme": "label",
    "test_label": true,
    "label_download_type": "url",
    "is_return_label": true,
    "rma_number": "asd12323",
    "charge_event": "carrier_default",
    "outbound_label_id": "se-28529731",
    "validate_address": "no_validation",
    "label_image_id": "img_DtBXupDBxREpHnwEXhTfgK",
    "ship_to_service_point_id": "614940",
    "ship_from_service_point_id": "614940"
  }'

Responses

The labels were created successfully.

Bodyapplication/json
label_idstring(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$read-only

A string that uniquely identifies the label. This ID is generated by ShipEngine when the label is created.

Example: "se-28529731"
statusstring(label_status)read-only

The possible statuses that a shipping label can be in.

StatusDescription
processingWhen labels are created in a batch, it may take a few minutes for all of the labels in the batch to be created. During this period, they will be in processing status.
completedThe label was successfully created
errorThe label could not be created due to an error, such as an invalid delivery address
voidedThe label has been voided
Enum"processing""completed""error""voided"
shipment_idstring(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$read-only

The shipment that this label is for. ShipEngine can create a shipment for you automatically when you create a label, or you can create your own shipment and then use it to print a label

Example: "se-28529731"
external_shipment_idstring or null<= 50 charactersread-only

A unique user-defined key to identify a shipment. This can be used to retrieve the shipment.

external_order_idstring or nullread-only

ID that the Order Source assigned

ship_datestring(date-time)(date)^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?...read-only

An ISO 8601 string that represents a date, but not a specific time. The value may contain a time component, but it will be set to 00:00:00 UTC by ShipEngine.

Example: "2018-09-23T00:00:00.000Z"
created_atstring(date-time)(date_time)^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(...read-only

An ISO 8601 string that represents a date and time.

Example: "2018-09-23T15:00:00.000Z"
shipment_costobject(monetary_value)read-only

The cost of shipping, delivery confirmation, and other carrier charges. This amount does not include insurance costs.

insurance_costobject(monetary_value)read-only

The insurance cost for this package. Add this to the shipment_cost field to get the total cost.

requested_comparison_amountobject(monetary_value)read-only

The total shipping cost for the specified comparison_rate_type.

rate_detailsArray of objects(rate_detail)read-only

A list of rate details that are associated with shipping cost. This is useful for displaying a breakdown of the rate to the user.

tracking_numberstringnon-emptyread-only

The tracking number for the package. Tracking number formats vary across carriers.

Example: "782758401696"
is_return_labelboolean

Indicates whether this is a return label. You may also want to set the rma_number so you know what is being returned.

rma_numberstring or null

An optional Return Merchandise Authorization number. This field is useful for return labels. You can set it to any string value.

is_internationalbooleanread-only

Indicates whether this is an international shipment. That is, the originating country and destination country are different.

batch_idstring(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$read-only

If this label was created as part of a batch, then this is the unique ID of that batch.

Example: "se-28529731"
carrier_idstring(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$read-only

The unique ID of the carrier account that was used to create this label

Example: "se-28529731"
charge_eventstring(label_charge_event)

The label charge event.

Enum"carrier_default""on_creation""on_carrier_acceptance"
service_codestring(service_code)^[a-z0-9]+(_[a-z0-9-]+)* ?$read-only

A carrier service, such as fedex_ground, usps_first_class_mail, flat_rate_envelope, etc.

Example: "usps_first_class_mail"
package_codestring(package_code)[ 1 .. 50 ] characters^[a-z0-9]+(_[a-z0-9]+)*$read-only

A package type, such as thick_envelope, small_flat_rate_box, large_package, etc. Use the code package for custom or unknown package types.

Example: "small_flat_rate_box"
voidedbooleanread-only

Indicates whether the label has been voided

voided_atstring or null(date-time)(date_time)^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(...read-only

An ISO 8601 string that represents a date and time.

Example: "2018-09-23T15:00:00.000Z"
label_formatstring(label_format)

The possible file formats in which shipping labels can be downloaded. We recommend pdf format because it is supported by all carriers, whereas some carriers do not support the png or zpl formats.

Label FormatSupported Carriers
pdfAll carriers
pngfedex
stamps_com
ups
usps
zplaccess_worldwide
apc
asendia
dhl_global_mail
dhl_express
dhl_express_australia
dhl_express_canada
dhl_express_worldwide
dhl_express_uk
dpd
endicia
fedex
fedex_uk
firstmile
imex
newgistics
ontrac
rr_donnelley
stamps_com
ups
usps
Default "pdf"
Enum"pdf""png""zpl"
display_schemestring(display_scheme)

The display format that the label should be shown in.

Default "label"
Enum"label""paperless""label_and_paperless"
label_layoutstring(label_layout)

The available layouts (sizes) in which shipping labels can be downloaded. The label format determines which sizes are supported. 4x6 is supported for all label formats, whereas letter (8.5" x 11") is only supported for pdf format.

Default "4x6"
Enum"4x6""letter""A4""A6"
trackablebooleanread-only

Indicates whether the shipment is trackable, in which case the tracking_status field will reflect the current status and each package will have a tracking_number.

label_image_idstring or null(image_id)>= 4 characters

The label image resource that was used to create a custom label image.

Example: "img_DtBXupDBxREpHnwEXhTfgK"
carrier_codestring(carrier_code)^[a-z0-9]+(_[a-z0-9]+)*$read-only

A shipping carrier, such as fedex, dhl_express, stamps_com, etc.

Example: "dhl_express"
tracking_statusstring(tracking_status)read-only

The current status of the package, such as in_transit or delivered

Enum"unknown""in_transit""error""delivered"
confirmationstring(delivery_confirmation)read-only

The type of delivery confirmation that is required for this shipment.

Enum"none""delivery""signature""adult_signature""direct_signature""delivery_mailed""verbal_confirmation""delivery_code""age_verification_16_plus"
label_downloadobject(label_download)read-only

Reference to the various downloadable file formats for the generated label

form_downloadobject or null(optional_link)read-only

The link to download the customs form (a.k.a. commercial invoice) for this shipment, if any. Forms are in PDF format. This field is null if the shipment does not require a customs form, or if the carrier does not support it.

qr_code_downloadobject or null(optional_link)read-only

The QR code download for the package

paperless_downloadobject or null(paperless_download)read-only

The paperless details which may contain elements like href, instructions and handoff_code.

insurance_claimobject or null(optional_link)read-only

The link to submit an insurance claim for the shipment. This field is null if the shipment is not insured or if the insurance provider does not support online claim submission.

packagesArray of objects(alternative_identifiers)read-only

The label's package(s).

Note: Some carriers only allow one package per label. If you attempt to create a multi-package label for a carrier that doesn't allow it, an error will be returned.

alternative_identifiersArray of objects or null(alternative_identifier)read-only

Additional information some carriers may provide by which to identify a given label in their system.

tracking_urlstring or nullread-only

The URL to track the package. This URL is provided by the carrier and is unique to the tracking number.

Example: "https://www.fedex.com/fedextrack/?action=track&trackingnumber=1234"
pickup_windowsArray of objects or nullread-only

An array of pickup windows provided by the carrier during label creation. Contains time ranges when the carrier will pick up the package. This is particularly useful when the carrier does not support the Schedule Pickup method but still provides pickup date information during label purchase.

ship_toobject(partial_shipping_address_to)read-only

Any residential or business mailing address, anywhere in the world.

Note: Either name or company_name must be set. Both may be specified, if relevant.

void_typestring or null(void_type)read-only

Indicates how a label was voided. refund_assist means the label was voided through the Refund Assist program, while manual means it was voided manually by the user.

Enum"refund_assist""manual"
Example: "manual"
refund_detailsobject or null(refund_details)read-only

Information about the Refund Assist request for this label. This field is null if the label is not eligible for Refund Assist.

total_costobject(monetary_value)read-only

The combined cost of all labels in this mailing request.

associated_labelsArray of objects(label)read-only

The individual labels created for each shipment in the request.

Response
application/json
{ "label_id": "se-28529731", "status": "processing", "shipment_id": "se-28529731", "external_shipment_id": "string", "external_order_id": "string", "ship_date": "2018-09-23T00:00:00.000Z", "created_at": "2018-09-23T15:00:00.000Z", "shipment_cost": { "currency": "string", "amount": 0 }, "insurance_cost": { "currency": "string", "amount": 0 }, "requested_comparison_amount": { "currency": "string", "amount": 0 }, "rate_details": [ {} ], "tracking_number": "782758401696", "is_return_label": true, "rma_number": "string", "is_international": true, "batch_id": "se-28529731", "carrier_id": "se-28529731", "charge_event": "carrier_default", "service_code": "usps_first_class_mail", "package_code": "small_flat_rate_box", "voided": true, "voided_at": "2018-09-23T15:00:00.000Z", "label_format": "pdf", "display_scheme": "label", "label_layout": "4x6", "trackable": true, "label_image_id": "img_DtBXupDBxREpHnwEXhTfgK", "carrier_code": "dhl_express", "tracking_status": "unknown", "confirmation": "none", "label_download": { "href": "http://api.shipengine.com/v1/labels/se-28529731", "pdf": "http://api.shipengine.com/v1/labels/se-28529731", "png": "http://api.shipengine.com/v1/labels/se-28529731", "zpl": "http://api.shipengine.com/v1/labels/se-28529731" }, "form_download": { "href": "http://api.shipengine.com/v1/labels/se-28529731", "type": "string" }, "qr_code_download": { "href": "http://api.shipengine.com/v1/labels/se-28529731", "type": "string" }, "paperless_download": { "href": "http://api.shipengine.com/v1/labels/se-28529731", "instructions": null, "handoff_code": null }, "insurance_claim": { "href": "http://api.shipengine.com/v1/labels/se-28529731", "type": "string" }, "packages": [ {} ], "alternative_identifiers": [ {} ], "tracking_url": "https://www.fedex.com/fedextrack/?action=track&trackingnumber=1234", "pickup_windows": [ {} ], "ship_to": { "name": "John Doe", "phone": "+1 204-253-9411 ext. 123", "email": "example@example.com", "company_name": "The Home Depot", "address_line1": "1999 Bishop Grandin Blvd.", "address_line2": "Unit 408", "address_line3": "Building #7", "city_locality": "Winnipeg", "state_province": "Manitoba", "postal_code": "78756-3717", "country_code": "CA", "address_residential_indicator": "no", "instructions": "string", "geolocation": [] }, "void_type": "manual", "refund_details": { "refund_status": "request_scheduled", "request_date": "2018-09-23T15:00:00.000Z", "amount_paid": {}, "amount_requested": {}, "amount_approved": {}, "amount_credited": {} }, "total_cost": { "currency": "string", "amount": 0 }, "associated_labels": [ {} ] }

Create mailing labels

Request

Create one or more mailing labels on a sheet layout. Use mailing_options to control which row and column to start printing from.

Security
api_key
Bodyapplication/jsonrequired
shipmentsArray of objects(shipment_request)non-emptyrequired

The shipments to create mail labels for. All shipments must use the same carrier_id.

shipments[].​carrier_idstring(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$required

The carrier account that is billed for the shipping charges

Example: "se-28529731"
shipments[].​service_codestring(service_code)^[a-z0-9]+(_[a-z0-9-]+)* ?$required

A carrier service, such as fedex_ground, usps_first_class_mail, flat_rate_envelope, etc.

Example: "usps_first_class_mail"
shipments[].​external_order_idstring or null

ID that the Order Source assigned

shipments[].​itemsArray of objects(shipment_item)

Describe the packages included in this shipment as related to potential metadata that was imported from external order sources

Default []
shipments[].​tax_identifiersArray of objects or null(tax_identifier)
shipments[].​external_shipment_idstring or null<= 50 characters

A unique user-defined key to identify a shipment. This can be used to retrieve the shipment.

Warning: The external_shipment_id is limited to 50 characters. Any additional characters will be truncated.

shipments[].​shipment_numberstring or null<= 50 characters

A non-unique user-defined number used to identify a shipment. If undefined, this will match the external_shipment_id of the shipment.

Warning: The shipment_number is limited to 50 characters. Any additional characters will be truncated.

shipments[].​ship_datestring(date-time)(date)^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?...

An ISO 8601 string that represents a date, but not a specific time. The value may contain a time component, but it will be set to 00:00:00 UTC by ShipEngine.

Example: "2018-09-23T00:00:00.000Z"
shipments[].​ship_toobject(partial_shipping_address_to)required

Any residential or business mailing address, anywhere in the world.

Note: Either name or company_name must be set. Both may be specified, if relevant.

shipments[].​ship_to.​namestringnon-emptyrequired

The name of a contact person at this address. This field may be set instead of - or in addition to - the company_name field.

Example: "John Doe"
shipments[].​ship_to.​phonestringnon-empty

The phone number of a contact person at this address. The format of this phone number varies depending on the country.

Example: "+1 204-253-9411 ext. 123"
shipments[].​ship_to.​emailstring or null

Email for the address owner.

Example: "example@example.com"
shipments[].​ship_to.​company_namestring or nullnon-empty

If this is a business address, then the company name should be specified here.

Example: "The Home Depot"
shipments[].​ship_to.​address_line1stringnon-emptyrequired

The first line of the street address. For some addresses, this may be the only line. Other addresses may require 2 or 3 lines.

Example: "1999 Bishop Grandin Blvd."
shipments[].​ship_to.​address_line2string or nullnon-empty

The second line of the street address. For some addresses, this line may not be needed.

Example: "Unit 408"
shipments[].​ship_to.​address_line3string or nullnon-empty

The third line of the street address. For some addresses, this line may not be needed.

Example: "Building #7"
shipments[].​ship_to.​city_localitystringnon-emptyrequired

The name of the city or locality

Example: "Winnipeg"
shipments[].​ship_to.​state_provincestringnon-emptyrequired

The state or province. For some countries (including the U.S.) only abbreviations are allowed. Other countries allow the full name or abbreviation.

Example: "Manitoba"
shipments[].​ship_to.​postal_codestring(postal_code)non-emptyrequired

postal code

Example: "78756-3717"
shipments[].​ship_to.​country_codestring(country_code)= 2 characters
Example: "CA"
shipments[].​ship_to.​address_residential_indicatorstring(address_residential_indicator)

Indicates whether this is a residential address.

Default "unknown"
Enum"unknown""yes""no"
Example: "no"
shipments[].​ship_to.​instructionsstring or nullnon-empty

Additional text about how to handle the shipment at this address.

shipments[].​ship_to.​geolocationArray of objects
shipments[].​ship_fromobject(partial_shipping_address)

Any residential or business mailing address, anywhere in the world.

Note: Either name or company_name must be set. Both may be specified, if relevant.

shipments[].​warehouse_idstring or null(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$

The warehouse that the shipment is being shipped from. Either warehouse_id or ship_from must be specified.

Default null
Example: "se-28529731"
shipments[].​return_toobject(partial_shipping_address)

Any residential or business mailing address, anywhere in the world.

Note: Either name or company_name must be set. Both may be specified, if relevant.

shipments[].​is_returnboolean or null

An optional indicator if the shipment is intended to be a return. Defaults to false if not provided.

Default false
shipments[].​confirmationstring(delivery_confirmation)

The type of delivery confirmation that is required for this shipment.

Default "none"
Enum"none""delivery""signature""adult_signature""direct_signature""delivery_mailed""verbal_confirmation""delivery_code""age_verification_16_plus"
shipments[].​customsobject or null(international_shipment_options)

Customs information. This is usually only needed for international shipments.

Default null
shipments[].​advanced_optionsobject(advanced_shipment_options)

Advanced shipment options. These are entirely optional.

shipments[].​insurance_providerstring(insurance_provider)

The insurance provider to use for any insured packages in the shipment.

Default "none"
Enum"none""shipsurance""parcelguard""xcover""carrier""third_party"
shipments[].​order_source_codestring(order_source_name)

The order sources that are supported by ShipEngine

Enum"amazon_ca""amazon_us""brightpearl""channel_advisor""cratejoy""ebay""etsy""jane""groupon_goods""magento"
shipments[].​packagesArray of objects(package)non-emptyrequired

The packages in the shipment.

Note: Some carriers only allow one package per shipment. If you attempt to create a multi-package shipment for a carrier that doesn't allow it, an error will be returned.

shipments[].​packages[].​package_idstring(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$

A string that uniquely identifies this package type

Example: "se-28529731"
shipments[].​packages[].​package_codestring(package_code)[ 1 .. 50 ] characters^[a-z0-9]+(_[a-z0-9]+)*$

A package type, such as thick_envelope, small_flat_rate_box, large_package, etc. Use the code package for custom or unknown package types.

Example: "small_flat_rate_box"
shipments[].​packages[].​package_namestring

The name of the of the package type

shipments[].​packages[].​weightobject(weight)required

The package weight

shipments[].​packages[].​weight.​valuenumber>= 0required

The weight, in the specified unit

shipments[].​packages[].​weight.​unitstring(weight_unit)required

The possible weight unit values

Enum"pound""ounce""gram""kilogram"
shipments[].​packages[].​dimensionsobject(dimensions)

The package dimensions

shipments[].​packages[].​insured_valueobject(monetary_value)

The insured value of the package. Requires the insurance_provider field of the shipment to be set.

Default {"currency":"USD","amount":0}
shipments[].​packages[].​label_messagesobject(label_messages)

Custom messages to print on the shipping label for the package. These are typically used to print invoice numbers, product numbers, or other internal reference numbers. Not all carriers support label messages. The number of lines and the maximum length of each line also varies by carrier.

CarrierMax linesMax line length
USPS (Stamps.com)360
FedEx335 for the first line. 30 for additional lines.
UPS235
OnTrac225
shipments[].​packages[].​external_package_idstringnon-empty

An external package id.

shipments[].​packages[].​content_descriptionstring or null[ 1 .. 35 ] characters

A short description of the package content. Required for shipments moving to, from, and through Mexico.

Example: "Hand knitted wool socks"
shipments[].​packages[].​productsArray of objects(products)>= 0 items

Details about products inside packages (Information provided would be used on custom documentation)

Default []
shipments[].​comparison_rate_typestring or null

Calculate a rate for this shipment with the requested carrier using a ratecard that differs from the default. Only supported for UPS and USPS.

Example: "retail"
mailing_optionsobjectrequired

Layout options for printing mail labels on a single sheet. Controls the starting position on the label sheet.

mailing_options.​start_rowinteger(int32)>= 0

The row on the sheet where label placement begins.

Default 0
Example: 0
mailing_options.​start_columninteger(int32)>= 0

The column on the sheet where label placement begins.

Default 0
Example: 0
label_layoutstringrequired

The mail label layout to use.

Enum"mail_label_sdc3110""mail_label_avery5160""mail_label_avery5163"
Example: "mail_label_sdc3110"
label_formatstring

The file format for the label.

Default "pdf"
Enum"pdf""png"
Example: "pdf"
display_schemestring(display_scheme)

The display format that the label should be shown in.

Default "label"
Enum"label""paperless""label_and_paperless"
test_labelboolean

Indicate if this label is being used only for testing purposes. If true, then no charge will be added to your account.

Default false
Example: true
label_download_typestring(label_download_type)

There are two different ways to download a label:

Label Download TypeDescription
urlYou will receive a URL, which you can use to download the label in a separate request. The URL will remain valid for 90 days.
inlineYou will receive the Base64-encoded label as part of the response. No need for a second request to download the label.
Default "url"
Enum"url""inline"
is_return_labelboolean

Indicates whether these are return labels.

Default false
Example: true
rma_numberstring or null

An optional Return Merchandise Authorization number for return labels.

Example: "asd12323"
charge_eventstring(label_charge_event)

The label charge event.

Enum"carrier_default""on_creation""on_carrier_acceptance"
outbound_label_idstring(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$

The label_id of the original label that the return label is for.

Example: "se-28529731"
validate_addressstring(validate_address)

The possible validate address values

Default "no_validation"
Enum"no_validation""validate_only""validate_and_clean"
label_image_idstring(image_id)>= 4 characters

The label image resource that was used to create a custom label image.

Example: "img_DtBXupDBxREpHnwEXhTfgK"
ship_to_service_point_idstring or null

A unique identifier for a carrier service point where the shipment will be delivered.

Example: "614940"
ship_from_service_point_idstring or null

A unique identifier for a carrier drop off point where a merchant plans to deliver packages.

Example: "614940"
curl -i -X POST \
  https://docs.shipstation.com/_mock/apis/shipengine/openapi/v1/mailing/mail_labels \
  -H 'API-Key: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "shipments": [
      {
        "carrier_id": "se-28529731",
        "service_code": "usps_first_class_mail",
        "external_order_id": "string",
        "items": [],
        "tax_identifiers": [
          {
            "taxable_entity_type": "shipper",
            "identifier_type": "vat",
            "issuing_authority": "string",
            "value": "string"
          }
        ],
        "external_shipment_id": "string",
        "shipment_number": "string",
        "ship_date": "2018-09-23T00:00:00.000Z",
        "ship_to": {
          "name": "John Doe",
          "phone": "+1 204-253-9411 ext. 123",
          "email": "example@example.com",
          "company_name": "The Home Depot",
          "address_line1": "1999 Bishop Grandin Blvd.",
          "address_line2": "Unit 408",
          "address_line3": "Building #7",
          "city_locality": "Winnipeg",
          "state_province": "Manitoba",
          "postal_code": "78756-3717",
          "country_code": "CA",
          "address_residential_indicator": "no",
          "instructions": "string",
          "geolocation": [
            {
              "type": "what3words",
              "value": "cats.with.thumbs"
            }
          ]
        },
        "ship_from": {
          "name": "John Doe",
          "phone": "+1 204-253-9411 ext. 123",
          "email": "example@example.com",
          "company_name": "The Home Depot",
          "address_line1": "1999 Bishop Grandin Blvd.",
          "address_line2": "Unit 408",
          "address_line3": "Building #7",
          "city_locality": "Winnipeg",
          "state_province": "Manitoba",
          "postal_code": "78756-3717",
          "country_code": "CA",
          "address_residential_indicator": "no",
          "instructions": "string"
        },
        "warehouse_id": null,
        "return_to": {
          "name": "John Doe",
          "phone": "+1 204-253-9411 ext. 123",
          "email": "example@example.com",
          "company_name": "The Home Depot",
          "address_line1": "1999 Bishop Grandin Blvd.",
          "address_line2": "Unit 408",
          "address_line3": "Building #7",
          "city_locality": "Winnipeg",
          "state_province": "Manitoba",
          "postal_code": "78756-3717",
          "country_code": "CA",
          "address_residential_indicator": "no",
          "instructions": "string"
        },
        "is_return": false,
        "confirmation": "none",
        "customs": null,
        "advanced_options": {
          "bill_to_account": null,
          "bill_to_country_code": null,
          "bill_to_party": null,
          "bill_to_postal_code": null,
          "contains_alcohol": false,
          "delivered_duty_paid": false,
          "dry_ice": false,
          "dry_ice_weight": {
            "value": 0,
            "unit": "pound"
          },
          "non_machinable": false,
          "saturday_delivery": false,
          "fedex_freight": {
            "shipper_load_and_count": "string",
            "booking_confirmation": "string"
          },
          "use_ups_ground_freight_pricing": null,
          "freight_class": "77.5",
          "custom_field1": null,
          "custom_field2": null,
          "custom_field3": null,
          "origin_type": null,
          "additional_handling": null,
          "shipper_release": null,
          "collect_on_delivery": {
            "payment_type": "any",
            "payment_amount": {
              "currency": "string",
              "amount": 0
            }
          },
          "third_party_consignee": false,
          "dangerous_goods": false,
          "dangerous_goods_contact": {
            "name": "string",
            "phone": "string"
          },
          "windsor_framework_details": {
            "movement_indicator": "c2c",
            "not_at_risk": true
          },
          "license_number": "514785",
          "invoice_number": "IOC56888",
          "certificate_number": "784515",
          "fragile": true,
          "delivery_as_addressed": true,
          "return_after_first_attempt": true,
          "regulated_content_type": null,
          "netstamps_options": {
            "row": 1,
            "column": 1
          }
        },
        "insurance_provider": "none",
        "order_source_code": "amazon_ca",
        "packages": [
          {
            "package_id": "se-28529731",
            "package_code": "small_flat_rate_box",
            "package_name": "string",
            "weight": {
              "value": 0,
              "unit": "pound"
            },
            "dimensions": {
              "unit": "inch",
              "length": 0,
              "width": 0,
              "height": 0
            },
            "insured_value": {
              "currency": "USD",
              "amount": 0
            },
            "label_messages": {
              "reference1": null,
              "reference2": null,
              "reference3": null
            },
            "external_package_id": "string",
            "content_description": "Hand knitted wool socks",
            "products": []
          }
        ],
        "comparison_rate_type": "retail"
      }
    ],
    "mailing_options": {
      "start_row": 0,
      "start_column": 0
    },
    "label_layout": "mail_label_sdc3110",
    "label_format": "pdf",
    "display_scheme": "label",
    "test_label": true,
    "label_download_type": "url",
    "is_return_label": true,
    "rma_number": "asd12323",
    "charge_event": "carrier_default",
    "outbound_label_id": "se-28529731",
    "validate_address": "no_validation",
    "label_image_id": "img_DtBXupDBxREpHnwEXhTfgK",
    "ship_to_service_point_id": "614940",
    "ship_from_service_point_id": "614940"
  }'

Responses

The labels were created successfully.

Bodyapplication/json
label_idstring(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$read-only

A string that uniquely identifies the label. This ID is generated by ShipEngine when the label is created.

Example: "se-28529731"
statusstring(label_status)read-only

The possible statuses that a shipping label can be in.

StatusDescription
processingWhen labels are created in a batch, it may take a few minutes for all of the labels in the batch to be created. During this period, they will be in processing status.
completedThe label was successfully created
errorThe label could not be created due to an error, such as an invalid delivery address
voidedThe label has been voided
Enum"processing""completed""error""voided"
shipment_idstring(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$read-only

The shipment that this label is for. ShipEngine can create a shipment for you automatically when you create a label, or you can create your own shipment and then use it to print a label

Example: "se-28529731"
external_shipment_idstring or null<= 50 charactersread-only

A unique user-defined key to identify a shipment. This can be used to retrieve the shipment.

external_order_idstring or nullread-only

ID that the Order Source assigned

ship_datestring(date-time)(date)^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?...read-only

An ISO 8601 string that represents a date, but not a specific time. The value may contain a time component, but it will be set to 00:00:00 UTC by ShipEngine.

Example: "2018-09-23T00:00:00.000Z"
created_atstring(date-time)(date_time)^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(...read-only

An ISO 8601 string that represents a date and time.

Example: "2018-09-23T15:00:00.000Z"
shipment_costobject(monetary_value)read-only

The cost of shipping, delivery confirmation, and other carrier charges. This amount does not include insurance costs.

insurance_costobject(monetary_value)read-only

The insurance cost for this package. Add this to the shipment_cost field to get the total cost.

requested_comparison_amountobject(monetary_value)read-only

The total shipping cost for the specified comparison_rate_type.

rate_detailsArray of objects(rate_detail)read-only

A list of rate details that are associated with shipping cost. This is useful for displaying a breakdown of the rate to the user.

tracking_numberstringnon-emptyread-only

The tracking number for the package. Tracking number formats vary across carriers.

Example: "782758401696"
is_return_labelboolean

Indicates whether this is a return label. You may also want to set the rma_number so you know what is being returned.

rma_numberstring or null

An optional Return Merchandise Authorization number. This field is useful for return labels. You can set it to any string value.

is_internationalbooleanread-only

Indicates whether this is an international shipment. That is, the originating country and destination country are different.

batch_idstring(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$read-only

If this label was created as part of a batch, then this is the unique ID of that batch.

Example: "se-28529731"
carrier_idstring(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$read-only

The unique ID of the carrier account that was used to create this label

Example: "se-28529731"
charge_eventstring(label_charge_event)

The label charge event.

Enum"carrier_default""on_creation""on_carrier_acceptance"
service_codestring(service_code)^[a-z0-9]+(_[a-z0-9-]+)* ?$read-only

A carrier service, such as fedex_ground, usps_first_class_mail, flat_rate_envelope, etc.

Example: "usps_first_class_mail"
package_codestring(package_code)[ 1 .. 50 ] characters^[a-z0-9]+(_[a-z0-9]+)*$read-only

A package type, such as thick_envelope, small_flat_rate_box, large_package, etc. Use the code package for custom or unknown package types.

Example: "small_flat_rate_box"
voidedbooleanread-only

Indicates whether the label has been voided

voided_atstring or null(date-time)(date_time)^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(...read-only

An ISO 8601 string that represents a date and time.

Example: "2018-09-23T15:00:00.000Z"
label_formatstring(label_format)

The possible file formats in which shipping labels can be downloaded. We recommend pdf format because it is supported by all carriers, whereas some carriers do not support the png or zpl formats.

Label FormatSupported Carriers
pdfAll carriers
pngfedex
stamps_com
ups
usps
zplaccess_worldwide
apc
asendia
dhl_global_mail
dhl_express
dhl_express_australia
dhl_express_canada
dhl_express_worldwide
dhl_express_uk
dpd
endicia
fedex
fedex_uk
firstmile
imex
newgistics
ontrac
rr_donnelley
stamps_com
ups
usps
Default "pdf"
Enum"pdf""png""zpl"
display_schemestring(display_scheme)

The display format that the label should be shown in.

Default "label"
Enum"label""paperless""label_and_paperless"
label_layoutstring(label_layout)

The available layouts (sizes) in which shipping labels can be downloaded. The label format determines which sizes are supported. 4x6 is supported for all label formats, whereas letter (8.5" x 11") is only supported for pdf format.

Default "4x6"
Enum"4x6""letter""A4""A6"
trackablebooleanread-only

Indicates whether the shipment is trackable, in which case the tracking_status field will reflect the current status and each package will have a tracking_number.

label_image_idstring or null(image_id)>= 4 characters

The label image resource that was used to create a custom label image.

Example: "img_DtBXupDBxREpHnwEXhTfgK"
carrier_codestring(carrier_code)^[a-z0-9]+(_[a-z0-9]+)*$read-only

A shipping carrier, such as fedex, dhl_express, stamps_com, etc.

Example: "dhl_express"
tracking_statusstring(tracking_status)read-only

The current status of the package, such as in_transit or delivered

Enum"unknown""in_transit""error""delivered"
confirmationstring(delivery_confirmation)read-only

The type of delivery confirmation that is required for this shipment.

Enum"none""delivery""signature""adult_signature""direct_signature""delivery_mailed""verbal_confirmation""delivery_code""age_verification_16_plus"
label_downloadobject(label_download)read-only

Reference to the various downloadable file formats for the generated label

form_downloadobject or null(optional_link)read-only

The link to download the customs form (a.k.a. commercial invoice) for this shipment, if any. Forms are in PDF format. This field is null if the shipment does not require a customs form, or if the carrier does not support it.

qr_code_downloadobject or null(optional_link)read-only

The QR code download for the package

paperless_downloadobject or null(paperless_download)read-only

The paperless details which may contain elements like href, instructions and handoff_code.

insurance_claimobject or null(optional_link)read-only

The link to submit an insurance claim for the shipment. This field is null if the shipment is not insured or if the insurance provider does not support online claim submission.

packagesArray of objects(alternative_identifiers)read-only

The label's package(s).

Note: Some carriers only allow one package per label. If you attempt to create a multi-package label for a carrier that doesn't allow it, an error will be returned.

alternative_identifiersArray of objects or null(alternative_identifier)read-only

Additional information some carriers may provide by which to identify a given label in their system.

tracking_urlstring or nullread-only

The URL to track the package. This URL is provided by the carrier and is unique to the tracking number.

Example: "https://www.fedex.com/fedextrack/?action=track&trackingnumber=1234"
pickup_windowsArray of objects or nullread-only

An array of pickup windows provided by the carrier during label creation. Contains time ranges when the carrier will pick up the package. This is particularly useful when the carrier does not support the Schedule Pickup method but still provides pickup date information during label purchase.

ship_toobject(partial_shipping_address_to)read-only

Any residential or business mailing address, anywhere in the world.

Note: Either name or company_name must be set. Both may be specified, if relevant.

void_typestring or null(void_type)read-only

Indicates how a label was voided. refund_assist means the label was voided through the Refund Assist program, while manual means it was voided manually by the user.

Enum"refund_assist""manual"
Example: "manual"
refund_detailsobject or null(refund_details)read-only

Information about the Refund Assist request for this label. This field is null if the label is not eligible for Refund Assist.

total_costobject(monetary_value)read-only

The combined cost of all labels in this mailing request.

associated_labelsArray of objects(label)read-only

The individual labels created for each shipment in the request.

Response
application/json
{ "label_id": "se-28529731", "status": "processing", "shipment_id": "se-28529731", "external_shipment_id": "string", "external_order_id": "string", "ship_date": "2018-09-23T00:00:00.000Z", "created_at": "2018-09-23T15:00:00.000Z", "shipment_cost": { "currency": "string", "amount": 0 }, "insurance_cost": { "currency": "string", "amount": 0 }, "requested_comparison_amount": { "currency": "string", "amount": 0 }, "rate_details": [ {} ], "tracking_number": "782758401696", "is_return_label": true, "rma_number": "string", "is_international": true, "batch_id": "se-28529731", "carrier_id": "se-28529731", "charge_event": "carrier_default", "service_code": "usps_first_class_mail", "package_code": "small_flat_rate_box", "voided": true, "voided_at": "2018-09-23T15:00:00.000Z", "label_format": "pdf", "display_scheme": "label", "label_layout": "4x6", "trackable": true, "label_image_id": "img_DtBXupDBxREpHnwEXhTfgK", "carrier_code": "dhl_express", "tracking_status": "unknown", "confirmation": "none", "label_download": { "href": "http://api.shipengine.com/v1/labels/se-28529731", "pdf": "http://api.shipengine.com/v1/labels/se-28529731", "png": "http://api.shipengine.com/v1/labels/se-28529731", "zpl": "http://api.shipengine.com/v1/labels/se-28529731" }, "form_download": { "href": "http://api.shipengine.com/v1/labels/se-28529731", "type": "string" }, "qr_code_download": { "href": "http://api.shipengine.com/v1/labels/se-28529731", "type": "string" }, "paperless_download": { "href": "http://api.shipengine.com/v1/labels/se-28529731", "instructions": null, "handoff_code": null }, "insurance_claim": { "href": "http://api.shipengine.com/v1/labels/se-28529731", "type": "string" }, "packages": [ {} ], "alternative_identifiers": [ {} ], "tracking_url": "https://www.fedex.com/fedextrack/?action=track&trackingnumber=1234", "pickup_windows": [ {} ], "ship_to": { "name": "John Doe", "phone": "+1 204-253-9411 ext. 123", "email": "example@example.com", "company_name": "The Home Depot", "address_line1": "1999 Bishop Grandin Blvd.", "address_line2": "Unit 408", "address_line3": "Building #7", "city_locality": "Winnipeg", "state_province": "Manitoba", "postal_code": "78756-3717", "country_code": "CA", "address_residential_indicator": "no", "instructions": "string", "geolocation": [] }, "void_type": "manual", "refund_details": { "refund_status": "request_scheduled", "request_date": "2018-09-23T15:00:00.000Z", "amount_paid": {}, "amount_requested": {}, "amount_approved": {}, "amount_credited": {} }, "total_cost": { "currency": "string", "amount": 0 }, "associated_labels": [ {} ] }

Create envelope

Request

Create a single envelope shipment.

Security
api_key
Bodyapplication/jsonrequired
shipmentobject(shipment_request)required

The information necessary to ship a package, such as the origin, the destination, the carrier service, and the package dimensions and weight.

Note: Either ship_from or warehouse_id must be set.

shipment.​carrier_idstring(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$required

The carrier account that is billed for the shipping charges

Example: "se-28529731"
shipment.​service_codestring(service_code)^[a-z0-9]+(_[a-z0-9-]+)* ?$required

A carrier service, such as fedex_ground, usps_first_class_mail, flat_rate_envelope, etc.

Example: "usps_first_class_mail"
shipment.​external_order_idstring or null

ID that the Order Source assigned

shipment.​itemsArray of objects(shipment_item)

Describe the packages included in this shipment as related to potential metadata that was imported from external order sources

Default []
shipment.​tax_identifiersArray of objects or null(tax_identifier)
shipment.​external_shipment_idstring or null<= 50 characters

A unique user-defined key to identify a shipment. This can be used to retrieve the shipment.

Warning: The external_shipment_id is limited to 50 characters. Any additional characters will be truncated.

shipment.​shipment_numberstring or null<= 50 characters

A non-unique user-defined number used to identify a shipment. If undefined, this will match the external_shipment_id of the shipment.

Warning: The shipment_number is limited to 50 characters. Any additional characters will be truncated.

shipment.​ship_datestring(date-time)(date)^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?...

An ISO 8601 string that represents a date, but not a specific time. The value may contain a time component, but it will be set to 00:00:00 UTC by ShipEngine.

Example: "2018-09-23T00:00:00.000Z"
shipment.​ship_toobject(partial_shipping_address_to)required

Any residential or business mailing address, anywhere in the world.

Note: Either name or company_name must be set. Both may be specified, if relevant.

shipment.​ship_to.​namestringnon-emptyrequired

The name of a contact person at this address. This field may be set instead of - or in addition to - the company_name field.

Example: "John Doe"
shipment.​ship_to.​phonestringnon-empty

The phone number of a contact person at this address. The format of this phone number varies depending on the country.

Example: "+1 204-253-9411 ext. 123"
shipment.​ship_to.​emailstring or null

Email for the address owner.

Example: "example@example.com"
shipment.​ship_to.​company_namestring or nullnon-empty

If this is a business address, then the company name should be specified here.

Example: "The Home Depot"
shipment.​ship_to.​address_line1stringnon-emptyrequired

The first line of the street address. For some addresses, this may be the only line. Other addresses may require 2 or 3 lines.

Example: "1999 Bishop Grandin Blvd."
shipment.​ship_to.​address_line2string or nullnon-empty

The second line of the street address. For some addresses, this line may not be needed.

Example: "Unit 408"
shipment.​ship_to.​address_line3string or nullnon-empty

The third line of the street address. For some addresses, this line may not be needed.

Example: "Building #7"
shipment.​ship_to.​city_localitystringnon-emptyrequired

The name of the city or locality

Example: "Winnipeg"
shipment.​ship_to.​state_provincestringnon-emptyrequired

The state or province. For some countries (including the U.S.) only abbreviations are allowed. Other countries allow the full name or abbreviation.

Example: "Manitoba"
shipment.​ship_to.​postal_codestring(postal_code)non-emptyrequired

postal code

Example: "78756-3717"
shipment.​ship_to.​country_codestring(country_code)= 2 characters
Example: "CA"
shipment.​ship_to.​address_residential_indicatorstring(address_residential_indicator)

Indicates whether this is a residential address.

Default "unknown"
Enum"unknown""yes""no"
Example: "no"
shipment.​ship_to.​instructionsstring or nullnon-empty

Additional text about how to handle the shipment at this address.

shipment.​ship_to.​geolocationArray of objects
shipment.​ship_fromobject(partial_shipping_address)

Any residential or business mailing address, anywhere in the world.

Note: Either name or company_name must be set. Both may be specified, if relevant.

shipment.​warehouse_idstring or null(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$

The warehouse that the shipment is being shipped from. Either warehouse_id or ship_from must be specified.

Default null
Example: "se-28529731"
shipment.​return_toobject(partial_shipping_address)

Any residential or business mailing address, anywhere in the world.

Note: Either name or company_name must be set. Both may be specified, if relevant.

shipment.​is_returnboolean or null

An optional indicator if the shipment is intended to be a return. Defaults to false if not provided.

Default false
shipment.​confirmationstring(delivery_confirmation)

The type of delivery confirmation that is required for this shipment.

Default "none"
Enum"none""delivery""signature""adult_signature""direct_signature""delivery_mailed""verbal_confirmation""delivery_code""age_verification_16_plus"
shipment.​customsobject or null(international_shipment_options)

Customs information. This is usually only needed for international shipments.

Default null
shipment.​advanced_optionsobject(advanced_shipment_options)

Advanced shipment options. These are entirely optional.

shipment.​insurance_providerstring(insurance_provider)

The insurance provider to use for any insured packages in the shipment.

Default "none"
Enum"none""shipsurance""parcelguard""xcover""carrier""third_party"
shipment.​order_source_codestring(order_source_name)

The order sources that are supported by ShipEngine

Enum"amazon_ca""amazon_us""brightpearl""channel_advisor""cratejoy""ebay""etsy""jane""groupon_goods""magento"
shipment.​packagesArray of objects(package)non-emptyrequired

The packages in the shipment.

Note: Some carriers only allow one package per shipment. If you attempt to create a multi-package shipment for a carrier that doesn't allow it, an error will be returned.

shipment.​packages[].​package_idstring(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$

A string that uniquely identifies this package type

Example: "se-28529731"
shipment.​packages[].​package_codestring(package_code)[ 1 .. 50 ] characters^[a-z0-9]+(_[a-z0-9]+)*$

A package type, such as thick_envelope, small_flat_rate_box, large_package, etc. Use the code package for custom or unknown package types.

Example: "small_flat_rate_box"
shipment.​packages[].​package_namestring

The name of the of the package type

shipment.​packages[].​weightobject(weight)required

The package weight

shipment.​packages[].​weight.​valuenumber>= 0required

The weight, in the specified unit

shipment.​packages[].​weight.​unitstring(weight_unit)required

The possible weight unit values

Enum"pound""ounce""gram""kilogram"
shipment.​packages[].​dimensionsobject(dimensions)

The package dimensions

shipment.​packages[].​insured_valueobject(monetary_value)

The insured value of the package. Requires the insurance_provider field of the shipment to be set.

Default {"currency":"USD","amount":0}
shipment.​packages[].​label_messagesobject(label_messages)

Custom messages to print on the shipping label for the package. These are typically used to print invoice numbers, product numbers, or other internal reference numbers. Not all carriers support label messages. The number of lines and the maximum length of each line also varies by carrier.

CarrierMax linesMax line length
USPS (Stamps.com)360
FedEx335 for the first line. 30 for additional lines.
UPS235
OnTrac225
shipment.​packages[].​external_package_idstringnon-empty

An external package id.

shipment.​packages[].​content_descriptionstring or null[ 1 .. 35 ] characters

A short description of the package content. Required for shipments moving to, from, and through Mexico.

Example: "Hand knitted wool socks"
shipment.​packages[].​productsArray of objects(products)>= 0 items

Details about products inside packages (Information provided would be used on custom documentation)

Default []
shipment.​comparison_rate_typestring or null

Calculate a rate for this shipment with the requested carrier using a ratecard that differs from the default. Only supported for UPS and USPS.

Example: "retail"
label_layoutstringrequired

The envelope layout to use.

Enum"envelope_9""envelope_10""envelope_11""envelope_12""envelope_personal""envelope_monarch""envelope_greeting""envelope_invitation""envelope_traditional_single""envelope_standard_single"
Example: "envelope_9"
label_formatstring

The file format for the label.

Default "pdf"
Enum"pdf""png""zpl"
Example: "pdf"
display_schemestring(display_scheme)

The display format that the label should be shown in.

Default "label"
Enum"label""paperless""label_and_paperless"
test_labelboolean

Indicate if this label is being used only for testing purposes. If true, then no charge will be added to your account.

Default false
Example: true
label_download_typestring(label_download_type)

There are two different ways to download a label:

Label Download TypeDescription
urlYou will receive a URL, which you can use to download the label in a separate request. The URL will remain valid for 90 days.
inlineYou will receive the Base64-encoded label as part of the response. No need for a second request to download the label.
Default "url"
Enum"url""inline"
is_return_labelboolean

Indicates whether this is a return label.

Default false
Example: true
rma_numberstring or null

An optional Return Merchandise Authorization number for return labels.

Example: "asd12323"
charge_eventstring(label_charge_event)

The label charge event.

Enum"carrier_default""on_creation""on_carrier_acceptance"
outbound_label_idstring(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$

The label_id of the original label that the return label is for.

Example: "se-28529731"
validate_addressstring(validate_address)

The possible validate address values

Default "no_validation"
Enum"no_validation""validate_only""validate_and_clean"
label_image_idstring(image_id)>= 4 characters

The label image resource that was used to create a custom label image.

Example: "img_DtBXupDBxREpHnwEXhTfgK"
ship_to_service_point_idstring or null

A unique identifier for a carrier service point where the shipment will be delivered.

Example: "614940"
ship_from_service_point_idstring or null

A unique identifier for a carrier drop off point where a merchant plans to deliver packages.

Example: "614940"
curl -i -X POST \
  https://docs.shipstation.com/_mock/apis/shipengine/openapi/v1/mailing/envelopes \
  -H 'API-Key: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "shipment": {
      "carrier_id": "se-28529731",
      "service_code": "usps_first_class_mail",
      "external_order_id": "string",
      "items": [],
      "tax_identifiers": [
        {
          "taxable_entity_type": "shipper",
          "identifier_type": "vat",
          "issuing_authority": "string",
          "value": "string"
        }
      ],
      "external_shipment_id": "string",
      "shipment_number": "string",
      "ship_date": "2018-09-23T00:00:00.000Z",
      "ship_to": {
        "name": "John Doe",
        "phone": "+1 204-253-9411 ext. 123",
        "email": "example@example.com",
        "company_name": "The Home Depot",
        "address_line1": "1999 Bishop Grandin Blvd.",
        "address_line2": "Unit 408",
        "address_line3": "Building #7",
        "city_locality": "Winnipeg",
        "state_province": "Manitoba",
        "postal_code": "78756-3717",
        "country_code": "CA",
        "address_residential_indicator": "no",
        "instructions": "string",
        "geolocation": [
          {
            "type": "what3words",
            "value": "cats.with.thumbs"
          }
        ]
      },
      "ship_from": {
        "name": "John Doe",
        "phone": "+1 204-253-9411 ext. 123",
        "email": "example@example.com",
        "company_name": "The Home Depot",
        "address_line1": "1999 Bishop Grandin Blvd.",
        "address_line2": "Unit 408",
        "address_line3": "Building #7",
        "city_locality": "Winnipeg",
        "state_province": "Manitoba",
        "postal_code": "78756-3717",
        "country_code": "CA",
        "address_residential_indicator": "no",
        "instructions": "string"
      },
      "warehouse_id": null,
      "return_to": {
        "name": "John Doe",
        "phone": "+1 204-253-9411 ext. 123",
        "email": "example@example.com",
        "company_name": "The Home Depot",
        "address_line1": "1999 Bishop Grandin Blvd.",
        "address_line2": "Unit 408",
        "address_line3": "Building #7",
        "city_locality": "Winnipeg",
        "state_province": "Manitoba",
        "postal_code": "78756-3717",
        "country_code": "CA",
        "address_residential_indicator": "no",
        "instructions": "string"
      },
      "is_return": false,
      "confirmation": "none",
      "customs": null,
      "advanced_options": {
        "bill_to_account": null,
        "bill_to_country_code": null,
        "bill_to_party": null,
        "bill_to_postal_code": null,
        "contains_alcohol": false,
        "delivered_duty_paid": false,
        "dry_ice": false,
        "dry_ice_weight": {
          "value": 0,
          "unit": "pound"
        },
        "non_machinable": false,
        "saturday_delivery": false,
        "fedex_freight": {
          "shipper_load_and_count": "string",
          "booking_confirmation": "string"
        },
        "use_ups_ground_freight_pricing": null,
        "freight_class": "77.5",
        "custom_field1": null,
        "custom_field2": null,
        "custom_field3": null,
        "origin_type": null,
        "additional_handling": null,
        "shipper_release": null,
        "collect_on_delivery": {
          "payment_type": "any",
          "payment_amount": {
            "currency": "string",
            "amount": 0
          }
        },
        "third_party_consignee": false,
        "dangerous_goods": false,
        "dangerous_goods_contact": {
          "name": "string",
          "phone": "string"
        },
        "windsor_framework_details": {
          "movement_indicator": "c2c",
          "not_at_risk": true
        },
        "license_number": "514785",
        "invoice_number": "IOC56888",
        "certificate_number": "784515",
        "fragile": true,
        "delivery_as_addressed": true,
        "return_after_first_attempt": true,
        "regulated_content_type": null,
        "netstamps_options": {
          "row": 1,
          "column": 1
        }
      },
      "insurance_provider": "none",
      "order_source_code": "amazon_ca",
      "packages": [
        {
          "package_id": "se-28529731",
          "package_code": "small_flat_rate_box",
          "package_name": "string",
          "weight": {
            "value": 0,
            "unit": "pound"
          },
          "dimensions": {
            "unit": "inch",
            "length": 0,
            "width": 0,
            "height": 0
          },
          "insured_value": {
            "currency": "USD",
            "amount": 0
          },
          "label_messages": {
            "reference1": null,
            "reference2": null,
            "reference3": null
          },
          "external_package_id": "string",
          "content_description": "Hand knitted wool socks",
          "products": []
        }
      ],
      "comparison_rate_type": "retail"
    },
    "label_layout": "envelope_9",
    "label_format": "pdf",
    "display_scheme": "label",
    "test_label": true,
    "label_download_type": "url",
    "is_return_label": true,
    "rma_number": "asd12323",
    "charge_event": "carrier_default",
    "outbound_label_id": "se-28529731",
    "validate_address": "no_validation",
    "label_image_id": "img_DtBXupDBxREpHnwEXhTfgK",
    "ship_to_service_point_id": "614940",
    "ship_from_service_point_id": "614940"
  }'

Responses

The label was created successfully.

Bodyapplication/json
label_idstring(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$read-onlyrequired

A string that uniquely identifies the label. This ID is generated by ShipEngine when the label is created.

Example: "se-28529731"
statusstring(label_status)read-onlyrequired

The possible statuses that a shipping label can be in.

StatusDescription
processingWhen labels are created in a batch, it may take a few minutes for all of the labels in the batch to be created. During this period, they will be in processing status.
completedThe label was successfully created
errorThe label could not be created due to an error, such as an invalid delivery address
voidedThe label has been voided
Enum"processing""completed""error""voided"
shipment_idstring(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$read-onlyrequired

The shipment that this label is for. ShipEngine can create a shipment for you automatically when you create a label, or you can create your own shipment and then use it to print a label

Example: "se-28529731"
external_shipment_idstring or null<= 50 charactersread-onlyrequired

A unique user-defined key to identify a shipment. This can be used to retrieve the shipment.

external_order_idstring or nullread-onlyrequired

ID that the Order Source assigned

ship_datestring(date-time)(date)^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?...read-onlyrequired

An ISO 8601 string that represents a date, but not a specific time. The value may contain a time component, but it will be set to 00:00:00 UTC by ShipEngine.

Example: "2018-09-23T00:00:00.000Z"
created_atstring(date-time)(date_time)^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(...read-onlyrequired

An ISO 8601 string that represents a date and time.

Example: "2018-09-23T15:00:00.000Z"
shipment_costobject(monetary_value)read-onlyrequired

The cost of shipping, delivery confirmation, and other carrier charges. This amount does not include insurance costs.

shipment_cost.​currencystring(currency)required

The currencies that are supported by ShipEngine are the ones that specified by ISO 4217: https://www.iso.org/iso-4217-currency-codes.html

shipment_cost.​amountnumber>= 0required

The monetary amount, in the specified currency.

insurance_costobject(monetary_value)read-onlyrequired

The insurance cost for this package. Add this to the shipment_cost field to get the total cost.

insurance_cost.​currencystring(currency)required

The currencies that are supported by ShipEngine are the ones that specified by ISO 4217: https://www.iso.org/iso-4217-currency-codes.html

insurance_cost.​amountnumber>= 0required

The monetary amount, in the specified currency.

requested_comparison_amountobject(monetary_value)read-only

The total shipping cost for the specified comparison_rate_type.

rate_detailsArray of objects(rate_detail)read-only

A list of rate details that are associated with shipping cost. This is useful for displaying a breakdown of the rate to the user.

tracking_numberstringnon-emptyread-onlyrequired

The tracking number for the package. Tracking number formats vary across carriers.

Example: "782758401696"
is_return_labelbooleanrequired

Indicates whether this is a return label. You may also want to set the rma_number so you know what is being returned.

rma_numberstring or nullrequired

An optional Return Merchandise Authorization number. This field is useful for return labels. You can set it to any string value.

is_internationalbooleanread-onlyrequired

Indicates whether this is an international shipment. That is, the originating country and destination country are different.

batch_idstring(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$read-onlyrequired

If this label was created as part of a batch, then this is the unique ID of that batch.

Example: "se-28529731"
carrier_idstring(se_id)[ 1 .. 25 ] characters^se(-[a-z0-9]+)+$read-onlyrequired

The unique ID of the carrier account that was used to create this label

Example: "se-28529731"
charge_eventstring(label_charge_event)required

The label charge event.

Enum"carrier_default""on_creation""on_carrier_acceptance"
service_codestring(service_code)^[a-z0-9]+(_[a-z0-9-]+)* ?$read-onlyrequired

A carrier service, such as fedex_ground, usps_first_class_mail, flat_rate_envelope, etc.

Example: "usps_first_class_mail"
package_codestring(package_code)[ 1 .. 50 ] characters^[a-z0-9]+(_[a-z0-9]+)*$read-onlyrequired

A package type, such as thick_envelope, small_flat_rate_box, large_package, etc. Use the code package for custom or unknown package types.

Example: "small_flat_rate_box"
voidedbooleanread-onlyrequired

Indicates whether the label has been voided

voided_atstring or null(date-time)(date_time)^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(...read-only

An ISO 8601 string that represents a date and time.

Example: "2018-09-23T15:00:00.000Z"
label_formatstring(label_format)required

The possible file formats in which shipping labels can be downloaded. We recommend pdf format because it is supported by all carriers, whereas some carriers do not support the png or zpl formats.

Label FormatSupported Carriers
pdfAll carriers
pngfedex
stamps_com
ups
usps
zplaccess_worldwide
apc
asendia
dhl_global_mail
dhl_express
dhl_express_australia
dhl_express_canada
dhl_express_worldwide
dhl_express_uk
dpd
endicia
fedex
fedex_uk
firstmile
imex
newgistics
ontrac
rr_donnelley
stamps_com
ups
usps
Default "pdf"
Enum"pdf""png""zpl"
display_schemestring(display_scheme)required

The display format that the label should be shown in.

Default "label"
Enum"label""paperless""label_and_paperless"
label_layoutstring(label_layout)required

The available layouts (sizes) in which shipping labels can be downloaded. The label format determines which sizes are supported. 4x6 is supported for all label formats, whereas letter (8.5" x 11") is only supported for pdf format.

Default "4x6"
Enum"4x6""letter""A4""A6"
trackablebooleanread-onlyrequired

Indicates whether the shipment is trackable, in which case the tracking_status field will reflect the current status and each package will have a tracking_number.

label_image_idstring or null(image_id)>= 4 charactersrequired

The label image resource that was used to create a custom label image.

Example: "img_DtBXupDBxREpHnwEXhTfgK"
carrier_codestring(carrier_code)^[a-z0-9]+(_[a-z0-9]+)*$read-onlyrequired

A shipping carrier, such as fedex, dhl_express, stamps_com, etc.

Example: "dhl_express"
tracking_statusstring(tracking_status)read-onlyrequired

The current status of the package, such as in_transit or delivered

Enum"unknown""in_transit""error""delivered"
confirmationstring(delivery_confirmation)read-only

The type of delivery confirmation that is required for this shipment.

Enum"none""delivery""signature""adult_signature""direct_signature""delivery_mailed""verbal_confirmation""delivery_code""age_verification_16_plus"
label_downloadobject(label_download)read-onlyrequired

Reference to the various downloadable file formats for the generated label

label_download.​hrefstring(url)(url)non-empty

The URL of the linked resource, if any

Example: "http://api.shipengine.com/v1/labels/se-28529731"
label_download.​pdfstring(url)(url)non-empty

The URL for the pdf generated label

Example: "http://api.shipengine.com/v1/labels/se-28529731"
label_download.​pngstring(url)(url)non-empty

The URL for the png generated label

Example: "http://api.shipengine.com/v1/labels/se-28529731"
label_download.​zplstring(url)(url)non-empty

The URL for the zpl generated label

Example: "http://api.shipengine.com/v1/labels/se-28529731"
form_downloadobject or null(optional_link)read-onlyrequired

The link to download the customs form (a.k.a. commercial invoice) for this shipment, if any. Forms are in PDF format. This field is null if the shipment does not require a customs form, or if the carrier does not support it.

form_download.​hrefstring(url)(url)non-emptyrequired

The URL of the linked resource, if any

Example: "http://api.shipengine.com/v1/labels/se-28529731"
form_download.​typestringnon-empty

The type of resource, or the type of relationship to the parent resource

qr_code_downloadobject or null(optional_link)read-onlyrequired

The QR code download for the package

qr_code_download.​hrefstring(url)(url)non-empty

The URL of the linked resource, if any

Example: "http://api.shipengine.com/v1/labels/se-28529731"
qr_code_download.​typestringnon-empty

The type of resource, or the type of relationship to the parent resource

paperless_downloadobject or null(paperless_download)read-onlyrequired

The paperless details which may contain elements like href, instructions and handoff_code.

paperless_download.​hrefstring(url)(url)non-empty

The URL of the linked resource, if any

Example: "http://api.shipengine.com/v1/labels/se-28529731"
paperless_download.​instructionsstring or null

The instructions for the paperless download.

Default null
paperless_download.​handoff_codestring or null

The handoff code for the paperless download.

Default null
insurance_claimobject or null(optional_link)read-onlyrequired

The link to submit an insurance claim for the shipment. This field is null if the shipment is not insured or if the insurance provider does not support online claim submission.

insurance_claim.​hrefstring(url)(url)non-emptyrequired

The URL of the linked resource, if any

Example: "http://api.shipengine.com/v1/labels/se-28529731"
insurance_claim.​typestringnon-empty

The type of resource, or the type of relationship to the parent resource

packagesArray of objects(alternative_identifiers)read-onlyrequired

The label's package(s).

Note: Some carriers only allow one package per label. If you attempt to create a multi-package label for a carrier that doesn't allow it, an error will be returned.

packages[].​package_idinteger(int32)read-only

The shipment package id

packages[].​package_codestring(package_code)[ 1 .. 50 ] characters^[a-z0-9]+(_[a-z0-9]+)*$

A package type, such as thick_envelope, small_flat_rate_box, large_package, etc. Use the code package for custom or unknown package types.

Example: "small_flat_rate_box"
packages[].​weightobject(weight)required

The package weight

packages[].​weight.​valuenumber>= 0required

The weight, in the specified unit

packages[].​weight.​unitstring(weight_unit)required

The possible weight unit values

Enum"pound""ounce""gram""kilogram"
packages[].​dimensionsobject(dimensions)

The package dimensions

packages[].​insured_valueobject(monetary_value)

The insured value of the package. Requires the insurance_provider field of the shipment to be set.

Default {"currency":"USD","amount":0}
packages[].​tracking_numberstring(tracking_number)non-emptyread-only

The tracking number for the package. The format depends on the carrier.

Example: "1Z932R800392060079"
packages[].​label_downloadobject(label_download)read-only

The label download for the package

packages[].​form_downloadobject(optional_link)read-only

The form download for any customs that are needed

packages[].​qr_code_downloadobject(optional_link)read-only

The QR code download for the package

packages[].​paperless_downloadobject(paperless_download)read-only

The paperless details which may contain elements like href, instructions and handoff_code.

packages[].​label_messagesobject(label_messages)

Custom messages to print on the shipping label for the package. These are typically used to print invoice numbers, product numbers, or other internal reference numbers. Not all carriers support label messages. The number of lines and the maximum length of each line also varies by carrier.

CarrierMax linesMax line length
USPS (Stamps.com)360
FedEx335 for the first line. 30 for additional lines.
UPS235
OnTrac225
packages[].​external_package_idstringnon-empty

An external package id.

packages[].​content_descriptionstring or null[ 1 .. 35 ] characters

A short description of the package content. Required for shipments moving to, from, and through Mexico.

Example: "Hand knitted wool socks"
packages[].​sequenceinteger(int32)read-only

Package sequence

packages[].​has_label_documentsboolean

Whether the package has label documents available for download

packages[].​has_form_documentsboolean

Whether the package has form documents available for download

packages[].​has_qr_code_documentsboolean

Whether the package has QR code documents available for download

packages[].​has_paperless_label_documentsboolean

Whether the package has paperless documents available for download

packages[].​alternative_identifiersArray of objects or null(alternative_identifier)read-only

Alternative identifiers associated with this package.

alternative_identifiersArray of objects or null(alternative_identifier)read-only

Additional information some carriers may provide by which to identify a given label in their system.

tracking_urlstring or nullread-only

The URL to track the package. This URL is provided by the carrier and is unique to the tracking number.

Example: "https://www.fedex.com/fedextrack/?action=track&trackingnumber=1234"
pickup_windowsArray of objects or nullread-only

An array of pickup windows provided by the carrier during label creation. Contains time ranges when the carrier will pick up the package. This is particularly useful when the carrier does not support the Schedule Pickup method but still provides pickup date information during label purchase.

ship_toobject(partial_shipping_address_to)read-onlyrequired

Any residential or business mailing address, anywhere in the world.

Note: Either name or company_name must be set. Both may be specified, if relevant.

ship_to.​namestringnon-emptyrequired

The name of a contact person at this address. This field may be set instead of - or in addition to - the company_name field.

Example: "John Doe"
ship_to.​phonestringnon-empty

The phone number of a contact person at this address. The format of this phone number varies depending on the country.

Example: "+1 204-253-9411 ext. 123"
ship_to.​emailstring or null

Email for the address owner.

Example: "example@example.com"
ship_to.​company_namestring or nullnon-empty

If this is a business address, then the company name should be specified here.

Example: "The Home Depot"
ship_to.​address_line1stringnon-emptyrequired

The first line of the street address. For some addresses, this may be the only line. Other addresses may require 2 or 3 lines.

Example: "1999 Bishop Grandin Blvd."
ship_to.​address_line2string or nullnon-empty

The second line of the street address. For some addresses, this line may not be needed.

Example: "Unit 408"
ship_to.​address_line3string or nullnon-empty

The third line of the street address. For some addresses, this line may not be needed.

Example: "Building #7"
ship_to.​city_localitystringnon-emptyrequired

The name of the city or locality

Example: "Winnipeg"
ship_to.​state_provincestringnon-emptyrequired

The state or province. For some countries (including the U.S.) only abbreviations are allowed. Other countries allow the full name or abbreviation.

Example: "Manitoba"
ship_to.​postal_codestring(postal_code)non-emptyrequired

postal code

Example: "78756-3717"
ship_to.​country_codestring(country_code)= 2 characters
Example: "CA"
ship_to.​address_residential_indicatorstring(address_residential_indicator)

Indicates whether this is a residential address.

Default "unknown"
Enum"unknown""yes""no"
Example: "no"
ship_to.​instructionsstring or nullnon-empty

Additional text about how to handle the shipment at this address.

ship_to.​geolocationArray of objects
void_typestring or null(void_type)read-only

Indicates how a label was voided. refund_assist means the label was voided through the Refund Assist program, while manual means it was voided manually by the user.

Enum"refund_assist""manual"
Example: "manual"
refund_detailsobject or null(refund_details)read-only

Information about the Refund Assist request for this label. This field is null if the label is not eligible for Refund Assist.

Response
application/json
{ "label_id": "se-28529731", "status": "processing", "shipment_id": "se-28529731", "external_shipment_id": "string", "external_order_id": "string", "ship_date": "2018-09-23T00:00:00.000Z", "created_at": "2018-09-23T15:00:00.000Z", "shipment_cost": { "currency": "string", "amount": 0 }, "insurance_cost": { "currency": "string", "amount": 0 }, "requested_comparison_amount": { "currency": "string", "amount": 0 }, "rate_details": [ {} ], "tracking_number": "782758401696", "is_return_label": true, "rma_number": "string", "is_international": true, "batch_id": "se-28529731", "carrier_id": "se-28529731", "charge_event": "carrier_default", "service_code": "usps_first_class_mail", "package_code": "small_flat_rate_box", "voided": true, "voided_at": "2018-09-23T15:00:00.000Z", "label_format": "pdf", "display_scheme": "label", "label_layout": "4x6", "trackable": true, "label_image_id": "img_DtBXupDBxREpHnwEXhTfgK", "carrier_code": "dhl_express", "tracking_status": "unknown", "confirmation": "none", "label_download": { "href": "http://api.shipengine.com/v1/labels/se-28529731", "pdf": "http://api.shipengine.com/v1/labels/se-28529731", "png": "http://api.shipengine.com/v1/labels/se-28529731", "zpl": "http://api.shipengine.com/v1/labels/se-28529731" }, "form_download": { "href": "http://api.shipengine.com/v1/labels/se-28529731", "type": "string" }, "qr_code_download": { "href": "http://api.shipengine.com/v1/labels/se-28529731", "type": "string" }, "paperless_download": { "href": "http://api.shipengine.com/v1/labels/se-28529731", "instructions": null, "handoff_code": null }, "insurance_claim": { "href": "http://api.shipengine.com/v1/labels/se-28529731", "type": "string" }, "packages": [ {} ], "alternative_identifiers": [ {} ], "tracking_url": "https://www.fedex.com/fedextrack/?action=track&trackingnumber=1234", "pickup_windows": [ {} ], "ship_to": { "name": "John Doe", "phone": "+1 204-253-9411 ext. 123", "email": "example@example.com", "company_name": "The Home Depot", "address_line1": "1999 Bishop Grandin Blvd.", "address_line2": "Unit 408", "address_line3": "Building #7", "city_locality": "Winnipeg", "state_province": "Manitoba", "postal_code": "78756-3717", "country_code": "CA", "address_residential_indicator": "no", "instructions": "string", "geolocation": [] }, "void_type": "manual", "refund_details": { "refund_status": "request_scheduled", "request_date": "2018-09-23T15:00:00.000Z", "amount_paid": {}, "amount_requested": {}, "amount_approved": {}, "amount_credited": {} } }

Manifests

manifests

Operations

Package Pickups

Scheduled package pickups

Operations

Package Types

custom package types

Operations

Rates

Make sure you ship as cost-effectively as possible by quickly comparing rates using the ShipEngine Rates API. As long as you have the carrier connected to your account, you'll be able to see and compare different rates and services.

Operations

Service Points

Service points allow customers to pick up their packages at convenient locations.

Operations

Shipments

Shipments are at the center of the ShipEngine API. A shipment is the first step in creating a shipping label, or creating a manifest. It's also essential for getting shipping rates.

Operations

Tags

tags

Operations

Tokens

Manage authentication tokens for secure API access.

Operations

Tracking

Track packages across any of our 20+ supported carrier accounts and create tracking events to keep your customers up-to-date. Easily integrate real-time tracking information for shipments into your app, email, or SMS.

Operations

Warehouses

warehouses

Operations

Webhooks

Webhooks are a powerful feature of ShipEngine that can save you from sending repeated polling requests to check on the state of something. With webhooks, ShipEngine will automatically contact your servers when the state changes. This can include parcel tracking events, notification of the completion of a batch operation, or new sales orders.

Operations