> For the complete documentation index, see [llms.txt](https://help.recart.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.recart.com/developers/public-api/order/create-an-order.md).

# Create an order

Create an order in Recart. It sends the associated receipt flow to the recipient. Flow must be active to send the message.

```json
{"openapi":"3.1.0","info":{"title":"Recart API","version":"2023-12"},"tags":[{"name":"Order","description":"Orders"}],"servers":[{"url":"https://api.recart.com/app-integrations/2023-12","description":"Production"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Recart-API-Key","description":"It can be obtained in Recart account after contacting Support"}},"schemas":{"CreateOrder":{"type":"object","required":["type","attributes"],"properties":{"type":{"type":"string"},"attributes":{"type":"object","required":["orderStatusUrl","orderNumber","orderId","totalPrice","lineItems","createdAt"],"properties":{"phoneNumber":{"type":"string","description":"Preferably E.164 format"},"sessionId":{"type":"string","description":"Recart identifier of the purchase session. Use `_recart.getSessionId()` on the merchant's store when Recart script is running."},"orderStatusUrl":{"type":"string","format":"uri","description":"URL of the order status page"},"orderNumber":{"type":"string","format":"int64","description":"Order number"},"orderId":{"type":"string","format":"int64","description":"Order ID"},"totalPrice":{"type":"object","required":["value","currency"],"properties":{"value":{"type":"number","format":"double","description":"Value of order"},"currency":{"type":"string","description":"Currency of the order"}}},"createdAt":{"type":"string","description":"UTC Date and time in ISO 8601 format"},"lineItems":{"type":"array","items":{"type":"object","required":["productId","name","quantity","price"],"properties":{"productId":{"type":"string","format":"int64","description":"ID of the product"},"variantId":{"type":"string","format":"int64","description":"ID of the product variant"},"name":{"type":"string","description":"Name of the product"},"quantity":{"type":"integer","format":"int32","description":"Quantity of the product"},"price":{"type":"object","required":["value","currency"],"properties":{"value":{"type":"number","format":"double","description":"Value of orderItem"},"currency":{"type":"string","description":"Currency of the orderItem"}}}}}},"discountCodes":{"type":"array","items":{"type":"object","required":["code","amount"],"properties":{"code":{"type":"string","description":"Discount code"},"amount":{"type":"number","format":"double","description":"Value of discount"}}}}}}}},"HttpErrorBody":{"type":"object","required":["errors"],"properties":{"errors":{"type":"array","items":{"type":"object","required":["id","code","title","detail"],"properties":{"id":{"type":"string"},"code":{"type":"string"},"title":{"type":"string"},"detail":{"type":"string"}}}}}}},"responses":{"HttpError":{"description":"HTTP Error response","content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/HttpErrorBody"}}}}}},"paths":{"/orders":{"post":{"summary":"Create an order","tags":["Order"],"operationId":"postOrder","description":"Create an order in Recart. It sends the associated receipt flow to the recipient. Flow must be active to send the message.\n","requestBody":{"required":true,"content":{"application/vnd.api+json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CreateOrder"}}}}}},"responses":{"202":{"description":"Created"},"4XX":{"$ref":"#/components/responses/HttpError"},"5XX":{"$ref":"#/components/responses/HttpError"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.recart.com/developers/public-api/order/create-an-order.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
