# Welcome to Nekoya API!

## Want to jump right in?

Feeling like an eager beaver? Jump in to the Get Started docs and get making your first request:

{% content-ref url="/pages/MlKdefynSvHEQQdiIW8W" %}
[Get Started](/get-started)
{% endcontent-ref %}

## Want to deep dive?

Dive a little deeper and start exploring our API reference to get an idea of everything that's possible with the API:

{% content-ref url="/pages/8667VB4ZMsKSLrl9i2u0" %}
[API Reference](/reference/api-reference)
{% endcontent-ref %}


# Get Started

## Get your API keys

Your API requests are authenticated using API keys. Any request that doesn't include an API key will return an error.

You can [contact us](mailto:nekoya@chocola.dev) to generate the API key.


# API Reference

Dive into the specifics of each API endpoint by checking out our complete documentation.

## Product

Everything related to product.

{% content-ref url="/pages/bhvSd9MIZGqdjIv0mWnF" %}
[Product](/reference/api-reference/product)
{% endcontent-ref %}

## Authentication

Everything related to authentication.

{% content-ref url="/pages/VBt5AZ87mLczG3YjvzAL" %}
[Authentication](/reference/api-reference/authentication)
{% endcontent-ref %}

## Transaction

Everything related to transaction.

{% content-ref url="/pages/2YLMp4YzhAb0IBEersaX" %}
[Transaction](/reference/api-reference/transaction)
{% endcontent-ref %}

## Subscribe

Everything related to subscribe.

{% content-ref url="/pages/qZ5dbEZjTJHJdLWEqslx" %}
[Subscribe](/reference/api-reference/subscribe)
{% endcontent-ref %}


# Product

## All Products

<mark style="color:blue;">`GET`</mark> `https://nekoya.moe.team/api/getproducts`

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

```javascript
[
  {
    "ID": "306796_02",
    "TITLE": "Scuderia Ferrari Speedcat Men's Motorsport Shoes",
    "IMAGE": "Product_18.webp",
    "DESCRIPTION": "Born for speed. Raised in style. The Speedcat returns over 20 years later, this time with sleek Scuderia Ferrari engineering. The signature low profile silhouette features a premium suede upper, plus an authentic rounded driver's heel and Scuderia Ferrari racing shield at the heel. Taking iconic track style to the streets.",
    "STOCK": 99,
    "PRICE": 1500000,
    "SIZE": "46",
    "DISCOUNT": 0,
    "BRAND": "Puma"
  },
  {
    "ID": "306807_01",
    "TITLE": "Ferrari Nitefox GT Men's Shoes",
    "IMAGE": "Product_20.webp",
    "DESCRIPTION": "In Partnership with Scuderia Ferrari, the Nitefox GT is inspired by the Ferrari Testarossa’s aerodynamics. One of the most iconic elements is the wind takes on side of the car, giving a very distinctive look.",
    "STOCK": 99,
    "PRICE": 4500000,
    "SIZE": "47",
    "DISCOUNT": 20,
    "BRAND": "Puma"
  },
  {
    "ID": "306809_03",
    "TITLE": "Scuderia Ferrari RCT XETIC Forza Men's ",
    "IMAGE": "Product_19.webp",
    "DESCRIPTION": "This progressive motorsport silhouette uses ground-breaking XETIC cushioning technology to bring you a sleek, high-tech shoe with an ultimately shock-absorbing stride. With sleek Ferrari branding and team colors, it's built for life in the fast lane.",
    "STOCK": 99,
    "PRICE": 2200000,
    "SIZE": "45",
    "DISCOUNT": 0,
    "BRAND": "Puma"
  },
  {
    "ID": "306842_02",
    "TITLE": "Mercedes F1 RS Connect Motorsport Shoes",
    "IMAGE": "Product_17.webp",
    "DESCRIPTION": "This innovative addition to the Running System family is inspired by the revolution in connection and communication in our modern, digital world. The RS Connect rides the wave of technological transformation, with a fresh, futuristic design in eye-popping monochrome neon. A richly layered upper and premium Mercedes-AMG Petronas Motorsport branding at the heel bring a high-end, motorsport feel to these comfortable, cushioned sneaks.",
    "STOCK": 99,
    "PRICE": 2000000,
    "SIZE": "47",
    "DISCOUNT": 0,
    "BRAND": "Puma"
  }
]
```

{% endtab %}
{% endtabs %}

## Product Info

<mark style="color:blue;">`GET`</mark> `https://nekoya.moe.team/api/getproduct`

#### Query Parameters

| Name                                 | Type   | Description |
| ------------------------------------ | ------ | ----------- |
| id<mark style="color:red;">\*</mark> | String | Product ID  |

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

