Skip to main content
POST
/
salesOrders
Create Sales Order
curl --request POST \
  --url https://api.jtl-cloud.com/erp/salesOrders \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --header 'x-appid: <x-appid>' \
  --header 'x-appversion: <x-appversion>' \
  --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"
}
'
{
  "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,
    "PaymentStatus": 0,
    "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,
    "DeliveryCompleteStatus": 0,
    "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
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

x-api-key
string
header
required

Optional: If no token is present, the API Gateway injects it.

Headers

api-version
string

Specify the desired API version, e.g. '1.0'. If not provided, the last available version is set.

x-appid
string
required

This is the name of your application, e.g. "MyApp/1.0.0". It is used to identify your application.

x-appversion
string
required

This is where the version number of your application is entered, e.g. "1.0.0".

x-runas
string

The User-Id (int or uuid) on whose behalf the request is executed. Requires scope 'Application.RunAs'.

X-SessionId
string<uuid>

The id of a session in which the call will be executed.

x-tenant-id
string<uuid>
required

The tenant ID for the target ERP instance.

Query Parameters

renameSalesOrderNumberWhenAlreadyExists
boolean

If true, the sales order number will be renamed if it already exists.

disableAutomaticWorkflows
boolean

If true, the workflows do not trigger automatic.

Body

application/json

The sales order to create.

Model Class: CreateSalesOrder

CompanyId
integer<int32>
required
CustomerId
integer<int32>
required
Number
string
Example:

"A1004465"

ExternalNumber
string
Example:

"D456-64894-132"

BillingNumber
string
Example:

"RE-202404-10000"

DepartureCountry
object

Model Class: CreateDepartureCountry

CustomerVatID
string
Example:

"DE12345"

BillingAddress
object

Model Class: CreateAddress

Shipmentaddress
object

Model Class: CreateAddress

SalesOrderDate
string<date-time>
Example:

"2023-02-01T12:45:00.0000000+00:00"

SalesOrderPaymentDetails
object

Model Class: CreateSalesOrderPaymentDetail

SalesOrderShippingDetail
object

Model Class: CreateSalesOrderShippingDetail

ColorcodeId
integer<int32>
Comment
string
Example:

"an additional order comment"

CustomerComment
string
Example:

"an additional customer comment"

LanguageIso
string
Example:

"DE"

Response

The created sales order.

Model Class: SalesOrder

Id
integer<int32>
required
Number
string
required

The number of the sales order.

Example:

"A1004465"

ExternalNumber
string
required

The external number of the sales order.

Example:

"D456-64894-132"

BillingNumber
string
required

The number of the invoice.

Example:

"RE-202404-10000"

CompanyId
integer<int32>
required
DepartureCountry
object
required

Model Class: DepartureCountry

CustomerId
integer<int32>
required
CustomerVatID
string
required

The VAT ID of the customer.

Example:

"DE12345"

MerchantVatID
string
required

The VAT ID of the merchant.

Example:

"DE12345"

BillingAddress
object
required

Model Class: Address

Shipmentaddress
object
required

Model Class: Address

SalesOrderDate
string<date-time>
required

The date when the order was created.

Example:

"2023-02-01T12:45:00.0000000+00:00"

SalesOrderPaymentDetails
object
required

Model Class: SalesOrderPaymentDetail

SalesOrderShippingDetail
object
required

Model Class: SalesOrderShippingDetail

ColorcodeId
integer<int32>
required
IsExternalInvoice
boolean
required

Indicates if the invoice of the order was created in an external system, like Amazon VCS.

Example:

false

Comment
string
required

A comment on the sales order.

Example:

"an additional order comment"

CustomerComment
string
required

A customer comment on the sales order.

Example:

"an additional customer comment"

IsCancelled
boolean
required

Indicates if the order has been cancelled. There is a special endpoint for cancelling sales orders.

Example:

false

LanguageIso
string
required

The language of the order.

Example:

"DE"

CancellationDetails
object
required

Model Class: SalesOrderCancellationDetails

SalesChannelId
string
required
Example:

"1-1-1"

UserCreatedId
integer<int32>
required
UserId
integer<int32>
required
TransactionStatusId
integer<int32>
required