API
| HTTP method | POST |
|---|---|
| API URL | https://rolexaf.shop/api/v1 |
| API Key | Sign in to get API key |
| Response format | JSON |
| Account API currency | AFN |
Service list services
| Parameter | Description |
|---|---|
key | Your private API key |
action | services |
key=YOUR_API_KEY&action=services
[
{
"service": 7522,
"name": "Example service",
"type": "Default",
"category": "Example category",
"rate": "25.500000",
"pricing_unit": "per_1000",
"unit_quantity": 1000,
"unit_rate": "25.500000",
"min": "100",
"max": "100000",
"refill": false,
"cancel": false
}
]Add order add
Price is calculated server-side. Persist request_id for retries; use a new ID for a new purchase. An order ID does not mean delivery is complete.
| Parameter | Description |
|---|---|
key | Your private API key |
action | add |
service | Service ID from services |
link | Valid target link or identifier |
quantity | Quantity between min and max |
request_id | Required: 16–128 ASCII letters, digits, hyphens or underscores. Reuse for retries of the same purchase. |
coupon | Optional valid coupon code |
Order form types
Only standard orders are documented as supported by the current public API. The other forms are reference-only; do not submit them through this API. Use the dedicated website form.
Available
key | Your private API key |
action | add |
service | Service ID from services |
link | Valid target link or identifier |
quantity | Quantity between min and max |
request_id | Required: 16–128 ASCII letters, digits, hyphens or underscores. Reuse for retries of the same purchase. |
Reference only; unavailable
key | Your private API key |
action | add |
service | Service ID from services |
link | Valid target link or identifier |
quantity | Quantity between min and max |
runs | Delivery runs |
interval | Interval in minutes |
request_id | Required: 16–128 ASCII letters, digits, hyphens or underscores. Reuse for retries of the same purchase. |
Reference only; unavailable
key | Your private API key |
action | add |
service | Service ID from services |
link | Valid target link or identifier |
request_id | Required: 16–128 ASCII letters, digits, hyphens or underscores. Reuse for retries of the same purchase. |
Reference only; unavailable
key | Your private API key |
action | add |
service | Service ID from services |
link | Valid target link or identifier |
quantity | Quantity between min and max |
keywords | Keywords, one per line |
request_id | Required: 16–128 ASCII letters, digits, hyphens or underscores. Reuse for retries of the same purchase. |
Reference only; unavailable
key | Your private API key |
action | add |
service | Service ID from services |
link | Valid target link or identifier |
comments | Comments, one per line |
request_id | Required: 16–128 ASCII letters, digits, hyphens or underscores. Reuse for retries of the same purchase. |
Reference only; unavailable
key | Your private API key |
action | add |
service | Service ID from services |
link | Valid target link or identifier |
quantity | Quantity between min and max |
username | Comment owner username |
request_id | Required: 16–128 ASCII letters, digits, hyphens or underscores. Reuse for retries of the same purchase. |
Reference only; unavailable
key | Your private API key |
action | add |
service | Service ID from services |
link | Valid target link or identifier |
quantity | Quantity between min and max |
answer_number | Poll answer number |
request_id | Required: 16–128 ASCII letters, digits, hyphens or underscores. Reuse for retries of the same purchase. |
key=YOUR_API_KEY&action=add&service=7522&link=https%3A%2F%2Fexample.com%2Ftarget&quantity=1000&request_id=client-order-demo-00001
{
"order": 23501
}Order status status
| Parameter | Description |
|---|---|
key | Your private API key |
action | status |
order | Order ID belonging to your account |
key=YOUR_API_KEY&action=status&order=23501
{
"charge": "12.5000",
"start_count": "3572",
"status": "In progress",
"remains": "157",
"currency": "AFN"
}Multiple order status status
| Parameter | Description |
|---|---|
key | Your private API key |
action | status |
orders | Comma-separated order IDs; up to 100 |
key=YOUR_API_KEY&action=status&orders=23501%2C23502
{
"23501": {
"charge": "12.5000",
"start_count": "3572",
"status": "In progress",
"remains": "157",
"currency": "AFN"
},
"23502": {
"error": "Incorrect order ID"
}
}Create refill refill
Currently unavailable| Parameter | Description |
|---|---|
key | Your private API key |
action | refill |
order | Order ID belonging to your account |
{
"error": "Provider-confirmed refill/cancel is not enabled. Contact support; the order status and wallet have not changed."
}Create multiple refills refill
Currently unavailable| Parameter | Description |
|---|---|
key | Your private API key |
action | refill |
orders | Comma-separated order IDs; up to 100 |
{
"error": "Provider-confirmed refill/cancel is not enabled. Contact support; the order status and wallet have not changed."
}Refill status refill_status
Currently unavailable| Parameter | Description |
|---|---|
key | Your private API key |
action | refill_status |
refill | Refill request ID |
{
"error": "Provider-confirmed refill/cancel is not enabled. Contact support; the order status and wallet have not changed."
}Multiple refill status refill_status
Currently unavailable| Parameter | Description |
|---|---|
key | Your private API key |
action | refill_status |
refills | Comma-separated refill IDs; up to 100 (reference format) |
{
"error": "Provider-confirmed refill/cancel is not enabled. Contact support; the order status and wallet have not changed."
}Cancel orders cancel
Currently unavailable| Parameter | Description |
|---|---|
key | Your private API key |
action | cancel |
orders | Comma-separated order IDs; up to 100 |
{
"error": "Provider-confirmed refill/cancel is not enabled. Contact support; the order status and wallet have not changed."
}User balance balance
| Parameter | Description |
|---|---|
key | Your private API key |
action | balance |
key=YOUR_API_KEY&action=balance
{
"balance": "100.8429",
"currency": "AFN"
}Errors and troubleshooting
| Error | Description |
|---|---|
Incorrect API key | Check the key and account status. |
Method not allowed. Use POST. / Send the API key in the POST body, not in the URL. | Submit the request using POST. |
API access disabled for this reseller | Contact support about reseller API access. |
Incorrect service ID / Incorrect order ID | Use a valid service ID or an order ID owned by your account. |
New order link is empty / Incorrect quantity / Quantity less than minimum / Quantity more than maximum | Check target and quantity against min and max. |
insufficient_balance | Top up your wallet. |
Send a persistent request_id (16-128 letters, digits, underscore or hyphen) for add requests. / idempotency_conflict | Provide a valid persistent ID; use a new one for a different purchase. |
Currency rate unavailable; enable and update the selected API currency in admin settings. | Change the API currency or ask support to enable its rate. |
rate_limited / price_changed / purchase_disabled | Stop and check rates and access; keep the same ID for the same purchase retry. |
Provider-confirmed refill/cancel is not enabled. | This operation is currently unavailable. |
Cannot load services / Order service unavailable / Database connection failed | Retry later; preserve the same request ID for an order retry. |
Security and integration
Use HTTPS and POST; never expose keys in URLs, browser code or logs. services also works without a key, but account rates and currency require a key. No real key is embedded in these examples.
API currency is independent of website display currency: choose AFN, USD or TRY in your profile. The ledger remains AFN; foreign exchange rates must be available.
Use returned service IDs; the example below is fictional. rate is the legacy per-1000 rate, unit_rate the actual unit price, and unit_quantity the unit size. The current API returns Default for type and false for refill/cancel.
PHP integration example
Example requires PHP 8.1+ and cURL. Set the URL and key securely first. The example does not automatically place orders.
Download PHP example<?php
/** Prime Social public API client. PHP 8.1+, ext-curl. No requests run on include. */
final class PrimeSocialApi {
public function __construct(private string $url, private string $key) {
if (!filter_var($url, FILTER_VALIDATE_URL) || parse_url($url, PHP_URL_SCHEME) !== 'https' || trim($key) === '') {
throw new InvalidArgumentException('Configure an HTTPS API URL and a private API key.');
}
}
private function call(string $action, array $params = []): array {
$ch = curl_init($this->url);
curl_setopt_array($ch, [CURLOPT_POST => true, CURLOPT_POSTFIELDS => http_build_query(['key'=>$this->key,'action'=>$action]+$params), CURLOPT_RETURNTRANSFER=>true, CURLOPT_CONNECTTIMEOUT=>10, CURLOPT_TIMEOUT=>45, CURLOPT_FOLLOWLOCATION=>false, CURLOPT_SSL_VERIFYPEER=>true, CURLOPT_SSL_VERIFYHOST=>2, CURLOPT_HTTPHEADER=>['Accept: application/json','Content-Type: application/x-www-form-urlencoded']]);
try {
$raw = curl_exec($ch);
if ($raw === false) throw new RuntimeException('Connection failed; for add retries reuse the original request ID.');
$code = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($code < 200 || $code >= 300) throw new RuntimeException('HTTP error '.$code);
$data = json_decode($raw,true,512,JSON_THROW_ON_ERROR);
if (!is_array($data)) throw new RuntimeException('Unexpected API response.');
if (isset($data['error'])) throw new RuntimeException((string)$data['error']);
return $data;
} finally { curl_close($ch); }
}
public function services(): array { return $this->call('services'); }
public function balance(): array { return $this->call('balance'); }
public function add(int $service,string $link,int $quantity,string $requestId, string $coupon=''): array {
if (!preg_match('/^[A-Za-z0-9_-]{16,128}$/D',$requestId)) throw new InvalidArgumentException('Invalid request ID.');
if ($service<1 || $quantity<1 || trim($link)==='') throw new InvalidArgumentException('Invalid order input.');
return $this->call('add',['service'=>$service,'link'=>$link,'quantity'=>$quantity,'request_id'=>$requestId,'coupon'=>$coupon]);
}
public function status(int $order): array { return $this->call('status',['order'=>$order]); }
public function statuses(array $orders): array {
if (!$orders || count($orders)>100) throw new InvalidArgumentException('Provide 1 to 100 order IDs.');
foreach ($orders as $id) if (!is_int($id) || $id<1) throw new InvalidArgumentException('Invalid order ID.');
return $this->call('status',['orders'=>implode(',',$orders)]);
}
// Refill and cancel are intentionally unavailable in this API release.
}
// Usage (uncomment on your private server; never publish your key):
// $api = new PrimeSocialApi(getenv('PRIME_API_URL') ?: 'https://praimaf.shop/api/v1', getenv('PRIME_API_KEY') ?: '');
// $balance = $api->balance();
// $services = $api->services();
// For add: generate and STORE a unique ID in your database BEFORE submitting.
// $requestId = bin2hex(random_bytes(16)); // persist this ID for all retries
// $order = $api->add(123, 'https://example.com/target', 100, $requestId);
// $status = $api->status(12345);
// $statuses = $api->statuses([12345,12346]);
