Intro#
FreedomPay provides an opportunity to issue a virtual payment card in one of the partner banks.
Query Mechanics#
Name | Value | Description |
---|
Content-type | application/json | Request body format |
Request-Id | unique string | Request unique string |
Auth-Id | int | Merchant unique ID |
Sign | string | Request signature |
Request-Id must be unique. If duplicates are found, an error will be returned and the request will not be processed.
Request Signature#
Each request must be signed. The signature is passed to the Headers parameter Sign
.
The ID of the user making the request is also passed to Headers, the Auth-Id
parameterzSignature Generation Process:#
JSON request must be in one line, without hyphens.
Add the merchant's secret key to the end of the JSON (provided by the manager).
Calculate the SHA256 hash of the received string and add it to the request headers, the Sign
parameter.
Example of a string before calculating SHA256:#
{"cardholder_name":"IVANOV IVAN IVANOVICH","phone":"79651234567","product_code":"1","card_id":555}some_secret_string
curl --location --request GET 'some_url.com' \
--header 'Request-Id: 5aac88a2-d16d-4601-927c-8b02bf44375c' \
--header 'Auth-Id: 12345' \
--header 'Sign: 4f64cb8c08eca4cffdbd6ee810dce21928132ea96c3b52a3b32f74be98b766b4' \
--header 'Content-Type: application/json' \
--data-raw '{
"cardholder_name": "IVANOV IVAN IVANOVICH",
"phone": 79651234567,
"product_code": 1,
"card_id": 555
}'