Hi @gunner52
This is Vineet from Identixweb, a Shopify Development Agency.
You can’t currently purchase a Shopify Shipping return label programmatically through the Admin API.
The “create a return label in shopify” option in the admin is still an admin-side shopify Shipping flow. Shopify has return APIs, but they don’t expose a shippingLabelCreate, buyShipping, or equivalent mutation to buy postage/return labels directly through shopify Shipping. Shopify’s docs only show return label creation from the order page in admin or the Shopify app.
reverseDeliveryCreateWithShipping is not a label-purchase API. It lets you attach external shipping information to a reverse delivery, including tracking details and a label file URL. Shopify’s developer docs describe it as creating a reverse delivery with associated external shipping information, and the mutation accepts trackingInput and labelInput.fileUrl.
So the practical workflow is:
Create or approve the return in Shopify.
Get the reverseFulfillmentOrderId.
Buy the return label from a carrier/label API like Shippo, EasyPost, ShipStation, your 3PL, or your carrier account.
Upload or host the label PDF.
Call reverseDeliveryCreateWithShipping with the tracking number, tracking URL, and label file URL.
Set notifyCustomer: true if you want Shopify to email the customer return instructions.
Example structure:
</>Graph QL
mutation reverseDeliveryCreateWithShipping(
$reverseFulfillmentOrderId: ID!,
$reverseDeliveryLineItems: [ReverseDeliveryLineItemInput!]!,
$trackingInput: ReverseDeliveryTrackingInput,
$labelInput: ReverseDeliveryLabelInput,
$notifyCustomer: Boolean
) {
reverseDeliveryCreateWithShipping(
reverseFulfillmentOrderId: $reverseFulfillmentOrderId,
reverseDeliveryLineItems: $reverseDeliveryLineItems,
trackingInput: $trackingInput,
labelInput: $labelInput,
notifyCustomer: $notifyCustomer
) {
reverseDelivery {
id
}
userErrors {
field
message
}
}
}
Variables:
{
“reverseFulfillmentOrderId”: “gid://shopify/ReverseFulfillmentOrder/123”,
“reverseDeliveryLineItems”: [ ],
“trackingInput”: {
“number”: “TRACKING123”,
“url”: “https://carrier-tracking-url.com/TRACKING123”
},
“labelInput”: {
“fileUrl”: “https://your-label-url.com/return-label.pdf”
},
“notifyCustomer”: true
}