Initialize a new draft return.
The return created using this endpoint can be configured and modified using the other draft return API endpoints.
When integrating the draft return APIs, this endpoint should be the first one called. The response includes the initial state of the draft return as well as links to the next available actions.
The unique identifier of the shop associated with the draft return.
This header is not required, as the merchant's shop is identified by the API key present in the request.
The Shopify order name.
"#1001"
Any secondary input included by the shopper when looking up their order (for example, ZIP/postal code or email address).
Whether or not the return will use Loop's Gift flow. For details, see Gift Returns.
false
Successful response with draft return data.
The draft return object.
Contextual information about the draft return. The context object provides data needed for actions (e.g., eligible items, return reasons, shipping methods). Context fields are dynamically populated based on the current state and available actions.
HATEOAS links representing available actions for the current draft return state.
How to use links:
rel field to identify the actionfields array to see what data is requiredhref using the specified methodis_required: trueState-based availability:
created state: Links for adding items, setting customer, finalizing itemsitems-finalized state: Links for setting credit type, selecting return method, submittingsubmitted, cancelled, expired): No action links (empty array)The links array dynamically changes based on:
An array of error codes. In the event of a partial failure, the API will return all possible data as well as any error codes that were thrown.
See Error codes for a full list of possible errors.