curl --request POST \
--url https://api.loopreturns.com/api/v1/warehouse/return/{id}/remove \
--header 'X-Authorization: <api-key>'import requests
url = "https://api.loopreturns.com/api/v1/warehouse/return/{id}/remove"
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/warehouse/return/{id}/remove', 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/warehouse/return/{id}/remove",
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/warehouse/return/{id}/remove"
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/warehouse/return/{id}/remove")
.header("X-Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loopreturns.com/api/v1/warehouse/return/{id}/remove")
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_bodytrue{
"errors": "Unauthorized."
}{
"errors": [
{
"message": "No return found with this ID."
}
]
}{
"message": "The line item id field is required.",
"errors": {
"line_item_id": [
"The line item id field is required."
]
}
}{
"data": {
"line_item_id": "123456789"
},
"errors": {
"message": "Return cannot be modified."
}
}Remove Line Items
Remove one or more line items from an open return.
Only returns whose outcome is entirely a refund or entirely store credit can be modified. Exchanges and mixed outcomes cannot.
Removing items reduces the return total and its refund or gift card value.
What happens to the return afterwards
If the request removes every remaining item, the return is cancelled rather than processed, freeing the items for a new return. This is checked first, so it applies at any item count, whatever the outcome.
Otherwise:
- Refund outcome: the return is processed and closed and the remaining items refunded, without a
separate call to Process Return. A later
call for the same return responds with a
422. - Store credit outcome: the return stays open and further items can be removed. Reshop instant refunds count as a refund outcome and close the return.
On a refund return, pass every line item ID in a single comma separated request. Removing them one at a time fails: the first request closes the return.
Required API key scope
- Returns
curl --request POST \
--url https://api.loopreturns.com/api/v1/warehouse/return/{id}/remove \
--header 'X-Authorization: <api-key>'import requests
url = "https://api.loopreturns.com/api/v1/warehouse/return/{id}/remove"
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/warehouse/return/{id}/remove', 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/warehouse/return/{id}/remove",
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/warehouse/return/{id}/remove"
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/warehouse/return/{id}/remove")
.header("X-Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loopreturns.com/api/v1/warehouse/return/{id}/remove")
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_bodytrue{
"errors": "Unauthorized."
}{
"errors": [
{
"message": "No return found with this ID."
}
]
}{
"message": "The line item id field is required.",
"errors": {
"line_item_id": [
"The line item id field is required."
]
}
}{
"data": {
"line_item_id": "123456789"
},
"errors": {
"message": "Return cannot be modified."
}
}Common error responses
Each of these responds with a422.
Return not modifiable. The return is already closed or cancelled, or it has an exchange. This is
also what a second removal request returns, once the first one has closed a refund return.
{
"data": { "line_item_id": "1234567" },
"errors": { "message": "Return cannot be modified." }
}
{
"data": { "line_item_id": "1234567,7654321" },
"errors": {
"message": "Not all line items qualify for removal - Received: 1234567, 7654321 - Qualifying: 7654321"
}
}
line_item_id.
{
"message": "The line item id field is required.",
"errors": { "line_item_id": ["The line item id field is required."] }
}
Authorizations
Path Parameters
The unique identifier associated with the return.
Query Parameters
The line_item_id of an item on the return, as listed in the return's line_items array. To
remove more than one, pass them as comma separated values.
Response
Success
The value returned when the return action succeeds.
true