Skip to main content

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.

Required scope: orders:write

Grant 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). With save_to_product: true the 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_type and non_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 of product_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_id is 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​

OK

Response Headers
    Content-Type