curl --request POST \
--url https://api.jtl-cloud.com/erp/v2/sales-orders/calculate-sales-entity \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"calculateSalesEntityRequest": {
"companyId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"vatId": "<string>",
"customerId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"lineItems": [
{
"syncNumber": 123,
"quantity": 123,
"taxClassId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"taxCodeId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"taxRate": 123,
"totalSalesPriceNet": 123,
"totalSalesPriceGross": 123,
"itemId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"salesPriceNet": 123,
"discountPercent": 123,
"parentSyncNumber": 123
}
],
"currencyIso": "<string>",
"currencyFactor": 123,
"departureCountryIso": "<string>",
"shippingMethodId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"shopId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"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"
}
],
"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-sales-entity"
payload = {
"calculateSalesEntityRequest": {
"companyId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"vatId": "<string>",
"customerId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"lineItems": [
{
"syncNumber": 123,
"quantity": 123,
"taxClassId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"taxCodeId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"taxRate": 123,
"totalSalesPriceNet": 123,
"totalSalesPriceGross": 123,
"itemId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"salesPriceNet": 123,
"discountPercent": 123,
"parentSyncNumber": 123
}
],
"currencyIso": "<string>",
"currencyFactor": 123,
"departureCountryIso": "<string>",
"shippingMethodId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"shopId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"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"
}
],
"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({
calculateSalesEntityRequest: {
companyId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
vatId: '<string>',
customerId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
lineItems: [
{
syncNumber: 123,
quantity: 123,
taxClassId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
taxCodeId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
taxRate: 123,
totalSalesPriceNet: 123,
totalSalesPriceGross: 123,
itemId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
salesPriceNet: 123,
discountPercent: 123,
parentSyncNumber: 123
}
],
currencyIso: '<string>',
currencyFactor: 123,
departureCountryIso: '<string>',
shippingMethodId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
shopId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
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'}
],
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-sales-entity', 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-sales-entity",
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([
'calculateSalesEntityRequest' => [
'companyId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'vatId' => '<string>',
'customerId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'lineItems' => [
[
'syncNumber' => 123,
'quantity' => 123,
'taxClassId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'taxCodeId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'taxRate' => 123,
'totalSalesPriceNet' => 123,
'totalSalesPriceGross' => 123,
'itemId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'salesPriceNet' => 123,
'discountPercent' => 123,
'parentSyncNumber' => 123
]
],
'currencyIso' => '<string>',
'currencyFactor' => 123,
'departureCountryIso' => '<string>',
'shippingMethodId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'shopId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'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'
]
],
'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-sales-entity"
payload := strings.NewReader("{\n \"calculateSalesEntityRequest\": {\n \"companyId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"vatId\": \"<string>\",\n \"customerId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"lineItems\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"taxCodeId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"taxRate\": 123,\n \"totalSalesPriceNet\": 123,\n \"totalSalesPriceGross\": 123,\n \"itemId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"salesPriceNet\": 123,\n \"discountPercent\": 123,\n \"parentSyncNumber\": 123\n }\n ],\n \"currencyIso\": \"<string>\",\n \"currencyFactor\": 123,\n \"departureCountryIso\": \"<string>\",\n \"shippingMethodId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"shopId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\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 }\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-sales-entity")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"calculateSalesEntityRequest\": {\n \"companyId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"vatId\": \"<string>\",\n \"customerId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"lineItems\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"taxCodeId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"taxRate\": 123,\n \"totalSalesPriceNet\": 123,\n \"totalSalesPriceGross\": 123,\n \"itemId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"salesPriceNet\": 123,\n \"discountPercent\": 123,\n \"parentSyncNumber\": 123\n }\n ],\n \"currencyIso\": \"<string>\",\n \"currencyFactor\": 123,\n \"departureCountryIso\": \"<string>\",\n \"shippingMethodId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"shopId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\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 }\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-sales-entity")
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 \"calculateSalesEntityRequest\": {\n \"companyId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"vatId\": \"<string>\",\n \"customerId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"lineItems\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"taxCodeId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"taxRate\": 123,\n \"totalSalesPriceNet\": 123,\n \"totalSalesPriceGross\": 123,\n \"itemId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"salesPriceNet\": 123,\n \"discountPercent\": 123,\n \"parentSyncNumber\": 123\n }\n ],\n \"currencyIso\": \"<string>\",\n \"currencyFactor\": 123,\n \"departureCountryIso\": \"<string>\",\n \"shippingMethodId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"shopId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\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 }\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,
"totalSalesPriceNet": 123,
"totalSalesPriceGross": 123,
"discountPercent": 123,
"taxRate": 123,
"taxClassId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"taxCodeId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"itemId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"parentSyncNumber": 123
}
],
"totalNetAmount": 123,
"totalGrossAmount": 123,
"totalNetAmountExcludingShipping": 123,
"totalGrossAmountExcludingShipping": 123,
"vatId": "<string>",
"currencyIso": "<string>",
"currencyFactor": 123,
"shippingCostNet": 123,
"shippingCostGross": 123,
"vatAmounts": [
{
"taxRate": 123,
"vatAmount": 123
}
]
}Recalculate prices, discounts, and taxes for a sales entity from a client-supplied state without persisting it.
Recalculate prices, discounts, and taxes for a sales entity from a client-supplied state without persisting it.
curl --request POST \
--url https://api.jtl-cloud.com/erp/v2/sales-orders/calculate-sales-entity \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"calculateSalesEntityRequest": {
"companyId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"vatId": "<string>",
"customerId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"lineItems": [
{
"syncNumber": 123,
"quantity": 123,
"taxClassId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"taxCodeId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"taxRate": 123,
"totalSalesPriceNet": 123,
"totalSalesPriceGross": 123,
"itemId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"salesPriceNet": 123,
"discountPercent": 123,
"parentSyncNumber": 123
}
],
"currencyIso": "<string>",
"currencyFactor": 123,
"departureCountryIso": "<string>",
"shippingMethodId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"shopId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"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"
}
],
"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-sales-entity"
payload = {
"calculateSalesEntityRequest": {
"companyId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"vatId": "<string>",
"customerId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"lineItems": [
{
"syncNumber": 123,
"quantity": 123,
"taxClassId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"taxCodeId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"taxRate": 123,
"totalSalesPriceNet": 123,
"totalSalesPriceGross": 123,
"itemId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"salesPriceNet": 123,
"discountPercent": 123,
"parentSyncNumber": 123
}
],
"currencyIso": "<string>",
"currencyFactor": 123,
"departureCountryIso": "<string>",
"shippingMethodId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"shopId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"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"
}
],
"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({
calculateSalesEntityRequest: {
companyId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
vatId: '<string>',
customerId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
lineItems: [
{
syncNumber: 123,
quantity: 123,
taxClassId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
taxCodeId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
taxRate: 123,
totalSalesPriceNet: 123,
totalSalesPriceGross: 123,
itemId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
salesPriceNet: 123,
discountPercent: 123,
parentSyncNumber: 123
}
],
currencyIso: '<string>',
currencyFactor: 123,
departureCountryIso: '<string>',
shippingMethodId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
shopId: 'b45f6432-2462-4c6f-b00f-1d9d01000000',
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'}
],
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-sales-entity', 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-sales-entity",
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([
'calculateSalesEntityRequest' => [
'companyId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'vatId' => '<string>',
'customerId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'lineItems' => [
[
'syncNumber' => 123,
'quantity' => 123,
'taxClassId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'taxCodeId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'taxRate' => 123,
'totalSalesPriceNet' => 123,
'totalSalesPriceGross' => 123,
'itemId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'salesPriceNet' => 123,
'discountPercent' => 123,
'parentSyncNumber' => 123
]
],
'currencyIso' => '<string>',
'currencyFactor' => 123,
'departureCountryIso' => '<string>',
'shippingMethodId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'shopId' => 'b45f6432-2462-4c6f-b00f-1d9d01000000',
'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'
]
],
'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-sales-entity"
payload := strings.NewReader("{\n \"calculateSalesEntityRequest\": {\n \"companyId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"vatId\": \"<string>\",\n \"customerId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"lineItems\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"taxCodeId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"taxRate\": 123,\n \"totalSalesPriceNet\": 123,\n \"totalSalesPriceGross\": 123,\n \"itemId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"salesPriceNet\": 123,\n \"discountPercent\": 123,\n \"parentSyncNumber\": 123\n }\n ],\n \"currencyIso\": \"<string>\",\n \"currencyFactor\": 123,\n \"departureCountryIso\": \"<string>\",\n \"shippingMethodId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"shopId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\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 }\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-sales-entity")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"calculateSalesEntityRequest\": {\n \"companyId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"vatId\": \"<string>\",\n \"customerId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"lineItems\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"taxCodeId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"taxRate\": 123,\n \"totalSalesPriceNet\": 123,\n \"totalSalesPriceGross\": 123,\n \"itemId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"salesPriceNet\": 123,\n \"discountPercent\": 123,\n \"parentSyncNumber\": 123\n }\n ],\n \"currencyIso\": \"<string>\",\n \"currencyFactor\": 123,\n \"departureCountryIso\": \"<string>\",\n \"shippingMethodId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"shopId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\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 }\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-sales-entity")
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 \"calculateSalesEntityRequest\": {\n \"companyId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"vatId\": \"<string>\",\n \"customerId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"lineItems\": [\n {\n \"syncNumber\": 123,\n \"quantity\": 123,\n \"taxClassId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"taxCodeId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"taxRate\": 123,\n \"totalSalesPriceNet\": 123,\n \"totalSalesPriceGross\": 123,\n \"itemId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"salesPriceNet\": 123,\n \"discountPercent\": 123,\n \"parentSyncNumber\": 123\n }\n ],\n \"currencyIso\": \"<string>\",\n \"currencyFactor\": 123,\n \"departureCountryIso\": \"<string>\",\n \"shippingMethodId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\n \"shopId\": \"b45f6432-2462-4c6f-b00f-1d9d01000000\",\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 }\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,
"totalSalesPriceNet": 123,
"totalSalesPriceGross": 123,
"discountPercent": 123,
"taxRate": 123,
"taxClassId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"taxCodeId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"itemId": "b45f6432-2462-4c6f-b00f-1d9d01000000",
"parentSyncNumber": 123
}
],
"totalNetAmount": 123,
"totalGrossAmount": 123,
"totalNetAmountExcludingShipping": 123,
"totalGrossAmountExcludingShipping": 123,
"vatId": "<string>",
"currencyIso": "<string>",
"currencyFactor": 123,
"shippingCostNet": 123,
"shippingCostGross": 123,
"vatAmounts": [
{
"taxRate": 123,
"vatAmount": 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
Recalculate prices, discounts, and taxes for a sales entity from a client-supplied state without persisting it. - Request
The sales entity 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 entity request. Changes are processed in the order specified.
Show child attributes
Show child attributes
Response
Sales entity calculated successfully.
Recalculate prices, discounts, and taxes for a sales entity from a client-supplied state without persisting it. - Response
The list of calculated sales entity line items.
Show child attributes
Show child attributes
The total net amount for the sales entity.
The total gross amount for the sales entity.
The total net amount for the sales entity excluding shipping costs.
The total gross amount for the sales entity excluding shipping costs.
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 gross shipping cost.
The VAT amounts grouped by tax rate.
Show child attributes
Show child attributes
The tax setting applied to the sales entity.
0, 10, 15, 20 Was this page helpful?