```javascript
[
  {
    "ID": "GY8803",
    "TITLE": "Nano X1 Men's Training Shoes",
    "IMAGE": "Product_37.webp",
    "DESCRIPTION": "Climb, jump and throw the barbell around in shoes made for the way you work out. Perfected by elite athletes, Reebok Nano X1 Shoes are made for anyone who loves to train hard. This men's version has a Flexweave® knit upper that's breathable yet durable, with integrated support for multidirectional movement. Floatride Energy Foam cushioning in the forefoot provides a responsive feel. A heel clip adds stability.",
    "STOCK": 99,
    "PRICE": 1800000,
    "SIZE": "45",
    "DISCOUNT": 0,
    "BRAND": "Reebok"
  }
]
```

{% endtab %}
{% endtabs %}


# Authentication

## Register

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

#### Headers

| Name                                           | Type   | Description                       |
| ---------------------------------------------- | ------ | --------------------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/x-www-form-urlencoded |

#### Request Body

| Name                                          | Type   | Description              |
| --------------------------------------------- | ------ | ------------------------ |
| email<mark style="color:red;">\*</mark>       | String | <xxx@example.com>        |
| password<mark style="color:red;">\*</mark>    | String | 1 - 64 string characters |
| first\_name<mark style="color:red;">\*</mark> | String | First Name               |
| last\_name<mark style="color:red;">\*</mark>  | String | Last Name                |

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

```javascript
{
    "message": "Register Verification Sent ~"
}
```

{% endtab %}

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

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

{% endtab %}
{% endtabs %}

## Login

## Account without 2FA Enabled

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

#### Headers

| Name                                           | Type   | Description                       |
| ---------------------------------------------- | ------ | --------------------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/x-www-form-urlencoded |

#### Request Body

| Name                                       | Type   | Description              |
| ------------------------------------------ | ------ | ------------------------ |
| email<mark style="color:red;">\*</mark>    | String | <xxx@example.com>        |
| password<mark style="color:red;">\*</mark> | String | 1 - 64 string characters |
| ua                                         | String | User Agent               |
| ip                                         | String | IP Address               |

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

```javascript
{
    "id": 29,
    "first_name": "Celia",
    "last_name": "Claire",
    "email": "celia@moe.team",
    "verify": true,
    "otp": false,
    "session_token": "2RBHSp3I8jjDzjuKaXXDWadJqRkJ1M3Q8nTmF9mioAL73OVZO8zc73sg4VBCVLQeXQRtbXZ6gQ5r1vjupkzoZP1HiRBXgHw74O7eKki6SPHIDYuxVfAdn6jPZ76HRRqI1jR1aKOdhwMq5RgOK7eMB5HEUKNu6gHIQkncoxRxz1eh5QGwGa9vYPW7TE3izEDbkGEqlIbnGf6O9foTty5HiJilPLtgVFvHUSoN6t7yDMXy2NjI0a4bKu5Pb6de0inh"
}
```

{% endtab %}

{% tab title="205: Reset Content " %}

```javascript
{
    "message": "Sorry Your email is not registered in our system"
}
```

{% endtab %}

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

```javascript
{
    "message": "Sorry You haven't verified your email"
}
```

{% endtab %}

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

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

{% endtab %}

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

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

{% endtab %}
{% endtabs %}

## Account with 2FA Enabled

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

#### Headers

| Name                                           | Type   | Description                       |
| ---------------------------------------------- | ------ | --------------------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/x-www-form-urlencoded |

#### Request Body

| Name                                       | Type   | Description              |
| ------------------------------------------ | ------ | ------------------------ |
| email<mark style="color:red;">\*</mark>    | String | <xxx@example.com>        |
| password<mark style="color:red;">\*</mark> | String | 1 - 64 string characters |
| ua                                         | String | User Agent               |
| ip                                         | String | IP Address               |

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

```javascript
{
    "message": "OTP Verification Sent ~",
    "otp": true,
    "token": "Xb5VNMMfoWZyHf22EMS3MjmgFdjDnAPTM3OoCh3CYP8sF6ospVzAaTjCPVM5FM5c"
}
```

{% endtab %}

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

```javascript
{
    "message": "Sorry You haven't verified your email"
}
```

{% endtab %}

{% tab title="205: Reset Content " %}

```javascript
{
    "message": "Sorry Your email is not registered in our system"
}
```

{% endtab %}

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

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

{% endtab %}

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

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

{% endtab %}
{% endtabs %}

## OTP

## Submit OTP

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

#### Headers

| Name                                           | Type   | Description                       |
| ---------------------------------------------- | ------ | --------------------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/x-www-form-urlencoded |

#### Request Body

| Name                                    | Type   | Description        |
| --------------------------------------- | ------ | ------------------ |
| token<mark style="color:red;">\*</mark> | String | Encrypted String   |
| code<mark style="color:red;">\*</mark>  |        | OTP Code (6 digit) |

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

