Skip to main content
POST
/
order
/
create
Order creation
curl --request POST \
  --url https://app.xmenu.it/api/order/create \
  --header 'Content-Type: application/json' \
  --header 'X-Client-Id: <api-key>' \
  --header 'X-Client-Secret: <api-key>' \
  --data '
{
  "client": {
    "first_name": "<string>",
    "last_name": "<string>",
    "email": "<string>",
    "phone": "<string>"
  },
  "dmethod": "<string>",
  "payment_method": "cash",
  "details": [
    {
      "product": {
        "uid": "<string>"
      },
      "quantity": 123,
      "notes": "<string>",
      "options": [
        {
          "uid": "<string>",
          "values": [
            {
              "uid": "<string>",
              "quantity": 123
            }
          ]
        }
      ]
    }
  ],
  "subrestaurant_uid": "<string>",
  "language": "<string>",
  "pickup": {
    "date": "2023-11-07T05:31:56Z"
  },
  "delivery": {
    "date": "2023-11-07T05:31:56Z",
    "address": {
      "place_id": "<string>",
      "doorbell": "<string>",
      "floor": "<string>"
    }
  },
  "payment_method_sub": "<string>",
  "coupon": {},
  "notes": "<string>",
  "creator": "customer"
}
'
{
"success": true,
"error": "<string>",
"message": "<string>",
"order": {
"uid": "<string>",
"token": "<string>",
"order_number": "<string>",
"total": 123,
"date": "2023-11-07T05:31:56Z",
"confirmed": true,
"delivery_fee": 123,
"pickup_date": "2023-11-07T05:31:56Z",
"delivery_date": "2023-11-07T05:31:56Z"
}
}
write:orders

Authorizations

X-Client-Id
string
header
required

Client ID for API Client authentication (must be used together with Client Secret)

X-Client-Secret
string
header
required

Client Secret for API Client authentication (must be used together with Client ID)

Body

application/json
client
object
required
dmethod
string
required

Delivery method:

  • 0 = pickup at location
  • 1 = home delivery
  • 0t = at table
  • 20 = pickup at pickup point
  • 0e-{id} = event (where {id} is the event ID)
  • dcf-{id} = custom method (where {id} is the method ID)
payment_method
enum<string>
required

Payment method:

  • cash = cash
  • invoice = invoice
  • external = externally handled
Available options:
cash,
invoice,
external
details
object[]
required

Order items (products with quantities/options)

subrestaurant_uid
string

Location identifier. Required for multi-location restaurants

language
string

ISO 639-1 language code; defaults to restaurant settings

pickup
object

Pickup data. Required for dmethod=0

delivery
object

Delivery data. Required for dmethod=1

payment_method_sub
string

Payment sub-method. Required if payment_method=cash

coupon
object

Discount code application

notes
string

General order notes

creator
enum<string>

Order origin:

  • customer = customer (default)
  • restaurant = restaurant
Available options:
customer,
restaurant

Response

Order creation response

success
boolean
required

Operation result: true if successful, false if failed

error
string

Error code if the operation failed. Possible values:

  • PRODUCT_NOT_FOUND = product not found
  • PRODUCT_NOT_AVAILABLE = product unavailable
  • OPTION_NOT_FOUND = option not found
  • OPTION_VALUE_NOT_FOUND = option value not found
  • INVALID_ADDRESS = invalid address or out of zone
  • COUPON_ERROR = coupon application error
  • SUBRESTAURANT_NOT_FOUND = location not found

See Error codes for general error codes that may occur.

message
string

Human-readable error description if the operation failed

order
object

Created order data (present only if success = true)