Menu
shippingLabelPurchase
Purchases a shipping label for a fulfillment order. The shippingLabelPurchase mutation buys one shipping label for one fulfillment order using Shopify Shipping.
Use it in a workflow
- Add a step and choose the Shopify connector.
- Pick the shippingLabelPurchase action (under Shipping).
- Fill in the fields below, then reference the result from later steps as
{{shippinglabelpurchase.response.data}}.
Query
This is the mutation the action sends by default. Edit it in the step's Query field to change which fields come back.
mutation ShippingLabelPurchase($shippingLabelPurchase: ShippingLabelPurchaseInput!) {
shippingLabelPurchase(shippingLabelPurchase: $shippingLabelPurchase) {
shippingLabelPurchaseResult {
done
errors {
code
field
message
}
id
shippingLabels {
cancellable
id
location
printed
shippingDocuments
trackingInfo
}
status
}
userErrors {
code
field
message
}
}
}
Variables
Pass these as a JSON object in the step's Variables field.
{
"shippingLabelPurchase": {
"fulfillmentOrderId": "string",
"shippingDatetime": "string",
"packageInfo": {
"customPackage": {
"weight": "string",
"dimensions": "string",
"type": "string"
},
"carrierPackage": {
"carrierCode": "string",
"carrierPackageCode": "string",
"name": "string"
}
},
"totalWeight": {
"value": 0,
"unit": "KILOGRAMS"
},
"notifyCustomer": false,
"preferredRateSelection": {
"carrierCode": "string",
"serviceCode": "string"
},
"originAddress": {
"address1": "string",
"address2": "string",
"city": "string",
"company": "string",
"country": "string",
"countryCode": "AF",
"firstName": "string",
"id": "string",
"lastName": "string",
"phone": "string",
"province": "string",
"provinceCode": "string"
}
}
}
Response
Read the result with {{shippinglabelpurchase.response.data.data.shippingLabelPurchase}}. If the API returns errors, the step fails and they are at {{shippinglabelpurchase.response.data.errors}}.
Need more? See the Shopify guide for connection setup and behaviour shared by every action.
Was this page helpful?