# API v1

Base URL:

```text
https://your-domain.com/api/v1
```

Protected endpoints require:

```http
Accept: application/json
Authorization: Bearer YOUR_API_KEY_HERE
```

Generate an API key from the buyer dashboard under `Change Password -> API Access`.
Generating a new key revokes the previous key.

## Abilities

```text
wallet:read
logs:read
logs:buy
numbers:read
numbers:buy
boosting:read
boosting:buy
orders:read
```

## Wallet

```http
GET /wallet
```

## Logs API

```http
GET /logs/parent-categories
GET /logs/categories?per_page=25&parent_category_id=2
GET /logs/categories/{category}
GET /logs/orders?per_page=25
POST /logs/orders
```

Purchase request:

```json
{
  "category_id": 12,
  "quantity": 1,
  "idempotency_key": "logs-order-20260503-0001"
}
```

## Numbers API

```http
GET /numbers/countries
GET /numbers/services?country_id=1
GET /numbers/area-codes?country_id=1&service_id=123
GET /numbers/orders?per_page=25
GET /numbers/orders/{orderId}
POST /numbers/orders
POST /numbers/orders/{orderId}/check
POST /numbers/orders/{orderId}/cancel
```

Purchase request:

```json
{
  "country_id": 1,
  "service_id": 123,
  "selected_area_codes": ["917"],
  "idempotency_key": "number-order-20260503-0001"
}
```

## Boosting API

```http
GET /boost/categories
GET /boost/services?category=Instagram%20Followers
GET /boost/services/{service}
GET /boost/orders?per_page=25
GET /boost/orders/{orderId}
POST /boost/orders
POST /boost/orders/{orderId}/check
POST /boost/orders/{orderId}/cancel
```

Default service purchase request:

```json
{
  "service_id": "101",
  "link": "https://instagram.com/p/example",
  "quantity": 1000,
  "idempotency_key": "boost-order-20260503-0001"
}
```

## Errors

```json
{
  "success": false,
  "status": 402,
  "message": "Insufficient wallet balance.",
  "code": "INSUFFICIENT_BALANCE"
}
```

Common codes:

```text
UNAUTHENTICATED
VALIDATION_FAILED
USER_DISABLED
USER_BANNED
INSUFFICIENT_BALANCE
IDEMPOTENCY_KEY_REUSED
IDEMPOTENCY_KEY_IN_PROGRESS
LOG_CATEGORY_NOT_FOUND
OUT_OF_STOCK
NUMBER_SERVICE_NOT_FOUND
NUMBER_ORDER_NOT_FOUND
NUMBER_OUT_OF_STOCK
NUMBER_CODE_ALREADY_RECEIVED
BOOST_SERVICE_NOT_FOUND
BOOST_ORDER_NOT_FOUND
BOOST_CANCEL_UNAVAILABLE
BOOST_CANCEL_REJECTED
```
