Table of contents

Preparing and adding a site, bot or app

Do you want visitors of your website, bot, or app to be able to easily pay for goods and services directly on your service?
And at the same time, do you want to receive programmatic feedback about these payments?

With Azvox, this is very easy to do. And there are several ways to do this, both simpler and more complex, with greater flexibility of settings.

But first, so that you can accept payments on your site, bot or app, you need to add it to Azvox.

Adding a site to Azvox

Go to the ADD SITE section and click the Add Site button

Fill in the site name
Copy the Secret key
Fill in the Domain, without https://

If you want Azvox to notify your site of the payment status after the client has paid and redirect the Client back to your site, then you need to fill in the StatusUrl, SuccessUrl and FailUrl.

To do this, enable the switch Callback and Client redirection and specify relative paths to the scripts. Specify paths relative to the root of your domain, starting with the / symbol
For example:
/pay_status.php
/pay_success.php
/pay_fail.php
You can find an example of these scripts and documentation on handling responses in this document below.

After saving, your Site will appear in the list of sites in the ADD SITE section.

Now you need to confirm that the added site belongs to you and that you have access to it.
It's easy to do. Just place a special text file in the root of your site.
To do this, in the list of your sites, click on the red Confirm Ownership button and follow the simple instructions.

Congratulations. Your site has been added to Azvox and sent for moderation. Site moderation does not require any action from you and takes no more than 24 hours.
During this time, Azvox employees will check that your site meets the Azvox requirements, which you can read below.

During the moderation, you can already set up payments on your site and test it.
While your site is being moderated, only the wallet in which you added this Site will be able to pay bills.

Adding a Bot or App to Azvox

Use this method if your site, bot, or application does not have a domain name and is only accessible by IP address.

The following documentation will use the word App to refer to a bot, application, or site that does not have a domain name.

For this, Azvox has a universal way to connect your App.

Go to the ADD SITE section and click on the Add Bot or Application button

Fill in the name of your App
Copy the secret key
Enter the IP address and Port, specify in the format IP:Port. Example: 1.1.1.1:443
Select the protocol for connecting to your APP, possible options are Http or Https
Specify the Status Url, it will be used for notifications. Azvox will send payment data to it in real time if the client has paid or refused to pay the invoice issued to the Client by your App.

If you want Azvox to provide to your Clients the ability to go to the desired URL after payment or refusal to pay, then you need to fill in SuccessUrl and FailUrl.

To do this, turn on the Client redirection switch and specify the full paths to the scripts, starting with http:// or https://.
Example:
https://yoursite.com/clients_success_page.php
http://shop.yoursite.com/success_page/
http://1.2.3.4/clients/?pay_failed=1
https://1.2.3.4:5555/clients/failed_payment/
An example of these scripts and documentation on handling responses can be found in this document, below.

After saving, your App will appear in the list of sites in the ADD SITE section.

Congratulations. Your App has been added to Azvox. Your App does not require moderation and is ready to work immediately.

Requirements for websites
Any sites that are not related to the following categories are allowed to work:
Terrorism, extremism
Pornography
Violence

If your site does not belong to these categories, then the moderation of your site will be completed quickly and successfully.
If your site for some reason did not pass the check, do not be upset.
You just need to eliminate these reasons and send the site for moderation again. The reasons will be indicated in the list of sites and in the Support section in the corresponding Message.

Creating a payment

To receive payment from a visitor of your site, you need to create an invoice that will be offered to this visitor for payment.

There are several ways to create invoices in Azvox:
Payment Form Generator,
Using Api,
Using Full Control
Payment Form Generator

This is the easiest way to accept payments from your Clients.

Your own website is not required, programming knowledge is not required and you can start accepting payments in a few clicks.

Everything you need to start accepting payments:
Go to the CONNECTION section.
Add a payment form.
Insert the form code on any page of your site, or simply pass the link to this form to any of your clients.

If you selected the site where you will place this form when creating the form, and when adding the site you specified Status, Success and Fail Url, then after payment, clients will be redirected to your site and Azvox will transfer information about the payment to the specified StatusUrl.

This method of creating invoices is convenient and fast, but it does not suit everyone, since it does not allow you to automatically generate an order description and payment amount.
If you need this and the functionality of payment forms is not enough for you, see the next method.

Using a ready-made PHP class for working with Azvox API

If your site uses PHP and you have minimal programming knowledge, then this method is exactly what you need.

With this class you can create invoices using just a few lines of code.

Add API in the API integration section.
Add the following code to the desired page of your site:
Creating an invoice using PHP class cAzvox.php:Copy code
<?php require_once "cAzvox.php"; $api = new cAzvox( "Main number of your Azvox wallet (W12345)", "Api ID (specified in the list of your APIs)", "Password for API access" ); // $shop_id is ID of your site in Azvox, can be found in the list of your sites. // Or enter 0 if you just want to create an invoice for payment that is not associated to your site. $shop_id = 12345; // $order_id is the order ID in your accounting system, if you don't have an order ID, enter 0. $order_id = 123; $data = array( "m_shop" => $shop_id, "m_orderid" => $order_id, "m_amount" => 100.15, // Order amount "m_curr" => "USD", // Order currency USD, EUR or RUB "m_desc" => "Description", // Description of your order that the client will see ); // If you want Azvox to return additional data when reporting about payment, uncomment the line below and add it to the array as shown in the example // $data["m_params"] = json_encode(array("var1" => "value1", "var2" => "value2")); $newInvoice = $api->createInvoice($data); $errors = $api->getErrors(); if (!$errors){ echo '<a href="'.$newInvoice['pay_url'].'">Pay</a>'; }else{ print_r($errors); } ?>
This code will display a link on the page, when clicked, the Client will be redirected to the invoice payment page.
If the request was successful, then the variable $newInvoice will contain an array with the following data:
$newInvoice:Copy code
Array( [invoice_id] => Azvox Invoice ID [m_orderid] => Order ID, you specified when creating the invoice $order_id [pay_url] => Link to the invoice payment page that you need to send the Client to )
If any error occurred, $api->getErrors() will contain an array with a detailed description of the error.
For a list of possible errors, see below, in the detailed API documentation.
Creation with Azvox API

