Endpoints
Orders
Send orders placed on your website to your workspace.
Create an order
POST /ordersCreates 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.
| Field | Rules |
|---|---|
customer_name | Required. Up to 255 characters. |
customer_phone | Required without customer_email. With country code, for example +8801712345678. |
customer_email | Required without customer_phone. |
external_id | Optional. Your own order ID, up to 100 characters - see Avoid duplicates. |
shipping_address | Optional. Up to 1,000 characters. |
notes | Optional. Up to 5,000 characters. |
payment_status | Optional. unpaid or paid. |
payment_method | Optional. cod, bank, card, mobile_wallet, gateway or other. |
discount, shipping, tax | Optional amounts, 0 or more. |
items | Required. 1 to 200 lines. |
Order lines
| Field | Rules |
|---|---|
quantity | Required. 1 to 100,000. |
product_id | A product in the workspace. Its name, SKU and price are used unless you send your own. |
variant_id | Required when the product has variants. |
name, unit_price | Required when there is no product_id. |
sku | Optional. Up to 100 characters. |
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.