> For the complete documentation index, see [llms.txt](https://docs.nekoya.moe.team/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nekoya.moe.team/reference/api-reference/transaction.md).

# Transaction

## Create Transaction

<mark style="color:green;">`POST`</mark> `https://nekoya.moe.team/api/checkout`

#### Query Parameters

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

#### Headers

| Name         | Type   | Description                       |
| ------------ | ------ | --------------------------------- |
| Content-Type | String | application/x-www-form-urlencoded |

#### Request Body

| Name                                             | Type          | Description                           |
| ------------------------------------------------ | ------------- | ------------------------------------- |
| firstName<mark style="color:red;">\*</mark>      | String        | First Name                            |
| lastName<mark style="color:red;">\*</mark>       | String        | Last Name                             |
| phoneNumber<mark style="color:red;">\*</mark>    | String        | (+1) xxx xxx xxx                      |
| streetAddress1<mark style="color:red;">\*</mark> | String        | Street Address                        |
| streetAddress2<mark style="color:red;">\*</mark> | String        | Street Addres (Alternative)           |
| region<mark style="color:red;">\*</mark>         | String        | Region                                |
| province<mark style="color:red;">\*</mark>       | String        | Province                              |
| city<mark style="color:red;">\*</mark>           | String        | City                                  |
| district<mark style="color:red;">\*</mark>       | String        | District                              |
| subDistrict<mark style="color:red;">\*</mark>    | String        | Sub District                          |
| postalCode<mark style="color:red;">\*</mark>     | String        | Postal Code                           |
| logistic<mark style="color:red;">\*</mark>       | String        | Logistic Provider (JNE, JNT, SICEPAT) |
| data<mark style="color:red;">\*</mark>           | String (JSON) | Order Data                            |

{% tabs %}
{% tab title="400: Bad Request " %}

```javascript
{
    "message": "Bad Request"
}
```

{% endtab %}

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

```javascript
{
    "message": "Unauthorized"
}
```

{% endtab %}

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

```javascript
{
    "order_id": 3,
    "data": "{'product_id': '306796_02', 'quantity': 35}"
}
```

{% endtab %}
{% endtabs %}

## All Transactions

<mark style="color:green;">`POST`</mark> `https://nekoya.moe.team/api/transaction`

#### Query Parameters

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

#### Headers

| Name         | Type   | Description                       |
| ------------ | ------ | --------------------------------- |
| Content-Type | String | application/x-www-form-urlencoded |

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

```javascript
[
    {
        "id": 1,
        "userId": 14,
        "firstName": "Gawr",
        "lastName": "Gura",
        "phoneNumber": "081238749274",
        "streetAddress1": "Isekai",
        "streetAddress2": "Isekai 2",
        "region": "Indonesia",
        "province": "DKI Jakarta",
        "city": "Jakarta",
        "district": "Jakarta Utara",
        "subDistrict": "Penjaringan",
        "postalCode": "11330",
        "logistic": "JNE",
        "paymentMethod": "-",
        "data": "[\n  {\n    \"product_id\": \"306796_02\",\n    \"quantity\": 30\n  }\n]",
        "paid": "0",
        "status": "pending"
    },
    {
        "id": 2,
        "userId": 14,
        "firstName": "Minato",
        "lastName": "Aqua",
        "phoneNumber": "081238749274",
        "streetAddress1": "Isekai",
        "streetAddress2": "Isekai 2",
        "region": "Indonesia",
        "province": "DKI Jakarta",
        "city": "Jakarta",
        "district": "Jakarta Utara",
        "subDistrict": "Penjaringan",
        "postalCode": "11330",
        "logistic": "JNE",
        "paymentMethod": "-",
        "data": "[{\"product_id\": \"306796_02\",\"quantity\": 35}]",
        "paid": "0",
        "status": "pending"
    },
    {
        "id": 3,
        "userId": 14,
        "firstName": "Akai",
        "lastName": "Haato",
        "phoneNumber": "081238749274",
        "streetAddress1": "Isekai",
        "streetAddress2": "Isekai 2",
        "region": "Indonesia",
        "province": "DKI Jakarta",
        "city": "Jakarta",
        "district": "Jakarta Utara",
        "subDistrict": "Penjaringan",
        "postalCode": "11330",
        "logistic": "JNE",
        "paymentMethod": "-",
        "data": "[{\"product_id\": \"306796_02\",\"quantity\": 35}]",
        "paid": "0",
        "status": "pending"
    }
]
```

{% endtab %}

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

```javascript
{
    "message": "Unauthorized"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    "message": "Bad Request"
}
```

{% endtab %}
{% endtabs %}
