Application Programming Interface

API - Application programming interface, IPN - Instant Payment Notification.
If you don't accept the variant with fixed amount payment button, then API+IPN will be glad to help any programmer. Payment, that valid for payment only 15 minutes, can be created by REST/JSON-RPC call. ALFAcoins send notification to merchant on status change for payment. Status definition can be location on statuses page.
All requests are only available via HTTPS, in the interest of security best practices we do not support API calls over HTTP.
We support both REST and JSON-RPC calls. To use JSON-RPC calls please add .json at the end of request.

POST Requests

We support both REST and JSON-RPC calls. To use JSON-RPC calls please add .json at the end of request.

BitSend

BitSend primary use to payout salaries for staff or making direct deposits to different cryptocurrency addresses
url: https://www.alfacoins.com/api/bitsend
method: POST
data type: REST/JSON
data required:
  name = Shop Name of API which you assigned when you create the API
  secret_key = Secret key which is given after API was created
  password = MD5 password hash from API with CAPITAL LETTERS
  type = Cryptocurrency to pay with
  address = Client cryptocurrency address for deposit
  amount = Deposit amount in merchant's fiat currency
  recipient_name = (Optional) Client Name (for email notification)
  recipient_email = (Optional) Client email (for email notification)
  reference = (Optional) Deposit description (for client notification)

example data:
{
  "name": "Bitcoin shop",
  "secret_key": "c4ca4238a0b923820dcc509a6f75849b",
  "password": "C81E728D9D4C2F636F067F89CC14862C",
  "type": "bitcoin",
  "address": "1FE7bSYsXSMrdXTCdRUWUB6jGFFba74fzm",
  "amount": 1.23412341
}

success output:
{
  "id": "[ALFAcoins BitSend ID]"
}
{error: "Error message"}

BitSend Status

BitSend status primary use to get information of bitsend payout
url: https://www.alfacoins.com/api/bitsend_status
method: POST
data type: REST/JSON
data required:
  name = Shop Name of API which you assigned when you create the API
  secret_key = Secret key which is given after API was created
  password = MD5 password hash from API with CAPITAL LETTERS
  bitsend_id = (int) Bitsend ID

example data:
{
  "name": "Bitcoin shop",
  "secret_key": "c4ca4238a0b923820dcc509a6f75849b",
  "password": "C81E728D9D4C2F636F067F89CC14862C",
  "bitsend_id": 34516,
}

success output:
{
  "status": "[ALFAcoins BitSend Status]",
  "txid": "[Cryptocurrency transaction id]",
  "coin_amount": "[Coin amount]",
  "rate": "[Rate between currencies]",
  "type": "[Cryptocurrency used for payout]",
}
{error: "Error message"}

Create Order

Create order for payment
url: https://www.alfacoins.com/api/create
method: POST
data type: REST/JSON
data required:
  name = Shop Name of API which you assigned when you create the API
  secret_key = Secret key which is given after API was created
  password = MD5 password hash from API with CAPITAL LETTERS
  type = Cryptocurrency to get paid with
  amount = Deposit amount in merchant's fiat currency
  order_id = Merchant's Order ID
  description = (Optional) Description for order
  options = (Optional) Array
          {
            "notificationURL": "[custom Merchant's URL for payment notification]",
            "redirectURL": "[Merchant's page which is shown after payment is made by a customer]",
            "payerName": "[Customer's name for notification]",
            "payerEmail": "[Customer's email for notification]"
          }

example data:
{
  "name": "Bitcoin shop",
  "secret_key": "c4ca4238a0b923820dcc509a6f75849b",
  "password": "C81E728D9D4C2F636F067F89CC14862C",
  "type": "bitcoin",
  "amount": 1.23412341,
  "order_id": "Order10001",
  "description": "Payment for t-shirt ALFAcoins size XXL",
  "options": {
                "notificationURL": "https://www.alfacoinshop.com/notification.php",
                "redirectURL": "https://www.alfacoinshop.com/my/orders/success",
                "payerName": "Victor",
                "payerEmail": "[email protected]"
              }
}

success output:
{
  "id": "[ALFAcoins TXN ID]",
  "address": "[Cryptocurrency deposit address chosen in API"],
  "coin_amount": "[Amount to pay in cryptocurrency]",
  "url": "[ALFAcoins payment URL]",
  "iframe": "[ALFAcoins iframe URL]"
}
{error: "Error message"}

Order status

Get status of created Order
url: https://www.alfacoins.com/api/status
method: POST
data type: REST/JSON
data required:
  name = Shop Name of API which you assigned when you create the API
  secret_key = Secret key which is given after API was created
  password = MD5 password hash from API with CAPITAL LETTERS
  txn_id = ALFAcoins TXN ID

example data:
{
  "name": "Bitcoin shop",
  "secret_key": "c4ca4238a0b923820dcc509a6f75849b",
  "password": "C81E728D9D4C2F636F067F89CC14862C",
  "txn_id": 1005
}

