Create an order
ProRead & write keyAvailable on the Pro and Enterprise plans (beta).
POSThttps://app.reshta.ir/api/v1/public…/public/orders
Creates a new order in the business that owns the key and sends the order.created event to your webhooks. The response is the new record.
Request
curl https://app.reshta.ir/api/v1/public/orders \ -X POST \ -H "Authorization: Bearer $RESHTA_API_KEY" \ -H "Idempotency-Key: 7f3c2b1e-4a5d-4c6f-9e1a-2b3c4d5e6f70" \ -H "Content-Type: application/json" \ -d '{"contact_id":"0192c4e8-7b1a-7c3e-9f20-5d6a1b2c3d4e","status":"paid","source":"api","currency":"IRR","total_amount":24500000,"items":[{"name_snapshot":"کاپشن پاییزه","qty":1,"unit_price":24500000}]}'Headers
AuthorizationstringrequiredBearer followed by the business API key (rk_live_…).
Idempotency-KeystringrequiredA unique ID for this operation, such as a fresh UUID; retrying with the same key does nothing twice.
Content-Typeapplication/jsonrequiredThe body is UTF-8 JSON.
Body parameters
numberstringoptionalOrder number.
contact_iduuid | nulloptionalOnly orders of this contact.
deal_iduuid | nulloptionalThe related deal.
statusstringoptionaldefault: "paid"Order status.values:pendingpaidpreparingshippeddeliveredcancelledrefundedpartially_refunded
total_amountintegeroptionalTotal, an integer in rials.
currencystringoptionaldefault: "IRR"Currency, such as IRR.
sourcestringoptionaldefault: "manual"Through the API only manual or api; the others are set by the integrations.values:manualapiwoocommercesnappshopbasalamdigikaladuza
external_idstring | nulloptionalSet by integrations only; refused through the API.
provider_connection_iduuid | nulloptionalSet by integrations only; refused through the API.
placed_atstringoptionalWhen the order was placed, ISO 8601.
customobjectoptionaldefault: {}Custom fields, keyed by field key.
owner_iduuid | nulloptionalOnly records owned by this teammate.
itemsobject[]optionalOrder lines.
items[].product_iduuid | nulloptionalThe catalogue product.
items[].name_snapshotstringrequiredThe item name on this order.
items[].qtynumberoptionaldefault: 1Quantity; default 1.
items[].unit_priceintegerrequiredUnit price in rials.
items[].discount_pctnumberoptionaldefault: 0Discount percent.
items[].discount_amountintegeroptionalLine discount in rials; not together with discount_pct.
payment_termsstringoptionalprepay, or cod (cash on delivery).values:prepaycod
sales_source_codestringoptional
shipping_addressobjectoptionalShipping address.
shipping_address.statestring | nulloptional
shipping_address.citystring | nulloptional
shipping_address.linestring | nulloptional
shipping_address.postal_codestring | nulloptional
Responses and errors
201—Created; the body is the record.
400validation_errorInvalid body, or no Idempotency-Key; details names the field.
401unauthorizedThe key is missing, wrong or revoked, or its creator is no longer active.
403forbiddenThe key has no write access.
409conflictThis Idempotency-Key came with another body, or is still in progress.
429rate_limitedOver 120 requests per minute; Retry-After says how many seconds to wait.
Response
400
{ "error": { "code": "validation_error", "message": "Idempotency-Key header is required", "details": [ { "field": "idempotency_key", "message": "idempotency_key_required" } ] }}Related webhook: order.created