application/json

Body Required

  • total string Required
  • sub_total string Required
  • customer_id string(uuid) Required
  • cashier string
  • cashier_code string
  • isDraft boolean
  • start string(date-time) | null
  • services array[object] Required
    Hide services attributes Show services attributes object
    • id string(uuid)
    • staffId string(uuid)
    • quantity integer
    • price number
    • unit_amount number
    • total_amount number
    • type string

      Values are service or product.

    • applyDiscount boolean
    • options_ids array[string]
  • discount object
    Hide discount attributes Show discount attributes object
    • amount number
    • type string

      Values are percentage or fixed.

    • apply_all boolean
  • payment_methods array[object] Required
    Hide payment_methods attributes Show payment_methods attributes object
    • id string(uuid)
    • amount number
    • total_amount number

Responses

  • 201 application/json

    Order created successfully

  • 400

    Bad request

POST /pos/orders
curl \
 --request POST 'https://api.mahjoz.io/api/v1/pos/orders' \
 --header "X-Api-Key: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"start":null,"total":"515.20","cashier":"569511","isDraft":false,"discount":{"type":"percentage","amount":20,"apply_all":true},"services":[{"id":"707915cd-dfe1-4375-b9fb-c33b819475da","type":"service","price":50,"staffId":"21831c95-dcce-44db-8a59-a7eb6d200687","quantity":1,"unit_amount":50,"total_amount":50,"applyDiscount":true}],"sub_total":"644.00","customer_id":"96a0a424-bc82-4ed9-b007-05921e361172","cashier_code":"569511","payment_methods":[{"id":"5ec3a074-a353-4d8f-bd30-20aec07910a1","amount":404,"total_amount":404}]}'
Request example
{
  "start": null,
  "total": "515.20",
  "cashier": "569511",
  "isDraft": false,
  "discount": {
    "type": "percentage",
    "amount": 20,
    "apply_all": true
  },
  "services": [
    {
      "id": "707915cd-dfe1-4375-b9fb-c33b819475da",
      "type": "service",
      "price": 50,
      "staffId": "21831c95-dcce-44db-8a59-a7eb6d200687",
      "quantity": 1,
      "unit_amount": 50,
      "total_amount": 50,
      "applyDiscount": true
    }
  ],
  "sub_total": "644.00",
  "customer_id": "96a0a424-bc82-4ed9-b007-05921e361172",
  "cashier_code": "569511",
  "payment_methods": [
    {
      "id": "5ec3a074-a353-4d8f-bd30-20aec07910a1",
      "amount": 404,
      "total_amount": 404
    }
  ]
}
Response examples (201)
{}