Create Shipment Label

Creates a shipping label. The labelData field returned in the response is a base64 encoded PDF value. Yopu can decode and save the output as a PDF file to retrieve a printable label. The body of this request has the following attributes:

Name Data Type Description
carrierCode string Identifies the carrier to be used for this label.

Required
serviceCode string Identifies the shipping service to be used for this label.

Required
packageCode string Identifies the packing type that should be used for this label.

Required
confirmation string The type of delivery confirmation that is to be used once the shipment is created. Possible values: none, delivery, signature, adult_signature, and direct_signature. direct_signature is available for FedEx only.

Optional
shipDate string The date the shipment will be shipped.

Required
weight Object: numbers and strings Weight of the order.

Required
dimensions Object: numbers and strings Dimensions of the order.
shipFrom Address Address indicating shipment's origin. Use the Address model.

Required
shipTo Address Address indicating shipment's destination. Use the Address model.

Required
insuranceOptions Object: numbers, strings, and boolean The shipping insurance information associated with this order.

Learn more about InsuranceOptions
internationalOptions Object: strings, and an Array of customs items Customs information that can be used to generate customs documents for international orders.

Learn more about InternationalOptions

Optional
advancedOptions Object: numbers, strings, and boolean Various AdvancedOptions may be available depending on the shipping carrier that is used to ship the order.

Optional
testLabel boolean Specifies whether a test label should be created. Default value: false.

Optional

IMPORTANT

Active Manual Store Required

You must have at least one active Manual Store on your ShipStation account to create labels with this endpoint.

If you deactivated the Manual Store your ShipStation account initially came with, you must activate one. Otherwise, if you try to create labels with this endpoint, you will see a 500 error that reads, “Object reference not set to an instance of an object.”

Example Request

POST /shipments/createlabel HTTP/1.1
Host: ssapi.shipstation.com
Authorization: __YOUR_AUTH_HERE__
Content-Type: application/json

{
  "carrierCode": "fedex",
  "serviceCode": "fedex_ground",
  "packageCode": "package",
  "confirmation": "delivery",
  "shipDate": "2014-04-03",
  "weight": {
    "value": 3,
    "units": "ounces"
  },
  "dimensions": {
    "units": "inches",
    "length": 7,
    "width": 5,
    "height": 6
  },
  "shipFrom": {
    "name": "Jason Hodges",
    "company": "ShipStation",
    "street1": "2815 Exposition Blvd",
    "street2": "Ste 2353242",
    "street3": null,
    "city": "Austin",
    "state": "TX",
    "postalCode": "78703",
    "country": "US",
    "phone": null,
    "residential": false
  },
  "shipTo": {
    "name": "The President",
    "company": "US Govt",
    "street1": "1600 Pennsylvania Ave",
    "street2": "Oval Office",
    "street3": null,
    "city": "Washington",
    "state": "DC",
    "postalCode": "20500",
    "country": "US",
    "phone": null,
    "residential": false
  },
  "insuranceOptions": null,
  "internationalOptions": null,
  "advancedOptions": null,
  "testLabel": false
}

Example Response

{
  "shipmentId": 123456789,
  "orderId": null,
  "userId": null,
  "customerEmail": null,
  "orderNumber": null,
  "createDate": "2016-04-03T12:11:36.8630000",
  "shipDate": "2016-04-03",
  "shipmentCost": 9.06,
  "insuranceCost": 0,
  "trackingNumber": "782390443992",
  "isReturnLabel": false,
  "batchNumber": null,
  "carrierCode": "fedex",
  "serviceCode": "fedex_ground",
  "packageCode": "package",
  "confirmation": "delivery",
  "warehouseId": null,
  "voided": false,
  "voidDate": null,
  "marketplaceNotified": false,
  "notifyErrorMessage": null,
  "shipTo": null,
  "weight": null,
  "dimensions": null,
  "insuranceOptions": null,
  "advancedOptions": null,
  "shipmentItems": null,
  "labelData": "JVBERi0xLjQKJeLjz9MKMiAwIG9iago8PC9MZW5ndGggNjIvRmlsdGVyL0ZsYXRlRGVjb2RlPj5zdHJlYW0KeJwr5HIK4TI2U...",
  "formData": null
}