Skip to main content

API

HTTP methodPOST
API URL
https://rolexaf.shop/api/v1
API KeySign in to get API key
Response formatJSON
Account API currencyAFN

Service list services

ParameterDescription
keyYour private API key
actionservices
Example request (POST)
key=YOUR_API_KEY&action=services
Example JSON response
[
    {
        "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.

ParameterDescription
keyYour private API key
actionadd
serviceService ID from services
linkValid target link or identifier
quantityQuantity between min and max
request_idRequired: 16–128 ASCII letters, digits, hyphens or underscores. Reuse for retries of the same purchase.
couponOptional 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

keyYour private API key
actionadd
serviceService ID from services
linkValid target link or identifier
quantityQuantity between min and max
request_idRequired: 16–128 ASCII letters, digits, hyphens or underscores. Reuse for retries of the same purchase.
Example request (POST)
key=YOUR_API_KEY&action=add&service=7522&link=https%3A%2F%2Fexample.com%2Ftarget&quantity=1000&request_id=client-order-demo-00001
Example JSON response
{
    "order": 23501
}

Order status status

ParameterDescription
keyYour private API key
actionstatus
orderOrder ID belonging to your account
Example request (POST)
key=YOUR_API_KEY&action=status&order=23501
Example JSON response
{
    "charge": "12.5000",
    "start_count": "3572",
    "status": "In progress",
    "remains": "157",
    "currency": "AFN"
}

Multiple order status status

ParameterDescription
keyYour private API key
actionstatus
ordersComma-separated order IDs; up to 100
Example request (POST)
key=YOUR_API_KEY&action=status&orders=23501%2C23502
Example JSON response
{
    "23501": {
        "charge": "12.5000",
        "start_count": "3572",
        "status": "In progress",
        "remains": "157",
        "currency": "AFN"
    },
    "23502": {
        "error": "Incorrect order ID"
    }
}

Create refill refill

Currently unavailable
ParameterDescription
keyYour private API key
actionrefill
orderOrder ID belonging to your account
Example JSON response
{
    "error": "Provider-confirmed refill/cancel is not enabled. Contact support; the order status and wallet have not changed."
}

Create multiple refills refill

Currently unavailable
ParameterDescription
keyYour private API key
actionrefill
ordersComma-separated order IDs; up to 100
Example JSON response
{
    "error": "Provider-confirmed refill/cancel is not enabled. Contact support; the order status and wallet have not changed."
}

Refill status refill_status

Currently unavailable
ParameterDescription
keyYour private API key
actionrefill_status
refillRefill request ID
Example JSON response
{
    "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
ParameterDescription
keyYour private API key
actionrefill_status
refillsComma-separated refill IDs; up to 100 (reference format)
Example JSON response
{
    "error": "Provider-confirmed refill/cancel is not enabled. Contact support; the order status and wallet have not changed."
}

Cancel orders cancel

Currently unavailable
ParameterDescription
keyYour private API key
actioncancel
ordersComma-separated order IDs; up to 100
Example JSON response
{
    "error": "Provider-confirmed refill/cancel is not enabled. Contact support; the order status and wallet have not changed."
}

User balance balance

ParameterDescription
keyYour private API key
actionbalance
Example request (POST)
key=YOUR_API_KEY&action=balance
Example JSON response
{
    "balance": "100.8429",
    "currency": "AFN"
}

Errors and troubleshooting

ErrorDescription
Incorrect API keyCheck 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 resellerContact support about reseller API access.
Incorrect service ID / Incorrect order IDUse 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 maximumCheck target and quantity against min and max.
insufficient_balanceTop up your wallet.
Send a persistent request_id (16-128 letters, digits, underscore or hyphen) for add requests. / idempotency_conflictProvide 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_disabledStop 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 failedRetry 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 8.1+
<?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]);
Search services

Search, compare and choose using each service's actual prices and conditions.