success output:
{
  "status": "[Payment status]",
  "address": "[Cryptocurrency deposit address chosen in API]",
  "coin_requested_amount": "[Requested amount in cryptocurrency]",
  "requested_amount": "[Requested amount in fiat]",
  "amount": "[Received amount]",
  "rate": "[Rate between selected cryptocurrency and fiat]",
  "coin_amount": "[Received amount in cryptocurrency]",
  "currency": "[Merchant fiat currency]",
  "type": "[Cryptocurrency name]",
  "date": "[Payment renewal time]"
}
{error: "Error message"}

Statistics

Merchant's volume and balance statistics
url: https://www.alfacoins.com/api/stats
method: POST
data type: REST/JSON
data required:
  name = Shop Name of API which you assigned when you create the API
  secret_key = Secret key which is given after API was created
  password = MD5 password hash from API with CAPITAL LETTERS

example data:
{
  "name": "Bitcoin shop",
  "secret_key": "c4ca4238a0b923820dcc509a6f75849b",
  "password": "C81E728D9D4C2F636F067F89CC14862C",
}

success output:
{
  "balances": {
                "BTC": "[Bitcoin balance]",
                "LTC": "[Litecoin balance]",
                "ETH": "[Ethereum balance]",
                "USD": "[USD Balance]"
              },
  "volume": "[Order's volume]",
  "pending": "[Amount sums of payments that waits for confirmation]",

}
{error: "Error message"}

Refund

Refund completed order
url: https://www.alfacoins.com/api/refund
method: POST
data type: REST/JSON
data required:
  name = Shop Name of API which you assigned when you create the API
  secret_key = Secret key which is given after API was created
  password = MD5 password hash from API with CAPITAL LETTERS
  txn_id = ALFAcoins TXN ID
  address = Customers cryptocurrency address for refund. Must be same cryptocurrency type as Order type
  amount = (Optional) Amount to refund, must be less Order amount, If omitted full amount will be refunded

example data:
{
  "name": "Bitcoin shop",
  "secret_key": "c4ca4238a0b923820dcc509a6f75849b",
  "password": "C81E728D9D4C2F636F067F89CC14862C",
  "txn_id": 1005,
  "address": "1FE7bSYsXSMrdXTCdRUWUB6jGFFba74fzm",
  "amount": 2
}

success output:
{
  "txid": "[Cryptocurrency Transaction ID]"
}
{error: "Error message"}

GET Requests

We support both REST and JSON-RPC calls. To use JSON-RPC calls please add .json at the end of request.

Rate

Get rate for pair
url: https://www.alfacoins.com/api/rate/[pair]
method: GET
data type: REST/JSON
data required:
  [pair] = Cryptocurrency and fiat Pair

example request:
https://www.alfacoins.com/api/rate/btcusd.json

success output:
["628.51000000"]
{error: "Error message"}

Rates

Get rate for all available pairs
url: https://www.alfacoins.com/api/rates
method: GET
data type: JSON

example request:
https://www.alfacoins.com/api/rates

success output:
{
  "BTC":[
          {"code":"USD","rate":628.54},
          {"code":"EUR","rate":579.940948}
        ],
  "LTC":[
          {"code":"USD","rate":3.76613},
          {"code":"EUR","rate":3.474931}
        ],
  "ETH":[
          {"code":"USD","rate":12},
          {"code":"EUR","rate":11.072154}
        ]
}

Status

ALFAcoins send notification to merchant on status change for payment.

Payment status

New

This status is used for freshly created payments.

Paid

This status indicates that the invoice has been paid, but payment is yet to be confirmed on the blockchain. NOTE: for final confirmed payment status, see: Completed.

Partially received

This status indicates that the payment has been partially made (received amount is less than amount specified in the payment).


Expired

This status indicates that the payment wasn't made within 15 minutes.

Completed

This status indicates that the invoice has been fully paid and confirmed on the blockchain.

Refunded

This status indicates that the payment has been refunded to your customer.

Notification

ALFAcoins sends inquiries to notificationURL using POST every time after status change and sends the following parameters:
id = Number of payment
hash = Payment hash for checking incoming data that consists of
  hash = strtoupper(md5(name:coin_received_amount:received_amount:currency:id:order_id:status:modified:password))
  where:
  name = API name
  password = API uppercase of md5 of password, strtoupper(md5("MD5 of password API in the uppercase."))
received_amount = Received in fiat
currency = Fiat currency (i.e. USD/EUR)
coin_received_amount = Received amount of cryptocurrency
order_id = Merchant's Order ID
status = Current payment status
modified = Last date and time when payment changed

Plugins for integration

Take payments on your online store via ALFAcoins. No programming required.

WooCommerce plugin

Plugin is available for download at https://wordpress.org/plugins/alfacoins-for-woocommerce/.
Follow these steps to install the plugin on your WordPress site:
  • Download the plugin zip file.
  • Login to your WordPress Admin. Click on "Plugins | Add New" from the left hand menu.
  • Click on the “Upload” option, then click “Choose File” to select the zip file from your computer. Once selected, press “OK” and press the "Install Now" button.
  • Activate the plugin on Plugins page.
  • Open the settings page for WooCommerce and click the "Payment Gateways" tab.
  • Click on the sub tab for "ALFAcoins"
  • Configure your settings.

If you have any troubles, you have found any bugs or you have something to say us, please leave your message on support page.