curl --request POST \
--url https://api.jtl-cloud.com/erp/salesOrders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"CompanyId": 123,
"CustomerId": 123,
"Number": "A1004465",
"ExternalNumber": "D456-64894-132",
"BillingNumber": "RE-202404-10000",
"DepartureCountry": {
"CountryISO": "DE",
"State": "Berlin",
"CurrencyIso": "EUR",
"CurrencyFactor": 1
},
"CustomerVatID": "DE12345",
"SalesOrderDate": "2023-02-01T12:45:00.0000000+00:00",
"SalesOrderPaymentDetails": {
"PaymentMethodId": 123,
"CurrencyIso": "EUR",
"CurrencyFactor": 1,
"PaymentTarget": 0,
"CashDiscount": 5,
"CashDiscountDays": 2
},
"SalesOrderShippingDetail": {
"ShippingMethodId": 123,
"ShippingPriority": 5,
"ShippingDate": "2023-01-15T13:00:00.0000000+00:00",
"EstimatedDeliveryDate": "2023-01-16T13:00:00.0000000+00:00",
"OnHoldReasonId": 123,
"ExtraWeight": 0.1
},
"ColorcodeId": 123,
"Comment": "an additional order comment",
"CustomerComment": "an additional customer comment",
"LanguageIso": "DE"
}
'import requests
url = "https://api.jtl-cloud.com/erp/salesOrders"
payload = {
"CompanyId": 123,
"CustomerId": 123,
"Number": "A1004465",
"ExternalNumber": "D456-64894-132",
"BillingNumber": "RE-202404-10000",
"DepartureCountry": {
"CountryISO": "DE",
"State": "Berlin",
"CurrencyIso": "EUR",
"CurrencyFactor": 1
},
"CustomerVatID": "DE12345",
"SalesOrderDate": "2023-02-01T12:45:00.0000000+00:00",
"SalesOrderPaymentDetails": {
"PaymentMethodId": 123,
"CurrencyIso": "EUR",
"CurrencyFactor": 1,
"PaymentTarget": 0,
"CashDiscount": 5,
"CashDiscountDays": 2
},
"SalesOrderShippingDetail": {
"ShippingMethodId": 123,
"ShippingPriority": 5,
"ShippingDate": "2023-01-15T13:00:00.0000000+00:00",
"EstimatedDeliveryDate": "2023-01-16T13:00:00.0000000+00:00",
"OnHoldReasonId": 123,
"ExtraWeight": 0.1
},
"ColorcodeId": 123,
"Comment": "an additional order comment",
"CustomerComment": "an additional customer comment",
"LanguageIso": "DE"
}
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,
CustomerId: 123,
Number: 'A1004465',
ExternalNumber: 'D456-64894-132',
BillingNumber: 'RE-202404-10000',
DepartureCountry: {CountryISO: 'DE', State: 'Berlin', CurrencyIso: 'EUR', CurrencyFactor: 1},
CustomerVatID: 'DE12345',
SalesOrderDate: '2023-02-01T12:45:00.0000000+00:00',
SalesOrderPaymentDetails: {
PaymentMethodId: 123,
CurrencyIso: 'EUR',
CurrencyFactor: 1,
PaymentTarget: 0,
CashDiscount: 5,
CashDiscountDays: 2
},
SalesOrderShippingDetail: {
ShippingMethodId: 123,
ShippingPriority: 5,
ShippingDate: '2023-01-15T13:00:00.0000000+00:00',
EstimatedDeliveryDate: '2023-01-16T13:00:00.0000000+00:00',
OnHoldReasonId: 123,
ExtraWeight: 0.1
},
ColorcodeId: 123,
Comment: 'an additional order comment',
CustomerComment: 'an additional customer comment',
LanguageIso: 'DE'
})
};
fetch('https://api.jtl-cloud.com/erp/salesOrders', 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/salesOrders",
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,
'CustomerId' => 123,
'Number' => 'A1004465',
'ExternalNumber' => 'D456-64894-132',
'BillingNumber' => 'RE-202404-10000',
'DepartureCountry' => [
'CountryISO' => 'DE',
'State' => 'Berlin',
'CurrencyIso' => 'EUR',
'CurrencyFactor' => 1
],
'CustomerVatID' => 'DE12345',
'SalesOrderDate' => '2023-02-01T12:45:00.0000000+00:00',
'SalesOrderPaymentDetails' => [
'PaymentMethodId' => 123,
'CurrencyIso' => 'EUR',
'CurrencyFactor' => 1,
'PaymentTarget' => 0,
'CashDiscount' => 5,
'CashDiscountDays' => 2
],
'SalesOrderShippingDetail' => [
'ShippingMethodId' => 123,
'ShippingPriority' => 5,
'ShippingDate' => '2023-01-15T13:00:00.0000000+00:00',
'EstimatedDeliveryDate' => '2023-01-16T13:00:00.0000000+00:00',
'OnHoldReasonId' => 123,
'ExtraWeight' => 0.1
],
'ColorcodeId' => 123,
'Comment' => 'an additional order comment',
'CustomerComment' => 'an additional customer comment',
'LanguageIso' => 'DE'
]),
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/salesOrders"
payload := strings.NewReader("{\n \"CompanyId\": 123,\n \"CustomerId\": 123,\n \"Number\": \"A1004465\",\n \"ExternalNumber\": \"D456-64894-132\",\n \"BillingNumber\": \"RE-202404-10000\",\n \"DepartureCountry\": {\n \"CountryISO\": \"DE\",\n \"State\": \"Berlin\",\n \"CurrencyIso\": \"EUR\",\n \"CurrencyFactor\": 1\n },\n \"CustomerVatID\": \"DE12345\",\n \"SalesOrderDate\": \"2023-02-01T12:45:00.0000000+00:00\",\n \"SalesOrderPaymentDetails\": {\n \"PaymentMethodId\": 123,\n \"CurrencyIso\": \"EUR\",\n \"CurrencyFactor\": 1,\n \"PaymentTarget\": 0,\n \"CashDiscount\": 5,\n \"CashDiscountDays\": 2\n },\n \"SalesOrderShippingDetail\": {\n \"ShippingMethodId\": 123,\n \"ShippingPriority\": 5,\n \"ShippingDate\": \"2023-01-15T13:00:00.0000000+00:00\",\n \"EstimatedDeliveryDate\": \"2023-01-16T13:00:00.0000000+00:00\",\n \"OnHoldReasonId\": 123,\n \"ExtraWeight\": 0.1\n },\n \"ColorcodeId\": 123,\n \"Comment\": \"an additional order comment\",\n \"CustomerComment\": \"an additional customer comment\",\n \"LanguageIso\": \"DE\"\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/salesOrders")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"CompanyId\": 123,\n \"CustomerId\": 123,\n \"Number\": \"A1004465\",\n \"ExternalNumber\": \"D456-64894-132\",\n \"BillingNumber\": \"RE-202404-10000\",\n \"DepartureCountry\": {\n \"CountryISO\": \"DE\",\n \"State\": \"Berlin\",\n \"CurrencyIso\": \"EUR\",\n \"CurrencyFactor\": 1\n },\n \"CustomerVatID\": \"DE12345\",\n \"SalesOrderDate\": \"2023-02-01T12:45:00.0000000+00:00\",\n \"SalesOrderPaymentDetails\": {\n \"PaymentMethodId\": 123,\n \"CurrencyIso\": \"EUR\",\n \"CurrencyFactor\": 1,\n \"PaymentTarget\": 0,\n \"CashDiscount\": 5,\n \"CashDiscountDays\": 2\n },\n \"SalesOrderShippingDetail\": {\n \"ShippingMethodId\": 123,\n \"ShippingPriority\": 5,\n \"ShippingDate\": \"2023-01-15T13:00:00.0000000+00:00\",\n \"EstimatedDeliveryDate\": \"2023-01-16T13:00:00.0000000+00:00\",\n \"OnHoldReasonId\": 123,\n \"ExtraWeight\": 0.1\n },\n \"ColorcodeId\": 123,\n \"Comment\": \"an additional order comment\",\n \"CustomerComment\": \"an additional customer comment\",\n \"LanguageIso\": \"DE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jtl-cloud.com/erp/salesOrders")
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 \"CustomerId\": 123,\n \"Number\": \"A1004465\",\n \"ExternalNumber\": \"D456-64894-132\",\n \"BillingNumber\": \"RE-202404-10000\",\n \"DepartureCountry\": {\n \"CountryISO\": \"DE\",\n \"State\": \"Berlin\",\n \"CurrencyIso\": \"EUR\",\n \"CurrencyFactor\": 1\n },\n \"CustomerVatID\": \"DE12345\",\n \"SalesOrderDate\": \"2023-02-01T12:45:00.0000000+00:00\",\n \"SalesOrderPaymentDetails\": {\n \"PaymentMethodId\": 123,\n \"CurrencyIso\": \"EUR\",\n \"CurrencyFactor\": 1,\n \"PaymentTarget\": 0,\n \"CashDiscount\": 5,\n \"CashDiscountDays\": 2\n },\n \"SalesOrderShippingDetail\": {\n \"ShippingMethodId\": 123,\n \"ShippingPriority\": 5,\n \"ShippingDate\": \"2023-01-15T13:00:00.0000000+00:00\",\n \"EstimatedDeliveryDate\": \"2023-01-16T13:00:00.0000000+00:00\",\n \"OnHoldReasonId\": 123,\n \"ExtraWeight\": 0.1\n },\n \"ColorcodeId\": 123,\n \"Comment\": \"an additional order comment\",\n \"CustomerComment\": \"an additional customer comment\",\n \"LanguageIso\": \"DE\"\n}"
response = http.request(request)
puts response.read_body{
"Id": 123,
"Number": "A1004465",
"ExternalNumber": "D456-64894-132",
"BillingNumber": "RE-202404-10000",
"CompanyId": 123,
"DepartureCountry": {
"CountryISO": "DE",
"State": "Berlin",
"CurrencyIso": "EUR",
"CurrencyFactor": 1
},
"CustomerId": 123,
"CustomerVatID": "DE12345",
"MerchantVatID": "DE12345",
"BillingAddress": {
"Id": 123,
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"City": "Example City",
"State": "Example State",
"CountryIso": "DE",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
},
"Shipmentaddress": {
"Id": 123,
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"City": "Example City",
"State": "Example State",
"CountryIso": "DE",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
},
"SalesOrderDate": "2023-02-01T12:45:00.0000000+00:00",
"SalesOrderPaymentDetails": {
"PaymentMethodId": 123,
"TotalGrossAmount": 19.99,
"CurrencyIso": "EUR",
"CurrencyFactor": 1,
"DateOfPayment": "2023-01-15T13:00:00.0000000+00:00",
"StillToPay": 0,
"PaymentTarget": 0,
"CashDiscount": 5,
"CashDiscountDays": 2
},
"SalesOrderShippingDetail": {
"ShippingMethodId": 123,
"ShippingPriority": 5,
"ShippingDate": "2023-01-15T13:00:00.0000000+00:00",
"EstimatedDeliveryDate": "2023-01-16T13:00:00.0000000+00:00",
"DeliveredDate": "2023-01-15T13:00:00.0000000+00:00",
"OnHoldReasonId": 123,
"ExtraWeight": 0.1
},
"ColorcodeId": 123,
"IsExternalInvoice": false,
"Comment": "an additional order comment",
"CustomerComment": "an additional customer comment",
"IsCancelled": false,
"LanguageIso": "DE",
"CancellationDetails": {
"CancellationReasonId": 123,
"CancellationComment": "Change of mind (once again); we should consider terminating the customer relationship",
"Date": "2023-02-01T12:45:00.0000000+00:00"
},
"SalesChannelId": "1-1-1",
"UserCreatedId": 123,
"UserId": 123,
"TransactionStatusId": 123
}{
"ErrorCode": "<string>",
"ValidationErrors": {},
"Errors": {},
"ErrorMessage": "<string>",
"Stacktrace": "<string>"
}Create Sales Order
Create a new sales order
curl --request POST \
--url https://api.jtl-cloud.com/erp/salesOrders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"CompanyId": 123,
"CustomerId": 123,
"Number": "A1004465",
"ExternalNumber": "D456-64894-132",
"BillingNumber": "RE-202404-10000",
"DepartureCountry": {
"CountryISO": "DE",
"State": "Berlin",
"CurrencyIso": "EUR",
"CurrencyFactor": 1
},
"CustomerVatID": "DE12345",
"SalesOrderDate": "2023-02-01T12:45:00.0000000+00:00",
"SalesOrderPaymentDetails": {
"PaymentMethodId": 123,
"CurrencyIso": "EUR",
"CurrencyFactor": 1,
"PaymentTarget": 0,
"CashDiscount": 5,
"CashDiscountDays": 2
},
"SalesOrderShippingDetail": {
"ShippingMethodId": 123,
"ShippingPriority": 5,
"ShippingDate": "2023-01-15T13:00:00.0000000+00:00",
"EstimatedDeliveryDate": "2023-01-16T13:00:00.0000000+00:00",
"OnHoldReasonId": 123,
"ExtraWeight": 0.1
},
"ColorcodeId": 123,
"Comment": "an additional order comment",
"CustomerComment": "an additional customer comment",
"LanguageIso": "DE"
}
'import requests
url = "https://api.jtl-cloud.com/erp/salesOrders"
payload = {
"CompanyId": 123,
"CustomerId": 123,
"Number": "A1004465",
"ExternalNumber": "D456-64894-132",
"BillingNumber": "RE-202404-10000",
"DepartureCountry": {
"CountryISO": "DE",
"State": "Berlin",
"CurrencyIso": "EUR",
"CurrencyFactor": 1
},
"CustomerVatID": "DE12345",
"SalesOrderDate": "2023-02-01T12:45:00.0000000+00:00",
"SalesOrderPaymentDetails": {
"PaymentMethodId": 123,
"CurrencyIso": "EUR",
"CurrencyFactor": 1,
"PaymentTarget": 0,
"CashDiscount": 5,
"CashDiscountDays": 2
},
"SalesOrderShippingDetail": {
"ShippingMethodId": 123,
"ShippingPriority": 5,
"ShippingDate": "2023-01-15T13:00:00.0000000+00:00",
"EstimatedDeliveryDate": "2023-01-16T13:00:00.0000000+00:00",
"OnHoldReasonId": 123,
"ExtraWeight": 0.1
},
"ColorcodeId": 123,
"Comment": "an additional order comment",
"CustomerComment": "an additional customer comment",
"LanguageIso": "DE"
}
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,
CustomerId: 123,
Number: 'A1004465',
ExternalNumber: 'D456-64894-132',
BillingNumber: 'RE-202404-10000',
DepartureCountry: {CountryISO: 'DE', State: 'Berlin', CurrencyIso: 'EUR', CurrencyFactor: 1},
CustomerVatID: 'DE12345',
SalesOrderDate: '2023-02-01T12:45:00.0000000+00:00',
SalesOrderPaymentDetails: {
PaymentMethodId: 123,
CurrencyIso: 'EUR',
CurrencyFactor: 1,
PaymentTarget: 0,
CashDiscount: 5,
CashDiscountDays: 2
},
SalesOrderShippingDetail: {
ShippingMethodId: 123,
ShippingPriority: 5,
ShippingDate: '2023-01-15T13:00:00.0000000+00:00',
EstimatedDeliveryDate: '2023-01-16T13:00:00.0000000+00:00',
OnHoldReasonId: 123,
ExtraWeight: 0.1
},
ColorcodeId: 123,
Comment: 'an additional order comment',
CustomerComment: 'an additional customer comment',
LanguageIso: 'DE'
})
};
fetch('https://api.jtl-cloud.com/erp/salesOrders', 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/salesOrders",
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,
'CustomerId' => 123,
'Number' => 'A1004465',
'ExternalNumber' => 'D456-64894-132',
'BillingNumber' => 'RE-202404-10000',
'DepartureCountry' => [
'CountryISO' => 'DE',
'State' => 'Berlin',
'CurrencyIso' => 'EUR',
'CurrencyFactor' => 1
],
'CustomerVatID' => 'DE12345',
'SalesOrderDate' => '2023-02-01T12:45:00.0000000+00:00',
'SalesOrderPaymentDetails' => [
'PaymentMethodId' => 123,
'CurrencyIso' => 'EUR',
'CurrencyFactor' => 1,
'PaymentTarget' => 0,
'CashDiscount' => 5,
'CashDiscountDays' => 2
],
'SalesOrderShippingDetail' => [
'ShippingMethodId' => 123,
'ShippingPriority' => 5,
'ShippingDate' => '2023-01-15T13:00:00.0000000+00:00',
'EstimatedDeliveryDate' => '2023-01-16T13:00:00.0000000+00:00',
'OnHoldReasonId' => 123,
'ExtraWeight' => 0.1
],
'ColorcodeId' => 123,
'Comment' => 'an additional order comment',
'CustomerComment' => 'an additional customer comment',
'LanguageIso' => 'DE'
]),
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/salesOrders"
payload := strings.NewReader("{\n \"CompanyId\": 123,\n \"CustomerId\": 123,\n \"Number\": \"A1004465\",\n \"ExternalNumber\": \"D456-64894-132\",\n \"BillingNumber\": \"RE-202404-10000\",\n \"DepartureCountry\": {\n \"CountryISO\": \"DE\",\n \"State\": \"Berlin\",\n \"CurrencyIso\": \"EUR\",\n \"CurrencyFactor\": 1\n },\n \"CustomerVatID\": \"DE12345\",\n \"SalesOrderDate\": \"2023-02-01T12:45:00.0000000+00:00\",\n \"SalesOrderPaymentDetails\": {\n \"PaymentMethodId\": 123,\n \"CurrencyIso\": \"EUR\",\n \"CurrencyFactor\": 1,\n \"PaymentTarget\": 0,\n \"CashDiscount\": 5,\n \"CashDiscountDays\": 2\n },\n \"SalesOrderShippingDetail\": {\n \"ShippingMethodId\": 123,\n \"ShippingPriority\": 5,\n \"ShippingDate\": \"2023-01-15T13:00:00.0000000+00:00\",\n \"EstimatedDeliveryDate\": \"2023-01-16T13:00:00.0000000+00:00\",\n \"OnHoldReasonId\": 123,\n \"ExtraWeight\": 0.1\n },\n \"ColorcodeId\": 123,\n \"Comment\": \"an additional order comment\",\n \"CustomerComment\": \"an additional customer comment\",\n \"LanguageIso\": \"DE\"\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/salesOrders")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"CompanyId\": 123,\n \"CustomerId\": 123,\n \"Number\": \"A1004465\",\n \"ExternalNumber\": \"D456-64894-132\",\n \"BillingNumber\": \"RE-202404-10000\",\n \"DepartureCountry\": {\n \"CountryISO\": \"DE\",\n \"State\": \"Berlin\",\n \"CurrencyIso\": \"EUR\",\n \"CurrencyFactor\": 1\n },\n \"CustomerVatID\": \"DE12345\",\n \"SalesOrderDate\": \"2023-02-01T12:45:00.0000000+00:00\",\n \"SalesOrderPaymentDetails\": {\n \"PaymentMethodId\": 123,\n \"CurrencyIso\": \"EUR\",\n \"CurrencyFactor\": 1,\n \"PaymentTarget\": 0,\n \"CashDiscount\": 5,\n \"CashDiscountDays\": 2\n },\n \"SalesOrderShippingDetail\": {\n \"ShippingMethodId\": 123,\n \"ShippingPriority\": 5,\n \"ShippingDate\": \"2023-01-15T13:00:00.0000000+00:00\",\n \"EstimatedDeliveryDate\": \"2023-01-16T13:00:00.0000000+00:00\",\n \"OnHoldReasonId\": 123,\n \"ExtraWeight\": 0.1\n },\n \"ColorcodeId\": 123,\n \"Comment\": \"an additional order comment\",\n \"CustomerComment\": \"an additional customer comment\",\n \"LanguageIso\": \"DE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jtl-cloud.com/erp/salesOrders")
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 \"CustomerId\": 123,\n \"Number\": \"A1004465\",\n \"ExternalNumber\": \"D456-64894-132\",\n \"BillingNumber\": \"RE-202404-10000\",\n \"DepartureCountry\": {\n \"CountryISO\": \"DE\",\n \"State\": \"Berlin\",\n \"CurrencyIso\": \"EUR\",\n \"CurrencyFactor\": 1\n },\n \"CustomerVatID\": \"DE12345\",\n \"SalesOrderDate\": \"2023-02-01T12:45:00.0000000+00:00\",\n \"SalesOrderPaymentDetails\": {\n \"PaymentMethodId\": 123,\n \"CurrencyIso\": \"EUR\",\n \"CurrencyFactor\": 1,\n \"PaymentTarget\": 0,\n \"CashDiscount\": 5,\n \"CashDiscountDays\": 2\n },\n \"SalesOrderShippingDetail\": {\n \"ShippingMethodId\": 123,\n \"ShippingPriority\": 5,\n \"ShippingDate\": \"2023-01-15T13:00:00.0000000+00:00\",\n \"EstimatedDeliveryDate\": \"2023-01-16T13:00:00.0000000+00:00\",\n \"OnHoldReasonId\": 123,\n \"ExtraWeight\": 0.1\n },\n \"ColorcodeId\": 123,\n \"Comment\": \"an additional order comment\",\n \"CustomerComment\": \"an additional customer comment\",\n \"LanguageIso\": \"DE\"\n}"
response = http.request(request)
puts response.read_body{
"Id": 123,
"Number": "A1004465",
"ExternalNumber": "D456-64894-132",
"BillingNumber": "RE-202404-10000",
"CompanyId": 123,
"DepartureCountry": {
"CountryISO": "DE",
"State": "Berlin",
"CurrencyIso": "EUR",
"CurrencyFactor": 1
},
"CustomerId": 123,
"CustomerVatID": "DE12345",
"MerchantVatID": "DE12345",
"BillingAddress": {
"Id": 123,
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"City": "Example City",
"State": "Example State",
"CountryIso": "DE",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
},
"Shipmentaddress": {
"Id": 123,
"Company": "Sportbedarf Sommer",
"Company2": "Innovation Division",
"FormOfAddress": "Mr.",
"Title": "Dr.",
"FirstName": "John",
"LastName": "Doe",
"Street": "Main St. 123",
"Address2": "Floor 5, Apt 302",
"PostalCode": "12345",
"City": "Example City",
"State": "Example State",
"CountryIso": "DE",
"VatID": "DE123456789",
"PhoneNumber": "+49 1234 445556661",
"MobilePhoneNumber": "+49 160 123 4567",
"EmailAddress": "example@email.com",
"Fax": "+49 1234 4455566615"
},
"SalesOrderDate": "2023-02-01T12:45:00.0000000+00:00",
"SalesOrderPaymentDetails": {
"PaymentMethodId": 123,
"TotalGrossAmount": 19.99,
"CurrencyIso": "EUR",
"CurrencyFactor": 1,
"DateOfPayment": "2023-01-15T13:00:00.0000000+00:00",
"StillToPay": 0,
"PaymentTarget": 0,
"CashDiscount": 5,
"CashDiscountDays": 2
},
"SalesOrderShippingDetail": {
"ShippingMethodId": 123,
"ShippingPriority": 5,
"ShippingDate": "2023-01-15T13:00:00.0000000+00:00",
"EstimatedDeliveryDate": "2023-01-16T13:00:00.0000000+00:00",
"DeliveredDate": "2023-01-15T13:00:00.0000000+00:00",
"OnHoldReasonId": 123,
"ExtraWeight": 0.1
},
"ColorcodeId": 123,
"IsExternalInvoice": false,
"Comment": "an additional order comment",
"CustomerComment": "an additional customer comment",
"IsCancelled": false,
"LanguageIso": "DE",
"CancellationDetails": {
"CancellationReasonId": 123,
"CancellationComment": "Change of mind (once again); we should consider terminating the customer relationship",
"Date": "2023-02-01T12:45:00.0000000+00:00"
},
"SalesChannelId": "1-1-1",
"UserCreatedId": 123,
"UserId": 123,
"TransactionStatusId": 123
}{
"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.
Query Parameters
If true, the sales order number will be renamed if it already exists.
If true, the workflows do not trigger automatic.
Body
The sales order to create.
Model Class: CreateSalesOrder
"A1004465"
"D456-64894-132"
"RE-202404-10000"
Model Class: CreateDepartureCountry
Show child attributes
Show child attributes
"DE12345"
Model Class: CreateAddress
Show child attributes
Show child attributes
Model Class: CreateAddress
Show child attributes
Show child attributes
"2023-02-01T12:45:00.0000000+00:00"
Model Class: CreateSalesOrderPaymentDetail
Show child attributes
Show child attributes
Model Class: CreateSalesOrderShippingDetail
Show child attributes
Show child attributes
"an additional order comment"
"an additional customer comment"
"DE"
Response
The created sales order.
Model Class: SalesOrder
The number of the sales order.
"A1004465"
The external number of the sales order.
"D456-64894-132"
The number of the invoice.
"RE-202404-10000"
Model Class: DepartureCountry
Show child attributes
Show child attributes
The VAT ID of the customer.
"DE12345"
The VAT ID of the merchant.
"DE12345"
Model Class: Address
Show child attributes
Show child attributes
Model Class: Address
Show child attributes
Show child attributes
The date when the order was created.
"2023-02-01T12:45:00.0000000+00:00"
Model Class: SalesOrderPaymentDetail
Show child attributes
Show child attributes
Model Class: SalesOrderShippingDetail
Show child attributes
Show child attributes
Indicates if the invoice of the order was created in an external system, like Amazon VCS.
false
A comment on the sales order.
"an additional order comment"
A customer comment on the sales order.
"an additional customer comment"
Indicates if the order has been cancelled. There is a special endpoint for cancelling sales orders.
false
The language of the order.
"DE"
Model Class: SalesOrderCancellationDetails
Show child attributes
Show child attributes
"1-1-1"
Was this page helpful?