curl --request POST \
--url https://api.jtl-cloud.com/erp/returns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"CompanyId": 123,
"SalesOrderId": 123,
"WarehouseId": 123,
"Items": [
{
"Quantity": 1073741823.5000005,
"ReturnReasonId": 123,
"ReturnReasonComment": "<string>",
"Credit": true,
"SalesOrderLineItemId": 123,
"DeliveryNoteLineItemId": 123
}
],
"ReturnDate": "2023-11-07T05:31:56Z",
"ExternalNumber": "<string>",
"ExternalComment": "<string>",
"InternalComment": "<string>",
"Contact": "<string>",
"Packages": [
{
"TrackingID": "<string>",
"ShippingMethodId": 123,
"ShippingMethodCustom": "<string>"
}
],
"TransmitToSalesChannel": true
}
'import requests
url = "https://api.jtl-cloud.com/erp/returns"
payload = {
"CompanyId": 123,
"SalesOrderId": 123,
"WarehouseId": 123,
"Items": [
{
"Quantity": 1073741823.5000005,
"ReturnReasonId": 123,
"ReturnReasonComment": "<string>",
"Credit": True,
"SalesOrderLineItemId": 123,
"DeliveryNoteLineItemId": 123
}
],
"ReturnDate": "2023-11-07T05:31:56Z",
"ExternalNumber": "<string>",
"ExternalComment": "<string>",
"InternalComment": "<string>",
"Contact": "<string>",
"Packages": [
{
"TrackingID": "<string>",
"ShippingMethodId": 123,
"ShippingMethodCustom": "<string>"
}
],
"TransmitToSalesChannel": True
}
headers = {
"x-tenant-id": "<x-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-tenant-id': '<x-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
CompanyId: 123,
SalesOrderId: 123,
WarehouseId: 123,
Items: [
{
Quantity: 1073741823.5000005,
ReturnReasonId: 123,
ReturnReasonComment: '<string>',
Credit: true,
SalesOrderLineItemId: 123,
DeliveryNoteLineItemId: 123
}
],
ReturnDate: '2023-11-07T05:31:56Z',
ExternalNumber: '<string>',
ExternalComment: '<string>',
InternalComment: '<string>',
Contact: '<string>',
Packages: [
{
TrackingID: '<string>',
ShippingMethodId: 123,
ShippingMethodCustom: '<string>'
}
],
TransmitToSalesChannel: true
})
};
fetch('https://api.jtl-cloud.com/erp/returns', 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.jtl-cloud.com/erp/returns",
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([
'CompanyId' => 123,
'SalesOrderId' => 123,
'WarehouseId' => 123,
'Items' => [
[
'Quantity' => 1073741823.5000005,
'ReturnReasonId' => 123,
'ReturnReasonComment' => '<string>',
'Credit' => true,
'SalesOrderLineItemId' => 123,
'DeliveryNoteLineItemId' => 123
]
],
'ReturnDate' => '2023-11-07T05:31:56Z',
'ExternalNumber' => '<string>',
'ExternalComment' => '<string>',
'InternalComment' => '<string>',
'Contact' => '<string>',
'Packages' => [
[
'TrackingID' => '<string>',
'ShippingMethodId' => 123,
'ShippingMethodCustom' => '<string>'
]
],
'TransmitToSalesChannel' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-tenant-id: <x-tenant-id>"
],
]);
$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://api.jtl-cloud.com/erp/returns"
payload := strings.NewReader("{\n \"CompanyId\": 123,\n \"SalesOrderId\": 123,\n \"WarehouseId\": 123,\n \"Items\": [\n {\n \"Quantity\": 1073741823.5000005,\n \"ReturnReasonId\": 123,\n \"ReturnReasonComment\": \"<string>\",\n \"Credit\": true,\n \"SalesOrderLineItemId\": 123,\n \"DeliveryNoteLineItemId\": 123\n }\n ],\n \"ReturnDate\": \"2023-11-07T05:31:56Z\",\n \"ExternalNumber\": \"<string>\",\n \"ExternalComment\": \"<string>\",\n \"InternalComment\": \"<string>\",\n \"Contact\": \"<string>\",\n \"Packages\": [\n {\n \"TrackingID\": \"<string>\",\n \"ShippingMethodId\": 123,\n \"ShippingMethodCustom\": \"<string>\"\n }\n ],\n \"TransmitToSalesChannel\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-tenant-id", "<x-tenant-id>")
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://api.jtl-cloud.com/erp/returns")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"CompanyId\": 123,\n \"SalesOrderId\": 123,\n \"WarehouseId\": 123,\n \"Items\": [\n {\n \"Quantity\": 1073741823.5000005,\n \"ReturnReasonId\": 123,\n \"ReturnReasonComment\": \"<string>\",\n \"Credit\": true,\n \"SalesOrderLineItemId\": 123,\n \"DeliveryNoteLineItemId\": 123\n }\n ],\n \"ReturnDate\": \"2023-11-07T05:31:56Z\",\n \"ExternalNumber\": \"<string>\",\n \"ExternalComment\": \"<string>\",\n \"InternalComment\": \"<string>\",\n \"Contact\": \"<string>\",\n \"Packages\": [\n {\n \"TrackingID\": \"<string>\",\n \"ShippingMethodId\": 123,\n \"ShippingMethodCustom\": \"<string>\"\n }\n ],\n \"TransmitToSalesChannel\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jtl-cloud.com/erp/returns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-tenant-id"] = '<x-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"CompanyId\": 123,\n \"SalesOrderId\": 123,\n \"WarehouseId\": 123,\n \"Items\": [\n {\n \"Quantity\": 1073741823.5000005,\n \"ReturnReasonId\": 123,\n \"ReturnReasonComment\": \"<string>\",\n \"Credit\": true,\n \"SalesOrderLineItemId\": 123,\n \"DeliveryNoteLineItemId\": 123\n }\n ],\n \"ReturnDate\": \"2023-11-07T05:31:56Z\",\n \"ExternalNumber\": \"<string>\",\n \"ExternalComment\": \"<string>\",\n \"InternalComment\": \"<string>\",\n \"Contact\": \"<string>\",\n \"Packages\": [\n {\n \"TrackingID\": \"<string>\",\n \"ShippingMethodId\": 123,\n \"ShippingMethodCustom\": \"<string>\"\n }\n ],\n \"TransmitToSalesChannel\": true\n}"
response = http.request(request)
puts response.read_body{
"Id": 123,
"Number": "<string>",
"ReturnDate": "2023-11-07T05:31:56Z",
"CustomerId": 123,
"ExternalNumber": "<string>",
"CompanyId": 123,
"SalesOrderId": 123,
"StateId": 123,
"WarehouseId": 123,
"ExternalComment": "<string>",
"InternalComment": "<string>",
"Contact": "<string>",
"TransmitToSalesChannel": true
}{
"ErrorCode": "<string>",
"ValidationErrors": {},
"Errors": {},
"ErrorMessage": "<string>",
"Stacktrace": "<string>"
}{
"ErrorCode": "<string>",
"ValidationErrors": {},
"Errors": {},
"ErrorMessage": "<string>",
"Stacktrace": "<string>"
}Create Return
Create a new return with associated items and packages.
curl --request POST \
--url https://api.jtl-cloud.com/erp/returns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"CompanyId": 123,
"SalesOrderId": 123,
"WarehouseId": 123,
"Items": [
{
"Quantity": 1073741823.5000005,
"ReturnReasonId": 123,
"ReturnReasonComment": "<string>",
"Credit": true,
"SalesOrderLineItemId": 123,
"DeliveryNoteLineItemId": 123
}
],
"ReturnDate": "2023-11-07T05:31:56Z",
"ExternalNumber": "<string>",
"ExternalComment": "<string>",
"InternalComment": "<string>",
"Contact": "<string>",
"Packages": [
{
"TrackingID": "<string>",
"ShippingMethodId": 123,
"ShippingMethodCustom": "<string>"
}
],
"TransmitToSalesChannel": true
}
'import requests
url = "https://api.jtl-cloud.com/erp/returns"
payload = {
"CompanyId": 123,
"SalesOrderId": 123,
"WarehouseId": 123,
"Items": [
{
"Quantity": 1073741823.5000005,
"ReturnReasonId": 123,
"ReturnReasonComment": "<string>",
"Credit": True,
"SalesOrderLineItemId": 123,
"DeliveryNoteLineItemId": 123
}
],
"ReturnDate": "2023-11-07T05:31:56Z",
"ExternalNumber": "<string>",
"ExternalComment": "<string>",
"InternalComment": "<string>",
"Contact": "<string>",
"Packages": [
{
"TrackingID": "<string>",
"ShippingMethodId": 123,
"ShippingMethodCustom": "<string>"
}
],
"TransmitToSalesChannel": True
}
headers = {
"x-tenant-id": "<x-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-tenant-id': '<x-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
CompanyId: 123,
SalesOrderId: 123,
WarehouseId: 123,
Items: [
{
Quantity: 1073741823.5000005,
ReturnReasonId: 123,
ReturnReasonComment: '<string>',
Credit: true,
SalesOrderLineItemId: 123,
DeliveryNoteLineItemId: 123
}
],
ReturnDate: '2023-11-07T05:31:56Z',
ExternalNumber: '<string>',
ExternalComment: '<string>',
InternalComment: '<string>',
Contact: '<string>',
Packages: [
{
TrackingID: '<string>',
ShippingMethodId: 123,
ShippingMethodCustom: '<string>'
}
],
TransmitToSalesChannel: true
})
};
fetch('https://api.jtl-cloud.com/erp/returns', 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.jtl-cloud.com/erp/returns",
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([
'CompanyId' => 123,
'SalesOrderId' => 123,
'WarehouseId' => 123,
'Items' => [
[
'Quantity' => 1073741823.5000005,
'ReturnReasonId' => 123,
'ReturnReasonComment' => '<string>',
'Credit' => true,
'SalesOrderLineItemId' => 123,
'DeliveryNoteLineItemId' => 123
]
],
'ReturnDate' => '2023-11-07T05:31:56Z',
'ExternalNumber' => '<string>',
'ExternalComment' => '<string>',
'InternalComment' => '<string>',
'Contact' => '<string>',
'Packages' => [
[
'TrackingID' => '<string>',
'ShippingMethodId' => 123,
'ShippingMethodCustom' => '<string>'
]
],
'TransmitToSalesChannel' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-tenant-id: <x-tenant-id>"
],
]);
$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://api.jtl-cloud.com/erp/returns"
payload := strings.NewReader("{\n \"CompanyId\": 123,\n \"SalesOrderId\": 123,\n \"WarehouseId\": 123,\n \"Items\": [\n {\n \"Quantity\": 1073741823.5000005,\n \"ReturnReasonId\": 123,\n \"ReturnReasonComment\": \"<string>\",\n \"Credit\": true,\n \"SalesOrderLineItemId\": 123,\n \"DeliveryNoteLineItemId\": 123\n }\n ],\n \"ReturnDate\": \"2023-11-07T05:31:56Z\",\n \"ExternalNumber\": \"<string>\",\n \"ExternalComment\": \"<string>\",\n \"InternalComment\": \"<string>\",\n \"Contact\": \"<string>\",\n \"Packages\": [\n {\n \"TrackingID\": \"<string>\",\n \"ShippingMethodId\": 123,\n \"ShippingMethodCustom\": \"<string>\"\n }\n ],\n \"TransmitToSalesChannel\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-tenant-id", "<x-tenant-id>")
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://api.jtl-cloud.com/erp/returns")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"CompanyId\": 123,\n \"SalesOrderId\": 123,\n \"WarehouseId\": 123,\n \"Items\": [\n {\n \"Quantity\": 1073741823.5000005,\n \"ReturnReasonId\": 123,\n \"ReturnReasonComment\": \"<string>\",\n \"Credit\": true,\n \"SalesOrderLineItemId\": 123,\n \"DeliveryNoteLineItemId\": 123\n }\n ],\n \"ReturnDate\": \"2023-11-07T05:31:56Z\",\n \"ExternalNumber\": \"<string>\",\n \"ExternalComment\": \"<string>\",\n \"InternalComment\": \"<string>\",\n \"Contact\": \"<string>\",\n \"Packages\": [\n {\n \"TrackingID\": \"<string>\",\n \"ShippingMethodId\": 123,\n \"ShippingMethodCustom\": \"<string>\"\n }\n ],\n \"TransmitToSalesChannel\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jtl-cloud.com/erp/returns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-tenant-id"] = '<x-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"CompanyId\": 123,\n \"SalesOrderId\": 123,\n \"WarehouseId\": 123,\n \"Items\": [\n {\n \"Quantity\": 1073741823.5000005,\n \"ReturnReasonId\": 123,\n \"ReturnReasonComment\": \"<string>\",\n \"Credit\": true,\n \"SalesOrderLineItemId\": 123,\n \"DeliveryNoteLineItemId\": 123\n }\n ],\n \"ReturnDate\": \"2023-11-07T05:31:56Z\",\n \"ExternalNumber\": \"<string>\",\n \"ExternalComment\": \"<string>\",\n \"InternalComment\": \"<string>\",\n \"Contact\": \"<string>\",\n \"Packages\": [\n {\n \"TrackingID\": \"<string>\",\n \"ShippingMethodId\": 123,\n \"ShippingMethodCustom\": \"<string>\"\n }\n ],\n \"TransmitToSalesChannel\": true\n}"
response = http.request(request)
puts response.read_body{
"Id": 123,
"Number": "<string>",
"ReturnDate": "2023-11-07T05:31:56Z",
"CustomerId": 123,
"ExternalNumber": "<string>",
"CompanyId": 123,
"SalesOrderId": 123,
"StateId": 123,
"WarehouseId": 123,
"ExternalComment": "<string>",
"InternalComment": "<string>",
"Contact": "<string>",
"TransmitToSalesChannel": true
}{
"ErrorCode": "<string>",
"ValidationErrors": {},
"Errors": {},
"ErrorMessage": "<string>",
"Stacktrace": "<string>"
}{
"ErrorCode": "<string>",
"ValidationErrors": {},
"Errors": {},
"ErrorMessage": "<string>",
"Stacktrace": "<string>"
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Headers
The Company-Id (int or uuid) of the company on whose behalf the request is executed.
The tenant ID for the target ERP instance.
Body
The details of the return to create.
Model Class: CreateReturn
The company of the corresponding sales order.
The id of the sales order if the return has exactly on corresponding sales order.
Id of the Warehouse.
List of items included in the return.
Show child attributes
Show child attributes
The date when the return was created.
An arbitrary external reference number for identifying the return, provided only during creation and cannot be changed afterward.
The external comment of the sales order.
The internal comment of the sales order.
The contact of the return.
List of packages included in the return.
Show child attributes
Show child attributes
Indicates whether the return should be transmitted to the sales channel (e.g. SCX or Amazon).
Response
The created return.
Model Class: Return
Unique ID to identify a return.
The number of the return.
The date when the return was created.
The customer ID.
An arbitrary external reference number for identifying the return, provided only during creation and cannot be changed afterward.
Indicates the origin of the return, specifying where or how the return was initiated.
0, 1, 2, 3, 4, 5, 6, 7 The company of the corresponding sales order.
The id of the sales order if the return has exactly on corresponding sales order.
The id of the return state.
Id of the Warehouse.
The external comment of the sales order.
The internal comment of the sales order.
The contact of the return.
Indicates whether the return should be transmitted to the sales channel (e.g. SCX or Amazon).
Was this page helpful?