Skip to content

Processing a Payment

Process a payment by redirecting to the KVELL payment page.

URL

Method: GET or POST

  • Production: https://pay.kvell.group/checkout
  • Stage: https://pay.stage.kvell.group/checkout

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
phone string No Payer's phone number for card binding
customer_key string No Alternative customer identifier for working with saved cards. Pass only one of phone or customer_key.
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:

sha256({api_key}{transaction}{amount}{secret_key})

If the expires_at parameter is passed, it is included in the signature.

sha256({api_key}{transaction}{amount}{expires_at}{secret_key})

where secret_key is the secret key found in the merchant's shop settings.

Request examples

GET request

https://pay.kvell.group/checkout?api_key={api_key}&signature={signature}&amount={amount}&description={description}&transaction={transaction}&success_url={success_url}&fail_url={fail_url}&phone={phone}&auto_return={auto_return}&extra_data={extra_data}&fiscal_data={fiscal_data}&split_data={split_data}
https://pay.kvell.group/checkout?api_key=3a8c82d6-d2c6-4165-9a6b-ab3f14d965ae&amount=10000&description=%D0%9F%D1%80%D0%BE%D0%B4%D1%83%D0%BA%D1%82%20%E2%84%961&signature=afc09ed74d83849d44c1f1906b10d20c147bf0eb25da940c020c980b3b44ca38&success_url=http%3A%2F%2Fyoursite.com%2Fsuccess&fail_url=http%3A%2F%2Fyoursite.com%2Ffail&transaction=fbfe9f88-d5c7-4994-aed6-ee8003f4f342&phone=79991234567&extra_data=%7B%22string%22%3A%20%22string%22%7D&fiscal_data=%7B%22items%22%3A%20%5B%7B%22name%22%3A%20%22TEST%22%2C%20%22price%22%3A%2010025%2C%20%22quantity%22%3A%202%2C%20%22sum%22%3A%2020050%2C%20%22measurement_unit%22%3A%20%22%D0%BA%D0%B3%22%2C%20%22payment_method%22%3A%20%22full_payment%22%2C%20%22payment_object%22%3A%20%22commodity%22%2C%20%22vat_type%22%3A%20%22vat20%22%7D%5D%2C%20%22client%22%3A%20%7B%22email%22%3A%20%22client_email%40mail.ru%22%2C%20%22phone%22%3A%20%22%2B71231234567%22%7D%2C%20%22company%22%3A%20%7B%22email%22%3A%20%22company_email%40mail.ru%22%2C%20%22sno%22%3A%20%22osn%22%2C%20%22payment_address%22%3A%20%22https%3A%2F%2Fkvell.com%22%7D%7D&split_data=%5B%7B%22service_id%22%3A%20%22343-23%22%2C%22amount%22%3A%201000%2C%22description%22%3A%20%22%22%2C%20%22metadata%22%3A%20%7B%7D%7D%5D

POST request

<form action="https://pay.kvell.group/checkout" 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="hidden" name="customer_key" value="customer-123">
    <input type="hidden" name="extra_data" value='{"string": "string"}'>
    <input type="hidden" name="fiscal_data"
           value='{"items": [{"name": "TEST", "price": 10025, "quantity": 2, "sum": 20050, "measurement_unit": "kg", "payment_method": "full_payment", "payment_object": "commodity", "vat_type": "vat20"}], "client": {"email": "client_email@mail.ru", "phone": "+71231234567"}, "company": {"email": "company_email@mail.ru", "sno": "osn", "payment_address": "https://kvell.com"}}'>
    <input type="hidden" name="split_data"
           value='[{"service_id": "343-23","amount": 1000,"description": "", "metadata": {}}]'>
    <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 \
  -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",
    "customer_key": "customer-123",
    "extra_data": {
      "string": "string"
    },
    "fiscal_data": {
      "items": [
        {
          "name": "TEST",
          "price": 10025,
          "quantity": 2,
          "sum": 20050,
          "measurement_unit": "kg",
          "payment_method": "full_payment",
          "payment_object": "commodity",
          "vat_type": "vat20"
        }
      ],
      "client": {
        "email": "client_email@mail.ru",
        "phone": "+71231234567"
      },
      "company": {
        "email": "company_email@mail.ru",
        "sno": "osn",
        "payment_address": "https://kvell.com"
      }
    },
    "split_data": [
      {
        "service_id": "343-23",
        "amount": 10000,
        "description": "Test",
        "metadata": {}
      }
    ]
  }'

Example response:

{
  "url": "https://pay.kvell.group/checkout/orders/90afde444c6d15c83289ece14e90b7e2927a3a4e"
}