Provider API v2
Provider API v2
The standard SMM provider API: one URL, one key and an action parameter. Compatible with PerfectPanel and every panel built on the same protocol.
Endpoint and request format
/api/v2Every action goes to the same URL. Send key and action plus the action’s parameters. Use POST with a form-encoded body — that’s what panels send — though GET with a query string, multipart and JSON bodies work too.
POST /api/v2 HTTP/1.1
Host: api.tiksmm.dev
Content-Type: application/x-www-form-urlencoded
key=tk_live_your_key_here&action=status&orders=184609%2C184610- IDs in
ordersandrefillsare comma-separated, up to 100 per call. In a JSON body you can send an array instead. commentsare newline-separated. In JSON you can send an array of strings.- Parameter names are lower case. Unknown parameters are ignored.
Actions
- POSTservicesThe service list with your rates. Panels call it when you import services and on every price sync.
- POSTaddPlaces an order and charges your balance. Returns the order ID.
- POSTstatusOrder status. One order with
order, or up to 100 withorders. - POSTrefillRequests a refill. One order with
order, or up to 100 withorders. - POSTrefill_statusRefill status. One refill with
refill, or up to 100 withrefills. - POSTcancelCancels up to 100 orders. Always answers with one entry per order.
- POSTbalanceYour available balance. Panels show it next to the provider and use it for low-balance alerts.
Responses and errors
Responses are JSON. Failures are HTTP 200 with an error key, because that’s what panel software checks:
{
"error": "Incorrect order ID"
}The only exception is rate limiting, which answers HTTP 429 with a Retry-After header (see Rate limits). Every response carries an X-Request-Id header you can look up in Dashboard → Request logs.
Before any action runs, these checks can fail, in this order:
{"error": "Invalid API key"}The key is missing, wrong or revoked. invalid_api_key{"error": "IP address is not allowed"}The key has an IP allowlist and this address isn’t on it. ip_not_allowed{"error": "Account is suspended"}The account is suspended. account_suspended{"error": "Too many requests"}Over the rate limit. This is the one v2 response that isn’t HTTP 200: it’s 429 with Retry-After. rate_limited{"error": "Incorrect request"}actionis missing or isn’t one of the seven actions. invalid_action{"error": "API key does not have permission for this action"}The key doesn’t have the scope this action needs. insufficient_scope{"error": "Internal error"}Something failed on our side. Nothing was applied; retry. internal_error
We keep these strings stable because panels match on them. Several different problems share Incorrect request; v3 tells them apart with a specific code and a message that says how to fix it.
services
/api/v2The service list with your rates. Panels call it when you import services and on every price sync.
Needs the orders:read scope (read orders and services). About scopes
Parameters
keystringAuthorization: Bearer … instead.actionstringservices- Paused services are left out until they resume, so panels stop offering them. Services that are only slower than usual (
degraded) stay in the list.
Example
curl https://api.tiksmm.dev/api/v2 \
-d key=tk_live_your_key_here \
-d action=services<?php
$ch = curl_init('https://api.tiksmm.dev/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => 'tk_live_your_key_here',
'action' => 'services',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
// Failures answer HTTP 200 with an "error" key.
if (isset($response['error'])) {
throw new RuntimeException($response['error']);
}
print_r($response);import requests
response = requests.post(
"https://api.tiksmm.dev/api/v2",
data={
"key": "tk_live_your_key_here",
"action": "services",
},
timeout=30,
).json()
# Failures answer HTTP 200 with an "error" key.
if isinstance(response, dict) and "error" in response:
raise RuntimeError(response["error"])
print(response)const response = await fetch("https://api.tiksmm.dev/api/v2", {
method: "POST",
body: new URLSearchParams({
key: "tk_live_your_key_here",
action: "services",
}),
}).then((res) => res.json())
// Failures answer HTTP 200 with an "error" key.
if (response.error) throw new Error(response.error)
console.log(response)[
{
"service": 101,
"name": "Followers — Standard",
"type": "Default",
"category": "TikTok Followers",
"rate": "1.0120",
"min": "100",
"max": "50000",
"dripfeed": true,
"refill": false,
"cancel": true,
"refill_days": 0,
"start_time": "0–1 h",
"speed_per_day": 15000,
"drop_estimate": "10–25%",
"description": "Lowest price. Mixed-quality global accounts with no refill."
},
{
"service": 102,
"name": "Followers — Premium, 30-day refill",
"type": "Default",
"category": "TikTok Followers",
"rate": "2.2080",
"min": "50",
"max": "100000",
"dripfeed": true,
"refill": true,
"cancel": true,
"refill_days": 30,
"start_time": "0–30 min",
"speed_per_day": 25000,
"drop_estimate": "3–8%",
"description": "Our best seller. Profiles with avatars and posts, low drop, 30-day refill."
}
]Response fields
serviceintegerservice with action=add.namestringtypestringadd parameters apply.DefaultCustom CommentsComment LikescategorystringTikTok FollowersTikTok LikesTikTok Commentsratedecimal stringminstringmaxstringdripfeedbooleanruns and interval are accepted.refillbooleancancelbooleanrefill_daysintegerstart_timestring0–30 min or 1–6 h.speed_per_dayintegerdrop_estimatestring3–8%.descriptionstringErrors
Only the failures any action can return.
add
/api/v2Places an order and charges your balance. Returns the order ID.
Needs the orders:write scope (place and cancel orders). About scopes
Parameters
keystringAuthorization: Bearer … instead.actionstringaddserviceintegerlinkstringquantityintegermin and max (per run with drip-feed).- The response’s
orderis a number. Store it — it’s the ID forstatus,refillandcancel. referenceis v3-only; v2 ignores it.
Default
Followers, likes and random comments: a link and a quantity.
curl https://api.tiksmm.dev/api/v2 \
-d key=tk_live_your_key_here \
-d action=add \
-d service=102 \
--data-urlencode link=https://www.tiktok.com/@mila.makes \
-d quantity=1000<?php
$ch = curl_init('https://api.tiksmm.dev/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => 'tk_live_your_key_here',
'action' => 'add',
'service' => '102',
'link' => 'https://www.tiktok.com/@mila.makes',
'quantity' => '1000',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
// Failures answer HTTP 200 with an "error" key.
if (isset($response['error'])) {
throw new RuntimeException($response['error']);
}
print_r($response);import requests
response = requests.post(
"https://api.tiksmm.dev/api/v2",
data={
"key": "tk_live_your_key_here",
"action": "add",
"service": "102",
"link": "https://www.tiktok.com/@mila.makes",
"quantity": "1000",
},
timeout=30,
).json()
# Failures answer HTTP 200 with an "error" key.
if isinstance(response, dict) and "error" in response:
raise RuntimeError(response["error"])
print(response)const response = await fetch("https://api.tiksmm.dev/api/v2", {
method: "POST",
body: new URLSearchParams({
key: "tk_live_your_key_here",
action: "add",
service: "102",
link: "https://www.tiktok.com/@mila.makes",
quantity: "1000",
}),
}).then((res) => res.json())
// Failures answer HTTP 200 with an "error" key.
if (response.error) throw new Error(response.error)
console.log(response){
"order": 184610
}Drip-feed
Split the order into runs. You’re charged for quantity × runs up front.
runsintegerintervalintegercurl https://api.tiksmm.dev/api/v2 \
-d key=tk_live_your_key_here \
-d action=add \
-d service=201 \
--data-urlencode link=https://www.tiktok.com/@mila.makes/video/7431187220394482945 \
-d quantity=500 \
-d runs=10 \
-d interval=60<?php
$ch = curl_init('https://api.tiksmm.dev/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => 'tk_live_your_key_here',
'action' => 'add',
'service' => '201',
'link' => 'https://www.tiktok.com/@mila.makes/video/7431187220394482945',
'quantity' => '500',
'runs' => '10',
'interval' => '60',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
// Failures answer HTTP 200 with an "error" key.
if (isset($response['error'])) {
throw new RuntimeException($response['error']);
}
print_r($response);import requests
response = requests.post(
"https://api.tiksmm.dev/api/v2",
data={
"key": "tk_live_your_key_here",
"action": "add",
"service": "201",
"link": "https://www.tiktok.com/@mila.makes/video/7431187220394482945",
"quantity": "500",
"runs": "10",
"interval": "60",
},
timeout=30,
).json()
# Failures answer HTTP 200 with an "error" key.
if isinstance(response, dict) and "error" in response:
raise RuntimeError(response["error"])
print(response)const response = await fetch("https://api.tiksmm.dev/api/v2", {
method: "POST",
body: new URLSearchParams({
key: "tk_live_your_key_here",
action: "add",
service: "201",
link: "https://www.tiktok.com/@mila.makes/video/7431187220394482945",
quantity: "500",
runs: "10",
interval: "60",
}),
}).then((res) => res.json())
// Failures answer HTTP 200 with an "error" key.
if (response.error) throw new Error(response.error)
console.log(response){
"order": 184611
}Custom Comments
Send the comments one per line. The number of lines is the quantity; quantity is ignored.
commentsstringcurl https://api.tiksmm.dev/api/v2 \
-d key=tk_live_your_key_here \
-d action=add \
-d service=301 \
--data-urlencode link=https://www.tiktok.com/@mila.makes/video/7431187220394482945 \
--data-urlencode $'comments=Saving this for later\nThe lighting in this one 🔥\nNeed a part 2\nHow did you do the transition?\nThis made my day'<?php
$ch = curl_init('https://api.tiksmm.dev/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => 'tk_live_your_key_here',
'action' => 'add',
'service' => '301',
'link' => 'https://www.tiktok.com/@mila.makes/video/7431187220394482945',
'comments' => "Saving this for later\nThe lighting in this one 🔥\nNeed a part 2\nHow did you do the transition?\nThis made my day",
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
// Failures answer HTTP 200 with an "error" key.
if (isset($response['error'])) {
throw new RuntimeException($response['error']);
}
print_r($response);import requests
response = requests.post(
"https://api.tiksmm.dev/api/v2",
data={
"key": "tk_live_your_key_here",
"action": "add",
"service": "301",
"link": "https://www.tiktok.com/@mila.makes/video/7431187220394482945",
"comments": "Saving this for later\nThe lighting in this one 🔥\nNeed a part 2\nHow did you do the transition?\nThis made my day",
},
timeout=30,
).json()
# Failures answer HTTP 200 with an "error" key.
if isinstance(response, dict) and "error" in response:
raise RuntimeError(response["error"])
print(response)const response = await fetch("https://api.tiksmm.dev/api/v2", {
method: "POST",
body: new URLSearchParams({
key: "tk_live_your_key_here",
action: "add",
service: "301",
link: "https://www.tiktok.com/@mila.makes/video/7431187220394482945",
comments: "Saving this for later\nThe lighting in this one 🔥\nNeed a part 2\nHow did you do the transition?\nThis made my day",
}),
}).then((res) => res.json())
// Failures answer HTTP 200 with an "error" key.
if (response.error) throw new Error(response.error)
console.log(response){
"order": 184612
}Comment Likes
Likes on one comment under a video: the video link, the comment author’s username and a quantity.
usernamestringcurl https://api.tiksmm.dev/api/v2 \
-d key=tk_live_your_key_here \
-d action=add \
-d service=304 \
--data-urlencode link=https://www.tiktok.com/@mila.makes/video/7431187220394482945 \
--data-urlencode username=jordan.eats \
-d quantity=200<?php
$ch = curl_init('https://api.tiksmm.dev/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => 'tk_live_your_key_here',
'action' => 'add',
'service' => '304',
'link' => 'https://www.tiktok.com/@mila.makes/video/7431187220394482945',
'username' => 'jordan.eats',
'quantity' => '200',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
// Failures answer HTTP 200 with an "error" key.
if (isset($response['error'])) {
throw new RuntimeException($response['error']);
}
print_r($response);import requests
response = requests.post(
"https://api.tiksmm.dev/api/v2",
data={
"key": "tk_live_your_key_here",
"action": "add",
"service": "304",
"link": "https://www.tiktok.com/@mila.makes/video/7431187220394482945",
"username": "jordan.eats",
"quantity": "200",
},
timeout=30,
).json()
# Failures answer HTTP 200 with an "error" key.
if isinstance(response, dict) and "error" in response:
raise RuntimeError(response["error"])
print(response)const response = await fetch("https://api.tiksmm.dev/api/v2", {
method: "POST",
body: new URLSearchParams({
key: "tk_live_your_key_here",
action: "add",
service: "304",
link: "https://www.tiktok.com/@mila.makes/video/7431187220394482945",
username: "jordan.eats",
quantity: "200",
}),
}).then((res) => res.json())
// Failures answer HTTP 200 with an "error" key.
if (response.error) throw new Error(response.error)
console.log(response){
"order": 184613
}Errors
{"error": "Incorrect service ID"}The service ID doesn’t exist. service_not_found{"error": "Service is temporarily disabled"}The service is paused. service_unavailable{"error": "Incorrect link"}The link isn’t a TikTok link, or it’s the wrong kind for the service. invalid_link{"error": "Incorrect request"}quantityis missing or not a whole number above zero. invalid_request{"error": "Incorrect comments"}No comment lines, or a line longer than 150 characters. invalid_comments{"error": "Incorrect username"}Comment Likes without a validusername. invalid_username{"error": "Quantity less than minimal {min}"}quantityis below the service minimum. quantity_below_minimum{"error": "Quantity more than maximum {max}"}quantityis above the service maximum. quantity_above_maximum{"error": "Drip-feed isn't available on this service."}{"error": "Runs must be a whole number from 2 to 100."}{"error": "Interval must be a whole number of minutes from 1 to 1,440."}{"error": "Not enough funds on balance"}Your balance doesn’t cover the charge. insufficient_funds{"error": "You have active order with this link. Please wait until order being completed."}An order on the same service and link is still pending, processing or in progress. duplicate_active_order
Plus the failures any action can return.
status
/api/v2Order status. One order with order, or up to 100 with orders.
Needs the orders:read scope (read orders and services). About scopes
Parameters
keystringAuthorization: Bearer … instead.actionstringstatusorderintegerorderscomma-separated integers- Every status read brings the order up to date first — there’s no cache to wait out.
One order
curl https://api.tiksmm.dev/api/v2 \
-d key=tk_live_your_key_here \
-d action=status \
-d order=184610<?php
$ch = curl_init('https://api.tiksmm.dev/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => 'tk_live_your_key_here',
'action' => 'status',
'order' => '184610',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
// Failures answer HTTP 200 with an "error" key.
if (isset($response['error'])) {
throw new RuntimeException($response['error']);
}
print_r($response);import requests
response = requests.post(
"https://api.tiksmm.dev/api/v2",
data={
"key": "tk_live_your_key_here",
"action": "status",
"order": "184610",
},
timeout=30,
).json()
# Failures answer HTTP 200 with an "error" key.
if isinstance(response, dict) and "error" in response:
raise RuntimeError(response["error"])
print(response)const response = await fetch("https://api.tiksmm.dev/api/v2", {
method: "POST",
body: new URLSearchParams({
key: "tk_live_your_key_here",
action: "status",
order: "184610",
}),
}).then((res) => res.json())
// Failures answer HTTP 200 with an "error" key.
if (response.error) throw new Error(response.error)
console.log(response){
"charge": "2.20800",
"start_count": "28105",
"status": "In progress",
"remains": "671",
"currency": "USD"
}Up to 100 orders
Keyed by order ID. IDs that aren’t yours get an error object instead of failing the whole request.
curl https://api.tiksmm.dev/api/v2 \
-d key=tk_live_your_key_here \
-d action=status \
-d orders=184609,184610,184700<?php
$ch = curl_init('https://api.tiksmm.dev/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => 'tk_live_your_key_here',
'action' => 'status',
'orders' => '184609,184610,184700',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
// Failures answer HTTP 200 with an "error" key.
if (isset($response['error'])) {
throw new RuntimeException($response['error']);
}
print_r($response);import requests
response = requests.post(
"https://api.tiksmm.dev/api/v2",
data={
"key": "tk_live_your_key_here",
"action": "status",
"orders": "184609,184610,184700",
},
timeout=30,
).json()
# Failures answer HTTP 200 with an "error" key.
if isinstance(response, dict) and "error" in response:
raise RuntimeError(response["error"])
print(response)const response = await fetch("https://api.tiksmm.dev/api/v2", {
method: "POST",
body: new URLSearchParams({
key: "tk_live_your_key_here",
action: "status",
orders: "184609,184610,184700",
}),
}).then((res) => res.json())
// Failures answer HTTP 200 with an "error" key.
if (response.error) throw new Error(response.error)
console.log(response){
"184609": {
"charge": "0.08280",
"start_count": "35643",
"status": "Completed",
"remains": "0",
"currency": "USD"
},
"184610": {
"charge": "2.20800",
"start_count": "28105",
"status": "In progress",
"remains": "671",
"currency": "USD"
},
"184700": {
"error": "Incorrect order ID"
}
}Response fields
chargedecimal stringcharge − refunded). Drops after a partial or cancel refund.start_countstring"0" until the order is In progress.statusstringPendingProcessingIn progressCompletedPartialCanceledremainsstringcurrencystringUSD.USDErrors
{"error": "Incorrect request"}{"error": "Incorrect order ID"}No order with that ID on your account (single). order_not_found{"error": "Maximum 100 IDs per request"}More than 100 IDs inorders. too_many_ids
Plus the failures any action can return.
refill
/api/v2Requests a refill. One order with order, or up to 100 with orders.
Needs the refills:write scope (request refills). About scopes
Parameters
keystringAuthorization: Bearer … instead.actionstringrefillorderintegerorderscomma-separated integers- Dates in reasons are UTC, formatted like
Dec 15, 23:42 UTC.
One order
The refill ID comes back as a string.
curl https://api.tiksmm.dev/api/v2 \
-d key=tk_live_your_key_here \
-d action=refill \
-d order=184607<?php
$ch = curl_init('https://api.tiksmm.dev/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => 'tk_live_your_key_here',
'action' => 'refill',
'order' => '184607',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
// Failures answer HTTP 200 with an "error" key.
if (isset($response['error'])) {
throw new RuntimeException($response['error']);
}
print_r($response);import requests
response = requests.post(
"https://api.tiksmm.dev/api/v2",
data={
"key": "tk_live_your_key_here",
"action": "refill",
"order": "184607",
},
timeout=30,
).json()
# Failures answer HTTP 200 with an "error" key.
if isinstance(response, dict) and "error" in response:
raise RuntimeError(response["error"])
print(response)const response = await fetch("https://api.tiksmm.dev/api/v2", {
method: "POST",
body: new URLSearchParams({
key: "tk_live_your_key_here",
action: "refill",
order: "184607",
}),
}).then((res) => res.json())
// Failures answer HTTP 200 with an "error" key.
if (response.error) throw new Error(response.error)
console.log(response){
"refill": "9038"
}Up to 100 orders
One entry per order. Accepted refills carry the refill ID as a number; rejected ones carry the reason.
curl https://api.tiksmm.dev/api/v2 \
-d key=tk_live_your_key_here \
-d action=refill \
-d orders=184607,184608<?php
$ch = curl_init('https://api.tiksmm.dev/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => 'tk_live_your_key_here',
'action' => 'refill',
'orders' => '184607,184608',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
// Failures answer HTTP 200 with an "error" key.
if (isset($response['error'])) {
throw new RuntimeException($response['error']);
}
print_r($response);import requests
response = requests.post(
"https://api.tiksmm.dev/api/v2",
data={
"key": "tk_live_your_key_here",
"action": "refill",
"orders": "184607,184608",
},
timeout=30,
).json()
# Failures answer HTTP 200 with an "error" key.
if isinstance(response, dict) and "error" in response:
raise RuntimeError(response["error"])
print(response)const response = await fetch("https://api.tiksmm.dev/api/v2", {
method: "POST",
body: new URLSearchParams({
key: "tk_live_your_key_here",
action: "refill",
orders: "184607,184608",
}),
}).then((res) => res.json())
// Failures answer HTTP 200 with an "error" key.
if (response.error) throw new Error(response.error)
console.log(response)[
{
"order": 184607,
"refill": 9038
},
{
"order": 184608,
"refill": {
"error": "Refill isn't offered on this service."
}
}
]Errors
{"error": "Incorrect order ID"}No order with that ID on your account. order_not_found{"error": "Refill isn't offered on this service."}The service has no refill window. refill_not_available{"error": "Refill opens once the order is completed."}The order is still pending, processing or in progress. refill_not_available{"error": "Canceled orders can't be refilled — nothing was delivered."}The order was canceled. refill_not_available{"error": "The {days}-day refill window closed on {date}."}The refill window has passed. refill_not_available{"error": "A refill is already running for this order."}An earlier refill is pending or in progress. refill_not_available{"error": "One refill per 24 hours. The next request opens {date}."}The last refill on this order was less than 24 hours ago. refill_not_available{"error": "Maximum 100 IDs per request"}More than 100 IDs. too_many_ids
Plus the failures any action can return.
refill_status
/api/v2Refill status. One refill with refill, or up to 100 with refills.
Needs the refills:write scope (request refills). About scopes
Parameters
keystringAuthorization: Bearer … instead.actionstringrefill_statusrefillintegerrefillscomma-separated integersOne refill
curl https://api.tiksmm.dev/api/v2 \
-d key=tk_live_your_key_here \
-d action=refill_status \
-d refill=9038<?php
$ch = curl_init('https://api.tiksmm.dev/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => 'tk_live_your_key_here',
'action' => 'refill_status',
'refill' => '9038',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
// Failures answer HTTP 200 with an "error" key.
if (isset($response['error'])) {
throw new RuntimeException($response['error']);
}
print_r($response);import requests
response = requests.post(
"https://api.tiksmm.dev/api/v2",
data={
"key": "tk_live_your_key_here",
"action": "refill_status",
"refill": "9038",
},
timeout=30,
).json()
# Failures answer HTTP 200 with an "error" key.
if isinstance(response, dict) and "error" in response:
raise RuntimeError(response["error"])
print(response)const response = await fetch("https://api.tiksmm.dev/api/v2", {
method: "POST",
body: new URLSearchParams({
key: "tk_live_your_key_here",
action: "refill_status",
refill: "9038",
}),
}).then((res) => res.json())
// Failures answer HTTP 200 with an "error" key.
if (response.error) throw new Error(response.error)
console.log(response){
"status": "Completed"
}Up to 100 refills
curl https://api.tiksmm.dev/api/v2 \
-d key=tk_live_your_key_here \
-d action=refill_status \
-d refills=9038,9040,9999<?php
$ch = curl_init('https://api.tiksmm.dev/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => 'tk_live_your_key_here',
'action' => 'refill_status',
'refills' => '9038,9040,9999',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
// Failures answer HTTP 200 with an "error" key.
if (isset($response['error'])) {
throw new RuntimeException($response['error']);
}
print_r($response);import requests
response = requests.post(
"https://api.tiksmm.dev/api/v2",
data={
"key": "tk_live_your_key_here",
"action": "refill_status",
"refills": "9038,9040,9999",
},
timeout=30,
).json()
# Failures answer HTTP 200 with an "error" key.
if isinstance(response, dict) and "error" in response:
raise RuntimeError(response["error"])
print(response)const response = await fetch("https://api.tiksmm.dev/api/v2", {
method: "POST",
body: new URLSearchParams({
key: "tk_live_your_key_here",
action: "refill_status",
refills: "9038,9040,9999",
}),
}).then((res) => res.json())
// Failures answer HTTP 200 with an "error" key.
if (response.error) throw new Error(response.error)
console.log(response)[
{
"refill": 9038,
"status": "Completed"
},
{
"refill": 9040,
"status": "Rejected"
},
{
"refill": 9999,
"status": {
"error": "Incorrect refill ID"
}
}
]Response fields
statusstringRejected means no drop was found; v3 and the dashboard show the reason.PendingIn progressCompletedRejectedErrors
{"error": "Incorrect request"}{"error": "Incorrect refill ID"}No refill with that ID on your account. refill_not_found{"error": "Maximum 100 IDs per request"}More than 100 IDs. too_many_ids
Plus the failures any action can return.
cancel
/api/v2Cancels up to 100 orders. Always answers with one entry per order.
Needs the orders:write scope (place and cancel orders). About scopes
Parameters
keystringAuthorization: Bearer … instead.actionstringcancelorderscomma-separated integersorder is accepted too.Example
cancel: 1 means the request was accepted. A pending order is canceled and refunded at once; a running one stops within about a minute and is refunded for what wasn’t delivered.
curl https://api.tiksmm.dev/api/v2 \
-d key=tk_live_your_key_here \
-d action=cancel \
-d orders=184610,184609<?php
$ch = curl_init('https://api.tiksmm.dev/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => 'tk_live_your_key_here',
'action' => 'cancel',
'orders' => '184610,184609',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
// Failures answer HTTP 200 with an "error" key.
if (isset($response['error'])) {
throw new RuntimeException($response['error']);
}
print_r($response);import requests
response = requests.post(
"https://api.tiksmm.dev/api/v2",
data={
"key": "tk_live_your_key_here",
"action": "cancel",
"orders": "184610,184609",
},
timeout=30,
).json()
# Failures answer HTTP 200 with an "error" key.
if isinstance(response, dict) and "error" in response:
raise RuntimeError(response["error"])
print(response)const response = await fetch("https://api.tiksmm.dev/api/v2", {
method: "POST",
body: new URLSearchParams({
key: "tk_live_your_key_here",
action: "cancel",
orders: "184610,184609",
}),
}).then((res) => res.json())
// Failures answer HTTP 200 with an "error" key.
if (response.error) throw new Error(response.error)
console.log(response)[
{
"order": 184610,
"cancel": 1
},
{
"order": 184609,
"cancel": {
"error": "The order is already completed."
}
}
]Errors
{"error": "Incorrect request"}No IDs were sent. invalid_request{"error": "Incorrect order ID"}No order with that ID on your account. order_not_found{"error": "This service doesn't allow cancellation once an order is accepted."}The service doesn’t allow cancellation. cancel_not_available{"error": "Cancellation was already requested. Delivery stops within about a minute."}You already asked. cancel_not_available{"error": "The order is already {completed | partial | canceled}."}The order is final. cancel_not_available{"error": "Maximum 100 IDs per request"}More than 100 IDs. too_many_ids
Plus the failures any action can return.
balance
/api/v2Your available balance. Panels show it next to the provider and use it for low-balance alerts.
Needs the balance:read scope (read balance). About scopes
Parameters
keystringAuthorization: Bearer … instead.actionstringbalanceExample
curl https://api.tiksmm.dev/api/v2 \
-d key=tk_live_your_key_here \
-d action=balance<?php
$ch = curl_init('https://api.tiksmm.dev/api/v2');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => http_build_query([
'key' => 'tk_live_your_key_here',
'action' => 'balance',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
// Failures answer HTTP 200 with an "error" key.
if (isset($response['error'])) {
throw new RuntimeException($response['error']);
}
print_r($response);import requests
response = requests.post(
"https://api.tiksmm.dev/api/v2",
data={
"key": "tk_live_your_key_here",
"action": "balance",
},
timeout=30,
).json()
# Failures answer HTTP 200 with an "error" key.
if isinstance(response, dict) and "error" in response:
raise RuntimeError(response["error"])
print(response)const response = await fetch("https://api.tiksmm.dev/api/v2", {
method: "POST",
body: new URLSearchParams({
key: "tk_live_your_key_here",
action: "balance",
}),
}).then((res) => res.json())
// Failures answer HTTP 200 with an "error" key.
if (response.error) throw new Error(response.error)
console.log(response){
"balance": "442.51035",
"currency": "USD"
}Response fields
balancedecimal stringcurrencystringUSD.USDErrors
Only the failures any action can return.
Something unclear or out of date? Write to support@tiksmm.dev and quote the page.