Initialize Payment Request
Request ParametersTo initialize a payment, two parameters need to be included in an HTTP POST request to the URL https://secure(-test).carusell.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.
Name | Type | Max Length | Description | Example |
---|---|---|---|---|
api_key | String | 255 | Shop key (identifier) | c84f1ac0-e4f0-0000-5298-70900c00c2a2 |
expiration | String | Maximum duration till when a payment can be provided | 2014-01-01 00:00 | |
amount | Float | 10.2 | Payment amount. Format: positive number with "." as a separator, no more than two digits after the dot | 327.78 |
currency | String | 3 | Payment currency. Possible values: EUR, USD, UZS | USD |
reference | String | 255 | Unique shop order number for further order identification | 123456789 |
description | String | 255 | Order description | test |
success_url | String | 255 | URL where User will be redirected after a successful payment | |
failure_url | String | 255 | URL where User will be redirected after an unsuccessful payment | |
lang | String | 2 | Language of the payment page | en, uk |
params.user_email | String | User E-mail |
Additional Parameters (Optional)
Name | Type | Max Length | Description | Example |
---|---|---|---|---|
pay_token | String | 255 | Payment token for recurrent payments | |
params.user_id | String | User ID within Partner's system | test_user | |
params.pay_token_flag | Integer | 1 | Payment token flag (see Recurrent Payments section) | 0 or 1 (default: 0) |
params.flag_get_url | Integer | 1 | Flag to receive payment form link in response | 0 or 1 (default: 0) |
params.user_phone | String | 255 | User's phone number | +371234567890 |
params.country_iso_code | String | 2 | ISO 3166-1 Alpha-2 country code | GB |
params.billing_city | String | 255 | User's city of residence | London |
params.billing_address | String | 255 | User's billing address | Example Street, 1, 23 |
params.billing_state | String | 255 | User's state/region of residence | England |
params.billing_postcode | String | 255 | User's ZIP/Postal code | 1001 |
params.extra_params | JSON | Custom merchant parameters | See example below | |
params.extra_params.merchant_site | String | Merchant website address |
**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.
Language | Example usage |
---|---|
PHP | hash_hmac('md5', $data, $secret_key); |
Where:
_data _ - base64 encoded JSON document string
secret_key - shop password
Updated 16 days ago