Skip to main content
POST
/
returns
Create Return
curl --request POST \
  --url https://api.jtl-cloud.com/erp/returns \
  --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,
  "SalesOrderId": 123,
  "WarehouseId": 123,
  "Items": [
    {
      "Quantity": 2,
      "ReturnReasonId": 123,
      "ReturnReasonComment": "too small",
      "SalesOrderLineItemId": 123,
      "DeliveryNoteLineItemId": 123
    }
  ],
  "ReturnDate": "2023-02-01T12:45:00.0000000+00:00",
  "ExternalNumber": "EX-12345",
  "ExternalComment": "a replacement is needed",
  "InternalComment": "handle with care",
  "Contact": "Mr. Robinson",
  "Packages": [
    {
      "TrackingID": "JJD0099999999",
      "ShippingMethodId": 123,
      "ShippingMethodCustom": "DHL"
    }
  ]
}
'
{
  "Id": 123,
  "Number": "A1004465",
  "ReturnDate": "2023-02-01T12:45:00.0000000+00:00",
  "CustomerId": 123,
  "ExternalNumber": "EX-12345",
  "Origin": 0,
  "CompanyId": 123,
  "SalesOrderId": 123,
  "StateId": 123,
  "WarehouseId": 123,
  "ExternalComment": "a replacement is needed",
  "InternalComment": "handle with care",
  "Contact": "Mr. Robinson"
}

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.

Body

application/json

The details of the return to create.

Model Class: CreateReturn

CompanyId
integer<int32>
required
SalesOrderId
integer<int32>
required
WarehouseId
integer<int32>
required
Items
object[]
required

List of items included in the return.

ReturnDate
string<date-time>
Example:

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

ExternalNumber
string
Example:

"EX-12345"

ExternalComment
string
Example:

"a replacement is needed"

InternalComment
string
Example:

"handle with care"

Contact
string
Example:

"Mr. Robinson"

Packages
object[]

Response

The created return.

Model Class: Return

Id
integer<int32>
required
Number
string
required

The number of the return.

Example:

"A1004465"

ReturnDate
string<date-time>
required

The date when the return was created.

Example:

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

CustomerId
integer<int32>
required
ExternalNumber
string
required

An arbitrary external reference number for identifying the return, provided only during creation and cannot be changed afterward.

Example:

"EX-12345"

Origin
enum<integer>
required

0 = None, 1 = Email, 2 = Manual, 3 = Phone, 4 = Fax, 5 = FFN, 6 = SCX, 7 = RestAPI

Available options:
0,
1,
2,
3,
4,
5,
6,
7
CompanyId
integer<int32>
required
SalesOrderId
integer<int32>
required
StateId
integer<int32>
required
WarehouseId
integer<int32>
required
ExternalComment
string
required

The external comment of the sales order.

Example:

"a replacement is needed"

InternalComment
string
required

The internal comment of the sales order.

Example:

"handle with care"

Contact
string
required

The contact of the return.

Example:

"Mr. Robinson"