AccsMaster API

Accsmaster is a best marketplace for social media accounts. By using our API you get access to all our products and offers to become a reseller

Accfarm Resellers

Table of contents

  1. Description
  2. Authorization
  3. Callback
  4. Order statuses

Description

Official API for Accfarm resellers. With it you can easily get Accfarm's list of offers, filter offers, get list of categories, get data about your orders, their status and, most importantly, create new orders! There is also ready-to-use PHP SDK!

PHP SDK:

  1. GitHub
  2. Packagist

Authorization

All API requests require bearer token authorization. To get bearer token you need to you Authentication endpoint.

Callback

If you provide callback_url in buy method, Accfarm will send you order data when order is complete with this data:

$response = [
  'number' => 'order_number', // order number
  'status' => 'status_id', //order status
  'total' => 'price', //total price of order
  'secret_key' => 'secret_key' //order secret key          
  'download_link' - 'link' // if needed
];

Call to you endpoint (your callback_url) will always have Signature header. This will allow you to be sure call is coming from Accfarm. To check if it's valid you're going to need to:

  1. Hash request data with your user secret with the following code:
function signCallbackData(string $secret, array $data)
{
    ksort($data);

    $string = '';

    foreach($data as $value) {
        if (in_array(gettype($value), ['array', 'object', 'NULL']) ){
            continue;
        }
        if(is_bool($value) && $value){
            $string .= 1;
        } else {
            $string .= $value;
        }
    }

    return hash_hmac('sha512', strtolower($string), $secret);
}
  1. And then to check resulting hash against Signature header:
$json = file_get_contents('php://input');
$data = json_decode($json);
$headers = getallheaders();
$secret = 'my_secret';
$testSignature = signCallbackData($secret, $data);
$signature = $headers['Signature'];
if (!hash_equals($signature, $testSignature)) {
    // Error, wrong signature
    die;
}
// Process data
// ...

Order statuses

  • 1: new:
  • 2: in_progress
  • 3: complete
  • 4: canceled
  • 5: pending
  • 6: refunded
  • 7: mispaid
  • HTTPS Support Yes
  • CORS Support Yes
  • Authentication Type apiKey
  • Price Free Option