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

# Order API

{% hint style="info" %}
**Good to know:** This API method provides developers the ability to expedite cart creation with a direct link to checkout with stacked discounts (i.e. line items discounted with promo and credit applied). Gift cards can also be optionally applied at checkout.
{% endhint %}

## GET orders endpoint

Search and filter customer orders by including any combination of query key value pairs <mark style="color:blue;">`id`</mark>,<mark style="color:blue;">`email`</mark>,<mark style="color:blue;">`created_at_min`</mark>, or <mark style="color:blue;">`created_at_max`</mark> appended to the /api/orders endpoint. A maximum of 250 records per request are returned in the response body. Dates should use ISOString format when appended as a query string, for example, new Date().toISOString().

{% code overflow="wrap" %}

```javascript
// Example date and email constrained request

https://app.shopwaive.com/api/orders?email=support@shopwaive.com&created_at_min=2024-09-22T04:51:20.144Z&created_at_max=2024-09-22T19:14:22.688Z
```

{% endcode %}

{% openapi src="/files/nXkIasLNtkmXNk5Zk3D2" path="/api/orders" method="get" %}
[index.yaml](https://2430267771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR7BwDfJhPObShd4z9nqx%2Fuploads%2Fgit-blob-a818df3017872e2c2a06781d4fdc9295507091b8%2Findex.yaml?alt=media)
{% endopenapi %}

## `POST` order endpoint

{% openapi src="/files/SxAe8b4pp5MX0TU3Y7gs" path="/api/order" method="post" %}
[index.yaml](https://2430267771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR7BwDfJhPObShd4z9nqx%2Fuploads%2Fgit-blob-19af57f14ff2e60779ae7fff8b31053b665b4756%2Findex.yaml?alt=media)
{% endopenapi %}

### Header

<table><thead><tr><th width="313">key</th><th>value</th></tr></thead><tbody><tr><td>X-Shopwaive-Access-Token</td><td>Store's platform API key for store (required)</td></tr><tr><td>X-Shopwaive-Platform</td><td>Store's platform (required)</td></tr><tr><td>Content-Type</td><td>Content type</td></tr></tbody></table>

### Request Body

| key            | value                                                 |
| -------------- | ----------------------------------------------------- |
| customerid     | Customer id associated with store's platform          |
| free\_shipping | Boolean                                               |
| tags           | Tags to apply to order                                |
| order\_notes   | Additional details or notes to apply to order         |
| description    | Description of credit applied (i.e. Shopwaive Credit) |
| amount         | Amount of credit to apply to order                    |
| cart           | Customer cart associated with order                   |

### Response Body

| key           | value                                           |
| ------------- | ----------------------------------------------- |
| status        | Status message                                  |
| checkout\_url | Checkout url to be used by customer for payment |
|               |                                                 |