If your site does not support PHP and you use another programming language, you need to access the Azvox API via HTTPS.

See below for more details. To create an invoice, see new_invoice

With full control

The previous methods of creating an invoice via API are convenient, but have one drawback.
Your API has a tariff plan, according to which there are limits on the number of requests per second and per minute.

By default, the free plan is selected (Free)
It has a limitation of no more than 1 request per second and no more than 6 requests per minute.
If you want to use API invoice creation methods and think that this number of requests is not enough for your purposes, then you can choose another plan in the API section.

But you can also create invoices in another way that allows you to have full control over the creation of the payment form.

You need to create a payment form on your website page:

Form example:Copy code
<form method="post" action="https://azvox.cash/pay/"> <input type="hidden" name="m_shop" value="12345"> <input type="hidden" name="m_orderid" value="123"> <input type="hidden" name="m_amount" value="100.15"> <input type="hidden" name="m_curr" value="USD"> <input type="hidden" name="m_desc" value="dGVzdA=="> <input type="hidden" name="m_sign" value="12A315A26EE2D255E180EFBE35AD0C376338159B7B6ADFE2B02313EF06233676"> <input type="hidden" name="m_params" value="eyJwYXJhbV9jdXIiOiJVU0QifQ=="> <input type="submit" name="m_process" value="Pay"> </form>

Or specify a direct link to payment if it is not possible to send a request to the payment page using the POST method:

Link example:Copy code
<a href="https://azvox.cash/pay/?m_shop=12345&m_orderid=123&m_amount=100.15&m_curr=USD&m_desc=dGVzdA==&m_sign=12A315A26EE2E255E181EFBE35AD0C396338159B7B6ADFE2A02313EF06233678"> You can pay via direct link </a>

Description of form parameters

NameParameterDescription
Site ID m_shop Site ID in Azvox
The ID is specified in the list of your sites in the ADD SITE section.
Requirements: Integer > 0
Example: 12345
Order ID m_orderid Order ID in your accounting system.
Must be unique for each new payment.
Requirements: Integer > 0
Example: 123
Payment amount m_amount The payment amount that the seller wishes to receive from the buyer. The amount must be greater than zero, the fractional part is separated by a dot, the number of digits after the dot is two.
Requirements: >= 0.01, Format: 0.00
Example: 123.12
Example 2: 100.00
Example 3: 0.50
Payment currency m_curr The currency in which the seller wishes to receive the money.
The buyer will be able to pay in any currency, regardless of the one specified here.
Possible currencies: USD, EUR, RUB
Example: USD
Payment description m_desc Description of the product or service.
Generated by the seller and displayed to the buyer at the payment moment.
Encoded using the base64 algorithm.
Requirements: String < 100 characters before encoding in base64
Example: dGVzdA==
PHP code:Copy code
<?php echo base64_encode('test'); ?>
Digital signature m_sign Used to verify the integrity of the received information and uniquely identify the sender.
Example:
12A315A26EE2D255E180EFBE35AD0C37
6338159B7B6ADFE2B02313EF06233676

Additional parameters m_params Specify this parameter only when transmitting data using the POST method.
JSON array of additional parameters data, encoded using the base64 algorithm.
Azvox will send this data to your StatusUrl script
Requirements: JSON string characters length < 1000
Example: eyJwYXJhbV9jdXIiOiJVU0QifQ==
PHP code:Copy code
<?php echo base64_encode(json_encode(array( "var1" => "value1", "var2" => "value2", "var3" => "value3" ))); ?>
Example of form generation in PHP
PHP code:Copy code
<?php $m_shop = 12345; // Your site ID in Azvox $m_key = 'jSp3%13v5hYLaXb'; // Secret key provided in your site settings $m_amount = 100.52; // Payment amount $m_curr = 'USD'; // Payment currency $m_orderid = 123; // Order ID in your accounting system $m_desc = 'Payment description that the client will see when paying.'; $m_params = false; // List of optional parameters that you can pass to the form // Azvox will send them to your payment processing script at StatusUrl // $m_params = array("var1" => "value1", "var2" => "value2", "var3" => "value3"); $m_amount = number_format($m_amount, 2, ".", ""); $m_desc = base64_encode($m_desc); $m_params = base64_encode(json_encode($m_params)); $arHash = array($m_shop,$m_orderid,$m_amount,$m_curr,$m_desc,$m_params,$m_key); $m_sign = strtoupper(hash('sha256', implode(':', $arHash))); ?> <form method="post" action="https://azvox.cash/pay/"> <input type="hidden" name="m_shop" value="<?=$m_shop;?>"> <input type="hidden" name="m_orderid" value="<?=$m_orderid;?>"> <input type="hidden" name="m_amount" value="<?=$m_amount;?>"> <input type="hidden" name="m_curr" value="<?=$m_curr;?>"> <input type="hidden" name="m_desc" value="<?=$m_desc;?>"> <input type="hidden" name="m_sign" value="<?=$m_sign;?>"> <input type="hidden" name="m_params" value="<?=$m_params;?>"> <input type="submit" name="m_process" value="Pay"> </form>
Example of generation payment link in PHP
PHP code:Copy code
<?php $m_shop = 12345; // Your site ID in Azvox $m_key = 'jSp3%13v5hYLaXb'; // Secret key provided in your site settings $m_amount = 100.52; // Payment amount $m_curr = 'USD'; // Payment currency $m_orderid = 123; // Order ID in your accounting system $m_desc = 'Payment description that the client will see when paying.'; $m_params = false; // Ignored when the GET method used, but this code is required to generate the m_sign digital signature $m_amount = number_format($m_amount, 2, ".", ""); $m_desc = base64_encode($m_desc); $m_params = base64_encode(json_encode($m_params)); $arHash = array($m_shop,$m_orderid,$m_amount,$m_curr,$m_desc,$m_params,$m_key); $m_sign = strtoupper(hash('sha256', implode(':', $arHash))); $pay_by_link = array("m_shop" => $m_shop, "m_orderid" => $m_orderid, "m_amount" => $m_amount, "m_curr" => $m_curr, "m_desc" => $m_desc, "m_sign" => $m_sign); $pay_by_link = "https://azvox.cash/pay/?".http_build_query($pay_by_link); ?> <a href="<?=$pay_by_link;?>">You can pay via direct link</a>


