Authentication/Setup
Set the request headers of all API requests to the following:
content-type: application/json
x-authorization: <api-key>
You must replace api-key with your personal API key.
Initial data
When a customer is dropped onto your store from the app, there will be multiple parameters in the link address. You will then need to URI Decode these parameters and use them for your on-store experience. The parameters are as follows:
URL Parameters | Description |
---|---|
loop_return_id | a UUID that is unique per order lookup |
loop_currency | the currency the original order was made in |
loop_total | total credit after tax in cents |
loop_base | total credit without tax |
loop_credit | amount of bonus credit |
loop_domain | the domain the user came from |
loop_subdomain | Loop's subdomain for you |
loop_redirect_uri | redirect link back to the app |
loop_customer_name | name of customer on the original order |
loop_experiment_b_eligible | boolean that informs you if this return is included in Loop's new On-Store flow |
loop_single_item_eligible | boolean that informs you if this return only has a single eligible item |
utm_redirect | redirect source used for analytics |
Example URL:
https://example.myshopify.com/?loop_total=1299&loop_base=799&loop_credit=500&loop_subdomain=example&loop_redirect_url=example.loopreturns.com%2F%23%2Fcredit&loop_customer_name=Jane%20Doe&loop_experiment_b_eligible=true&loop_single_item_eligible=false&utm_redirect=Loop_Returns
Example of data after decoding:
{
"loop_return_id": "e1d10005-ec40-47da-b47b-424c4b19f11c",
"loop_currency": "USD",
"loop_total": 1299,
"loop_base": 799,
"loop_credit": 500,
"loop_domain": "example.loopreturns.com",
"loop_subdomain": "example",
"loop_redirect_uri": "example.loopreturns.com/#/credit",
"loop_customer_name": "Jane Doe",
"loop_experiment_b_eligible": true,
"loop_single_item_eligible": false
}