Purchase a label
POST Purchase
Wallet purchase: The amount is deducted from your atoship wallet. rate in the response = what you paid.
BYOCA purchase: When the draft has a carrier_account_id, the shipment is created via your own carrier credentials. rate in the response = the carrier's quoted rate. Your atoship wallet is NOT charged for the shipment cost — your carrier account (or the third party you specified via billing) is billed by the carrier directly.
Third-party billing (UPS only): Set billing.payer = "third_party" with the third party's UPS account number, country, and postal code. UPS will bill that account instead of yours. This is the standard pattern for ERPNext/ERP integrations where shipping costs flow back to a customer's own UPS account.
Authorization: By submitting a third-party billing request, you confirm the third party has authorized you to bill their UPS account. atoship logs the authorization timestamp for audit/dispute resolution.
Parameters
Path Parameters
id
string
Required
POST /v1/labels. Must be in draft status.Request Body (optional)
customs
object
description: Plain-language contents. Generic words ("gift", "sample") are rejected by the carrier.
value: Declared customs value per item
contents_type: Defaults to
merchandisequantity: Defaults to
1hs_code: HS tariff number
country_of_origin: 2-letter ISO. Defaults to
UStax_id: Recipient tax id, where the destination requires one
tax_id_type: Type of the recipient tax id
Billing
payer / accountNumber / countryCode / postalCode) is set when the draft is created, on POST /v1/labels, and cannot be changed here. It is tied to the BYOCA carrier account chosen for the draft, so it is fixed once that draft exists.Returns
label_url.
INVALID_STATE — the label is not a draft (already purchased, or voided).NO_RATES — no rate could be obtained for this shipment.RATE_NOT_FOUND — the quoted rate expired before purchase.ROUTING_FAILED / PURCHASE_FAILED — the carrier declined the buy.INSURANCE_NOT_ALLOWED / INSURANCE_NOT_AVAILABLE / INSURANCE_OVER_MAX — the requested coverage is not available on this service.SERVICE_NOT_REGISTERED_FOR_ORIGIN / ORIGIN_NOT_REGISTERED / ORIGIN_ACCOUNT_UNUSABLE — this origin is not registered for the chosen service.COMPLIANCE_NOT_SUPPORTED — the shipment cannot be shipped compliantly on this service.ENTITLEMENT_CHECK_FAILED — entitlement could not be resolved; the purchase is refused rather than guessed.
INSUFFICIENT_FUNDS — the wallet balance does not cover the label.
FORBIDDEN — the label belongs to another account.SHIPPING_HELD — shipping is on hold for this organization.contract_required — a contract must be in place before this service can be bought.
NOT_FOUND — no such label.