Payments With Preauthorization
Process a payment with preauthorization via the KVELL payment page.
Difference from the standard payment page: the card data entry form opens immediately, without a payment method selection step. The card is not saved.
Processing a payment
URL
Method: GET or POST
- Production:
https://pay.kvell.group/checkout/preauthorize - Stage:
https://pay.stage.kvell.group/checkout/preauthorize
Request parameters
Name |
Type | Required | Description |
|---|---|---|---|
api_key |
string | Yes | Unique shop identifier |
signature |
string | Yes | Signature |
amount |
integer | Yes | Amount in kopecks |
description |
string | Yes | Transaction description |
transaction |
string | Yes | Unique transaction number on the merchant's side |
success_url |
string | Yes | URL to redirect to on successful completion of the request |
fail_url |
string | Yes | URL to redirect to on failed completion of the request |
auto_return |
string | No | Automatic redirect to success_url or fail_url after payment. Specified in seconds. If the value is greater than 0, the redirect happens after N seconds. If the value is 0, the redirect happens immediately. |
expires_at |
integer | No | Payment expiration date and time as a UNIX timestamp in seconds |
extra_data |
json | No | Additional information |
fiscal_data |
json | No | Receipt fiscalization under 54-FZ |
split_data |
array | No | Payment splitting |
Building the signature
The signature is built by concatenating api_key, transaction, amount, and secret_key. A sha256
hash is computed from the resulting string:
If the expires_at parameter is passed, it is included in the signature.
where secret_key is the secret key found in the merchant's shop settings.
Request examples
GET request
https://pay.kvell.group/checkout/preauthorize?api_key={api_key}&signature={signature}&amount={amount}&description={description}&transaction={transaction}&success_url={success_url}&fail_url={fail_url}&auto_return={auto_return}&extra_data={extra_data}&fiscal_data={fiscal_data}&split_data={split_data}
POST request
<form action="https://pay.kvell.group/checkout/preauthorize" method="POST">
<input type="hidden" name="api_key" value="3a8c82d6-d2c6-4165-9a6b-ab3f14d965ae">
<input type="hidden" name="amount" value="10000">
<input type="hidden" name="description" value="Product #1">
<input type="hidden" name="signature" value="afc09ed74d83849d44c1f1906b10d20c147bf0eb25da940c020c980b3b44ca38">
<input type="hidden" name="success_url" value="http://yoursite.com/success">
<input type="hidden" name="fail_url" value="http://yoursite.com/fail">
<input type="hidden" name="transaction" value="fbfe9f88-d5c7-4994-aed6-ee8003f4f342">
<input type="submit" value="Pay">
</form>
POST request with JSON
When sending data in JSON format, you must set the Accept: application/json and Content-Type: application/json headers. The response will contain a temporary URL to redirect the user to the payment page.
Example request:
curl -X POST https://pay.kvell.group/checkout/preauthorize \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"api_key": "3a8c82d6-d2c6-4165-9a6b-ab3f14d965ae",
"amount": 10000,
"description": "Product #1",
"signature": "afc09ed74d83849d44c1f1906b10d20c147bf0eb25da940c020c980b3b44ca38",
"success_url": "http://yoursite.com/success",
"fail_url": "http://yoursite.com/fail",
"transaction": "fbfe9f88-d5c7-4994-aed6-ee8003f4f342"
}'
Example response:
Callbacks
Callbacks are sent the same way as for a standard payment. See the Callbacks section for details.