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": 2,
"ReturnReasonId": 123,
"ReturnReasonComment": "too small",
"SalesOrderLineItemId": 123,
"DeliveryNoteLineItemId": 123
}
],
"ReturnDate": "2023-02-01T12:45:00.0000000+00:00",
"ExternalNumber": "EX-12345",
"ExternalComment": "a replacement is needed",
"InternalComment": "handle with care",
"Contact": "Mr. Robinson",
"Packages": [
{
"TrackingID": "JJD0099999999",
"ShippingMethodId": 123,
"ShippingMethodCustom": "DHL"
}
]
}
'import requests
url = "https://api.jtl-cloud.com/erp/returns"
payload = {
"CompanyId": 123,
"SalesOrderId": 123,
"WarehouseId": 123,
"Items": [
{
"Quantity": 2,
"ReturnReasonId": 123,
"ReturnReasonComment": "too small",
"SalesOrderLineItemId": 123,
"DeliveryNoteLineItemId": 123
}
],
"ReturnDate": "2023-02-01T12:45:00.0000000+00:00",
"ExternalNumber": "EX-12345",
"ExternalComment": "a replacement is needed",
"InternalComment": "handle with care",
"Contact": "Mr. Robinson",
"Packages": [
{
"TrackingID": "JJD0099999999",
"ShippingMethodId": 123,
"ShippingMethodCustom": "DHL"
}
]
}
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: 2,
ReturnReasonId: 123,
ReturnReasonComment: 'too small',
SalesOrderLineItemId: 123,
DeliveryNoteLineItemId: 123
}
],
ReturnDate: '2023-02-01T12:45:00.0000000+00:00',
ExternalNumber: 'EX-12345',
ExternalComment: 'a replacement is needed',
InternalComment: 'handle with care',
Contact: 'Mr. Robinson',
Packages: [
{
TrackingID: 'JJD0099999999',
ShippingMethodId: 123,
ShippingMethodCustom: 'DHL'
}
]
})
};
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' => 2,
'ReturnReasonId' => 123,
'ReturnReasonComment' => 'too small',
'SalesOrderLineItemId' => 123,
'DeliveryNoteLineItemId' => 123
]
],
'ReturnDate' => '2023-02-01T12:45:00.0000000+00:00',
'ExternalNumber' => 'EX-12345',
'ExternalComment' => 'a replacement is needed',
'InternalComment' => 'handle with care',
'Contact' => 'Mr. Robinson',
'Packages' => [
[
'TrackingID' => 'JJD0099999999',
'ShippingMethodId' => 123,
'ShippingMethodCustom' => 'DHL'
]
]
]),
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\": 2,\n \"ReturnReasonId\": 123,\n \"ReturnReasonComment\": \"too small\",\n \"SalesOrderLineItemId\": 123,\n \"DeliveryNoteLineItemId\": 123\n }\n ],\n \"ReturnDate\": \"2023-02-01T12:45:00.0000000+00:00\",\n \"ExternalNumber\": \"EX-12345\",\n \"ExternalComment\": \"a replacement is needed\",\n \"InternalComment\": \"handle with care\",\n \"Contact\": \"Mr. Robinson\",\n \"Packages\": [\n {\n \"TrackingID\": \"JJD0099999999\",\n \"ShippingMethodId\": 123,\n \"ShippingMethodCustom\": \"DHL\"\n }\n ]\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\": 2,\n \"ReturnReasonId\": 123,\n \"ReturnReasonComment\": \"too small\",\n \"SalesOrderLineItemId\": 123,\n \"DeliveryNoteLineItemId\": 123\n }\n ],\n \"ReturnDate\": \"2023-02-01T12:45:00.0000000+00:00\",\n \"ExternalNumber\": \"EX-12345\",\n \"ExternalComment\": \"a replacement is needed\",\n \"InternalComment\": \"handle with care\",\n \"Contact\": \"Mr. Robinson\",\n \"Packages\": [\n {\n \"TrackingID\": \"JJD0099999999\",\n \"ShippingMethodId\": 123,\n \"ShippingMethodCustom\": \"DHL\"\n }\n ]\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\": 2,\n \"ReturnReasonId\": 123,\n \"ReturnReasonComment\": \"too small\",\n \"SalesOrderLineItemId\": 123,\n \"DeliveryNoteLineItemId\": 123\n }\n ],\n \"ReturnDate\": \"2023-02-01T12:45:00.0000000+00:00\",\n \"ExternalNumber\": \"EX-12345\",\n \"ExternalComment\": \"a replacement is needed\",\n \"InternalComment\": \"handle with care\",\n \"Contact\": \"Mr. Robinson\",\n \"Packages\": [\n {\n \"TrackingID\": \"JJD0099999999\",\n \"ShippingMethodId\": 123,\n \"ShippingMethodCustom\": \"DHL\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"Id": 123,
"Number": "A1004465",
"ReturnDate": "2023-02-01T12:45:00.0000000+00:00",
"CustomerId": 123,
"ExternalNumber": "EX-12345",
"CompanyId": 123,
"SalesOrderId": 123,
"StateId": 123,
"WarehouseId": 123,
"ExternalComment": "a replacement is needed",
"InternalComment": "handle with care",
"Contact": "Mr. Robinson"
}{
"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": 2,
"ReturnReasonId": 123,
"ReturnReasonComment": "too small",
"SalesOrderLineItemId": 123,
"DeliveryNoteLineItemId": 123
}
],
"ReturnDate": "2023-02-01T12:45:00.0000000+00:00",
"ExternalNumber": "EX-12345",
"ExternalComment": "a replacement is needed",
"InternalComment": "handle with care",
"Contact": "Mr. Robinson",
"Packages": [
{
"TrackingID": "JJD0099999999",
"ShippingMethodId": 123,
"ShippingMethodCustom": "DHL"
}
]
}
'import requests
url = "https://api.jtl-cloud.com/erp/returns"
payload = {
"CompanyId": 123,
"SalesOrderId": 123,
"WarehouseId": 123,
"Items": [
{
"Quantity": 2,
"ReturnReasonId": 123,
"ReturnReasonComment": "too small",
"SalesOrderLineItemId": 123,
"DeliveryNoteLineItemId": 123
}
],
"ReturnDate": "2023-02-01T12:45:00.0000000+00:00",
"ExternalNumber": "EX-12345",
"ExternalComment": "a replacement is needed",
"InternalComment": "handle with care",
"Contact": "Mr. Robinson",
"Packages": [
{
"TrackingID": "JJD0099999999",
"ShippingMethodId": 123,
"ShippingMethodCustom": "DHL"
}
]
}
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: 2,
ReturnReasonId: 123,
ReturnReasonComment: 'too small',
SalesOrderLineItemId: 123,
DeliveryNoteLineItemId: 123
}
],
ReturnDate: '2023-02-01T12:45:00.0000000+00:00',
ExternalNumber: 'EX-12345',
ExternalComment: 'a replacement is needed',
InternalComment: 'handle with care',
Contact: 'Mr. Robinson',
Packages: [
{
TrackingID: 'JJD0099999999',
ShippingMethodId: 123,
ShippingMethodCustom: 'DHL'
}
]
})
};
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' => 2,
'ReturnReasonId' => 123,
'ReturnReasonComment' => 'too small',
'SalesOrderLineItemId' => 123,
'DeliveryNoteLineItemId' => 123
]
],
'ReturnDate' => '2023-02-01T12:45:00.0000000+00:00',
'ExternalNumber' => 'EX-12345',
'ExternalComment' => 'a replacement is needed',
'InternalComment' => 'handle with care',
'Contact' => 'Mr. Robinson',
'Packages' => [
[
'TrackingID' => 'JJD0099999999',
'ShippingMethodId' => 123,
'ShippingMethodCustom' => 'DHL'
]
]
]),
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\": 2,\n \"ReturnReasonId\": 123,\n \"ReturnReasonComment\": \"too small\",\n \"SalesOrderLineItemId\": 123,\n \"DeliveryNoteLineItemId\": 123\n }\n ],\n \"ReturnDate\": \"2023-02-01T12:45:00.0000000+00:00\",\n \"ExternalNumber\": \"EX-12345\",\n \"ExternalComment\": \"a replacement is needed\",\n \"InternalComment\": \"handle with care\",\n \"Contact\": \"Mr. Robinson\",\n \"Packages\": [\n {\n \"TrackingID\": \"JJD0099999999\",\n \"ShippingMethodId\": 123,\n \"ShippingMethodCustom\": \"DHL\"\n }\n ]\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\": 2,\n \"ReturnReasonId\": 123,\n \"ReturnReasonComment\": \"too small\",\n \"SalesOrderLineItemId\": 123,\n \"DeliveryNoteLineItemId\": 123\n }\n ],\n \"ReturnDate\": \"2023-02-01T12:45:00.0000000+00:00\",\n \"ExternalNumber\": \"EX-12345\",\n \"ExternalComment\": \"a replacement is needed\",\n \"InternalComment\": \"handle with care\",\n \"Contact\": \"Mr. Robinson\",\n \"Packages\": [\n {\n \"TrackingID\": \"JJD0099999999\",\n \"ShippingMethodId\": 123,\n \"ShippingMethodCustom\": \"DHL\"\n }\n ]\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\": 2,\n \"ReturnReasonId\": 123,\n \"ReturnReasonComment\": \"too small\",\n \"SalesOrderLineItemId\": 123,\n \"DeliveryNoteLineItemId\": 123\n }\n ],\n \"ReturnDate\": \"2023-02-01T12:45:00.0000000+00:00\",\n \"ExternalNumber\": \"EX-12345\",\n \"ExternalComment\": \"a replacement is needed\",\n \"InternalComment\": \"handle with care\",\n \"Contact\": \"Mr. Robinson\",\n \"Packages\": [\n {\n \"TrackingID\": \"JJD0099999999\",\n \"ShippingMethodId\": 123,\n \"ShippingMethodCustom\": \"DHL\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"Id": 123,
"Number": "A1004465",
"ReturnDate": "2023-02-01T12:45:00.0000000+00:00",
"CustomerId": 123,
"ExternalNumber": "EX-12345",
"CompanyId": 123,
"SalesOrderId": 123,
"StateId": 123,
"WarehouseId": 123,
"ExternalComment": "a replacement is needed",
"InternalComment": "handle with care",
"Contact": "Mr. Robinson"
}{
"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 User-Id (int or uuid) on whose behalf the request is executed. Requires scope 'Application.RunAs'.
The tenant ID for the target ERP instance.
Body
The details of the return to create.
Model Class: CreateReturn
List of items included in the return.
Show child attributes
Show child attributes
"2023-02-01T12:45:00.0000000+00:00"
"EX-12345"
"a replacement is needed"
"handle with care"
"Mr. Robinson"
Show child attributes
Show child attributes
Response
The created return.
Model Class: Return
The number of the return.
"A1004465"
The date when the return was created.
"2023-02-01T12:45:00.0000000+00:00"
An arbitrary external reference number for identifying the return, provided only during creation and cannot be changed afterward.
"EX-12345"
0 = None, 1 = Email, 2 = Manual, 3 = Phone, 4 = Fax, 5 = FFN, 6 = SCX, 7 = RestAPI
0, 1, 2, 3, 4, 5, 6, 7 The external comment of the sales order.
"a replacement is needed"
The internal comment of the sales order.
"handle with care"
The contact of the return.
"Mr. Robinson"
Was this page helpful?