Initialize Payment Request

Request Parameters

To initialize a payment, two parameters need to be included in an HTTP POST request to the URL https://secure(-test).8b.world/pay:

  • data: A base64-encoded JSON document string.
  • sign: A signature created based on the data string using hash_hmac for data validity confirmation.

JSON Document Parameters

NameTypeMax LengthDescriptionExample
api_keyString255Shop key (identifier)c84f1ac0-e4f0-0000-5298-70900c00c2a2
expirationStringMaximum duration till when a payment can be provided2014-01-01 00:00
amountFloat10.2Payment amount. Format: positive number with "." as a separator, no more than two digits after the dot327.78
currencyString3Payment currency. Possible values: EUR, USD, UZSUSD
referenceString255Unique shop order number for further order identification123456789
descriptionString255Order descriptiontest
success_urlString255URL where User will be redirected after a successful paymenthttp://test.com/success
failure_urlString255URL where User will be redirected after an unsuccessful paymenthttp://test.com/failure
langString2Language of the payment page.en, uk
params.user_emailString-User E-mail[email protected]

Additional Parameters (Optional)

NameTypeMax LengthDescriptionExample
pay_tokenString255Recurrent payment token. Parameter is optional and depends on payment gateway settings
ipString255Payer’s IP in IPv4/IPv6 format. Parameter is optional and depends on payment gateway settings8.8.8.8 / 2001:0db8:85a3:0000:0000:8a2e:0370:7334
params.user_idString-User identifier in Merchant's systemtest_user
params.verification_flagInteger1Verification of bank card attribute (Depends on an acquirer). 1 — Blocked for verification funds are automatically unlocked after successful verification0 or 1 (0 as a default)
params.random_amount_flagInteger1Lock of a random value for verification of bank card attribute. 1 — A random value from 0 to basic parameter amount is locked0 or 1 (0 as a default)
params.pay_token_flagInteger1Attribute designed for recurrent payment token. See detailed description in article 100 or 1 (0 as a default)
params.extra_paramsJSONAny other Merchant’s parameters{ "merchant_field1":"val1", "merchant_field2":"val2" }


Signature Generating Rule (the sign parameter)

The signature is formed based on a data string (Base64 encoded parameters string) with the help of hash_hmac.

The MD5 algorithm is used for the signature creation.

hash_hmac('md5', $data, $secret_key);

Where:

  • data - base64 encoded JSON document string
  • secret_key - shop password


API Reference

You can view a Reference API implementation for this method at this link