curl --request POST \
--url https://api.jtl-cloud.com/erp/v2/sales-orders/calculate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"calculateSalesOrderRequest": {
"companyId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"customerId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"lineItems": [
{
"syncNumber": 123,
"quantity": 123,
"itemId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"salesPriceNet": 123,
"salesPriceGross": 123,
"discountPercent": 123,
"taxClassId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"parentSyncNumber": 123
}
],
"departureCountryIso": "<string>",
"shippingMethodId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"shopId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"currencyIso": "<string>",
"currencyFactor": 123,
"departureCountryStateCode": "<string>",
"extraWeight": 123
},
"changes": [
{
"companyId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"customerId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"shippingMethodId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"lineItemChanges": {
"create": [
{
"syncNumber": 123,
"quantity": 123,
"itemId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"salesPriceNet": 123,
"salesPriceGross": 123,
"discountPercent": 123,
"taxClassId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"parentSyncNumber": 123
}
],
"update": [
{
"syncNumber": 123,
"quantity": 123,
"salesPriceNet": 123,
"salesPriceGross": 123,
"discountPercent": 123,
"taxClassId": "b45f6432-2462-4c6f-b00f-1d9d01000000"
}
],
"delete": [
123
]
},
"currencyIso": "<string>",
"currencyFactor": 123,
"departureCountryIso": "<string>",
"departureCountryStateCode": "<string>",
"extraWeight": 123
}
]
}
'import requests
url = "https://api.jtl-cloud.com/erp/v2/sales-orders/calculate"
payload = {
"calculateSalesOrderRequest": {
"companyId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"customerId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"lineItems": [
{
"syncNumber": 123,
"quantity": 123,
"itemId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"salesPriceNet": 123,
"salesPriceGross": 123,
"discountPercent": 123,
"taxClassId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"parentSyncNumber": 123
}
],
"departureCountryIso": "<string>",
"shippingMethodId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"shopId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"currencyIso": "<string>",
"currencyFactor": 123,
"departureCountryStateCode": "<string>",
"extraWeight": 123
},
"changes": [
{
"companyId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"customerId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"shippingMethodId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"lineItemChanges": {
"create": [
{
"syncNumber": 123,
"quantity": 123,
"itemId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"salesPriceNet": 123,
"salesPriceGross": 123,
"discountPercent": 123,
"taxClassId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"parentSyncNumber": 123
}
],
"update": [
{
"syncNumber": 123,
"quantity": 123,
"salesPriceNet": 123,
"salesPriceGross": 123,
"discountPercent": 123,
"taxClassId": "b45f6432-2462-4c6f-b00f-1d9d01000000"
}
],
"delete": [123]
},
"currencyIso": "<string>",
"currencyFactor": 123,
"departureCountryIso": "<string>",
"departureCountryStateCode": "<string>",
"extraWeight": 123
}
]
}
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({
calculateSalesOrderRequest: {
companyId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
customerId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
lineItems: [
{
syncNumber: 123,
quantity: 123,
itemId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
salesPriceNet: 123,
salesPriceGross: 123,
discountPercent: 123,
taxClassId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
parentSyncNumber: 123
}
],
departureCountryIso: '<string>',
shippingMethodId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
shopId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
currencyIso: '<string>',
currencyFactor: 123,
departureCountryStateCode: '<string>',
extraWeight: 123
},
changes: [
{
companyId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
customerId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
shippingMethodId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
lineItemChanges: {
create: [
{
syncNumber: 123,
quantity: 123,
itemId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
salesPriceNet: 123,
salesPriceGross: 123,
discountPercent: 123,
taxClassId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
parentSyncNumber: 123
}
],
update: [
{
syncNumber: 123,
quantity: 123,
salesPriceNet: 123,
salesPriceGross: 123,
discountPercent: 123,
taxClassId: 'b45f6432-2462-4c6f-b00f-1d9d01000000'
}
],
delete: [123]
},
currencyIso: '<string>',
currencyFactor: 123,
departureCountryIso: '<string>',
departureCountryStateCode: '<string>',
extraWeight: 123
}
]
})
};
fetch('https://api.jtl-cloud.com/erp/v2/sales-orders/calculate', 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/v2/sales-orders/calculate",
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([
'calculateSalesOrderRequest' => [
'companyId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'customerId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'lineItems' => [
[
'syncNumber' => 123,
'quantity' => 123,
'itemId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'salesPriceNet' => 123,
'salesPriceGross' => 123,
'discountPercent' => 123,
'taxClassId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'parentSyncNumber' => 123
]
],
'departureCountryIso' => '<string>',
'shippingMethodId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'shopId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'currencyIso' => '<string>',
'currencyFactor' => 123,
'departureCountryStateCode' => '<string>',
'extraWeight' => 123
],
'changes' => [
[
'companyId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'customerId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'shippingMethodId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'lineItemChanges' => [
'create' => [
[
'syncNumber' => 123,
'quantity' => 123,
'itemId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'salesPriceNet' => 123,
'salesPriceGross' => 123,
'discountPercent' => 123,
'taxClassId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'parentSyncNumber' => 123
]
],
'update' => [
[
'syncNumber' => 123,
'quantity' => 123,
'salesPriceNet' => 123,
'salesPriceGross' => 123,
'discountPercent' => 123,
'taxClassId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000'
]
],
'delete' => [
123
]
],
'currencyIso' => '<string>',
'currencyFactor' => 123,
'departureCountryIso' => '<string>',
'departureCountryStateCode' => '<string>',
'extraWeight' => 123
]
]
]),
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/v2/sales-orders/calculate"
payload := strings.NewReader("{\n \"calculateSalesOrderRequest\": {\n \"companyId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"customerId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"lineItems\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"itemId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"salesPriceNet\": 123,\n \"salesPriceGross\": 123,\n \"discountPercent\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"parentSyncNumber\": 123\n }\n ],\n \"departureCountryIso\": \"<string>\",\n \"shippingMethodId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"shopId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"currencyIso\": \"<string>\",\n \"currencyFactor\": 123,\n \"departureCountryStateCode\": \"<string>\",\n \"extraWeight\": 123\n },\n \"changes\": [\n {\n \"companyId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"customerId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"shippingMethodId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"lineItemChanges\": {\n \"create\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"itemId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"salesPriceNet\": 123,\n \"salesPriceGross\": 123,\n \"discountPercent\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"parentSyncNumber\": 123\n }\n ],\n \"update\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"salesPriceNet\": 123,\n \"salesPriceGross\": 123,\n \"discountPercent\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\"\n }\n ],\n \"delete\": [\n 123\n ]\n },\n \"currencyIso\": \"<string>\",\n \"currencyFactor\": 123,\n \"departureCountryIso\": \"<string>\",\n \"departureCountryStateCode\": \"<string>\",\n \"extraWeight\": 123\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/v2/sales-orders/calculate")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"calculateSalesOrderRequest\": {\n \"companyId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"customerId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"lineItems\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"itemId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"salesPriceNet\": 123,\n \"salesPriceGross\": 123,\n \"discountPercent\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"parentSyncNumber\": 123\n }\n ],\n \"departureCountryIso\": \"<string>\",\n \"shippingMethodId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"shopId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"currencyIso\": \"<string>\",\n \"currencyFactor\": 123,\n \"departureCountryStateCode\": \"<string>\",\n \"extraWeight\": 123\n },\n \"changes\": [\n {\n \"companyId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"customerId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"shippingMethodId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"lineItemChanges\": {\n \"create\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"itemId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"salesPriceNet\": 123,\n \"salesPriceGross\": 123,\n \"discountPercent\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"parentSyncNumber\": 123\n }\n ],\n \"update\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"salesPriceNet\": 123,\n \"salesPriceGross\": 123,\n \"discountPercent\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\"\n }\n ],\n \"delete\": [\n 123\n ]\n },\n \"currencyIso\": \"<string>\",\n \"currencyFactor\": 123,\n \"departureCountryIso\": \"<string>\",\n \"departureCountryStateCode\": \"<string>\",\n \"extraWeight\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jtl-cloud.com/erp/v2/sales-orders/calculate")
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 \"calculateSalesOrderRequest\": {\n \"companyId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"customerId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"lineItems\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"itemId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"salesPriceNet\": 123,\n \"salesPriceGross\": 123,\n \"discountPercent\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"parentSyncNumber\": 123\n }\n ],\n \"departureCountryIso\": \"<string>\",\n \"shippingMethodId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"shopId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"currencyIso\": \"<string>\",\n \"currencyFactor\": 123,\n \"departureCountryStateCode\": \"<string>\",\n \"extraWeight\": 123\n },\n \"changes\": [\n {\n \"companyId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"customerId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"shippingMethodId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"lineItemChanges\": {\n \"create\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"itemId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"salesPriceNet\": 123,\n \"salesPriceGross\": 123,\n \"discountPercent\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"parentSyncNumber\": 123\n }\n ],\n \"update\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"salesPriceNet\": 123,\n \"salesPriceGross\": 123,\n \"discountPercent\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\"\n }\n ],\n \"delete\": [\n 123\n ]\n },\n \"currencyIso\": \"<string>\",\n \"currencyFactor\": 123,\n \"departureCountryIso\": \"<string>\",\n \"departureCountryStateCode\": \"<string>\",\n \"extraWeight\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"lineItems": [
{
"syncNumber": 123,
"quantity": 123,
"salesPriceNet": 123,
"salesPriceGross": 123,
"discountPercent": 123,
"taxRate": 123,
"taxClassId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"itemId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"parentSyncNumber": 123
}
],
"totalNetAmount": 123,
"totalGrossAmount": 123,
"companyVatId": "<string>",
"currencyIso": "<string>",
"currencyFactor": 123,
"shippingCostNet": 123,
"vatAmounts": [
{
"taxRate": 123,
"vatAmount": 123
}
],
"shippingCostGross": 123
}Calculate prices, discounts, and taxes for a sales order without persisting it.
Calculate prices, discounts, and taxes for a sales order without persisting it.
curl --request POST \
--url https://api.jtl-cloud.com/erp/v2/sales-orders/calculate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"calculateSalesOrderRequest": {
"companyId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"customerId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"lineItems": [
{
"syncNumber": 123,
"quantity": 123,
"itemId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"salesPriceNet": 123,
"salesPriceGross": 123,
"discountPercent": 123,
"taxClassId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"parentSyncNumber": 123
}
],
"departureCountryIso": "<string>",
"shippingMethodId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"shopId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"currencyIso": "<string>",
"currencyFactor": 123,
"departureCountryStateCode": "<string>",
"extraWeight": 123
},
"changes": [
{
"companyId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"customerId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"shippingMethodId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"lineItemChanges": {
"create": [
{
"syncNumber": 123,
"quantity": 123,
"itemId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"salesPriceNet": 123,
"salesPriceGross": 123,
"discountPercent": 123,
"taxClassId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"parentSyncNumber": 123
}
],
"update": [
{
"syncNumber": 123,
"quantity": 123,
"salesPriceNet": 123,
"salesPriceGross": 123,
"discountPercent": 123,
"taxClassId": "b45f6432-2462-4c6f-b00f-1d9d01000000"
}
],
"delete": [
123
]
},
"currencyIso": "<string>",
"currencyFactor": 123,
"departureCountryIso": "<string>",
"departureCountryStateCode": "<string>",
"extraWeight": 123
}
]
}
'import requests
url = "https://api.jtl-cloud.com/erp/v2/sales-orders/calculate"
payload = {
"calculateSalesOrderRequest": {
"companyId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"customerId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"lineItems": [
{
"syncNumber": 123,
"quantity": 123,
"itemId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"salesPriceNet": 123,
"salesPriceGross": 123,
"discountPercent": 123,
"taxClassId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"parentSyncNumber": 123
}
],
"departureCountryIso": "<string>",
"shippingMethodId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"shopId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"currencyIso": "<string>",
"currencyFactor": 123,
"departureCountryStateCode": "<string>",
"extraWeight": 123
},
"changes": [
{
"companyId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"customerId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"shippingMethodId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"lineItemChanges": {
"create": [
{
"syncNumber": 123,
"quantity": 123,
"itemId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"salesPriceNet": 123,
"salesPriceGross": 123,
"discountPercent": 123,
"taxClassId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"parentSyncNumber": 123
}
],
"update": [
{
"syncNumber": 123,
"quantity": 123,
"salesPriceNet": 123,
"salesPriceGross": 123,
"discountPercent": 123,
"taxClassId": "b45f6432-2462-4c6f-b00f-1d9d01000000"
}
],
"delete": [123]
},
"currencyIso": "<string>",
"currencyFactor": 123,
"departureCountryIso": "<string>",
"departureCountryStateCode": "<string>",
"extraWeight": 123
}
]
}
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({
calculateSalesOrderRequest: {
companyId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
customerId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
lineItems: [
{
syncNumber: 123,
quantity: 123,
itemId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
salesPriceNet: 123,
salesPriceGross: 123,
discountPercent: 123,
taxClassId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
parentSyncNumber: 123
}
],
departureCountryIso: '<string>',
shippingMethodId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
shopId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
currencyIso: '<string>',
currencyFactor: 123,
departureCountryStateCode: '<string>',
extraWeight: 123
},
changes: [
{
companyId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
customerId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
shippingMethodId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
lineItemChanges: {
create: [
{
syncNumber: 123,
quantity: 123,
itemId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
salesPriceNet: 123,
salesPriceGross: 123,
discountPercent: 123,
taxClassId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
parentSyncNumber: 123
}
],
update: [
{
syncNumber: 123,
quantity: 123,
salesPriceNet: 123,
salesPriceGross: 123,
discountPercent: 123,
taxClassId: 'b45f6432-2462-4c6f-b00f-1d9d01000000'
}
],
delete: [123]
},
currencyIso: '<string>',
currencyFactor: 123,
departureCountryIso: '<string>',
departureCountryStateCode: '<string>',
extraWeight: 123
}
]
})
};
fetch('https://api.jtl-cloud.com/erp/v2/sales-orders/calculate', 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/v2/sales-orders/calculate",
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([
'calculateSalesOrderRequest' => [
'companyId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'customerId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'lineItems' => [
[
'syncNumber' => 123,
'quantity' => 123,
'itemId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'salesPriceNet' => 123,
'salesPriceGross' => 123,
'discountPercent' => 123,
'taxClassId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'parentSyncNumber' => 123
]
],
'departureCountryIso' => '<string>',
'shippingMethodId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'shopId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'currencyIso' => '<string>',
'currencyFactor' => 123,
'departureCountryStateCode' => '<string>',
'extraWeight' => 123
],
'changes' => [
[
'companyId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'customerId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'shippingMethodId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'lineItemChanges' => [
'create' => [
[
'syncNumber' => 123,
'quantity' => 123,
'itemId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'salesPriceNet' => 123,
'salesPriceGross' => 123,
'discountPercent' => 123,
'taxClassId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'parentSyncNumber' => 123
]
],
'update' => [
[
'syncNumber' => 123,
'quantity' => 123,
'salesPriceNet' => 123,
'salesPriceGross' => 123,
'discountPercent' => 123,
'taxClassId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000'
]
],
'delete' => [
123
]
],
'currencyIso' => '<string>',
'currencyFactor' => 123,
'departureCountryIso' => '<string>',
'departureCountryStateCode' => '<string>',
'extraWeight' => 123
]
]
]),
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/v2/sales-orders/calculate"
payload := strings.NewReader("{\n \"calculateSalesOrderRequest\": {\n \"companyId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"customerId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"lineItems\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"itemId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"salesPriceNet\": 123,\n \"salesPriceGross\": 123,\n \"discountPercent\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"parentSyncNumber\": 123\n }\n ],\n \"departureCountryIso\": \"<string>\",\n \"shippingMethodId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"shopId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"currencyIso\": \"<string>\",\n \"currencyFactor\": 123,\n \"departureCountryStateCode\": \"<string>\",\n \"extraWeight\": 123\n },\n \"changes\": [\n {\n \"companyId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"customerId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"shippingMethodId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"lineItemChanges\": {\n \"create\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"itemId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"salesPriceNet\": 123,\n \"salesPriceGross\": 123,\n \"discountPercent\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"parentSyncNumber\": 123\n }\n ],\n \"update\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"salesPriceNet\": 123,\n \"salesPriceGross\": 123,\n \"discountPercent\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\"\n }\n ],\n \"delete\": [\n 123\n ]\n },\n \"currencyIso\": \"<string>\",\n \"currencyFactor\": 123,\n \"departureCountryIso\": \"<string>\",\n \"departureCountryStateCode\": \"<string>\",\n \"extraWeight\": 123\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/v2/sales-orders/calculate")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"calculateSalesOrderRequest\": {\n \"companyId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"customerId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"lineItems\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"itemId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"salesPriceNet\": 123,\n \"salesPriceGross\": 123,\n \"discountPercent\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"parentSyncNumber\": 123\n }\n ],\n \"departureCountryIso\": \"<string>\",\n \"shippingMethodId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"shopId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"currencyIso\": \"<string>\",\n \"currencyFactor\": 123,\n \"departureCountryStateCode\": \"<string>\",\n \"extraWeight\": 123\n },\n \"changes\": [\n {\n \"companyId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"customerId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"shippingMethodId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"lineItemChanges\": {\n \"create\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"itemId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"salesPriceNet\": 123,\n \"salesPriceGross\": 123,\n \"discountPercent\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"parentSyncNumber\": 123\n }\n ],\n \"update\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"salesPriceNet\": 123,\n \"salesPriceGross\": 123,\n \"discountPercent\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\"\n }\n ],\n \"delete\": [\n 123\n ]\n },\n \"currencyIso\": \"<string>\",\n \"currencyFactor\": 123,\n \"departureCountryIso\": \"<string>\",\n \"departureCountryStateCode\": \"<string>\",\n \"extraWeight\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.jtl-cloud.com/erp/v2/sales-orders/calculate")
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 \"calculateSalesOrderRequest\": {\n \"companyId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"customerId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"lineItems\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"itemId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"salesPriceNet\": 123,\n \"salesPriceGross\": 123,\n \"discountPercent\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"parentSyncNumber\": 123\n }\n ],\n \"departureCountryIso\": \"<string>\",\n \"shippingMethodId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"shopId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"currencyIso\": \"<string>\",\n \"currencyFactor\": 123,\n \"departureCountryStateCode\": \"<string>\",\n \"extraWeight\": 123\n },\n \"changes\": [\n {\n \"companyId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"customerId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"shippingMethodId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"lineItemChanges\": {\n \"create\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"itemId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"salesPriceNet\": 123,\n \"salesPriceGross\": 123,\n \"discountPercent\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"parentSyncNumber\": 123\n }\n ],\n \"update\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"salesPriceNet\": 123,\n \"salesPriceGross\": 123,\n \"discountPercent\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\"\n }\n ],\n \"delete\": [\n 123\n ]\n },\n \"currencyIso\": \"<string>\",\n \"currencyFactor\": 123,\n \"departureCountryIso\": \"<string>\",\n \"departureCountryStateCode\": \"<string>\",\n \"extraWeight\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"lineItems": [
{
"syncNumber": 123,
"quantity": 123,
"salesPriceNet": 123,
"salesPriceGross": 123,
"discountPercent": 123,
"taxRate": 123,
"taxClassId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"itemId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"parentSyncNumber": 123
}
],
"totalNetAmount": 123,
"totalGrossAmount": 123,
"companyVatId": "<string>",
"currencyIso": "<string>",
"currencyFactor": 123,
"shippingCostNet": 123,
"vatAmounts": [
{
"taxRate": 123,
"vatAmount": 123
}
],
"shippingCostGross": 123
}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
Request parameters
Calculate prices, discounts, and taxes for a sales order without persisting it. - Request
The sales order calculation request model in the original state before any changes.
Show child attributes
Show child attributes
The mode for tax recalculation (NoRecalculation, KeepNetPrices, KeepGrossPrices).
0, 1, 2 The history of changes made to the sales order request. Changes are processed in the order specified.
Show child attributes
Show child attributes
Response
Sales order calculated successfully.
Calculate prices, discounts, and taxes for a sales order without persisting it. - Response
The list of calculated sales order line items.
Show child attributes
Show child attributes
The total net amount for the sales order.
The total gross amount for the sales order.
The VAT ID of the company for the departure country.
The ISO code of the currency used for the calculated prices.
The currency factor used for the price conversion.
The net shipping cost.
The VAT amounts grouped by tax rate.
Show child attributes
Show child attributes
The gross shipping cost.
Was this page helpful?