curl --request POST \
--url https://api.loopreturns.com/api/v1/draft-returns/{draft_return_id}/submit \
--header 'X-Authorization: <api-key>'import requests
url = "https://api.loopreturns.com/api/v1/draft-returns/{draft_return_id}/submit"
headers = {"X-Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Authorization': '<api-key>'}};
fetch('https://api.loopreturns.com/api/v1/draft-returns/{draft_return_id}/submit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.loopreturns.com/api/v1/draft-returns/{draft_return_id}/submit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.loopreturns.com/api/v1/draft-returns/{draft_return_id}/submit"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.loopreturns.com/api/v1/draft-returns/{draft_return_id}/submit")
.header("X-Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loopreturns.com/api/v1/draft-returns/{draft_return_id}/submit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"_links": {
"self": {
"href": "<string>"
}
},
"_templates": {},
"client_application": {},
"draft_return": {
"id": 12345,
"return_id": 67890,
"state": "created",
"currency": "USD",
"language": "en",
"credit_type": null,
"processing_type": "regular",
"customer": {
"email": "someone@test.com"
},
"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",
"return_reason": {
"name": "Item didn't fit",
"comment": null
},
"user_inputs": [
{
"id": 1,
"type": "yes-no",
"prompt": "Is the item still in its original packaging?",
"value": true
}
],
"image_uploads": [
"https://cdn.example.com/return-images/abc123.jpg"
]
}
],
"cart_items": [
{
"id": 201,
"variant_id": 501,
"product_id": 100,
"sku": "SHIRT-RED-S",
"title": "Red Shirt",
"variant_title": "Small",
"price": 2500,
"image": "https://cdn.example.com/products/red-shirt.jpg",
"exchange_type": "exchange",
"exchange_for_returning_item_id": 1
}
],
"selected_return_method": {
"id": 123,
"name": "<string>",
"type": "box-and-ship",
"title": "<string>",
"logo_url": "<string>",
"location_url": "<string>"
},
"payment_intent": {
"id": 123,
"provider": "<string>",
"provider_intent_id": "<string>"
},
"return_key": "<string>",
"requires_uncollectible_payment": false
},
"context": {
"languages": [
{
"name": "<string>",
"abbreviation": "<string>"
}
],
"order": {
"id": 123,
"currency": "<string>",
"original_payment_transactions": [
{
"type": "<string>",
"gateway": "<string>",
"amount": 123,
"currency": "<string>",
"brand": "<string>",
"last4": 123
}
],
"line_items": [
{
"id": 123,
"provider_product_id": 123,
"provider_variant_id": 123,
"title": "<string>",
"variant_title": "<string>",
"sku": "<string>",
"description": "<string>",
"price": 123,
"image": "<string>",
"parent_line_item_id": 123,
"options": [
{
"name": "<string>",
"value": "<string>"
}
]
}
]
},
"return_reason_groups": [
{
"id": 123,
"return_reasons": [
{
"id": 123,
"name": "<string>",
"parent_return_reason_id": 123,
"parent_return_reason_name": "<string>",
"is_commentable": true,
"requires_comments": true
}
]
}
],
"items_eligible_to_return": [
{
"order_line_item_id": 123,
"return_reason_group_id": 123,
"expiration": "<string>"
}
],
"items_not_eligible_to_return": [
{
"order_line_item_id": 123,
"ineligibility_code": "<string>",
"expiration": "<string>"
}
],
"return_reason_options": [
[
{
"id": 123,
"name": "<string>",
"is_commentable": true,
"requires_comments": true
}
]
],
"exchange_options": [
{
"product_options": [
{
"name": "<string>",
"values": "<array>",
"position": 123
}
],
"product_variants": [
{
"product_id": 123,
"variant_id": 123,
"title": "<string>",
"variant_title": "<string>",
"product_type": "<string>",
"options": {},
"image": "<string>",
"price": 123,
"currency": "<string>",
"is_available": true
}
]
}
],
"return_method_options": [
{
"id": 123,
"name": "<string>",
"type": "box-and-ship",
"fee": 123,
"title": "<string>",
"logo_url": "<string>",
"location_url": "<string>"
}
],
"processing_type_options": {
"required": false,
"options": [
{
"type": "regular",
"available": true,
"unavailability_reason": "not-enabled",
"authorization_amount": {
"amount": 5000,
"currency_code": "USD"
},
"charge_amount": {
"amount": 5000,
"currency_code": "USD"
},
"window_days": 14,
"hold_window_days": null
}
]
}
},
"errors": [
{
"code": "draft-returns-not-enabled",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "unauthorized",
"message": "Unauthorized."
}
]
}{
"errors": [
{
"code": "validation-failed",
"message": "Validation failed."
}
]
}Submit Draft Return
Submits the draft return. This finalizes the return and initiates any necessary workflows. Once the return has been submitted, it can be processed.
If no return policy covers the address on the draft return, the response is a 422
with errors[0].code set to returns-unavailable-for-order. The draft return stays
open. Do not retry the submit; ask the shopper for a different address or stop the return.
curl --request POST \
--url https://api.loopreturns.com/api/v1/draft-returns/{draft_return_id}/submit \
--header 'X-Authorization: <api-key>'import requests
url = "https://api.loopreturns.com/api/v1/draft-returns/{draft_return_id}/submit"
headers = {"X-Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-Authorization': '<api-key>'}};
fetch('https://api.loopreturns.com/api/v1/draft-returns/{draft_return_id}/submit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.loopreturns.com/api/v1/draft-returns/{draft_return_id}/submit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.loopreturns.com/api/v1/draft-returns/{draft_return_id}/submit"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.loopreturns.com/api/v1/draft-returns/{draft_return_id}/submit")
.header("X-Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loopreturns.com/api/v1/draft-returns/{draft_return_id}/submit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"_links": {
"self": {
"href": "<string>"
}
},
"_templates": {},
"client_application": {},
"draft_return": {
"id": 12345,
"return_id": 67890,
"state": "created",
"currency": "USD",
"language": "en",
"credit_type": null,
"processing_type": "regular",
"customer": {
"email": "someone@test.com"
},
"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",
"return_reason": {
"name": "Item didn't fit",
"comment": null
},
"user_inputs": [
{
"id": 1,
"type": "yes-no",
"prompt": "Is the item still in its original packaging?",
"value": true
}
],
"image_uploads": [
"https://cdn.example.com/return-images/abc123.jpg"
]
}
],
"cart_items": [
{
"id": 201,
"variant_id": 501,
"product_id": 100,
"sku": "SHIRT-RED-S",
"title": "Red Shirt",
"variant_title": "Small",
"price": 2500,
"image": "https://cdn.example.com/products/red-shirt.jpg",
"exchange_type": "exchange",
"exchange_for_returning_item_id": 1
}
],
"selected_return_method": {
"id": 123,
"name": "<string>",
"type": "box-and-ship",
"title": "<string>",
"logo_url": "<string>",
"location_url": "<string>"
},
"payment_intent": {
"id": 123,
"provider": "<string>",
"provider_intent_id": "<string>"
},
"return_key": "<string>",
"requires_uncollectible_payment": false
},
"context": {
"languages": [
{
"name": "<string>",
"abbreviation": "<string>"
}
],
"order": {
"id": 123,
"currency": "<string>",
"original_payment_transactions": [
{
"type": "<string>",
"gateway": "<string>",
"amount": 123,
"currency": "<string>",
"brand": "<string>",
"last4": 123
}
],
"line_items": [
{
"id": 123,
"provider_product_id": 123,
"provider_variant_id": 123,
"title": "<string>",
"variant_title": "<string>",
"sku": "<string>",
"description": "<string>",
"price": 123,
"image": "<string>",
"parent_line_item_id": 123,
"options": [
{
"name": "<string>",
"value": "<string>"
}
]
}
]
},
"return_reason_groups": [
{
"id": 123,
"return_reasons": [
{
"id": 123,
"name": "<string>",
"parent_return_reason_id": 123,
"parent_return_reason_name": "<string>",
"is_commentable": true,
"requires_comments": true
}
]
}
],
"items_eligible_to_return": [
{
"order_line_item_id": 123,
"return_reason_group_id": 123,
"expiration": "<string>"
}
],
"items_not_eligible_to_return": [
{
"order_line_item_id": 123,
"ineligibility_code": "<string>",
"expiration": "<string>"
}
],
"return_reason_options": [
[
{
"id": 123,
"name": "<string>",
"is_commentable": true,
"requires_comments": true
}
]
],
"exchange_options": [
{
"product_options": [
{
"name": "<string>",
"values": "<array>",
"position": 123
}
],
"product_variants": [
{
"product_id": 123,
"variant_id": 123,
"title": "<string>",
"variant_title": "<string>",
"product_type": "<string>",
"options": {},
"image": "<string>",
"price": 123,
"currency": "<string>",
"is_available": true
}
]
}
],
"return_method_options": [
{
"id": 123,
"name": "<string>",
"type": "box-and-ship",
"fee": 123,
"title": "<string>",
"logo_url": "<string>",
"location_url": "<string>"
}
],
"processing_type_options": {
"required": false,
"options": [
{
"type": "regular",
"available": true,
"unavailability_reason": "not-enabled",
"authorization_amount": {
"amount": 5000,
"currency_code": "USD"
},
"charge_amount": {
"amount": 5000,
"currency_code": "USD"
},
"window_days": 14,
"hold_window_days": null
}
]
}
},
"errors": [
{
"code": "draft-returns-not-enabled",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "unauthorized",
"message": "Unauthorized."
}
]
}{
"errors": [
{
"code": "validation-failed",
"message": "Validation failed."
}
]
}Authorizations
Headers
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.
Optional. Responses use Content-Type: application/prs.hal-forms+json.
application/prs.hal-forms+json Path Parameters
The unique identifier of the draft return.
Response
Successful response with draft return data.
The response uses Content-Type: application/prs.hal-forms+json and includes hypermedia
controls in _links and _templates instead of the standard links array.
HAL _links object. Always includes self. Other keys are relation names
corresponding to available actions for the current draft return state.
Show child attributes
Show child attributes
_templates object. Each key is a template/action name matching a
relation in _links. Templates describe the method, fields, and constraints
for the action.
Show child attributes
Show child attributes
Client-application header specification. Describes how the client should identify itself in subsequent requests.
The draft return object.
Show child attributes
Show child attributes
Contextual data for building the return UI. Keys are omitted when their value is null.
Show child attributes
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
Show child attributes