> 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 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="/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%2F6ubw9UddvrCf0iAZ6GBV%2Findex.yaml?alt=media\&token=e646eefb-a2b0-4757-82cf-b2820754e90a)
{% 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%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 |
|               |                                                 |


---

# 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:

```
GET https://api.shopwaive.com/reference/rest-api-documentation/order-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
