# Order

## - 장바구니 상품 추가

<mark style="color:green;">`POST`</mark> `/orders/v1/carts`

장바구니에 상품 추가

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | String | JWT token   |

#### Request Body

| Name                                       | Type    | Description |
| ------------------------------------------ | ------- | ----------- |
| item\_id<mark style="color:red;">\*</mark> | integer |             |
| count<mark style="color:red;">\*</mark>    | integer |             |

{% tabs %}
{% tab title="401: Unauthorized " %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="201: Created " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## - 장바구니 상품 수정

<mark style="color:purple;">`PATCH`</mark> `/orders/v1/carts`

상품 수량 수정

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | String | JWT token   |

#### Request Body

| Name                                           | Type    | Description |
| ---------------------------------------------- | ------- | ----------- |
| count<mark style="color:red;">\*</mark>        | integer | 상품 수량 수정    |
| cartItem\_id<mark style="color:red;">\*</mark> | integer |             |

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

```javascript
{
    // 
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## - 장바구니 상품 삭제

<mark style="color:red;">`DELETE`</mark> `/orders/v1/carts`

장바구니 상품 삭제

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | String | JWT token   |

#### Request Body

| Name                                           | Type   | Description |
| ---------------------------------------------- | ------ | ----------- |
| cartItem\_id<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="401: Unauthorized " %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="204: No Content " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## - 주문 정보 확인(회원)

<mark style="color:blue;">`GET`</mark> `/orders/v1`

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | String | JWT token   |

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

```javascript
{
    "status": 200,
    "data": [
         {
              "store_img": ,
              "store_name": ,
              "order_id": ,
              "order_status": ,
              "order_date": ,
              "total_price": ,
              "waiting_num": ,
              "has_review": ,
              "items": [
                   {
                        "name": ,
                   },
                   ...
              ]
         }, 
         ...
    [
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## - 주문 생성

<mark style="color:green;">`POST`</mark> `/orders/v1`

장바구니 주문&#x20;

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | String | JWT token   |

#### Request Body

| Name                                              | Type    | Description   |
| ------------------------------------------------- | ------- | ------------- |
| cartItem\_array<mark style="color:red;">\*</mark> | Array   | 장바구니 상품 array |
| count<mark style="color:red;">\*</mark>           | integer |               |

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

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## - 리뷰 확인(회원)

<mark style="color:blue;">`GET`</mark> `/orders/v1/reviews`

유저 리뷰 조회

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | String | JWT token   |

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

```javascript
{
    "status": 200,
    "data": [
        {
            "store_img": ,
            "store_name": ,
            "order_date": ,
            "total_price": ,
            "review_id": ,
            "content" ,
            "rating": ,
        },
        ...
    ]
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## - 리뷰 생성

<mark style="color:green;">`POST`</mark> `/orders/v1/reviews`

주문 내역에서 리뷰 등록

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | String | JWT token   |

#### Request Body

| Name                                        | Type    | Description |
| ------------------------------------------- | ------- | ----------- |
| contents<mark style="color:red;">\*</mark>  | String  |             |
| order\_id<mark style="color:red;">\*</mark> | integer |             |

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

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## - 리뷰 수정

<mark style="color:purple;">`PATCH`</mark> `/orders/v1/reviews`

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | String | JWT token   |

#### Request Body

| Name                                         | Type    | Description |
| -------------------------------------------- | ------- | ----------- |
| review\_id<mark style="color:red;">\*</mark> | integer |             |
| content<mark style="color:red;">\*</mark>    | String  |             |

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

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## - 리뷰 삭제

<mark style="color:red;">`DELETE`</mark> `/orders/v1/reviews`

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | String | JWT token   |

#### Request Body

| Name                                         | Type    | Description |
| -------------------------------------------- | ------- | ----------- |
| review\_id<mark style="color:red;">\*</mark> | integer |             |

{% tabs %}
{% tab title="204: No Content " %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

### ---

## - 주문 관리(신규 주문 목록 조회)

<mark style="color:blue;">`GET`</mark> `/orders/v1`

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | String | JWT token   |

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

```javascript
{
    "status": 200,
    "data": [
        {
            "order_id": ,
            "order_date",
            "member": ,
            "items": [
                {
                    "item_id": ,
                    "item_name": ,
                    "count": ,
                },
                ...
            ]
            "total_price": ,
        },        
        ...
    ]
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## - 주문 관리(조리 중인 주문 목록 조회)

<mark style="color:blue;">`GET`</mark> `/orders/v1`

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | String | JWT token   |

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

```javascript
{
    "status": 200,
    "data": [
        {
            "order_id": ,
            "order_date",
            "member": ,
            "items": [
                {
                    "item_id": ,
                    "item_name": ,
                    "count": ,
                },
                ...
            ],
            "total_price": ,
        },        
        ...
    ]
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## - 주문 관리(완료된 주문 목록 조회)

<mark style="color:blue;">`GET`</mark> `/orders/v1`

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | String | JWT token   |

#### Request Body

| Name   | Type   | Description |
| ------ | ------ | ----------- |
| status | String |             |

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

```javascript
{
    "status": 200,
    "data": [
        {
            "order_id": ,
            "order_date",
            "member": ,
            "items": [
                {
                    "item_id": ,
                    "item_name": ,
                    "count": ,
                },
                ...
            ],
            "total_price": ,
        },        
        ...
    ]
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## - 주문 접수(신규->조리 중)

<mark style="color:purple;">`PATCH`</mark> `/orders/v1`

새로 들어온 주문을 접수하고 주문 진행 중으로 상태 변경

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | String | JWT token   |

#### Request Body

| Name                                        | Type    | Description            |
| ------------------------------------------- | ------- | ---------------------- |
| order\_id<mark style="color:red;">\*</mark> | integer |                        |
| status<mark style="color:red;">\*</mark>    | String  | 조리 중인 주문 (progressing) |

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

```javascript
{
    "status": 200
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## - 주문 접수(조리 중-> 조리 완료)

<mark style="color:purple;">`PATCH`</mark> `/orders/v1/`

조리 중 상태를 조리 완료 상태로 변경

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | String | JWT token   |

#### Request Body

| Name                                        | Type    | Description        |
| ------------------------------------------- | ------- | ------------------ |
| order\_id<mark style="color:red;">\*</mark> | integer |                    |
| status<mark style="color:red;">\*</mark>    | String  | 완료된 주문 (completed) |

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

```javascript
{
    "status": 200
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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://foodtruckaroundme.gitbook.io/api-reference/order.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.
