Create a shipment
POST/shipping/{connection_id}/shipment
Parameters
fieldsstring array
Fields to return
rawstring
Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar
connection_idstring required
ID of the connection
Payload
idstring
Unique identifier for this shipment object
created_atdate-time
The date that this shipment object was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
updated_atdate-time
The last date that this shipment object was updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
order_idstring
Reference to commerce_order or accounting_order
organization_idstring
ref -> accounting Organization this shipment belongs to (multi-company ERPs)
carrier_idstring
Reference to the carrier
service_codestring
Code for the shipping service used
status enum
Current status of the shipment
rate_idstring
Optional reference to the selected rate (for traceability)
label_idstring
Optional reference to the shipping label
tracking_idstring
Optional reference to the tracking information
shipped_atdate-time
When shipment was createddispatched (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
rate_amountnumber
The rate amount used (may differ from shipping_cost due to adjustments)
rate_currencystring
Currency for rate_amount
rate_service_namestring
Service name from the rate (e.g., "Priority Mail")
rate_estimated_daysnumber
Estimated delivery days from the rate
rate_estimated_delivery_atdate-time
Estimated delivery date from the rate (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
is_rate_guaranteedboolean
Whether delivery is guaranteed (from rate)
return_authorization_numberstring
RMA number if return shipment
warehouse_location_idstring
Origin warehouselocation ID; points to CommerceLocation
warehouse_location_namestring
Origin warehouse location name
is_internationalboolean
Whether shipment is international
special_instructionsstring array
Array of special instructions
is_signature_requiredboolean
Signature required on delivery
is_adult_signature_requiredboolean
Adult signature required
reference_numberstring
Customer reference number
is_returnboolean
Whether this is a return shipment
original_shipment_idstring
Reference to original shipment if return; points to ShippingShipment
return_reasonstring
Reason for return
return_type enum
Valid values:
"CUSTOMER"
"VENDOR"
"WARRANTY"
"DEFECTIVE"
"OTHER"
Type of return
carrier_namestring
Human-readable carrier/provider name when there is no carrier record to reference (e.g. commerce-platform fulfillments)
tracking_urlstring
Carrier tracking URL for this shipment
Returns
| Response field | Type | Required | Description |
|---|---|---|---|
id | string | No | Unique identifier for this shipment object |
created_at | string (date-time) | No | The date that this shipment object was created (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
updated_at | string (date-time) | No | The last date that this shipment object was updated (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
order_id | string | No | Reference to commerce_order or accounting_order |
organization_id | string | No | ref -> accounting Organization this shipment belongs to (multi-company ERPs) |
from_address | object | No | Origin address |
from_address.address1 | string | No | |
from_address.address2 | string | No | |
from_address.city | string | No | |
from_address.region | string | No | |
from_address.region_code | string | No | |
from_address.postal_code | string | No | |
from_address.country | string | No | |
from_address.country_code | string | No | ISO 2-digit country code |
from_address.name | string | No | Recipientsender name |
from_address.company_name | string | No | Company name (for commercial addresses) |
from_address.telephone | string | No | Phone number (required by FedEx, UPS, DHL) |
from_address.email | string | No | Email address (for delivery notifications) |
from_address.is_residential | boolean | No | Alias for address_type === 'RESIDENTIAL' |
from_address.is_validated | boolean | No | Whether address has been validated |
from_address.delivery_instructions | string | No | Special delivery notes |
to_address | object | No | Destination address |
to_address.address1 | string | No | |
to_address.address2 | string | No | |
to_address.city | string | No | |
to_address.region | string | No | |
to_address.region_code | string | No | |
to_address.postal_code | string | No | |
to_address.country | string | No | |
to_address.country_code | string | No | ISO 2-digit country code |
to_address.name | string | No | Recipientsender name |
to_address.company_name | string | No | Company name (for commercial addresses) |
to_address.telephone | string | No | Phone number (required by FedEx, UPS, DHL) |
to_address.email | string | No | Email address (for delivery notifications) |
to_address.is_residential | boolean | No | Alias for address_type === 'RESIDENTIAL' |
to_address.is_validated | boolean | No | Whether address has been validated |
to_address.delivery_instructions | string | No | Special delivery notes |
packages | ShippingPackage[] | No | Array of packages in this shipment |
packages[].weight | number | No | Weight of the package |
packages[].weight_unit | enum | No | Unit for weight (g, kg, oz, lb) Values: g, kg, oz, lb |
packages[].length | number | No | Length of the package |
packages[].width | number | No | Width of the package |
packages[].height | number | No | Height of the package |
packages[].size_unit | enum | No | Unit for dimensions (cm, inch) Values: cm, inch |
packages[].description | string | No | Description of the package contents |
packages[].value | number | No | Declared value of the package |
packages[].currency | string | No | ISO 4217 currency code |
packages[].tracking_number | string | No | Package-level tracking (for multi-package shipments) |
packages[].insured_amount | number | No | Insured value for this package |
carrier_id | string | No | Reference to the carrier |
service_code | string | No | Code for the shipping service used |
status | enum | No | Current status of the shipment Values: PENDING, PROCESSING, IN_TRANSIT, DELIVERED, EXCEPTION, CANCELLED, LABEL_CREATED, PICKED_UP, OUT_FOR_DELIVERY, DELIVERY_ATTEMPTED, RETURNED_TO_SENDER, HELD_AT_LOCATION, CUSTOMS_CLEARANCE, EXCEPTION_RESOLVED |
rate_id | string | No | Optional reference to the selected rate (for traceability) |
label_id | string | No | Optional reference to the shipping label |
tracking_id | string | No | Optional reference to the tracking information |
shipped_at | string (date-time) | No | When shipment was createddispatched (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
rate_amount | number | No | The rate amount used (may differ from shipping_cost due to adjustments) |
rate_currency | string | No | Currency for rate_amount |
rate_service_name | string | No | Service name from the rate (e.g., "Priority Mail") |
rate_estimated_days | number | No | Estimated delivery days from the rate |
rate_estimated_delivery_at | string (date-time) | No | Estimated delivery date from the rate (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format) |
is_rate_guaranteed | boolean | No | Whether delivery is guaranteed (from rate) |
return_address | object | No | Return address (may differ from from_address) |
return_address.address1 | string | No | |
return_address.address2 | string | No | |
return_address.city | string | No | |
return_address.region | string | No | |
return_address.region_code | string | No | |
return_address.postal_code | string | No | |
return_address.country | string | No | |
return_address.country_code | string | No | ISO 2-digit country code |
return_address.name | string | No | Recipientsender name |
return_address.company_name | string | No | Company name (for commercial addresses) |
return_address.telephone | string | No | Phone number (required by FedEx, UPS, DHL) |
return_address.email | string | No | Email address (for delivery notifications) |
return_address.is_residential | boolean | No | Alias for address_type === 'RESIDENTIAL' |
return_address.is_validated | boolean | No | Whether address has been validated |
return_address.delivery_instructions | string | No | Special delivery notes |
return_authorization_number | string | No | RMA number if return shipment |
warehouse_location_id | string | No | Origin warehouselocation ID; points to CommerceLocation |
warehouse_location_name | string | No | Origin warehouse location name |
customs | object | No | Customs information |
customs.contents_type | enum | No | Values: MERCHANDISE, DOCUMENTS, GIFT, RETURNED_GOODS, SAMPLE, OTHER |
customs.description | string | No | Explanation of contents |
customs.amount | number | No | Customs declared value |
customs.currency | string | No | |
customs.duties_paid_by | enum | No | Values: SENDER, RECIPIENT, THIRD_PARTY |
customs.taxes_paid_by | enum | No | Values: SENDER, RECIPIENT, THIRD_PARTY |
customs.shipper_eori | string | No | Exporter EORI number |
customs.recipient_eori | string | No | Importer EORI number |
customs.shipper_tax_number | string | No | Exporter tax ID |
customs.recipient_tax_number | string | No | Importer tax ID |
customs.items | ShippingCustomsItem[] | No | Customs items |
customs.items[].description | string | No | Item description |
customs.items[].quantity | number | No | Quantity |
customs.items[].amount | number | No | Value per unit |
customs.items[].currency | string | No | |
customs.items[].weight | number | No | Weight per unit |
customs.items[].weight_unit | enum | No | Values: g, kg, oz, lb |
customs.items[].harmonized_tariff_code | string | No | HS code |
customs.items[].country_of_origin | string | No | Country of origin (ISO code) |
customs.items[].sku | string | No | SKU |
customs.restrictions | string[] | No | Any restrictions |
customs.non_delivery_option | enum | No | Values: RETURN, ABANDON |
is_international | boolean | No | Whether shipment is international |
insurance | object | No | Insurance details |
insurance.insured_value | number | No | Insured value |
insurance.currency | string | No | |
insurance.insurance_provider | string | No | Insurance provider name |
insurance.insurance_provider_code | string | No | Provider code |
insurance.insurance_cost | number | No | Cost of insurance |
insurance.insurance_cost_currency | string | No | |
insurance.coverage_type | enum | No | Values: STANDARD, PREMIUM, CUSTOM |
insurance.coverage_amount | number | No | Coverage amount (may differ from insured_value) |
special_instructions | string[] | No | Array of special instructions |
is_signature_required | boolean | No | Signature required on delivery |
is_adult_signature_required | boolean | No | Adult signature required |
reference_number | string | No | Customer reference number |
is_return | boolean | No | Whether this is a return shipment |
original_shipment_id | string | No | Reference to original shipment if return; points to ShippingShipment |
return_reason | string | No | Reason for return |
return_type | enum | No | Type of return Values: CUSTOMER, VENDOR, WARRANTY, DEFECTIVE, OTHER |
carrier_name | string | No | Human-readable carrier/provider name when there is no carrier record to reference (e.g. commerce-platform fulfillments) |
tracking_url | string | No | Carrier tracking URL for this shipment |
lineitems | ShippingShipmentLineitem[] | No | Item-level fulfillment lines (what shipped); used by commerce-platform fulfillments |
lineitems[].id | string | No | Unique identifier for this fulfillment line |
lineitems[].item_id | string | No | Reference to the CommerceItem being fulfilled (reference to CommerceItem) |
lineitems[].item_variant_id | string | No | Reference to the CommerceItemvariant being fulfilled (reference to CommerceCommerceItemvariant) |
lineitems[].order_lineitem_id | string | No | The order line being fulfilled |
lineitems[].quantity | number | No | Units fulfilled on this line |
lineitems[].item_name | string | No | Item name (for display) |
lineitems[].sku | string | No | Item SKU |
Errors
Errors return the HTTP status code and a JSON body with statusCode, error (the short label) and message (a human-readable detail).
{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Too many requests to unified.to API; max requests per minute: N"
}| Status | Error | Meaning |
|---|---|---|
400 | Bad Request | The request was malformed or failed validation. |
401 | Unauthorized | The connection is likely broken; re-authorize it. |
403 | Forbidden | The connection is missing permissions or scopes. |
404 | Not Found | The requested resource does not exist. |
429 | Too Many Requests | Rate limit exceeded (see the two sources below). |
500 | Internal Server Error | An unexpected error occurred. |
501 | Not Implemented | Not supported by this integration. |
Errors from the underlying integration pass through: the integration's status comes back as ours (429, 401, 403, 404 or 5xx), usually with its message. When the integration's error body is unclear, Unified extracts what it can and returns a clearer message.
429 Too Many Requests
A 429 has two possible sources:
- The integration's own rate limit, passed through.
- Unified's workspace limit: a rolling 60 seconds, set by plan, with the message
Too many requests to unified.to API; max requests per minute: N.
const options = {
method: 'POST',
url: 'https://api.unified.to/shipping/5de520f96e439b002043d8dc/shipment',
headers: {
authorization: 'bearer .....'
},
data: undefined,
params: {
fields: '',
raw: '',
}
};
const results = await axios.request(options); Are we missing anything? Let us know