> For the complete documentation index, see [llms.txt](https://movie-team.gitbook.io/movieteam/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://movie-team.gitbook.io/movieteam/movies/undefined-5.md).

# 티켓

## 결제 안된 티켓들 조회

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:8000/api/movies/ticket/`

#### Headers

| Name                                            | Type   | Description                    |
| ----------------------------------------------- | ------ | ------------------------------ |
| Authorization<mark style="color:red;">\*</mark> | String | "Bearer " + 발급 받은 access token |

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

{% endtab %}
{% endtabs %}

## 티켓 생성

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:8000/api/movies/ticket/`

#### Headers

| Name                                            | Type   | Description                    |
| ----------------------------------------------- | ------ | ------------------------------ |
| Authorization<mark style="color:red;">\*</mark> | String | "Bearer " + 발급 받은 access token |

#### Request Body

| Name                                   | Type | Description     |
| -------------------------------------- | ---- | --------------- |
| seat<mark style="color:red;">\*</mark> | List | 좌석 pk(여러 좌석 가능) |

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

````json
```json
{
    "tickets": [
        {
            "id": 1,
            "seat": 1,
            "user": 2
        },
        {
            "id": 2,
            "seat": 2,
            "user": 2
        }
    ],
    "message": "Tickets created successfully"
}
```
````

{% endtab %}
{% endtabs %}

## 좌석 기준 티켓 삭제

<mark style="color:red;">`DELETE`</mark> `http://127.0.0.1:8000/api/movies/ticket/<int:seat_pk>/`

#### Headers

| Name                                            | Type   | Description                    |
| ----------------------------------------------- | ------ | ------------------------------ |
| Authorization<mark style="color:red;">\*</mark> | String | "Bearer " + 발급 받은 access token |

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

````json
```json
{
    "message": "delete success"
}
```
````

{% endtab %}
{% endtabs %}

## 티켓 전체 삭제

<mark style="color:red;">`DELETE`</mark> `http://127.0.0.1:8000/api/movies/ticket/delete/`

#### Headers

| Name                                            | Type   | Description                    |
| ----------------------------------------------- | ------ | ------------------------------ |
| Authorization<mark style="color:red;">\*</mark> | String | "Bearer " + 발급 받은 access token |

#### Request Body

| Name                                    | Type | Description       |
| --------------------------------------- | ---- | ----------------- |
| seats<mark style="color:red;">\*</mark> | List | seat\_pk들을 담은 리스트 |

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

{% endtab %}
{% endtabs %}
