# Orders

## All Orders

<mark style="color:blue;">`GET`</mark> `https://yoursite.mavenseed.com/api/v1/orders`

Retrieve all orders

#### Path Parameters

| Name | Type    | Description            |
| ---- | ------- | ---------------------- |
| page | integer | Results are paginated. |

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Authorization | string | Auth token  |

{% tabs %}
{% tab title="200 Returns an array of members. Only the first 20 are returned. Passing the page param will paginate the results.
" %}

```javascript
[
    {
        "id": 4,
        "customer_id": 3,
        "guest_email": null,
        "currency": "USD",
        "created_at": "2019-02-22T11:43:44.193-05:00",
        "updated_at": "2019-02-22T11:43:44.193-05:00"
    },
    {
        "id": 11,
        "customer_id": 12,
        "guest_email": "chapt0r+test02@gmail.com",
        "currency": "USD",
        "created_at": "2019-03-12T23:42:02.341-04:00",
        "updated_at": "2019-03-12T23:42:02.341-04:00"
    }
]
```

{% endtab %}
{% endtabs %}

## Show Order

<mark style="color:blue;">`GET`</mark> `https://yoursite.mavenseed.com/api/v1/orders/:id`

Retrieve a single order

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Authorization | string | Auth token  |

{% tabs %}
{% tab title="200 " %}

```ruby
{
    "id": 4,
    "customer_id": 3,
    "guest_email": null,
    "currency": "USD",
    "created_at": "2019-02-22T11:43:44.193-05:00",
    "updated_at": "2019-02-22T11:43:44.193-05:00",
}
```

{% endtab %}

{% tab title="404 " %}

```ruby
null
```

{% endtab %}
{% endtabs %}

## Create Order

<mark style="color:green;">`POST`</mark> `https://yoursite.mavenseed.com/api/v1/orders`

Create an order.

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Authorization | string | Auth Token  |

#### Request Body

| Name         | Type    | Description              |
| ------------ | ------- | ------------------------ |
| customer\_id | integer | ID of customer for order |
| guest\_email | string  | email of guest user      |
| currency     | string  | Default is USD           |

{% tabs %}
{% tab title="201 " %}

```ruby
{
    "id": 4,
    "customer_id": 3,
    "guest_email": null,
    "currency": "USD",
    "created_at": "2019-02-22T11:43:44.193-05:00",
    "updated_at": "2019-02-22T11:43:44.193-05:00",
}
```

{% endtab %}
{% endtabs %}

## Update Order

<mark style="color:purple;">`PATCH`</mark> `https://yoursite.mavenseed.com/api/v1/orders/:id`

Update a single order. All of the above properties in create order are valid.

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Authorization | string | Auth token  |

{% tabs %}
{% tab title="200 " %}

```ruby
{
    "id": 4,
    "customer_id": 3,
    "guest_email": null,
    "currency": "USD",
    "created_at": "2019-02-22T11:43:44.193-05:00",
    "updated_at": "2019-02-22T11:43:44.193-05:00"
}
```

{% endtab %}
{% endtabs %}

## Delete a Order

<mark style="color:red;">`DELETE`</mark> `https://yoursite.mavenseed.com/api/v1/orders/:id`

Delete an order.

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Authorization | string | Auth toke   |

{% tabs %}
{% tab title="200 " %}

```
```

{% endtab %}
{% endtabs %}