```javascript
{
    "id": 29,
    "first_name": "Celia",
    "last_name": "Claire",
    "email": "celia@moe.team",
    "verify": true,
    "otp": true,
    "session_token": "2RBHSp3I8jjDzjuKaXXDWadJqRkJ1M3Q8nTmF9mioAL73OVZO8zc73sg4VBCVLQeXQRtbXZ6gQ5r1vjupkzoZP1HiRBXgHw74O7eKki6SPHIDYuxVfAdn6jPZ76HRRqI1jR1aKOdhwMq5RgOK7eMB5HEUKNu6gHIQkncoxRxz1eh5QGwGa9vYPW7TE3izEDbkGEqlIbnGf6O9foTty5HiJilPLtgVFvHUSoN6t7yDMXy2NjI0a4bKu5Pb6de0inh"
}
```

{% endtab %}

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

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

{% endtab %}

{% tab title="403: Forbidden " %}

```javascript
{
    "message": "Invalid OTP Code"
}
```

{% endtab %}
{% endtabs %}

## Enable / Disable OTP

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

#### Query Parameters

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

#### Headers

| Name                                           | Type   | Description                       |
| ---------------------------------------------- | ------ | --------------------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/x-www-form-urlencoded |

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

```javascript
{
    "message": "Success set OTP to true",
    "otp": true
}
```

{% endtab %}

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

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

{% endtab %}

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

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

{% endtab %}
{% endtabs %}

## Verify Account (Mail)

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

#### Headers

| Name                                           | Type   | Description                       |
| ---------------------------------------------- | ------ | --------------------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/x-www-form-urlencoded |

#### Request Body

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

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

```javascript
{
    "message": "Verified ~"
}
```

{% endtab %}

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

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

{% endtab %}

{% tab title="403: Forbidden " %}

```javascript
{
    "message": "Forbidden"
}
```

{% endtab %}
{% endtabs %}

## Reset Password

<mark style="color:green;">`POST`</mark> `https://nekoya.moe.team/api/request-reset-password`

#### Headers

| Name                                           | Type   | Description                       |
| ---------------------------------------------- | ------ | --------------------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/x-www-form-urlencoded |

#### Request Body

| Name                                    | Type   | Description       |
| --------------------------------------- | ------ | ----------------- |
| email<mark style="color:red;">\*</mark> | String | <xxx@example.com> |

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

```javascript
{
    "message": "Reset Password Verification Sent ~"
}
```

{% endtab %}

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

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

{% endtab %}

{% tab title="205: Reset Content " %}

```javascript
{
    "message": "Sorry Your email is not registered in our system"
}
```

{% endtab %}
{% endtabs %}

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

#### Query Parameters

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

#### Headers

| Name                                           | Type   | Description                       |
| ---------------------------------------------- | ------ | --------------------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/x-www-form-urlencoded |

#### Request Body

| Name                                       | Type   | Description              |
| ------------------------------------------ | ------ | ------------------------ |
| password<mark style="color:red;">\*</mark> | String | 1 - 64 string characters |

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

```javascript
{
    "message": "Success Reset Password ~"
}
```

{% endtab %}

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

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

{% endtab %}

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

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

{% endtab %}
{% endtabs %}

## Active Sessions

## Get All of Active Sessions

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

#### Query Parameters

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

#### Headers

| Name                                           | Type   | Description                       |
| ---------------------------------------------- | ------ | --------------------------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/x-www-form-urlencoded |

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

```javascript
[
    {
        "user_agent": "Mozilla/5.0 (Linux; Android 12; M2012K11AG) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.41 Mobile Safari/537.36",
        "ip": "12.26.220.109",
        "session": "5ES9v6ekrGuuuKEDOpk2COGlmchHldplY10PnIIOuMUVpw32FsJy9aniQyX7RzeVan3muRWlKf02pWnIua127PKF0uPLxEccic8x5VFlN3OsyNFeJM8mdKAduRhwCIcID57vBanPrrYQ5vqv0FGbWcl29rtXk40YDUFvYoqy2VtBx5Us2sW1HYMT5EFrwC7H0T75kyRqL1ZmSJLMLKgPoUkhxOa1AMqqdy2dbSke8pOLQo20B7bgvEmxxyKcrV9C"
    }
]
```

{% endtab %}

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

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

{% endtab %}

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

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

{% endtab %}
{% endtabs %}


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


# Subscribe

<mark style="color:blue;">`GET`</mark> `https://nekoya.moe.team/api/subscribe`

#### Query Parameters

| Name                                    | Type   | Description       |
| --------------------------------------- | ------ | ----------------- |
| email<mark style="color:red;">\*</mark> | String | <xxx@example.com> |

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

```javascript
{
    "message": "Success"
}
```

{% endtab %}

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

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

{% endtab %}
{% endtabs %}


