Endpoints

Orders

Send orders placed on your website to your workspace.

Create an order

Request
POST /orders

Creates an order with the source Website and status Pending. The customer is matched to an existing contact by phone, then email, or created as a new one.

FieldRules
customer_nameRequired. Up to 255 characters.
customer_phoneRequired without customer_email. With country code, for example +8801712345678.
customer_emailRequired without customer_phone.
external_idOptional. Your own order ID, up to 100 characters - see Avoid duplicates.
shipping_addressOptional. Up to 1,000 characters.
notesOptional. Up to 5,000 characters.
payment_statusOptional. unpaid or paid.
payment_methodOptional. cod, bank, card, mobile_wallet, gateway or other.
discount, shipping, taxOptional amounts, 0 or more.
itemsRequired. 1 to 200 lines.

Order lines

FieldRules
quantityRequired. 1 to 100,000.
product_idA product in the workspace. Its name, SKU and price are used unless you send your own.
variant_idRequired when the product has variants.
name, unit_priceRequired when there is no product_id.
skuOptional. Up to 100 characters.
Example
curl -X POST "https://<your-api-host>/api/public/v1/orders" \
  -H "X-Api-Key: mf_your_key" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "external_id": "WEB-10045",
    "customer_name": "Nadia Rahman",
    "customer_phone": "+8801712345678",
    "payment_method": "cod",
    "shipping": 5,
    "items": [{ "product_id": 12, "quantity": 2 }]
  }'

A new order returns 201 with the order, including its number, total, customer and items.

Avoid duplicates

Send your own order ID as external_id. If an order with the same external_id was already received, the API returns that order with 200 and the message Order already received instead of creating a second one. This makes it safe to retry a request that timed out.