Customer API Documentation
API Endpoint & Authentication
All customer API calls use a <strong>single HTTP POST</strong> endpoint. Authenticate with <code>key</code> or <code>apikey</code> (from your profile API key page) plus <code>action</code> to select the operation. Path is at the <strong>site root</strong> as <code>/api/v2</code> — no language prefix (e.g. no <code>/en/</code> before <code>/api</code>).
Send parameters as <code>application/x-www-form-urlencoded</code> (e.g. <code>curl -d</code>) or as JSON with <code>Content-Type: application/json</code>.
{
"key": "YOUR_API_KEY",
"action": "categories"
}
<strong>Note:</strong> Replace <code>YOUR_API_KEY</code> with your own key. Never put API keys in URLs, client-side code, or public repositories. Supported <code>action</code> values: <code>categories</code>, <code>services</code>, <code>inventory</code>, <code>add</code>, <code>status</code>, <code>balance</code>.
Testar API
Choose an action, enter any required parameters, then click <strong>Send Request</strong> to call the live API. If you are signed in with an API key, it is filled in below (masked).
Resposta
Customer API v2
Get Categories
All parent categories and their subcategory names (for filtering <strong>Services List</strong>).
Parâmetros da Requisição
| Parâmetro | Tipo | Descrição | Obrigatório |
|---|---|---|---|
key / apikey | Cadeia de caracteres | Your API key | Sim |
action | Cadeia de caracteres | categories | Sim |
Example Request
curl -X POST https://accplanet.com/api/v2 \
-d "key=YOUR_API_KEY" \
-d "action=categories"
Exemplo de Resposta
{
"categories": [
{
"category": "Social",
"subcategories": ["Premium", "Standard"]
},
{
"category": "Digital goods",
"subcategories": []
}
]
}
Services List
Available products (services) with stock. Optional filters use <strong>category / subcategory names</strong> as returned by Get Categories, or pass <code>service</code> to fetch one product by id (<code>business_id</code> or MongoDB id). Parameter <code>language</code> controls localization of <code>name</code>, <code>description</code>, <code>category</code>, and <code>subcategory</code> (see table below). <code>limit=0</code> returns all items in one response.
Parâmetros da Requisição
| Parâmetro | Tipo | Descrição | Obrigatório |
|---|---|---|---|
key / apikey | Cadeia de caracteres | Your API key | Sim |
action | Cadeia de caracteres | services | Sim |
page | Número | Page number (default <code>1</code>) when <code>limit</code> > 0 | No |
limit | Número | Items per page; <code>0</code> = return all (default <code>0</code>) | No |
category | Cadeia de caracteres | Parent category name (from Get Categories) | No |
subcategory | Cadeia de caracteres | Subcategory name (from Get Categories) | No |
service | Cadeia de caracteres | Return only this service / product id (same id as in list items) | No |
language | Cadeia de caracteres | Response language — use a code from Supported language codes below (default <code>en</code>) | No |
Supported language codes (language)
Pass one of these values (case-insensitive for matching). If omitted or <code>en</code>, fields stay in <strong>English</strong> (stored source text). Any other code below resolves translations via Aitranslator when <code>AITRANSLATOR_BASE_URL</code> is configured; missing translations fall back to English until queued translations complete.
| Código | Language | Nome nativo |
|---|---|---|
en |
English | English |
zh |
Chinese | 中文 |
es |
Spanish | Español |
fr |
French | Français |
de |
German | Deutsch |
ja |
Japanese | 日本語 |
ko |
Korean | 한국어 |
pt |
Portuguese | Português |
pt-BR |
Portuguese (Brazil) | Português (Brasil) |
ru |
Russian | Русский |
ar |
Arabic | العربية |
hi |
Hindi | हिन्दी |
vi |
Vietnamese | Tiếng Việt |
ur |
Urdu | اردو |
th |
Thai | ไทย |
tr |
Turkish | Türkçe |
bn-BD |
Bengali (Bangladesh) | বাংলা |
Also accepted (aliases)
These strings are normalized to a primary code above (same translation bucket):
| You may send | Resolves to |
|---|---|
zh-hans |
zh |
zh-cn |
zh |
zh-sg |
zh |
zh-hant |
zh |
zh-tw |
zh |
zh-hk |
zh |
zh-mo |
zh |
pt-br |
pt-BR |
pt_br |
pt-BR |
ptbr |
pt-BR |
bn-bd |
bn-BD |
bd |
bn-BD |
en-us |
en |
en-gb |
en |
<strong>Not supported:</strong> any other <code>language</code> value is treated like English (no translation). Use the exact primary codes or aliases listed here.
Example Request
curl -X POST https://accplanet.com/api/v2 \
-d "key=YOUR_API_KEY" \
-d "action=services"
curl -X POST https://accplanet.com/api/v2 \
-d "key=YOUR_API_KEY" \
-d "action=services" \
-d "page=1" \
-d "limit=50"
curl -X POST https://accplanet.com/api/v2 \
-d "key=YOUR_API_KEY" \
-d "action=services" \
-d "category=Instagram"
curl -X POST https://accplanet.com/api/v2 \
-d "key=YOUR_API_KEY" \
-d "action=services" \
-d "service=10042" \
-d "language=zh"
Exemplo de Resposta
<strong>Default</strong> (<code>limit</code> omitted or <code>0</code>): all services in one response.
{
"services": [
{
"service": 10042,
"name": "Example product A",
"description": "Product description (may be HTML)",
"type": "Default",
"category": "Social",
"subcategory": "Instagram",
"rate": "9.99",
"min": 1,
"max": 100,
"refill": false,
"cancel": false,
"stock": 100,
"entityType": "product",
"autoDelivery": true
}
],
"total": 2,
"page": 1,
"limit": 0,
"total_pages": 1
}
<strong>service</strong> is the product's numeric <code>business_id</code> when set; otherwise the MongoDB id as a string. Use the same value for <strong>Check Inventory</strong> and <strong>Add Order</strong>. <strong>category</strong> / <strong>subcategory</strong> match the names from <strong>Get Categories</strong> (empty <code>subcategory</code> when the product is attached to a top-level category only). <strong>description</strong> is the full product description (may contain HTML from the supplier editor).
Check Inventory
Stock for one service (same <code>service</code> id as in Services List).
Parâmetros da Requisição
| Parâmetro | Tipo | Descrição | Obrigatório |
|---|---|---|---|
key / apikey | Cadeia de caracteres | Your API key | Sim |
action | Cadeia de caracteres | inventory | Sim |
service | Cadeia de caracteres | Service / product id from services list | Sim |
Example Request
curl -X POST https://accplanet.com/api/v2 \
-d "key=YOUR_API_KEY" \
-d "action=inventory" \
-d "service=10042"
Exemplo de Resposta
{
"service": 10042,
"stock": 42,
"available": true,
"entityType": "product",
"autoDelivery": true
}
Add Order
Creates an order and pays from <strong>account balance</strong>. Optional <code>link</code> is accepted for compatibility but is not stored on the order.
Parâmetros da Requisição
| Parâmetro | Tipo | Descrição | Obrigatório |
|---|---|---|---|
key / apikey | Cadeia de caracteres | Your API key | Sim |
action | Cadeia de caracteres | add | Sim |
service | Cadeia de caracteres | Service / product id from services list | Sim |
quantity | Número | Quantity (default <code>1</code>) | No |
link | Cadeia de caracteres | Optional (reserved / future use) | No |
Example Request
curl -X POST https://accplanet.com/api/v2 \
-d "key=YOUR_API_KEY" \
-d "action=add" \
-d "service=10042" \
-d "quantity=1"
Exemplo de Resposta
HTTP status <code>201 Created</code>.
{
"order": "000000000000000000000001"
}
The <code>order</code> value is the MongoDB <code>ObjectId</code> (string). Use it with <strong>Order Status</strong> (<code>action=status</code>).
Status do Pedido
Parâmetros da Requisição
| Parâmetro | Tipo | Descrição | Obrigatório |
|---|---|---|---|
key / apikey | Cadeia de caracteres | Your API key | Sim |
action | Cadeia de caracteres | status | Sim |
order | Cadeia de caracteres | Order id returned by <code>add</code> | Sim |
Example Request
curl -X POST https://accplanet.com/api/v2 \
-d "key=YOUR_API_KEY" \
-d "action=status" \
-d "order=000000000000000000000001"
Exemplo de Resposta
{
"status": "In progress",
"charge": "75.00",
"start_count": 3,
"remains": 1,
"delivered_units": 2,
"currency": "USD",
"autoDelivery": true,
"entityType": "product"
}
{
"status": "Completed",
"charge": "50.00",
"start_count": 2,
"remains": 0,
"delivered_units": 2,
"currency": "USD",
"autoDelivery": true,
"entityType": "product",
"accounts": ["example_user:redacted", "example_user_2:redacted"]
}
Saldo
Parâmetros da Requisição
| Parâmetro | Tipo | Descrição | Obrigatório |
|---|---|---|---|
key / apikey | Cadeia de caracteres | Your API key | Sim |
action | Cadeia de caracteres | balance | Sim |
Example Request
curl -X POST https://accplanet.com/api/v2 \
-d "key=YOUR_API_KEY" \
-d "action=balance"
Exemplo de Resposta
{
"balance": "100.00",
"currency": "USD"
}
Balance is your <strong>user</strong> wallet (used for purchases).
Error Responses
Errors use a single <code>error</code> string. Wrong or missing API credentials typically return HTTP <code>401</code> with <code>{"error": "Invalid API key"}</code>; validation issues usually return <code>400</code>.
{"error": "Invalid API key"}
{"error": "Invalid action"}
{"error": "Service ID is required"}
{"error": "Service not found"}
{"error": "Product not found."}
{"error": "This product is not available for purchase."}
{"error": "Invalid quantity."}
{"error": "Minimum quantity is 2."}
{"error": "Insufficient stock. Available: 10."}
{"error": "Insufficient balance. Please recharge your account."}
{"error": "Order not found"}
{"error": "Category not found"}
{"error": "Subcategory not found"}
{"error": "Subcategory not found in category"}