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
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:
All API requests require bearer token authorization. To get bearer token you need to you Authentication endpoint.
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:
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);
}
$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
// ...