Send an order
Create an order end to end: look up IDs, build the request, read the response and warnings, and know what happens next.
Overview
Your app sends an order with POST /orders. The shop creates it as a regular order under the shop assigned to your key, together with the customer if needed. The key needs the scope orders.write.
The flow:
- Look up payment method and referrer IDs once, and order status IDs if you set the status.
- Optionally check the order with
POST /orders/validate. - Send the order.
- Store the returned order
id. - On a timeout or temporary error, send the same order again. See Retries and duplicate protection.
All examples use https://shop.example.com/api/v1. Each shop has its own address.
Step 1: look up IDs
An order references a payment method and, optionally, a referrer by their IDs in the shop.
GET /payment-methods lists the payment methods available in your key’s shop:
curl -s https://shop.example.com/api/v1/payment-methods \
-H "Authorization: Bearer $OMNEYA_API_KEY" \
-H "Accept: application/json"
{
"data": [
{
"id": 3,
"name": "Invoice",
"provider": "invoice",
"customer_class_ids": [],
"min_order_value": null,
"max_order_value": null,
"requires_customer_approval": false
}
]
}
Send only IDs from this list. Any other active payment method is rejected with payment_method_not_available, for example one that is assigned to a different shop or whose provider is not set up.
customer_class_ids is empty when the payment method is available to all customer classes. Together with min_order_value and max_order_value it is for your information; the order intake does not check these for ordinary payment methods.
The collective invoice is listed with requires_customer_approval: true. It is accepted only if the customer is approved for it, the same way as in the shop checkout: by the customer’s own setting, otherwise by the customer class. For a new customer, the shop’s default customer class decides. If the customer is not approved, the order is rejected with payment_method_not_available. If the billing address of such an order differs from the address stored for the customer, the order is still created, but invoiced on its own instead of on the collective invoice, and the response carries the warning collective_invoice_single_order.
GET /referrers lists the referrers that are active and assigned to your key’s shop:
{
"data": [{ "id": 17, "name": "Example Store App" }]
}
GET /order-statuses lists all order statuses of the shop, sorted by position:
{
"data": [
{ "id": 1, "name": "Incoming order", "system_status_id": 2, "position": 1 },
{ "id": 4, "name": "Payment received", "system_status_id": 3, "position": 2 }
]
}
You need it only if you want to set the status of new orders yourself (see Order status in step 2).
These IDs rarely change. Fetch them once and store them in your configuration. If you do not send a referrer_id, the default referrer of your key applies.
Step 2: build the request
A complete order for a new customer, with a separate delivery address at a parcel locker:
POST /api/v1/orders HTTP/1.1
Host: shop.example.com
Authorization: Bearer omn_live_AbCd1234_0123456789abcdefghijABCDEFGHIJ12
Content-Type: application/json
Accept: application/json
{
"external_order_id": "APP-100234",
"ordered_at": "2026-10-13T12:05:00Z",
"payment_method_id": 3,
"referrer_id": 17,
"currency": "EUR",
"comment": "Please ring twice",
"shipping_cost_gross": 4.9,
"customer": {
"external_id": "u-55871",
"email": "jane.doe@example.com",
"email_verified": true,
"telephone": "+49 30 0000000",
"billing": {
"salutation": "Ms",
"title": null,
"first_name": "Jane",
"last_name": "Doe",
"company": null,
"street": "Example Street",
"house": "5",
"additional": "2nd floor",
"postcode": "10115",
"city": "Berlin",
"state": null,
"country": "DE"
},
"shipping": {
"salutation": "Ms",
"first_name": "Jane",
"last_name": "Doe",
"street": "Packstation",
"house": "123",
"postcode": "10117",
"city": "Berlin",
"country": "DE",
"telephone": "+49 170 0000000",
"packstation": true,
"postnumber": "12345678"
}
},
"items": [
{ "sku": "SKU-1001", "quantity": 2, "unit_price_gross": 29.9 },
{ "article_id": 101683, "quantity": 1 }
]
}
Every field, its type and its limits are listed in the reference for Create an order. The rules that shape the flow:
Order number. external_order_id is your order number. It protects against duplicates: the same number never creates a second order for your access.
Order time. ordered_at is optional, in ISO 8601 with a time zone (Z or +02:00). It may be up to 30 days in the past and not in the future. Without it, the time of receipt is used.
Currency. Only EUR is accepted.
Order status. order_status_id is optional. Without it, the order starts in the shop’s incoming order status. With an ID from GET /order-statuses, the order is created directly in that status; it does not pass through the incoming status first. Every status of the shop is accepted, including cancelled and shipped statuses, so send only a status you really mean. The shop’s automatic processes for new orders (the “new order” event) run after the order was created in your status. An unknown ID is rejected with unknown_order_status.
Customer. For a new customer, send your customer ID in customer.external_id, plus email and billing. For a customer the shop already knows through your access, the ID alone is enough:
"customer": { "external_id": "u-55871" }
Instead of your ID you can also send the shop’s customer number, from an earlier response or from the shop operator:
"customer": { "customer_id": 9021 }
The shop then takes the email from its customer record and uses the customer’s default billing address: the address marked as default for invoices in the address book, or the main customer address if none is marked. If you send a billing address anyway, it is used for this order and added to the customer’s address book; the customer record itself is not changed. If that address is incomplete, the request fails with customer_address_incomplete and you need to send billing. How the shop decides which customer an order belongs to is explained in How customers are matched.
Delivery address. customer.shipping is optional. Without it, or with an empty object {}, the order is delivered to the billing address. A delivery address you send is stored in the order and added to the customer’s address book; an identical address is stored only once. For a parcel locker or post office, set packstation to true, put the locker number in house and the customer’s post number (6 to 10 digits) in postnumber.
Items. Between 1 and 200 items. Each item has exactly one of sku (the shop’s item number, not case-sensitive) or article_id (the shop’s main article number). Items with variants, for example sizes, share one article_id; use sku for them.
Prices. unit_price_gross is optional. If you send it, it is used as a fixed price. Without it, the shop’s own price applies. A discount of the customer’s class can also apply to prices you send, so always take the order total from grand_total_gross in the response.
Shipping costs. shipping_cost_gross is optional. If you send it, including 0, it applies. Without it, the shop calculates shipping costs with its own rules. The shipping method is always chosen by the shop.
Step 3: send it
curl -s -X POST https://shop.example.com/api/v1/orders \
-H "Authorization: Bearer $OMNEYA_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
--data @order.json
Step 4: read the response
A new order answers 201 Created:
{
"data": {
"id": 48211,
"order_number": "48211",
"external_order_id": "APP-100234",
"duplicate": false,
"customer_id": 9021,
"customer_created": true,
"status_id": 1,
"status": "Incoming order",
"payment_method_id": 3,
"referrer_id": 17,
"shipping_method_id": 4,
"shipping_method": "Parcel",
"shipping_cost_gross": 4.9,
"shipping_cost_source": "app",
"items": [
{ "sku": "SKU-1001", "quantity": 2, "unit_price_gross": 29.9, "price_source": "app" },
{ "sku": "SKU-2040", "quantity": 1, "unit_price_gross": 5.0, "price_source": "system" }
],
"grand_total_gross": 69.7,
"currency": "EUR"
},
"warnings": []
}
Store id (or order_number, which carries the same value as text) together with your order. Store customer_id with your customer if you want to reference the customer by the shop’s number later.
customer_created is true when a new customer was created. shipping_cost_source and price_source show whether a value came from your request (app) or was calculated by the shop (system). status_id and status show the order status (the one you sent, otherwise the incoming status); the status name is the one configured in the shop.
A 200 OK with "duplicate": true means the order already existed. See Retries and duplicate protection.
Warnings
warnings is always present. An empty list means everything went through as expected. A warning does not stop the order: it was created, but needs attention.
"warnings": [
{
"code": "no_shipping_method",
"message": "No shipping method matches. The order was created without a shipping method."
}
]
code |
Meaning |
|---|---|
no_shipping_method |
No shipping method matched the order. shipping_method_id and shipping_method are null; the operator sets the method by hand. |
customer_already_linked |
The customer was found by email, but is already linked to a different customer ID of your app |
collective_invoice_single_order |
The order uses the collective invoice, but its billing address differs from the customer’s stored address. The order is invoiced on its own, not on the collective invoice. |
Errors
If the order is rejected, nothing is created: no order, no customer, no stock reservation. The most common answers:
422 validation_failed: fix the fields listed inerror.details, then send again.422 client_not_configured: your access has no valid shop or referrer. Inform the operator.409 order_deleted: an order with this number existed and was deleted. Do not retry.
The details are in Errors and the error code reference.
What happens after the order is created
The order starts in the shop’s initial order status, or in the status you sent as order_status_id. After 201, the shop reserves stock and starts its usual processes, for example the order confirmation, payment handling and shipping. These run inside the shop. The API does not send further notifications to your app. To see the current state of an order, read it with GET /orders/{orderId} (scope orders.read), see Read an order.
Orders sent with a test key are created the same way and are marked in the order history. See Live and test environments.