Processing within Success, Fail and Status URL

During the payment process, the Client can either complete the payment or cancel it.

In both cases, the client will be given the option to return to your site, and client will be redirected to SuccessUrl or FailUrl accordingly.

Azvox will also call your payment processing script (StatusUrl) and report the payment status so you can process the invoice (order) on your side.

Successful Payment Script - SuccessUrl

This address will be suggested to the Client in case of successful payment of the invoice.

Keep in mind that the client may not navigate to the specified address.

Do not process the payment or any important data in this script, as anyone can navigate to this address and spoof the parameters passed to this script.

Use this script only as a notification that the payment was successful, or redirect the Client from the script to the desired section.

Example of Successful Payment Script - SuccessUrl:Copy code
<?php header('Content-Type: text/html; charset=utf-8'); // This parameter is only passed if you sent the request from the Azvox section - site testing $testOnly = isset($_POST["testOnly"])?true:false; $m_shop = 0; $m_orderid = 0; $m_amount = 0; $m_curr = ""; $m_params = ""; if (isset($_GET['success'])){ if (isset($_GET['m_shop'])){$m_shop = (int)$_GET['m_shop'];} // Check that the passed m_shop parameter matches your site if ($m_shop == "Your site ID in Azvox"){ // Order ID in your accounting system if (isset($_GET['m_orderid'])){$m_orderid = (int)$_GET['m_orderid'];} // Payment amount credited to the seller (different from the amount paid by the Client) if (isset($_GET['m_amount'])){$m_amount = $_GET['m_amount'];} // Payment currency if (isset($_GET['m_curr'])){$m_curr = $_GET['m_curr'];} // m_params will contain data filled in by the Client only if the invoice was paid through the payment form created in Azvox if (isset($_GET['m_params'])){$m_params = $_GET['m_params'];} if ($m_params != ""){$m_params = base64_decode($m_params);} if ($m_orderid > 0){ // At this point, check if this $m_orderid belongs to the Client who came to this address // If everything is correct, show the client a message about the successful payment // Under no circumstances should you mark the order as successful in this script, do this in the StatusUrl script echo 'Order number '.$m_orderid.' has been successfully completed. Order amount: '.$m_amount.' '.$m_curr; exit; } } } echo "ERROR"; exit; ?>
Payment Decline Script - FailUrl

This address will be suggested to the Client if they decline to pay the invoice.

Keep in mind that the client may not navigate to the specified address.

Do not process the payment or any important data in this script, as anyone can navigate to this address and spoof the parameters passed to this script.

Use this script only as a notification that the payment was declined by the Client, or redirect the Client from the script to the desired section.

Example of Payment Decline Script - FailUrl:Copy code
<?php header('Content-Type: text/html; charset=utf-8'); // This parameter is only passed if you sent the request from the Azvox section - site testing $testOnly = isset($_POST["testOnly"])?true:false; $m_shop = 0; $m_orderid = 0; $m_amount = 0; $m_curr = ""; $m_params = ""; if (isset($_GET['fail'])){ if (isset($_GET['m_shop'])){$m_shop = (int)$_GET['m_shop'];} // Check that the passed m_shop parameter matches your site if ($m_shop == "Your site ID in Azvox"){ // Order ID in your accounting system if (isset($_GET['m_orderid'])){$m_orderid = (int)$_GET['m_orderid'];} // Payment amount that was supposed to be credited to the seller if (isset($_GET['m_amount'])){$m_amount = $_GET['m_amount'];} // Payment currency if (isset($_GET['m_curr'])){$m_curr = $_GET['m_curr'];} // m_params will contain data filled in by the Client only if the invoice was created through the payment form created in Azvox if (isset($_GET['m_params'])){$m_params = $_GET['m_params'];} if ($m_params != ""){$m_params = base64_decode($m_params);} if ($m_orderid > 0){ // At this point, check if this $m_orderid belongs to the Client who came to this address // If everything is correct, show the client a message that the client declined the payment of the invoice // Under no circumstances should you mark the order as completed or declined in this script, do this in the StatusUrl script echo 'You declined to pay for order number '.$m_orderid.'. Order amount: '.$m_amount.' '.$m_curr; exit; } } } echo "ERROR"; exit; ?>
Payment Handler Script - StatusUrl

Azvox will send the data to this script when the Client completes or declines the payment.

Keep in mind that the Client does not navigate to this address and does not know its address.

Process the payment, mark it as paid or cancelled, only in this script, and only after appropriate checks.

Be sure to check on your side whether you have previously processed this payment, so as not to credit the purchase again.
In some cases, Azvox may send data multiple times.

StatusUrl must respond with the text $m_orderid|success.
Example: 123|success
Otherwise, Azvox will resend requests periodically until it receives the correct response.
But no more than 10 times.
You can also resend the request from the History section by clicking the More Details button at the right from relevant transaction.

