Skip to content

Request to order a bank transfer

Process description

  1. The merchant prepares a packet that it sends to a given URL as an HTTP GET request.
  2. Upon submission of a correct request, in the same HTTP session, ePay.bg will return to the merchant "System code for the payment made at ePay.bg".

Each registered merchant in the ePay.bg system has

  • Alphanumeric secret word of length 64 (secret)
  • Customer Identification Number (CIN).

The merchant can find them in his https://epay.bg/ profile without being able to change them.

Communication scheme

epay bank trasfer

Production environment

Method URL
GET https://www.epay.bg/send/send_vnbel.cgi

Demo environment

Method URL
GET https://demo.epay.bg/send/send_vnbel.cgi

Request to order a bank transfer

Parameter Type Description Optionality
ENCODED string Base64-encoded (RFC 3548) payment request, EOL=''. Mandatory
CHECKSUM string Checksum on ENCODED, generated as HMAC with SHA-1 algorithm and the merchant's secret word. Mandatory

Parameters in ENCODED

Parameter Type Description Optionality
MIN int Customer Identification Number (CIN) Mandatory
MEMAIL string Email of the merchant in the system Mandatory
INVOICE string Unique request number up to 64 characters

Accepted: numbers, Latin
Mandatory
RECIPIENT string Recipient of the order up to 35 characters

Accepted: Cyrillic, Latin, numbers, spaces, dashes, commas, periods
Mandatory
IBAN string Recipient's valid IBAN Mandatory
AMOUNT float Valid amount > 0.01 (eg: 22, 22.8, 22.80) Mandatory
STATEMENT string Reason up to 70 characters

Accepted: Cyrillic, Latin, numbers, spaces, dashes, commas, periods
Mandatory
CURRENCY string Accepted currency is BGN; if not supplied defaults to BGN Optional
ENCODING encoding encoding of RECIPIENT and STATEMENT; only accepted with utf-8 Optional

Example code for making the request

1
2
3
4
5
6
7
{
    # Encoding the request
    $ENCODED = encode_base64('DATA', ''); # '' for EOL (def. is "\n")   

    # Generate checksum
    $CHECKSUM = hmac_hex($ENCODED, $secret, \&sha1);
}
1
2
3
4
5
6
7
8
9
{
    # Encoding the request
    $ENCODED = base64_encode('DATA');

    # Generate checksum
    $CHECKSUM = hmac('sha1', $ENCODED, $secret);

    # hmac function code can be found in demo.php
}

Response

SYS_CODE=1234567890
ERR=Error description