Send and query orders
With the order addresses of the API you send orders from your online shop, ERP or inventory system straight into the warehouse. You ask how far each order has got, fetch the tracking numbers once it has left the warehouse, and change it as long as the warehouse has not started on it.
You find the complete description of every field in X-Sitter under Settings > API documentation (Einstellungen > API-Dokumentation) once you are logged in. There you can try every address right away with a token of your company.
Step 1: Check the requirements
- Your user has the menu entry Settings > API access (Einstellungen > API Zugang) in X-Sitter and the permissions of the group Orders (Aufträge) your token is meant to get.
- Your company has the module the orders arrive in. Orders sent through the API land in the module API unless you name another one.
GET /api/v1/orders/modulesshows the modules of your company. Without the module the API refuses every order with422 order_module_not_enabled. As a logistician you assign modules under Administration > Jobs & connections > Modules; as a client, ask your logistician. - The articles you ship exist in X-Sitter. The API finds them by their article number (
sku). An article number X-Sitter does not know is taken anyway, but the order can only be processed once the article exists.
Step 2: Create a token
- Click your name in the top right corner of X-Sitter, then Settings (Einstellungen).
- Choose API access (API Zugang) on the left.
- In the API token section, enter a Name (Bezeichnung), e.g. "Shop orders".
- In the group Orders (Aufträge), tick what your system needs: read (lesen) for status and tracking numbers, create (anlegen) for new orders, change (ändern) for corrections.
- Click Create token (Token anlegen) and take the token (it starts with
xst_) right away with copy (kopieren). It is shown only this one time.
The token is as valuable as a password. More about this in the overview.
Step 3: Test the order as a dry run
Before you send real orders, try your request as a dry run. Send the header X-XSitter-Dry-Run: true with it. The request then runs as usual: the same checks, the same response with the same status code, also the same error messages. At the end, however, everything is rolled back: the order is not saved, the warehouse never sees it and no workflows run. To make sure, the response carries the header X-XSitter-Dry-Run: true as well.
Replace xst_YOUR_TOKEN in the examples with your token:
curl -X POST "https://app.x-sitter.com/api/v1/orders" \
-H "Authorization: Bearer xst_YOUR_TOKEN" \
-H "X-XSitter-Dry-Run: true" \
-H "Content-Type: application/json" \
-d '{
"order_id": "1000123",
"delivery_address": {
"first_name": "Jane",
"last_name": "Doe",
"street": "123 Maple Street",
"zip": "12345",
"city": "Anytown",
"country": "DE",
"email": "jane@example.com"
},
"positions": [
{ "sku": "SKU-100", "quantity": 2, "price": 19.99 }
]
}'
<?php
$token = 'xst_YOUR_TOKEN';
$order = [
'order_id' => '1000123',
'delivery_address' => [
'first_name' => 'Jane',
'last_name' => 'Doe',
'street' => '123 Maple Street',
'zip' => '12345',
'city' => 'Anytown',
'country' => 'DE',
'email' => 'jane@example.com',
],
'positions' => [
['sku' => 'SKU-100', 'quantity' => 2, 'price' => 19.99],
],
];
$ch = curl_init('https://app.x-sitter.com/api/v1/orders');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($order),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $token,
'Content-Type: application/json',
'X-XSitter-Dry-Run: true',
],
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
$result = json_decode($body, true);
print_r($status === 201 ? $result['data'] : $result['error']);
import requests
token = "xst_YOUR_TOKEN"
order = {
"order_id": "1000123",
"delivery_address": {
"first_name": "Jane",
"last_name": "Doe",
"street": "123 Maple Street",
"zip": "12345",
"city": "Anytown",
"country": "DE",
"email": "jane@example.com",
},
"positions": [{"sku": "SKU-100", "quantity": 2, "price": 19.99}],
}
response = requests.post(
"https://app.x-sitter.com/api/v1/orders",
json=order,
headers={"Authorization": f"Bearer {token}", "X-XSitter-Dry-Run": "true"},
timeout=30,
)
result = response.json()
print(result["data"] if response.ok else result["error"])
const token = 'xst_YOUR_TOKEN';
const order = {
order_id: '1000123',
delivery_address: {
first_name: 'Jane',
last_name: 'Doe',
street: '123 Maple Street',
zip: '12345',
city: 'Anytown',
country: 'DE',
email: 'jane@example.com',
},
positions: [{ sku: 'SKU-100', quantity: 2, price: 19.99 }],
};
const response = await fetch('https://app.x-sitter.com/api/v1/orders', {
method: 'POST',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
'X-XSitter-Dry-Run': 'true',
},
body: JSON.stringify(order),
});
const result = await response.json();
console.log(response.ok ? result.data : result.error);
If you get 201, the order is fine. Leave out the header and the same call creates the order for real. Reading requests (GET) always run for real, the header changes nothing for them.
Step 4: Create an order
An order needs three things: your order number, the delivery address and at least one position. Everything else is optional.
Delivery address: company, first_name, last_name, street, house_number, add_on, zip, city, state, country, phone, email. Required are street, zip, city, country (two letters according to ISO 3166-1, e.g. DE) and either last_name or company. The house number may be part of street or separate in house_number. X-Sitter stores every value as you send it.
Positions:
The response is 201 with the whole order as it was saved. The header Location names its address. Keep the field id: you use it to query and change the order later. The order starts in the status open and appears right away in the order overview of the warehouse.
Step 5: Understand the response
A shipped order looks like this:
{
"data": {
"id": "01a0ca21-c3a9-7f5a-b51d-6a62a4736f7a",
"order_id": "1000123",
"order_number": null,
"company_id": 27,
"module": "api",
"platform": "webshop",
"status": "sent",
"business": false,
"priority": 10,
"order_date": "2026-11-06 09:30:00",
"added_at": "2026-11-06 09:30:02",
"updated_at": "2026-11-06 15:12:40",
"shipped_at": "2026-11-06 15:12:40",
"note": null,
"delivery_address": { "first_name": "Jane", "last_name": "Doe", "street": "123 Maple Street", "zip": "12345", "city": "Anytown", "country": "DE" },
"weight": 1.4,
"tracking": {
"carrier": "DHL",
"parcels": [
{ "number": "00340434161094042557", "url": "https://www.dhl.de/..." }
]
},
"positions": [
{
"id": "01a0ca21-c469-75dc-9e51-965821f74267",
"position": 1,
"article_id": "0198314b-fa6b-71d6-bccd-2da190385b72",
"sku": "SKU-100",
"ean": "4006381333931",
"name": "Spice mill",
"quantity": 2,
"delivered_quantity": 2,
"price": 19.99,
"tax_rate": 19,
"weight": 1.2,
"status": null,
"bundle": null,
"batch": null,
"delivered_batches": [
{ "batch": "529674", "best_before": "2027-02-11", "quantity": 2 }
]
}
]
}
}
The most important values of status (all statuses explained in Order statuses):
Step 6: Query status and tracking numbers
For a single order, call GET /api/v1/orders/{id}. For a regular sync, ask only for what has changed instead, for example every minute for the orders that were shipped since your last call:
curl "https://app.x-sitter.com/api/v1/orders/status/sent?updated_since=2026-11-06T08:00:00%2B01:00" \
-H "Authorization: Bearer xst_YOUR_TOKEN"
Remember the time of every call and send it as updated_since the next time. Separate several statuses with commas, e.g. /api/v1/orders/status/sent,cancelled. GET /api/v1/orders/status counts how many orders are in which status.
Narrow down the list
GET /api/v1/orders and GET /api/v1/orders/status/{status} know the same parameters:
Write a + in the time zone as %2B in the address, otherwise it arrives as a space. How to fetch all pages one after the other is explained in the overview.
Step 7: Change an order
As long as the warehouse has not started on the order, you can change it. That works in the statuses open, on_hold, faulty and waiting_payment. Afterwards the API answers with 409 order_not_editable and names the current status in details.order_status. Every change shows in the history of the order.
Head of the order: PATCH /api/v1/orders/{id} with the fields that change: order_number, order_date, platform, business, note and single fields of the delivery_address. An empty text removes an address field, but the address has to stay complete. Status, company and order_id never change here.
curl -X PATCH "https://app.x-sitter.com/api/v1/orders/01a0ca21-c3a9-7f5a-b51d-6a62a4736f7a" \
-H "Authorization: Bearer xst_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "note": "Ring twice", "delivery_address": { "street": "125 Maple Street", "add_on": "" } }'
Position: PATCH /api/v1/orders/{id}/positions/{position} with sku, name, ean, quantity, price, tax_rate or batch. {position} is the id of the position from the response. Another sku or quantity sets article and weight of the position anew. Positions of a set (bundle is parent or part) cannot be changed.
curl -X PATCH "https://app.x-sitter.com/api/v1/orders/01a0ca21-c3a9-7f5a-b51d-6a62a4736f7a/positions/01a0ca21-c469-75dc-9e51-965821f74267" \
-H "Authorization: Bearer xst_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "quantity": 3 }'
Both calls answer with the whole order after the change.
Batch per position
If a position has to come from a specific batch, for example a lot of your ERP, send the batch in the field batch of the position:
"positions": [
{ "sku": "SKU-100", "quantity": 1, "batch": "529674" }
]
- The warehouse then picks the position only from stock of this batch. If the batch is not enough, the missing quantity stays open. It is never filled up from another batch.
- Positions without
batchrun as usual; the warehouse then takes the oldest stock first. - Upper and lower case and spaces at the start or end do not matter. The batch has to be named the way the warehouse keeps it (as recorded at goods receipt).
- Up to 32 characters. The API refuses a longer batch with
422 invalid_order. - As long as the warehouse has not started, you change the batch with
PATCH …/positions/{position}and"batch": "…";"batch": nullor an empty text removes it.
As soon as the warehouse has picked, delivered_batches names per position the batches and best before dates the pieces left the warehouse with, also for positions that did not ask for a batch:
"batch": "529674",
"delivered_batches": [
{ "batch": "529674", "best_before": "2027-02-11", "quantity": 1 }
]
batch or best_before is null when the stock had no batch or no date. In the order form of X-Sitter you set the same batch by hand in the column Batch (Charge) of the position.
Sets (bills of materials)
If the sku of a position is a set from your catalogue, X-Sitter splits it into its parts. The set stays as a position with bundle: "parent" and is not picked. The parts follow as positions of their own with bundle: "part"; those are what the warehouse picks. A set has no batch of its own, its parts come from any batch.
For logisticians: orders of a client
As a logistician you see your own orders and those of your clients in the lists. With the header X-Company and the company number of the client you work for this one client only. A new order then belongs to the client:
curl -X POST "https://app.x-sitter.com/api/v1/orders" \
-H "Authorization: Bearer xst_YOUR_TOKEN" \
-H "X-Company: 27" \
-H "Content-Type: application/json" \
-d @order.json
As a client you never need X-Company. You see and change only your own orders.
Moving from api.x-sitter.com
The old API at api.x-sitter.com is being switched off, its functions now live here. What changes for your system:
- No login call any more. Instead of
GET /tokenwithapi-idandapi-secretyou create a token once (step 2) and send it with every request. It does not expire after eight hours. - Dry run instead of sandbox. The sandbox at
api.x-sitter.com/sandbox/is gone; use the headerX-XSitter-Dry-Run: true(step 3). - One shape for every response. Data comes as
{"data": …, "meta": …}, errors as{"error": …}with the matching HTTP status (the old API mostly answered with 406).
Sets are no longer checked against the stock when an order comes in: every order is taken with all its sets and waits in the warehouse for missing goods.