# 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 %}


---

# 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://docs.nekoya.moe.team/reference/api-reference/transaction.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.