Parameters that Azvox sends to your StatusUrl via POST method

NameDescription
m_status Transaction status: Paid (success) or Cancelled (fail)
m_operation_id Invoice ID in Azvox
m_operation_amount Amount paid by the Client.
Or an empty string in case of payment decline.
m_operation_curr Currency in which the Client made the payment.
Or an empty string in case of payment decline.
m_operation_timestamp Unix Timestamp of the payment date.
Or 0 in case of payment decline.
m_wallet Client's wallet number from which the payment was made.
Or an empty string in case of payment decline.
m_shop Your site ID in Azvox
m_orderid Order ID in your accounting system
m_amount Payment amount the seller wished to receive from the buyer.
m_curr Payment currency in which the seller wanted to receive the payment.
m_desc Product or service description, encoded in base64.
m_params Additional JSON parameters sent during payment creation, or data filled by the Client during payment if the payment was made using Azvox Payment Forms.
m_sign Digital signature used to verify the integrity of the data.
testOnly This parameter is only passed if you sent the request from the Azvox section - site testing.
Example of Payment Processing Script - StatusUrl:Copy code
<?php header('Content-Type: text/html; charset=utf-8'); if (isset($_POST['m_status']) && isset($_POST['m_shop']) && isset($_POST['m_orderid']) && isset($_POST['m_operation_id']) && isset($_POST['m_sign'])){ $testOnly = isset($_POST["testOnly"])?true:false; $m_key = "Secret key specified in your site settings"; $m_shop = "Your site ID in Azvox"; $arHash = array( $_POST['m_status'], $_POST['m_operation_id'], $_POST['m_operation_amount'], $_POST['m_operation_curr'], $_POST['m_operation_timestamp'], $_POST['m_wallet'], $_POST['m_shop'], $_POST['m_orderid'], $_POST['m_amount'], $_POST['m_curr'], $_POST['m_desc'], $_POST['m_params'], $m_key ); // Generate signature $sign_hash = strtoupper(hash('sha256', implode(':', $arHash))); $m_status = $_POST['m_status']; $m_shopid = (int)$_POST['m_shop']; // Verify the signature and other parameters if ($_POST['m_sign'] == $sign_hash && ($m_shopid == $m_shop) && ( ($m_status == 'success') || ($m_status == 'fail') )){ $operation_id = $_POST['m_operation_id']; $operation_amount = $_POST['m_operation_amount']; $operation_curr = $_POST['m_operation_curr']; $real_pay_date = $_POST['m_operation_timestamp']; $m_wallet = $_POST['m_wallet']; $m_orderid = (int)$_POST['m_orderid']; $m_amount = $_POST['m_amount']; $m_curr = $_POST['m_curr']; $m_desc = $_POST['m_desc']; $m_params = $_POST['m_params']; $m_desc = base64_decode($m_desc); $m_params = json_decode(base64_decode($m_params), true); $is_all_ok = false; if ($m_status == 'success'){ // The invoice has been paid and you can mark it as paid // At this point you need to find the $m_orderid invoice in your accounting system and check // does this invoice exist, has it not been processed before, is the payment amount and currency correct // If everything is correct, then process it and make the variable $is_all_ok = true $is_all_ok = true; // If all your checks are successful and you have processed the invoice, then assign true to the variable }elseif ($m_status == 'fail'){ // The customer refused to pay the invoice. If required, find this invoice in your database and mark that the customer cancelled the invoice $is_all_ok = true; // It's similar here. If all your checks are successful and you've processed the invoice, then assign true to the variable } if ($is_all_ok){ echo $m_orderid.'|success'; exit; } } } echo "ERROR"; exit; ?>
Azvox API
Interaction with Your Wallet via API

Azvox provides external developers with the ability to interact with the service programmatically.
One way to interact with the service is by using the API.

The API defines a set of functions for interaction via the HTTPS protocol.
These functions allow you to access various system resources, such as information about your balance and notifications, details of specific transactions or a list of transactions in the system, transferring money, and much more.

Preparing and Adding API

Go to the API Integration section and click on the Add API button.

Enter the API Name.
Copy the Password for API access.
Select the other necessary parameters.

For increased security, we recommend selecting access only for specified IP addresses so that the API can be used only from certain IP addresses. Also, choose only the necessary allowed actions for the API.

After saving, your API will be displayed in the Your APIs list in the API Integration section, and you can start using it.

Basics of Creating Requests

Interaction is performed using POST requests encoded in UTF-8 to the URL: https://azvox.cash/api/v3.6/
Each response from the Azvox server include a field called status, which contains either ok or error, indicating whether the request contains errors or has been processed successfully.

If status=error, the response will also include an error field with a detailed description of the error.
If status=ok, the response will include a data field with the response data, which you can review in more detail below.

For ease of use, you can use the ready-made PHP class for working with the Azvox API

Each request to the Azvox API server must include several required parameters:

ParameterDescription
account Main number of your Azvox wallet.
The number you enter during authorization.
Example: W12345
apiId API ID, which you can find in your list of APIs.
Example: 12345
apiPass Password for accessing this API
Example: oDU7XBwN%TMDUJ4
action The requested action.
See the detailed description of possible actions below.
Additional Data See the detailed description of these data below.
API - Checking the Existence of a Wallet
Data that you need to provide:
ParameterValueDescription
.........List of required parameters: account, apiId, apiPass.
actioncheck_wallet Action: Check if the wallet exists
wallet Azvox wallet number you want to check.
Example: W12345
Value you will receive in the data parameter in the response:
ValueDescription
wallet_ok or wallet_not_found Indicates whether the requested wallet number exists in Azvox
Example implementation using the PHP class cAzvox.php:Copy code
<?php require_once "cAzvox.php"; $api = new cAzvox( "Main number of your Azvox wallet (W12345)", "Api ID (specified in the list of your APIs)", "Password for API access" ); $isWalletOK = $api->isWalletExists('W12345'); if (!$api->getErrors()){ echo 'Wallet is: '.$isWalletOK; // ok|fail }else{print_r($api->getErrors());} ?>
API - Check wallet balance
Data that you need to provide:
ParameterValueDescription
.........List of required parameters: account, apiId, apiPass.
actionget_balance Action: Retrieve Wallet Balance
The array of data you will receive in the response in the `data` parameter:
ParameterDescription
USD USD balance of your wallet.
Example: 100.12
EUR EUR balance of your wallet.
Example: 12.00
RUB RUB balance of your wallet.
Example: 5678.20
Example implementation using the PHP class cAzvox.php:Copy code
<?php require_once "cAzvox.php"; $api = new cAzvox( "Main number of your Azvox wallet (W12345)", "Api ID (specified in the list of your APIs)", "Password for API access" ); $balance = $api->getBalance(); if (!$api->getErrors()){ echo 'Balance USD: '.$balance['USD'].'<br>'; echo 'Balance EUR: '.$balance['EUR'].'<br>'; echo 'Balance RUB: '.$balance['RUB'].'<br>'; }else{print_r($api->getErrors());} ?>
API - Check for notifications
Data that you need to provide:
ParameterValueDescription
.........List of required parameters: account, apiId, apiPass.
actionget_notifications Action: Checking for notifications
The array of data you will receive in the response in the `data` parameter:
ParameterValueDescription
messages 1 or 0 Indicates whether there are new messages in the chat.
p2p_exchange_from_owner 1 or 0 Indicates whether there is a new event in the P2P exchange initiated by the exchange owner.
p2p_exchange_from_client 1 or 0 Indicates whether there is a new event in the P2P exchange initiated by the exchange client.
tickets 1 or 0 Indicates whether there is a new message from Azvox Support.
Example implementation using the PHP class cAzvox.php:Copy code
<?php require_once "cAzvox.php"; $api = new cAzvox( "Main number of your Azvox wallet (W12345)", "Api ID (specified in the list of your APIs)", "Password for API access" ); $notifications = $api->getNotifications(); if (!$api->getErrors()){ $hasNewMessage = false; if ($notifications['messages'] == 1){ echo 'You have new Chat Message.'; $hasNewMessage = true; } if ($notifications['p2p_exchange_from_owner'] == 1){ echo 'You have new event in P2P Exchange from Exchanger.'; $hasNewMessage = true; } if ($notifications['p2p_exchange_from_client'] == 1){ echo 'You have new event in P2P Exchange from Client.'; $hasNewMessage = true; } if ($notifications['tickets'] == 1){ echo 'You have new Message from Support.'; $hasNewMessage = true; } if (!$hasNewMessage){ echo 'You have no Messages.'; } }else{print_r($api->getErrors());} ?>
API - Money transfer
Data that you need to provide:
ParameterValueDescription
.........List of required parameters: account, apiId, apiPass.
actiontransfer Action: Transfer money
to_wallet The Azvox wallet number to which you want to transfer money.
Example: W54321
amount The amount to be credited to the recipient's wallet.
Example: 100.12
curUSD, EUR, RUB The currency you want to transfer.
Example: USD
comment Comment for the recipient.
Example: Payment for goods
Can be left as an empty string.
Requirements: no more than 50 characters.
The array of data you will receive in the response in the `data` parameter:
ParameterDescription
history_operation_id Transaction ID in Azvox history
Example: 123123123
to_wallet Recipient's wallet number
Example: W54321
debited_amount The amount and currency debited from your balance.
Example: 101.13 USD
credited_amount The amount and currency credited to the recipient.
Example: 100.12 USD
Example implementation using the PHP class cAzvox.php:Copy code
<?php require_once "cAzvox.php"; $api = new cAzvox( "Main number of your Azvox wallet (W12345)", "Api ID (specified in the list of your APIs)", "Password for API access" ); $transfer = $api->transfer("W54321", "100.12", "USD", "Just a comment"); if (!$api->getErrors()){ echo 'Transfer Successful. Debited amount:-'.$transfer['debited_amount'].' To Wallet: '.$transfer['to_wallet'].' Credited amount:+'.$transfer['credited_amount']; }else{print_r($api->getErrors());} ?>
API - Internal money exchange
Data that you need to provide:
ParameterValueDescription
.........List of required parameters: account, apiId, apiPass.
actionexchange Action: Internal currency exchange.
From one currency in your wallet to another.
amount Amount you want to exchange.
Example: 100.52
from_curUSD, EUR, RUB Currency you want to exchange.
Example: USD
to_curUSD, EUR, RUB Currency you want to receive.
Example: EUR
The array of data you will receive in the response in the `data` parameter:
ParameterDescription
history_operation_id ID of the transaction in Azvox history.
Example: 123123123
debited_amount Amount and currency debited from your balance.
Example: 100.12 USD
credited_amount Amount and currency credited to your balance after the exchange.
Example: 90.56 EUR
Example implementation using the PHP class cAzvox.php:Copy code
<?php require_once "cAzvox.php"; $api = new cAzvox( "Main number of your Azvox wallet (W12345)", "Api ID (specified in the list of your APIs)", "Password for API access" ); $exchange = $api->exchange("100.12", "USD", "EUR"); if (!$api->getErrors()){ echo 'Internal Exchange Successful. Debited amount:-'.$exchange['debited_amount'].' Credited amount:+'.$exchange['credited_amount']; }else{print_r($api->getErrors());} ?>
API - Getting a list of transaction history
Data that you need to provide:
ParameterValueDescription
.........List of required parameters: account, apiId, apiPass.
actionget_history Action: Getting a list of transaction history
count1-10 The number of records you want to retrieve.
Example: 5
after_id The ID of the last transaction. You will get the records following this one.
If you are dumping a list of transactions, then specify 0 here to get the most recent records. And the next time you access, specify the ID of the last record you dumped to get the records following it.
Sort by date, descending, from newest to oldest.
Example: 123456
In the response, in the data parameter, you will receive an array of elements, each containing different data depending on the type of transaction:
Transaction TypeParameterDescription
Sent with any type of transaction operation_type Transaction type, the full list of types is specified below
Example: transfer
operation_id Transaction ID in your Azvox history
Example: 123123123
operation_status Transaction status.
Possible values:
ok - Transaction completed successfully
in_process - Transaction in process: The money has already been sent to the recipient and Azvox is sending data to the seller's site to inform them of this transaction.
problem - Problem with the transaction. The money has already been sent to the recipient and Azvox tried to send data to the seller's site to inform them of this transaction, but did not receive a correct response from the site for a long time. Go to the detailed transaction view in the history and re-send the data. If this is not your site and you made the payment, then contact the Administrator of this site and describe the problem to him.
date Date of transaction in format DD.MM.YYYY HH:MM:SS
Example: 31.12.2024 15:59:59
date_gmt Date time zone
Example: gmt+3
date_ts Unix Timestamp of the transaction
Example: 1716151413
is_api Whether the transaction was made using Azvox API
Possible values: ApiID or 0
Example: 123456
transfer Money Transfer
operation_id_to Transaction ID in the recipient's Azvox history
Example: 123123123
from_wallet Wallet number from which the payment was made
Example: W12345
to_wallet Wallet number to which the money was transferred
Example: W54321
debited_amount Amount debited from your balance
Example: 100.12
debited_cur Currency of debit. USD, EUR, RUB
Example: USD
fee_amount Azvox Fee amount
Example: 0.01
fee_cur Azvox Fee currency. USD, EUR, RUB
Example: USD
credited_amount Amount credited to the recipient's balance
Example: 100.12
credited_cur Currency of credit. USD, EUR, RUB
Example: USD
comment_b64 Comment from the sender encoded using base64.
Or an empty string.
get_transfer Receiving a Money Transfer
operation_id_from Transaction ID in the sender's Azvox history
Example: 123123123
from_wallet Wallet number from which the payment was made
Example: W54321
to_wallet Wallet number to which the money was transferred
Example: W12345
credited_amount Amount credited to your balance
Example: 100.12
credited_cur Currency of credit. USD, EUR, RUB
Example: USD
comment_b64 Comment from the sender encoded using base64.
Or an empty string.
exchange_internal Internal Exchange. From one currency in your wallet to another.
debited_amount Amount debited from your balance
Example: 100.12
debited_cur Currency of debit. USD, EUR, RUB
Example: USD
credited_amount Amount credited to your balance during the exchange
Example: 99.56
credited_cur Currency of credit. USD, EUR, RUB
Example: EUR
merchant_pay Paying an invoice generated on the website, from a form or via a link
operation_id_to Transaction ID in the recipient's Azvox history
Example: 123123123
debited_amount Amount debited from your balance
Example: 100.12
debited_cur Currency of debit. USD, EUR, RUB
Example: USD
from_wallet Wallet number from which the payment was made
Example: W12345
merchant_get_pay Receiving payment from an invoice generated on your website, from your form or via your link.
operation_id_from Transaction ID in the sender's Azvox history
Example: 123123123
credited_amount Amount credited to your balance
Example: 99.56
credited_cur Currency of credit. USD, EUR, RUB
Example: EUR
from_wallet Wallet number from which the payment was made
Example: W12345
buy_anon_wallet Purchase of an Anonymous Azvox Wallet Number
anon_wallet Number of the purchased Anonymous Azvox wallet
Example: W102030
debited_amount Amount debited from your balance
Example: 3.00
debited_cur Currency of debit. USD, EUR, RUB
Example: USD
buy_api_plan Purchase of API Plan
plan Plan Name
Example: Business
debited_amount Amount debited from your balance
Example: 50.00
debited_cur Currency of debit. USD, EUR, RUB
Example: USD
get_ref_earn Receiving Referral Earnings
to_wallet Your wallet number to which the earnings were credited
Example: W12345
credited_amount Amount credited to your balance
Example: 158.63
credited_cur Currency of credit. USD, EUR, RUB
Example: USD
Example implementation using the PHP class cAzvox.php:Copy code
<?php require_once "cAzvox.php"; $api = new cAzvox( "Main number of your Azvox wallet (W12345)", "Api ID (specified in the list of your APIs)", "Password for API access" ); $count_rows = 5; // 1-10 $after_id = 0; $history_list = $api->getLastHistory( $count_rows, $after_id ); if (!$api->getErrors()){ foreach( $history_list as $operation_id => $transaction ){ $operation_type = $transaction['operation_type']; print_r($transaction); } }else{print_r($api->getErrors());} ?>
API - Transaction details
Data that you need to provide:
ParameterValueDescription
.........List of required parameters: account, apiId, apiPass.
actionhistory_details Action: Get detailed information about a transaction.
history_operation_id The transaction ID from Azvox history that you want to get information about.
Example: 123456
In the response, in the data parameter, you will receive an array of parameters that may vary depending on the type of transaction:
Transaction TypeParameterDescription
Passed with any type of transaction operation_type Type of transaction; a full list of types is provided below
Example: transfer
operation_id Transaction ID in your Azvox history
Example: 123123123
operation_status Transaction status.
Possible values:
ok - Transaction completed successfully
in_process - Transaction in process: The money has already been sent to the recipient and Azvox is sending data to the seller's site to inform them of this transaction.
problem - Problem with the transaction. The money has already been sent to the recipient and Azvox tried to send data to the seller's site to inform them of this transaction, but did not receive a correct response from the site for a long time. Go to the detailed transaction view in the history and re-send the data. If this is not your site and you made the payment, then contact the Administrator of this site and describe the problem to him.
date Transaction date in the format DD.MM.YYYY HH:MM:SS
Example: 31.12.2024 15:59:59
date_gmt Time zone of the date
Example: gmt+3
date_ts Unix Timestamp of the transaction
Example: 1716151413
is_api Whether the transaction was made using Azvox API
Possible values: ApiID or 0
Example: 123456
transfer Money Transfer
operation_id_to Transaction ID in the recipient's Azvox history
Example: 123123123
from_wallet Wallet number from which the payment was made
Example: W12345
to_wallet Wallet number to which the money was transferred
Example: W54321
debited_amount Amount debited from your balance
Example: 100.12
debited_cur Currency of the debited amount. USD, EUR, RUB
Example: USD
fee_amount Azvox Fee amount
Example: 0.01
fee_cur Currency of Azvox Fee. USD, EUR, RUB
Example: USD
credited_amount Amount credited to the recipient's balance
Example: 100.12
credited_cur Currency of the credited amount. USD, EUR, RUB
Example: USD
comment_b64 Comment from the sender encoded using base64.
Or an empty string.
get_transfer Receiving a Money Transfer
operation_id_from Transaction ID in the sender's Azvox history
Example: 123123123
from_wallet Wallet number from which the payment was made
Example: W54321
to_wallet Wallet number to which the money was transferred
Example: W12345
credited_amount Amount credited to your balance
Example: 100.12
credited_cur Currency of the credited amount. USD, EUR, RUB
Example: USD
comment_b64 Comment from the sender encoded using base64.
Or an empty string.
exchange_internal Internal Exchange. From one currency in your wallet to another.
debited_amount Amount debited from your balance
Example: 100.12
debited_cur Currency of the debited amount. USD, EUR, RUB
Example: USD
credited_amount Amount credited to your balance during the exchange
Example: 99.56
credited_cur Currency of the credited amount. USD, EUR, RUB
Example: EUR
merchant_pay Payment for an invoice generated on the website, from a form, or via a link.
operation_id_to Transaction ID in the recipient's Azvox history
Example: 123123123
invoice_id Invoice ID in Azvox
Example: 123123123
debited_amount Amount debited from your balance
Example: 98.12
debited_cur Currency of the debited amount. USD, EUR, RUB
Example: EUR
m_amount Order amount.
Example: 100.35
m_cur Order currency. USD, EUR, RUB
Example: USD
from_wallet Wallet number from which the payment was made
Example: W12345
m_name Site name in Azvox; if this is your site, otherwise an empty string.
Example: My_Shop
m_domain Site domain name in Azvox; if this is your site, otherwise an empty string.
Example: myshop.com
m_orderid Order ID in the website's accounting system.
Example: 123
m_desc_b64 Order description encoded using base64.
Example: dGVzdA==
m_params_b64 Only provided if you are the owner of the website or form for which the payment was made.
Additional parameters or data from the form fields filled out by the buyer, packed in JSON and encoded using base64.
Example: eyJwYXJhbV9jdXIiOiJVU0QifQ==
m_shop Site ID in Azvox if you are the owner of this website.
Example: 123123123
m_form Form ID in Azvox if the invoice was created using Azvox's Payment Form and you are the creator of this form.
Example: 123123123
merchant_get_pay Receiving payment for an invoice generated on your website, from your form, or via your link.
operation_id_from Transaction ID in the sender's Azvox history
Example: 123123123
invoice_id Invoice ID in Azvox
Example: 123123123
credited_amount Amount credited to your balance
Example: 99.56
credited_cur Currency of the credited amount. USD, EUR, RUB
Example: EUR
m_amount Order amount.
Example: 99.56
m_cur Order currency. USD, EUR, RUB
Example: EUR
op_amount Amount debited from the buyer's balance.
Example: 100.53
op_cur Currency of the amount debited from the buyer's balance. USD, EUR, RUB
Example: USD
from_wallet Wallet number from which the payment was made
Example: W12345
m_name Site name in Azvox.
Example: My_Shop
m_domain Site domain name.
Example: shop.com
m_orderid Order ID in your accounting system.
Example: 123
m_desc_b64 Order description encoded using base64.
Example: dGVzdA==
m_params_b64 Additional parameters or data from the form fields filled out by the buyer, packed in JSON and encoded using base64.
Example: eyJwYXJhbV9jdXIiOiJVU0QifQ==
m_shop Site ID in Azvox.
Example: 123123123
m_form Form ID in Azvox if the invoice was created using Azvox's Payment Form.
Example: 123123123
buy_anon_wallet Purchase of an Anonymous Azvox wallet number
anon_wallet Number of the purchased Anonymous Azvox wallet
Example: W102030
debited_amount Amount debited from your balance
Example: 3.00
debited_cur Currency of the debited amount. USD, EUR, RUB
Example: USD
buy_api_plan Purchase of an API plan
plan Plan name
Example: Business
debited_amount Amount debited from your balance
Example: 50.00
debited_cur Currency of the debited amount. USD, EUR, RUB
Example: USD
get_ref_earn Receiving referral income
to_wallet Wallet number to which the income was credited
Example: W12345
credited_amount Amount credited to your balance
Example: 158.63
credited_cur Currency of the credited amount. USD, EUR, RUB
Example: USD
Example implementation using the PHP class cAzvox.php:Copy code
<?php require_once "cAzvox.php"; $api = new cAzvox( "Main number of your Azvox wallet (W12345)", "Api ID (specified in the list of your APIs)", "Password for API access" ); $history_transaction_id = 123456; $history_details = $api->getHistoryDetails($history_transaction_id); if (!$api->getErrors()){ $operation_type = $history_details['operation_type']; print_r($history_details); }else{print_r($api->getErrors());} ?>
API - Invoice details
Data that you need to provide:
ParameterValueDescription
.........List of required parameters: account, apiId, apiPass.
actionget_invoice Action: Get detailed information about an Invoice.
invoiceid Azvox Invoice ID for which you want to get information. Not to be confused with history_operation_id - ID from transaction historyExample: 123456
In the response, in the data parameter, you will receive an array of parameters:
ParameterDescription
status Invoice status.
Possible values: new - Invoice created but not paid by the client and the client has not cancelled the payment.
fail - The client has cancelled the payment.
ok - Invoice has been paid.
in_process - Transaction in process: The money has already been sent to the recipient and Azvox is sending data to the seller's site to inform them of this transaction.
problem - Problem with the transaction. The money has already been sent to the recipient and Azvox tried to send data to the seller's site to inform them of this transaction, but did not receive a correct response from the site for a long time. Go to the detailed transaction view in the history and re-send the data. If this is not your site and you made the payment, then contact the Administrator of this site and describe the problem to him.
Example: ok
pay_url Payment link for the invoice. Filled only when the invoice status is status=new
invoice_id Invoice ID in Azvox
Example: 123123123
m_orderid Order ID in the website's accounting system.
Example: 123
receiver Payment recipient. Website domain or recipient's wallet number.
Example: shop.com or W123678
date Date the invoice was created in DD.MM.YYYY HH:MM:SS format
Example: 31.12.2024 15:59:59
date_gmt Time zone of the invoice creation date
Example: gmt+3
date_ts Unix Timestamp of the invoice creation date
Example: 1716151413
op_date Date the invoice was paid in DD.MM.YYYY HH:MM:SS format
Example: 31.12.2024 15:59:59
op_date_gmt Time zone of the invoice payment date
Example: gmt+3
op_date_ts Unix Timestamp of the invoice payment date
Example: 1716151413
op_wallet Wallet number from which the payment was made
Example: W12345
m_amount Order amount.
Example: 100.35
m_cur Order currency. USD, EUR, RUB
Example: USD
op_amount Amount debited from the buyer's balance.
Example: 98.62
op_cur Currency of the amount debited from the buyer's balance. USD, EUR, RUB
Example: EUR
m_desc_b64 Order description encoded using base64.
Example: dGVzdA==
m_params_b64 Only provided if you are the owner of the website or form associated with the invoice.
Additional parameters or data from the form fields filled out by the buyer, packed in JSON and encoded using base64.
Example: eyJwYXJhbV9jdXIiOiJVU0QifQ==
m_shop Site ID in Azvox if you are the owner of this site.
Example: 123123123
m_form Form ID in Azvox if the invoice was created using Azvox's Payment Form and you are the creator of this form.
Example: 123123123
Example implementation using the PHP class cAzvox.php:Copy code
<?php require_once "cAzvox.php"; $api = new cAzvox( "Main number of your Azvox wallet (W12345)", "Api ID (specified in the list of your APIs)", "Password for API access" ); $invoice_id = 123456; $invoice = $api->getInvoice($invoice_id); if (!$api->getErrors()){ $invoice_status = $invoice['status']; print_r($invoice); }else{print_r($api->getErrors());} ?>
API - Creating a new invoice for payment
Before you start working with the API for creating invoices, you need to review the documentation.
Review the Merchant - Creation and Processing of Payments and then proceed with creating invoices through the API.
Data that you need to provide:
ParameterValueDescription
.........List of required parameters: account, apiId, apiPass.
actionnew_invoice Action: Creating a new invoice for payment.
m_shop ID of your site in Azvox, which you can find in your list of sites.
Alternatively, specify 0 if you want to create an invoice for payment not associated with your site.
Example: 123456
m_orderid ID of the order in your accounting system; specify 0 if you do not have an order ID.
Example: 123
m_amount The amount of the order that you want to receive after payment by the client.
Example: 100.57
m_curr The currency of the order that you want to receive. USD, EUR, RUB
Example: USD
m_desc Description of your order that the client will see.
Up to 100 characters.
Example: Description
m_params Additional data packed in JSON or an empty string.
Specify this if you want Azvox to return additional data to your StatusUrl script when processing the payment.
Up to 1000 characters.
Example: Description
In the response, in the `data` parameter, you will receive an array of parameters:
ParameterDescription
invoice_id ID of the invoice in Azvox
Example: 123123123
m_orderid ID of the order in your accounting system.
Example: 123
pay_url Link to pay the invoice.
Example implementation using the PHP class cAzvox.php:Copy code
<?php require_once "cAzvox.php"; $api = new cAzvox( "Main number of your Azvox wallet (W12345)", "Api ID (specified in the list of your APIs)", "Password for API access" ); // $shop_id is ID of your site in Azvox, can be found in the list of your sites. // Or enter 0 if you just want to create an invoice for payment that is not associated to your site. $shop_id = 12345; // $order_id is the order ID in your accounting system, if you don't have an order ID, enter 0. $order_id = 123; $data = array( "m_shop" => $shop_id, "m_orderid" => $order_id, "m_amount" => 100.15, // Order amount "m_curr" => "USD", // Order currency USD, EUR or RUB "m_desc" => "Description", // Description of your order that the client will see ); // If you want Azvox to return additional data when reporting about payment, uncomment the line below and add it to the array as shown in the example // $data["m_params"] = json_encode(array("var1" => "value1", "var2" => "value2")); $newInvoice = $api->createInvoice($data); $errors = $api->getErrors(); if (!$errors){ echo '<a href="'.$newInvoice['pay_url'].'">Pay</a>'; }else{ print_r($errors); } ?>