Update Label Batch Customs
PUT/api/shipping-label-batches/:shippingLabelBatch/customs
Saves customs values for some of a batch's international orders, then (with rate: true) gets rates for them in the background.
orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Body:
item_ids(required, 1–50 integers): the batch items to save.declaration(optional object, applied to every listed item):contents_type(required with declaration: merchandise, gift, sample, documents, returned_goods, other),contents_explanation(required when contents_type is other, max 255),non_delivery(required with declaration: return, abandon),incoterm(required with declaration: ddu, ddp),signer(nullable, max 100).products(optional array):product_id(required, distinct),description(nullable, max 255 — the customs line description, kept on the batch items only),hs_code(nullable, 6–10 digits, dots allowed),country_of_origin(nullable, two-letter ISO),save_to_product(boolean). Withsave_to_product: truethe HTS code and country of origin are written to the product, so later orders use them; otherwise they are kept on these batch items only.orders(optional array):item_id(required, distinct),contents_typeandnon_delivery(nullable — this order's own value, overriding the declaration),itn(nullable, X followed by 14 digits — the AES ITN for a US export over $2,500 for one HTS code),lines(array ofproduct_id+unit_value> 0: the customs value of one unit when the order's price is missing or 0).rate(boolean): get rates for the saved items afterwards;rate_job.tracked_job_log_idis the background job.
Returns the same shape as Get Label Batch Customs plus refused: items left unchanged because their label is bought or being bought, each with item_id, order_number, status and message. 422 when every listed item is refused, an item is not in this batch, or a value is invalid. 409 while a rate or buy job holds the batch (with rate: true).
Authentication: Requires Bearer token with the orders write scope and the fulfillment_orders.ship permission.
Request
Responses
- 200
- 401
- 403
- 404
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Unprocessable Content
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.