Overview
The Return Create API allows for a wide array of actions to be performed on returns, but one of the simplest ways to get started is to use the API to check the eligibility of items for return. This guide walks through the process of initializing a draft return and checking item eligibility.Requirements
- A Loop API key with the
Draft Returns (read)andDraft Returns (write)scopes. For details on how to create or modify an API key, see Authentication. - The shop ID for the merchant’s shop.
- The Shopify order name of the order for which you want to check the eligibility.
1. Initialize a Draft Return
First, initialize a draft return using the order information. This is done using the Initialize Draft Return endpoint.- Lists of eligible and ineligible items
- Available return reasons
- Links to next possible actions
- Any error codes thrown
2. Check Item Eligibility
In the response from initializing the draft return, you’ll find two important arrays:items_eligible_to_return: Contains items that can be returneditems_not_eligible_to_return: Contains items that can’t be returned
- Return policy rules
- Time since purchase
- Item-specific restrictions
- Order status
The eligibility check happens automatically when initializing the draft return and continuously throughout the draft return process.
3. Get Detailed Return Status
At any point, you can check the current state of the draft return using the Get draft return endpoint.Get draft return
- Current eligible/ineligible items
- Customer information
- Return methods available
- Any errors or issues
4. Handle the Results
Based on the eligibility results, you can:-
If there are eligible items for return:
- Proceed with adding items to the return using the Add Returning Item endpoint.
- Set return reasons and types for each item.
- Continue with the return process.
-
If no items are eligible:
- Cancel the draft return using the Cancel Draft Return endpoint.
- Inform the customer that no items are eligible for return.
Flow Summary
- Initialize draft return
- Check eligibility in response
- If items are eligible:
- Add items to return
- Set return reasons
- Select return method
- Submit return
- If no items are eligible:
- Cancel draft return
- Inform customer