Custom Integrations with Loop
OVERVIEW
Loops API and webhooks are documented in more detail here: https://docs.loopreturns.com.
Receiving Returns Data
Webhooks
Each time a customer initiates a return, a Loop webhook will deliver details of the return to a pre-defined endpoint. This data can be leveraged to create a record (RA, RMA, etc) in a third-party system. Subscribers can choose to receive webhooks upon the creation of a return, when the return status has been changed, or both.
Returns API
In some cases, it’s best to pull returns from Loop on a recurring basis. This can be done using either of two endpoints in our API, each delivering varying fidelities of returns data during a specified period (date parameters):
Example API responses can be found in the documentation above.
Processing Returns
There are four actions that can be taken via the API:
- Process return
- Flag return
- Cancel return
- Close return
Process Return
When a return has met merchant criteria and is approved, hitting the Process Return endpoint will process the return and execute the customer’s requested outcome in Shopify.
Flag Return
Returns that require additional action can be flagged via the Flag Return endpoint. These returns will be sent to the “Needs Review” section of the Loop admin and can be actioned on a case-by-case basis by the merchant.
Cancel Return
Although typically actioned manually by the merchant to handle edge cases, the Cancel Return endpoint can be leveraged to cancel a return within Loop.
Close Return
You may also close a return via the Close Return endpoint. Closing a return does not allow a customer to resubmit an item in a later return, and it does not issue any refunds or exchanges that processing a return would issue.
FAQ
1. Can I send custom parameters through the flag endpoint?
Currently, no. However, this functionality will be included in future API enhancements
2. I'm getting an "unauthorized" error when making API calls, what is wrong with the API key?
Loop's API keys use "scopes" to determine what actions a key is allowed to be used for. If a key does not have the appropriate scope assigned to it then even if the key is valid you will get a 401 unauthorized response. For example: if you are trying to use the Details List API and your API key does not have the "Returns" scope you will get an "unauthorized" response
You can either make a new key with the required scope for your action or you can add the scope to your key in the Developer page of the admin. Keys can have multiple scopes.
More details on Looop's API scopes and what scopes are needed for what actions can be found in the documentation. API key Scopes
2. Can I edit a return using the API?
At this time returns cannot be edited after they are created.