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": 1073741823.5000005,
      "ReturnReasonId": 123,
      "ReturnReasonComment": "<string>",
      "Credit": true,
      "SalesOrderLineItemId": 123,
      "DeliveryNoteLineItemId": 123
    }
  ],
  "ReturnDate": "2023-11-07T05:31:56Z",
  "ExternalNumber": "<string>",
  "ExternalComment": "<string>",
  "InternalComment": "<string>",
  "Contact": "<string>",
  "Packages": [
    {
      "TrackingID": "<string>",
      "ShippingMethodId": 123,
      "ShippingMethodCustom": "<string>"
    }
  ],
  "TransmitToSalesChannel": true
}
'
{
  "Id": 123,
  "Number": "<string>",
  "ReturnDate": "2023-11-07T05:31:56Z",
  "CustomerId": 123,
  "ExternalNumber": "<string>",
  "Origin": 0,
  "CompanyId": 123,
  "SalesOrderId": 123,
  "StateId": 123,
  "WarehouseId": 123,
  "ExternalComment": "<string>",
  "InternalComment": "<string>",
  "Contact": "<string>",
  "TransmitToSalesChannel": true
}

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-companyid
string

The Company-Id (int or uuid) of the company on whose behalf the request is 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

The company of the corresponding sales order.

SalesOrderId
integer<int32>
required

The id of the sales order if the return has exactly on corresponding sales order.

WarehouseId
integer<int32>
required

Id of the Warehouse.

Items
object[]
required

List of items included in the return.

ReturnDate
string<date-time>

The date when the return was created.

ExternalNumber
string

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

ExternalComment
string

The external comment of the sales order.

InternalComment
string

The internal comment of the sales order.

Contact
string

The contact of the return.

Packages
object[]

List of packages included in the return.

TransmitToSalesChannel
boolean

Indicates whether the return should be transmitted to the sales channel (e.g. SCX or Amazon).

Response

The created return.

Model Class: Return

Id
integer<int32>
required

Unique ID to identify a return.

Number
string
required

The number of the return.

ReturnDate
string<date-time>
required

The date when the return was created.

CustomerId
integer<int32>
required

The customer ID.

ExternalNumber
string
required

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

Origin
enum<integer>
required

Indicates the origin of the return, specifying where or how the return was initiated.

Available options:
0,
1,
2,
3,
4,
5,
6,
7
CompanyId
integer<int32>
required

The company of the corresponding sales order.

SalesOrderId
integer<int32>
required

The id of the sales order if the return has exactly on corresponding sales order.

StateId
integer<int32>
required

The id of the return state.

WarehouseId
integer<int32>
required

Id of the Warehouse.

ExternalComment
string
required

The external comment of the sales order.

InternalComment
string
required

The internal comment of the sales order.

Contact
string
required

The contact of the return.

TransmitToSalesChannel
boolean
required

Indicates whether the return should be transmitted to the sales channel (e.g. SCX or Amazon).