# 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 store 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="<https://2430267771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR7BwDfJhPObShd4z9nqx%2Fuploads%2F6ubw9UddvrCf0iAZ6GBV%2Findex.yaml?alt=media&token=e646eefb-a2b0-4757-82cf-b2820754e90a>" path="/api/orders" method="get" %}
[index.yaml](https://2430267771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR7BwDfJhPObShd4z9nqx%2Fuploads%2F6ubw9UddvrCf0iAZ6GBV%2Findex.yaml?alt=media\&token=e646eefb-a2b0-4757-82cf-b2820754e90a)
{% endopenapi %}

## `POST` order endpoint

{% openapi src="<https://2430267771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR7BwDfJhPObShd4z9nqx%2Fuploads%2FbR6l66fKRS3weXwiRMxK%2Findex.yaml?alt=media&token=bf6a576f-d4bd-4c53-930c-0067f2d371da>" path="/api/order" method="post" %}
[index.yaml](https://2430267771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR7BwDfJhPObShd4z9nqx%2Fuploads%2FbR6l66fKRS3weXwiRMxK%2Findex.yaml?alt=media\&token=bf6a576f-d4bd-4c53-930c-0067f2d371da)
{% 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. Store 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 |
|               |                                                 |
