curl --request POST \
--url https://{defaultHost}/v1/return_requests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"return_request": {
"order": "213066ed-6936-4dab-9f12-a581ffdcc375",
"return_items": [
{
"line_item": "c9857aaa-8412-40f9-931c-f0e1d8bfe33f",
"quantity": 1,
"return_reason_id": "wrong_item"
}
]
}
}
'import requests
url = "https://{defaultHost}/v1/return_requests"
payload = { "return_request": {
"order": "213066ed-6936-4dab-9f12-a581ffdcc375",
"return_items": [
{
"line_item": "c9857aaa-8412-40f9-931c-f0e1d8bfe33f",
"quantity": 1,
"return_reason_id": "wrong_item"
}
]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
return_request: {
order: '213066ed-6936-4dab-9f12-a581ffdcc375',
return_items: [
{
line_item: 'c9857aaa-8412-40f9-931c-f0e1d8bfe33f',
quantity: 1,
return_reason_id: 'wrong_item'
}
]
}
})
};
fetch('https://{defaultHost}/v1/return_requests', 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://{defaultHost}/v1/return_requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'return_request' => [
'order' => '213066ed-6936-4dab-9f12-a581ffdcc375',
'return_items' => [
[
'line_item' => 'c9857aaa-8412-40f9-931c-f0e1d8bfe33f',
'quantity' => 1,
'return_reason_id' => 'wrong_item'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/v1/return_requests"
payload := strings.NewReader("{\n \"return_request\": {\n \"order\": \"213066ed-6936-4dab-9f12-a581ffdcc375\",\n \"return_items\": [\n {\n \"line_item\": \"c9857aaa-8412-40f9-931c-f0e1d8bfe33f\",\n \"quantity\": 1,\n \"return_reason_id\": \"wrong_item\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{defaultHost}/v1/return_requests")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"return_request\": {\n \"order\": \"213066ed-6936-4dab-9f12-a581ffdcc375\",\n \"return_items\": [\n {\n \"line_item\": \"c9857aaa-8412-40f9-931c-f0e1d8bfe33f\",\n \"quantity\": 1,\n \"return_reason_id\": \"wrong_item\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/return_requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"return_request\": {\n \"order\": \"213066ed-6936-4dab-9f12-a581ffdcc375\",\n \"return_items\": [\n {\n \"line_item\": \"c9857aaa-8412-40f9-931c-f0e1d8bfe33f\",\n \"quantity\": 1,\n \"return_reason_id\": \"wrong_item\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "e3b70852-0b80-4798-9355-1cbacf4ee885",
"object": "return_request",
"number": "0000-R1",
"status": "open",
"order": "213066ed-6936-4dab-9f12-a581ffdcc375",
"created_at": 1782485892,
"updated_at": 1782485892
}Create
Creates a new return request.
curl --request POST \
--url https://{defaultHost}/v1/return_requests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"return_request": {
"order": "213066ed-6936-4dab-9f12-a581ffdcc375",
"return_items": [
{
"line_item": "c9857aaa-8412-40f9-931c-f0e1d8bfe33f",
"quantity": 1,
"return_reason_id": "wrong_item"
}
]
}
}
'import requests
url = "https://{defaultHost}/v1/return_requests"
payload = { "return_request": {
"order": "213066ed-6936-4dab-9f12-a581ffdcc375",
"return_items": [
{
"line_item": "c9857aaa-8412-40f9-931c-f0e1d8bfe33f",
"quantity": 1,
"return_reason_id": "wrong_item"
}
]
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
return_request: {
order: '213066ed-6936-4dab-9f12-a581ffdcc375',
return_items: [
{
line_item: 'c9857aaa-8412-40f9-931c-f0e1d8bfe33f',
quantity: 1,
return_reason_id: 'wrong_item'
}
]
}
})
};
fetch('https://{defaultHost}/v1/return_requests', 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://{defaultHost}/v1/return_requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'return_request' => [
'order' => '213066ed-6936-4dab-9f12-a581ffdcc375',
'return_items' => [
[
'line_item' => 'c9857aaa-8412-40f9-931c-f0e1d8bfe33f',
'quantity' => 1,
'return_reason_id' => 'wrong_item'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/v1/return_requests"
payload := strings.NewReader("{\n \"return_request\": {\n \"order\": \"213066ed-6936-4dab-9f12-a581ffdcc375\",\n \"return_items\": [\n {\n \"line_item\": \"c9857aaa-8412-40f9-931c-f0e1d8bfe33f\",\n \"quantity\": 1,\n \"return_reason_id\": \"wrong_item\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{defaultHost}/v1/return_requests")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"return_request\": {\n \"order\": \"213066ed-6936-4dab-9f12-a581ffdcc375\",\n \"return_items\": [\n {\n \"line_item\": \"c9857aaa-8412-40f9-931c-f0e1d8bfe33f\",\n \"quantity\": 1,\n \"return_reason_id\": \"wrong_item\"\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/return_requests")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"return_request\": {\n \"order\": \"213066ed-6936-4dab-9f12-a581ffdcc375\",\n \"return_items\": [\n {\n \"line_item\": \"c9857aaa-8412-40f9-931c-f0e1d8bfe33f\",\n \"quantity\": 1,\n \"return_reason_id\": \"wrong_item\"\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "e3b70852-0b80-4798-9355-1cbacf4ee885",
"object": "return_request",
"number": "0000-R1",
"status": "open",
"order": "213066ed-6936-4dab-9f12-a581ffdcc375",
"created_at": 1782485892,
"updated_at": 1782485892
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Show child attributes
Show child attributes
Response
Success
The UUID of the specific object.
A string describing the object type returned.
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
The unique identifier for this return request that is auto generated based on this account's order protocol.
Expandable – The associated order ID.
Expandable – Property not returned unless expanded.
The current status of this return request – either open or complete.
Time at which the object was created. Measured in seconds since the Unix epoch.
Time at which the object was last updated. Measured in seconds since the Unix epoch.
Was this page helpful?