Skip to main content

Buy Shipping Labels with the GraphQL Admin API

New shippingLabelPurchase mutation in the GraphQL Admin API

The GraphQL Admin API now includes the shippingLabelPurchase mutation, which lets apps purchase Shopify Shipping labels for eligible fulfillment orders.

Apps can provide the fulfillment order, shipping date and time, package details, total weight, customer notification preference, and optional preferred carrier/service selection. If a preferred rate isn't provided, Shopify selects the cheapest available rate.

Label purchase runs asynchronously. The mutation returns a ShippingLabelPurchaseResult, which apps can poll to track the request status:

  • PENDING_PURCHASE: the purchase is still processing.
  • PURCHASED: the label was purchased successfully, and the purchased labels are available on shippingLabels.
  • PURCHASE_FAILED: the purchase failed, and details are available on errors.

Requirements

The mutation requires the write_orders access scope and a user with the buy_shipping_labels permission. Shops must also accept the Shopify Shipping terms of service before purchasing labels through the API.

Related documentation

Was this section helpful?