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_tokenString255Payment token for recurrent payments
params.user_idString-User ID within Partner's systemtest_user
params.pay_token_flagInteger1Payment token flag. See Recurrent Payments section for a detailed description.0 or 1 (0 as a default)
params.flag_get_urlInteger1Flag used to receive payment form link in response to payment request0 or 1 (0 as a default)
params.extra_paramsJSON-Custom Merchant parameters{ "merchant_field1":"val1", "merchant_field2":"val2" }
params.extra_params.merchant_siteString-Merchant website addresswww.realsite.com

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