curl --request POST \
--url https://api.loopreturns.com/api/v1/draft-returns/{draft_return_id}/address \
--header 'Content-Type: application/json' \
--header 'X-Authorization: <api-key>' \
--data '
{
"address": {
"address1": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"address2": "<string>"
}
}
'{
"draft_return": {
"id": 12345,
"return_id": 67890,
"state": "created",
"currency": "<string>",
"language": "en",
"credit_type": null,
"store_credit_type": "gift-card",
"processing_type": "regular",
"return_policy": {
"id": 1,
"name": "Standard 30-day return",
"return_window_days": 30
},
"totals": {
"return_total": {
"amount": 5000,
"currency": "USD"
},
"new_item_total": {
"amount": 3000,
"currency": "USD"
},
"total_bonus_offered": {
"amount": 500,
"currency": "USD"
},
"bonus_used": {
"amount": 500,
"currency": "USD"
},
"fees": {
"applied": {
"amount": 300,
"currency": "USD"
},
"refund": {
"amount": 100,
"currency": "USD"
},
"credit": {
"amount": 100,
"currency": "USD"
},
"exchange": {
"amount": 100,
"currency": "USD"
}
},
"amount_due": {
"amount": 0,
"currency": "USD"
},
"credit": {
"remaining_credit": {
"amount": 2000,
"currency": "USD"
},
"refund_credit": {
"amount": 2000,
"currency": "USD"
},
"store_credit": {
"amount": 0,
"currency": "USD"
}
},
"net": {
"amount": 2000,
"currency": "USD"
}
},
"customer": {
"email": "[email protected]"
},
"shipping_address": {
"name": "Jane Doe",
"company": null,
"address1": "123 Main St",
"address2": "Apt 4",
"city": "Chicago",
"state": "Illinois",
"zip": "60622",
"country": "United States",
"country_code": "US",
"phone": "555-555-5555"
},
"returning_items": [
{
"id": 1,
"order_line_item_id": 12346,
"return_type": "credit",
"resolution": "return",
"reason": {
"id": 2,
"name": "Item didn't fit",
"comment": null
},
"user_input": [
{
"id": 1,
"prompt": "Is the item still in its original packaging?",
"value": true
}
],
"image_uploads": [
"https://cdn.example.com/return-images/abc123.jpg"
],
"has_exchange_item": false
}
],
"cart_items": [
{
"id": 201,
"variant_id": 501,
"product_id": 100,
"sku": "SHIRT-RED-S",
"title": "Red Shirt",
"variant_title": "Small",
"product_type": "Apparel",
"price": {
"amount": 2500,
"currency": "USD"
},
"price_currency_code": "USD",
"image": "https://cdn.example.com/products/red-shirt.jpg",
"exchange_type": "exchange",
"exchange_for_returning_item_id": 1
}
],
"selected_return_method": "UPS Ground"
},
"context": {
"order": {
"id": 42,
"currency": "USD",
"line_items": [
{
"id": 74,
"provider_product_id": 7804939829359,
"provider_variant_id": 43045586894959,
"title": "Example Product",
"variant_title": "Example Variant",
"price": 2250,
"image": "https://example.com/example.jpg"
}
]
},
"items_eligible_to_return": [
{
"order_line_item_id": 74
}
],
"items_not_eligible_to_return": [
{
"order_line_item_id": 12347,
"ineligibility_code": "not_eligible_for_return"
}
],
"return_reasons": [
{
"id": 1,
"name": "Too small",
"requires_comment": false,
"child_reasons": [
{
"id": 10,
"name": "Size too small"
}
]
}
],
"return_methods": [
{
"id": 1,
"name": "UPS Ground",
"type": "label",
"cost": 0,
"carrier": "UPS"
}
],
"available_credit_types": [
"refund"
],
"cart_products": [
{
"id": 100,
"title": "Red Shirt",
"product_type": "Apparel",
"image": "https://cdn.example.com/products/red-shirt.jpg",
"variants": [
{
"id": 501,
"title": "Small",
"sku": "SHIRT-RED-S",
"price": 2500,
"available": true
}
]
}
]
},
"links": [
{
"rel": "<string>",
"href": "<string>",
"method": "<string>",
"description": "Add a line item to the return",
"prompt": "Which item would you like to return?",
"fields": [
{
"name": "order_line_item_id",
"type": "int",
"description": "ID of the line item to return",
"allowed_values": [
"refund",
"gift",
"exchange"
],
"is_required": true
}
],
"is_required": true
}
],
"errors": [
{
"code": "<string>",
"message": "<string>"
}
]
}Sets the return shipping address for the draft return.
curl --request POST \
--url https://api.loopreturns.com/api/v1/draft-returns/{draft_return_id}/address \
--header 'Content-Type: application/json' \
--header 'X-Authorization: <api-key>' \
--data '
{
"address": {
"address1": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"country_code": "<string>",
"zip": "<string>",
"address2": "<string>"
}
}
'{
"draft_return": {
"id": 12345,
"return_id": 67890,
"state": "created",
"currency": "<string>",
"language": "en",
"credit_type": null,
"store_credit_type": "gift-card",
"processing_type": "regular",
"return_policy": {
"id": 1,
"name": "Standard 30-day return",
"return_window_days": 30
},
"totals": {
"return_total": {
"amount": 5000,
"currency": "USD"
},
"new_item_total": {
"amount": 3000,
"currency": "USD"
},
"total_bonus_offered": {
"amount": 500,
"currency": "USD"
},
"bonus_used": {
"amount": 500,
"currency": "USD"
},
"fees": {
"applied": {
"amount": 300,
"currency": "USD"
},
"refund": {
"amount": 100,
"currency": "USD"
},
"credit": {
"amount": 100,
"currency": "USD"
},
"exchange": {
"amount": 100,
"currency": "USD"
}
},
"amount_due": {
"amount": 0,
"currency": "USD"
},
"credit": {
"remaining_credit": {
"amount": 2000,
"currency": "USD"
},
"refund_credit": {
"amount": 2000,
"currency": "USD"
},
"store_credit": {
"amount": 0,
"currency": "USD"
}
},
"net": {
"amount": 2000,
"currency": "USD"
}
},
"customer": {
"email": "[email protected]"
},
"shipping_address": {
"name": "Jane Doe",
"company": null,
"address1": "123 Main St",
"address2": "Apt 4",
"city": "Chicago",
"state": "Illinois",
"zip": "60622",
"country": "United States",
"country_code": "US",
"phone": "555-555-5555"
},
"returning_items": [
{
"id": 1,
"order_line_item_id": 12346,
"return_type": "credit",
"resolution": "return",
"reason": {
"id": 2,
"name": "Item didn't fit",
"comment": null
},
"user_input": [
{
"id": 1,
"prompt": "Is the item still in its original packaging?",
"value": true
}
],
"image_uploads": [
"https://cdn.example.com/return-images/abc123.jpg"
],
"has_exchange_item": false
}
],
"cart_items": [
{
"id": 201,
"variant_id": 501,
"product_id": 100,
"sku": "SHIRT-RED-S",
"title": "Red Shirt",
"variant_title": "Small",
"product_type": "Apparel",
"price": {
"amount": 2500,
"currency": "USD"
},
"price_currency_code": "USD",
"image": "https://cdn.example.com/products/red-shirt.jpg",
"exchange_type": "exchange",
"exchange_for_returning_item_id": 1
}
],
"selected_return_method": "UPS Ground"
},
"context": {
"order": {
"id": 42,
"currency": "USD",
"line_items": [
{
"id": 74,
"provider_product_id": 7804939829359,
"provider_variant_id": 43045586894959,
"title": "Example Product",
"variant_title": "Example Variant",
"price": 2250,
"image": "https://example.com/example.jpg"
}
]
},
"items_eligible_to_return": [
{
"order_line_item_id": 74
}
],
"items_not_eligible_to_return": [
{
"order_line_item_id": 12347,
"ineligibility_code": "not_eligible_for_return"
}
],
"return_reasons": [
{
"id": 1,
"name": "Too small",
"requires_comment": false,
"child_reasons": [
{
"id": 10,
"name": "Size too small"
}
]
}
],
"return_methods": [
{
"id": 1,
"name": "UPS Ground",
"type": "label",
"cost": 0,
"carrier": "UPS"
}
],
"available_credit_types": [
"refund"
],
"cart_products": [
{
"id": 100,
"title": "Red Shirt",
"product_type": "Apparel",
"image": "https://cdn.example.com/products/red-shirt.jpg",
"variants": [
{
"id": 501,
"title": "Small",
"sku": "SHIRT-RED-S",
"price": 2500,
"available": true
}
]
}
]
},
"links": [
{
"rel": "<string>",
"href": "<string>",
"method": "<string>",
"description": "Add a line item to the return",
"prompt": "Which item would you like to return?",
"fields": [
{
"name": "order_line_item_id",
"type": "int",
"description": "ID of the line item to return",
"allowed_values": [
"refund",
"gift",
"exchange"
],
"is_required": true
}
],
"is_required": true
}
],
"errors": [
{
"code": "<string>",
"message": "<string>"
}
]
}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 unique identifier of the draft return.
Show child attributes
Successful response with draft return data.
The draft return object.
Show child attributes
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.
Show child attributes
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:
Show child attributes
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.
Show child attributes