RETM | REST API
  1. Orders
RETM | REST API
  • Developer guide
  • New to our DevPortal 🤔
  • Authentication
    • Token
      POST
  • Webhook
    • Overview
    • Invoice Webhooks
      • Webhook Events
      • Invoice Created
    • Orders Webhooks
      • Webhook Events
      • Order Triggeres
    • Menu Webhooks
      • Menu Updates
      • Menu Changed
    • Loyalty Webhooks
      • Promotional Coupon
      • Check Reward
      • Redeem Reward
    • Customer webhook
      • Customer Data
      • Customer hook
    • Error webhook
      • Stay Alert to Connectivity Issues
      • Error webhook
  • Orders
    • Orders
      GET
    • Create Order
      POST
    • Cancel Order
      POST
    • Update delivery order status
      POST
  • Menu
    • Categories
      • List Categories
      • Single Categoy
    • Products
      • Products
      • Single Product
      • Simple List
    • Menu
      GET
  • Branches
    • Branches
      GET
  • Devices
    • Devices
      GET
  • Order type
    • Order types
      GET
    • Create order type
      POST
  • Price Lists
    • Price Lists
      GET
  • Payment Methods
    • Payment methods
    • Create pay method
  • Order Charges
    • order charges
    • Create order charges
  • Taxes
    • Tax list
    • Create tax
  • Customers
    • Customers
  1. Orders

Create Order

POST
https://{serviceID}.retm.sa/api/v2/orders/create

Create Order#

This API allows a marketplace application to create an order in the system by providing customer, product, and payment details.

Endpoint#

URL: /api/orders/create
Method: POST
Content-Type: application/json

Request Body#

Root Object:
ParameterTypeRequiredDescription
branchstringYesThe unique identifier of the branch.
customerCustomer[]YesAn object containing the customer's details.
discountDiscount[]NoOptional discount details for the order.
notestringNoAdditional notes for the order.
ordertypestringNoThe order type ID obtained from the order type API.
partner_referencestringNoReference ID for the order in the partner system.
paymentsPayments[]NoPayment details for the order.
productsProduct[]YesA list of products included in the order.
subtotalnumberNoThe subtotal amount before tax and discounts.
taxnumberNoThe total tax amount for the order.
taxesTaxes[]NoA list of taxes applied to the order.
totalnumberNoThe total amount after tax and discounts.
Customer Object:
ParameterTypeRequiredDescription
addressAddressNoCustomer's address details.
nameCustomerNameNoCustomer's name in multiple languages.
phonestringYesCustomer's phone number.
Address Object:
ParameterTypeRequiredDescription
addressstringYesThe detailed address.
idstringYesUnique identifier for the address.
latitudestringYesLatitude coordinate.
longitudestringYesLongitude coordinate.
nameAddressNameYesName for the address in multiple languages.
notestringNoAdditional notes about the address.
Product Object:
ParameterTypeRequiredDescription
idstringYesUnique identifier of the product.
quantitynumberYesQuantity of the product ordered.
totalnumberYesTotal amount after tax and discounts.
discountnumberNoDiscount applied to the product.
modifiersModifier[]NoList of modifiers applied to the product.
notestringNoAdditional notes for the product.
subtotalnumberNoSubtotal amount before tax and discounts.
taxnumberNoTax amount for the product.
taxesTax[]NoList of taxes applied to the product.
variantstringNoSpecific variant of the product.
Modifier Object:
ParameterTypeRequiredDescription
idstringYesUnique identifier of the modifier.
amountnumberYesPrice or amount associated with the modifier.
quantitynumberYesQuantity of the modifier applied.
TAX Object:
ParameterTypeRequiredDescription
idstringYesUnique identifier of the tax.
valuenumberYesValue of the tax applied.
Payments Object:
ParameterTypeRequiredDescription
idstringYesUnique identifier for the payment method or transaction.
amountnumberYesTotal amount paid for the order.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json
branch
string 
required
partner_reference
string 
optional
Refrence for this order in your system
customer
object 
required
phone
string 
required
name
object 
optional
address
object 
optional
products
array [object {10}] 
required
id
string 
required
quantity
number 
required
total
number 
required
variant
string 
optional
subtotal
number 
optional
tax
number 
optional
discount
number 
optional
note
string 
optional
modifiers
array [object {3}] 
optional
taxes
array [object {2}] 
optional
ordertype
string 
optional
note
string 
optional
total
number 
optional
subtotal
number 
optional
tax
number 
optional
discount
object 
optional
code
string 
optional
amount
number 
optional
taxes
object 
optional
id
string 
required
value
number 
required
payments
object 
optional
id
string 
required
amount
number 
required
charges
object 
optional
id
string 
optional
amount
number 
optional
auto_accept
boolean 
optional
Example
{
    "branch": "01hvxcfmtfbr3x3ph8r81kdtqj",
    "customer": {
        "phone": "055123456"
    },
    "charges":{
        "id":"string",
        "value":"decimal"
    },
    "partner_reference": "Jahez: 12327",
    "auto_accept":true,
    "note": "cut in half please",
    "total": 11.5,
    "subtotal":10,
    "tax": 1.15,
    "ordertype": "01hw7tf60necbpr8rps6xg78cq",
    "products": [
        {
            "id": "01GZK6C7J03PQP7KGRAQ3F197Y",
            "variant": "01j82mx3m4376mp9rw5a9rxkbx",
            "quantity": 2,
            "total": 11.5,
            "subtotal": 10,
            "tax": 1.15,
            "discount": 0,
            "note": null,
            "modifiers": [
                {
                    "id": "01hpkd1wj0k9bfermyc8cy0agk",
                    "quantity": 2,
                    "amount":0
                }
            ],
            "taxes": [
                {
                    "id": "01j9t4g36v6vgz798bd3nj3ezh",
                    "value": 1.15
                }
            ]
        }
    ],
    "payments": [{
        "id": "01GZERV8JPY7PNWM2HJ5RXYG2K",
        "amount": 10
    }],
    "taxes": [
        {
            "id": "01j9t4g36v6vgz798bd3nj3ezh",
            "value": 1.15
        }
    ]
}

Responses

🟢200Success
application/json
Body
message
string 
required
order
object 
required
id
string 
required
order_reference
string 
required
partner_reference
string 
optional
Your unique value
Example
{
    "message": "Order Created Successfully",
    "order": {
        "id": "01jh0tfx4khneamer3ks2s5sa4",
        "order_reference": 290,
        "partner_reference": "Jahez: 12327"
    }
}
Modified at 2025-06-17 11:20:10
Previous
Orders
Next
Cancel Order
Built with