Admin API / Mutations
purchaseShipmentLabel
Buys a 4 × 6 in PDF shipping label for one NOT_STARTED shipment with no label, at a rate from quoteShipmentLabelRates. The shipment's seller pays, also when store staff call: from the seller's wallet, or by card when the seller's payment processor or account history requires a card. A marketplace that connected its own Shippo account pays Shippo itself, and the seller is not charged. That marketplace sells labels only for the shipments of its owners. Another seller's shipment gets ShippoAccountUnavailableError with SELLER_NOT_OWNER. On success the shipment and its PAID orders become READY_TO_SHIP, and no later order joins the shipment. A repeat with the same idempotencyKey and input within 24 hours returns the stored success; the same key with another input returns IdempotencyConflictError. While an earlier purchase on a marketplace's own Shippo account has an unknown outcome, each attempt checks it again. In the first 90 seconds after that purchase, the attempt returns LabelPurchaseFailedError, because the purchase can still run. Then a sold label returns PurchaseShipmentLabelSuccess with that label. An outcome that is still unknown, a quote field that changed after the sale, such as the parcel or an address, or no label on Shippo in the first hour returns ShipmentNotLabelableError with PURCHASE_UNCONFIRMED and buys nothing. After 1 hour with no label on Shippo, the attempt continues as a new purchase. A purchase that fails after the checks, for example at the carrier, returns LabelPurchaseFailedError, whose message states the charge and its refund. After CardDeclinedError or LabelPurchaseFailedError, send a new idempotencyKey to try again.
admin:shipments:purchaseRequires this member role or higher: SELLER A member below this role, or an inactive member, who has outstanding seller obligations can also call it.purchaseShipmentLabel(
input: PurchaseShipmentLabelInput!
): PurchaseShipmentLabelPayload!Arguments
| Argument | Type | Description |
|---|---|---|
input | PurchaseShipmentLabelInput! | The shipment, the rate and the card. |