Backend API
Create a new shipment.
When fulfilling bundle items within a shipment, each item within the bundle will need to have shipment information added individually.
Arguments
List of line items describing the products shipped.
ID of the order item shipped.
ID of the item product.
Expandable link to the product item.
ID of the order bundle item shipped, if applicable.
Options from the order item shipped, if applicable.
Unique identifier for the object.
Name of the product option.
Name value of the product option.
Quantity of the item shipped. Defaults to 1.
ID of the item variant, if applicable.
Expandable link to the item variant, if applicable.
Unique identifier for the shipment item.
ID of the order this shipment was created for.
Tracking code used to identify the shipment, if applicable.
Expandable link to the order.
Indicates the shipment was canceled.
ID of a 3rd party carrier offering the service, if applicable.
Name of a 3rd party carrier offering the service, if applicable.
Date the expected shipment is meant to arrive at the destination, if applicable.
The customer's shipping address.
Destination customer name.
Destination address line 1: street address/PO box/company name.
Destination address line 2: apartment/suite/unit/building.
Destination city/district/suburb/town/village.
Two-letter ISO code country code.
Destination phone number.
Destination state/county/province/region.
Destination zip/postal code.
Internal admin notes, not visible to the customer.
The shipment origin location.
ID of the origin location, if applicable.
List of packages included in this shipment.
Height of the package in centimeters or inches.
Length of the package in centimeters or inches.
Type of package. This value can be enumerated, representing the types of packages used by the fulfillment provider.
Weight of the package in the unit of the store's default (lb, oz, lb).
Width of the package in centimeters or inches.
ID of a shipping service as configured in shipment settings.
Name of the shipping service.
Expandable list of notifications sent on behalf of the shipment.
Unique incremental shipment number, assigned automatically.
The order’s shipping label.
When set to true, a shipment label will be purchased on-demand from the carrier. The carrier is set in label purchase settings.
An image of the shipment label, if present.
Date the image was uploaded.
Size of the image in bytes.
An MD5 hash of the image contents. This can be used to identify the image for caching purposes.
Optional image name.
MIME content type of the image.
Arbitrary image data, typically used to store custom values. See Frontend API for more details.
A reference to the raw image data.
Indicates the image is not visible to customers.
A public URL to reference the image. Updated automatically if image content changes.
Image width in pixels, if applicable.
Image height in pixels, if applicable.
const { swell } = require('swell-node');
swell.init('store-id', 'secret-key');
await swell.post('/shipments', {
order_id: '5a9ea7ba3f95740a914267f1',
items: [
{
order_item_id: '5a9ea7ba3f95740a914267f2',
product_id: '5cad15bc9b14d1990724663a',
quantity: 2,
}
],
tracking_code: 'T192000000XYZ',
});
Response
{
"id": "5cad15bc9b14d1990724663a",
"number": "S10001",
"order_id": "5a9ea7ba3f95740a914267f1",
"items": [
{
"id": "5a9ea7ba3f95740a914267f2",
"order_item_id": "5a9ea7ba3f95740a914267f2",
"product_id": "5cad15bc9b14d1990724663b",
"quantity": 2,
...
}
],
"tracking_code": "T192000000XYZ",
...
}