REST API v3
REST API v3
A JSON API with bearer authentication, structured errors, cursor pagination and idempotent order creation. Use it for your own tooling; panels can stay on v2.
Base URL and format
/api/v3- Every path below is relative to
https://api.tiksmm.dev/api/v3. - Send JSON with
Content-Type: application/json. Responses are always JSON. - Reads are GET; anything that changes state is POST. Successful creates answer 201, everything else 200.
Authentication
Send your key as a bearer token on every request except GET /status. There is no key parameter in v3.
curl https://api.tiksmm.dev/api/v3/balance \
-H 'Authorization: Bearer tk_live_your_key_here'<?php
$ch = curl_init('https://api.tiksmm.dev/api/v3/balance');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer tk_live_your_key_here',
],
]);
$body = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
if ($status >= 400) {
// $body['error']['code'] is stable; switch on it.
throw new RuntimeException($body['error']['code'] . ': ' . $body['error']['message']);
}
print_r($body);import requests
res = requests.get(
"https://api.tiksmm.dev/api/v3/balance",
headers={
"Authorization": "Bearer tk_live_your_key_here",
},
timeout=30,
)
body = res.json()
if not res.ok:
# body["error"]["code"] is stable; switch on it.
raise RuntimeError(f'{body["error"]["code"]}: {body["error"]["message"]}')
print(body)const res = await fetch("https://api.tiksmm.dev/api/v3/balance", {
headers: {
Authorization: "Bearer tk_live_your_key_here",
},
})
const body = await res.json()
if (!res.ok) {
// body.error.code is stable; switch on it.
throw new Error(`${body.error.code}: ${body.error.message}`)
}
console.log(body)Keys, scopes and IP allowlists are shared with v2 — see Authentication. Each endpoint below names the scope it needs.
Errors
Failures use the HTTP status that fits (400, 401, 402, 403, 404, 409, 422, 429, 500) and always the same body. Switch on code, which never changes; show message to your staff, which says how to fix the problem.
{
"error": {
"code": "duplicate_active_order",
"message": "Order 184610 for this link and service is still running. Wait for it to finish — two orders on one link make start counts unreliable.",
"param": "link",
"details": {
"order": 184610
},
"doc_url": "/docs/errors#duplicate_active_order",
"request_id": "req_f8xrrISYryqXQcXJ3x"
}
}codestringmessagestringparamstringlink, quantity, …).detailsobjectretry_after or the conflicting order.doc_urlstring/docs/errors#<code>.request_idstringreq_…), also sent as X-Request-Id. Quote it to support.Any endpoint that needs a key can return these, checked in this order:
- 401invalid_api_key
- 403ip_not_allowed
- 403account_suspended
- 429rate_limited
- 403insufficient_scope
- 500internal_error
Every code, with its fix, is on Errors. doc_url links straight to it.
Pagination
GET /orders and GET /transactions return newest first, a page at a time, as a list object:
{
"object": "list",
"data": [
"…"
],
"has_more": true,
"next_cursor": "184610"
}- Ask for up to 100 items with
limit(default 25). Values outside 1–100 are clamped, not rejected. - While
has_moreis true, passnext_cursorback asstarting_afterto get the next, older page. - Cursors are IDs (an order ID, or a
txn_…transaction ID), so pages stay stable while new items arrive.
curl "https://api.tiksmm.dev/api/v3/orders?limit=100&starting_after=184610" \
-H 'Authorization: Bearer tk_live_your_key_here'<?php
$ch = curl_init('https://api.tiksmm.dev/api/v3/orders?limit=100&starting_after=184610');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer tk_live_your_key_here',
],
]);
$body = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
if ($status >= 400) {
// $body['error']['code'] is stable; switch on it.
throw new RuntimeException($body['error']['code'] . ': ' . $body['error']['message']);
}
print_r($body);import requests
res = requests.get(
"https://api.tiksmm.dev/api/v3/orders",
params={
"limit": "100",
"starting_after": "184610",
},
headers={
"Authorization": "Bearer tk_live_your_key_here",
},
timeout=30,
)
body = res.json()
if not res.ok:
# body["error"]["code"] is stable; switch on it.
raise RuntimeError(f'{body["error"]["code"]}: {body["error"]["message"]}')
print(body)const res = await fetch("https://api.tiksmm.dev/api/v3/orders?limit=100&starting_after=184610", {
headers: {
Authorization: "Bearer tk_live_your_key_here",
},
})
const body = await res.json()
if (!res.ok) {
// body.error.code is stable; switch on it.
throw new Error(`${body.error.code}: ${body.error.message}`)
}
console.log(body)Idempotency
Networks fail after requests arrive. To retry POST /orders safely, send an Idempotency-Key header — any unique string up to 200 characters, such as your panel’s own order ID or a UUID.
- Same key, same body: we don’t place a second order. You get the original response again (status 201 and the order as it was when created) with an
Idempotent-Replayed: trueheader. - Same key, different body: refused with idempotency_conflict (409). Bodies are compared after JSON parsing, so whitespace doesn’t matter but field order and values do — resend exactly what you sent.
- Only successful creates are remembered. If the first attempt failed (say,
insufficient_funds), retrying with the same key runs the request again. - Keys belong to your account; two accounts can use the same string without colliding.
curl https://api.tiksmm.dev/api/v3/orders \
-H 'Authorization: Bearer tk_live_your_key_here' \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: panel-48213' \
-d '{
"service": 102,
"link": "https://www.tiktok.com/@mila.makes",
"quantity": 1000
}'<?php
$ch = curl_init('https://api.tiksmm.dev/api/v3/orders');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer tk_live_your_key_here',
'Content-Type: application/json',
'Idempotency-Key: panel-48213',
],
CURLOPT_POSTFIELDS => json_encode([
'service' => 102,
'link' => 'https://www.tiktok.com/@mila.makes',
'quantity' => 1000,
]),
]);
$body = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
if ($status >= 400) {
// $body['error']['code'] is stable; switch on it.
throw new RuntimeException($body['error']['code'] . ': ' . $body['error']['message']);
}
print_r($body);import requests
res = requests.post(
"https://api.tiksmm.dev/api/v3/orders",
headers={
"Authorization": "Bearer tk_live_your_key_here",
"Content-Type": "application/json",
"Idempotency-Key": "panel-48213",
},
json={
"service": 102,
"link": "https://www.tiktok.com/@mila.makes",
"quantity": 1000,
},
timeout=30,
)
body = res.json()
if not res.ok:
# body["error"]["code"] is stable; switch on it.
raise RuntimeError(f'{body["error"]["code"]}: {body["error"]["message"]}')
print(body)const res = await fetch("https://api.tiksmm.dev/api/v3/orders", {
method: "POST",
headers: {
Authorization: "Bearer tk_live_your_key_here",
"Content-Type": "application/json",
"Idempotency-Key": "panel-48213",
},
body: JSON.stringify({
service: 102,
link: "https://www.tiktok.com/@mila.makes",
quantity: 1000,
}),
})
const body = await res.json()
if (!res.ok) {
// body.error.code is stable; switch on it.
throw new Error(`${body.error.code}: ${body.error.message}`)
}
console.log(body)HTTP/1.1 201 Created
Content-Type: application/json
Idempotent-Replayed: true
X-Request-Id: req_Q2m8VdT0aXk4LpRw1c
{"id":184610,"object":"order","status":"pending", …}A replay has a new X-Request-Id but no Location header. To see the order’s current state, follow up with GET /orders/{id}.
Rate limit headers
Every authenticated response tells you where you stand. Each key has a bucket of 120 requests that refills at 2 per second, shared between v2 and v3.
| Header | Meaning |
|---|---|
X-RateLimit-Limit | Bucket size: 120. |
X-RateLimit-Remaining | Whole requests left right now. |
X-RateLimit-Reset | Seconds until the bucket is full again. A duration, not a timestamp. |
Retry-After | Only on 429: seconds to wait before retrying. |
More on Rate limits.
Request IDs
Every response has an X-Request-Id header (req_…), repeated as request_id in error bodies. Every request with a valid key is logged with its parameters and our response in Dashboard → Request logs, searchable by that ID. Quote it when you contact support.
Money, IDs and timestamps
- Money is a decimal string in USD:
"2.20800". Charges and balances carry five decimals; service rates carry four. Parse with a decimal type, not a float. - Order and refill IDs are integers, the same numbers v2 uses. Transaction IDs are strings like
txn_lgWDr5M6xpGd6V. - Timestamps are ISO 8601 in UTC:
2026-11-15T10:14:03.532Z. Fields that haven’t happened yet arenull, never missing. - Every object has an
objectfield (order,refill,list, …) so you can tell payloads apart.
Endpoints
Objects: Order, Order event, Refill, Service, Balance, Transaction, Status.
OpenAPI spec
The whole v3 API is described in OpenAPI 3.1 — every path, parameter, schema, example and error code. Import it into Postman or Insomnia, or generate a typed client.
/api/v3/openapi.jsonnpx openapi-typescript https://api.tiksmm.dev/api/v3/openapi.json -o tiksmm.d.tsVersioning
v3 changes only by adding things: new endpoints, new optional parameters, new fields on objects, new error codes and new event types. Write clients that ignore fields they don’t know. Anything that would break an existing client ships as a new version, and v2’s responses never change shape. See the changelog.
New to v3? The Create an order endpoint is the place to start.
Something unclear or out of date? Write to support@tiksmm.dev and quote the page.