Qut PayWebsiteDashboardKnowledge baseAPI (OpenAPI)Guide for AI agentsРУСҚАЗEN

Salebot + Qut Pay: Kaspi invoices from your bot

Built a bot in Salebot and selling through WhatsApp, Telegram or Instagram? Once an order is placed, the bot can send the customer a Kaspi invoice on its own: it lands in the customer's Kaspi.kz app. When the customer pays, the bot checks it and writes "Paid". It takes one HTTP request and no programmer.

Qut Pay and Salebot are separate services; we are not partners. The bot calls the Qut Pay API through Salebot's standard "API-запрос" (API request) block.

What you need

WhereWhat
Qut PayA cabinet at qut.kz/app, a connected Kaspi Pay cashier and an API key (cabinet → Integrations → API keys)
SalebotA plan with API functions: in Salebot they work only on the «Бизнес» and «Инфобиз» plans
In the botVariables holding the customer's phone and the amount, e.g. phone and amount

Test with a sandbox key (qp_test_…) first: invoices are created but nobody is charged.

1. The create-invoice block

Open the block where the order is confirmed and add an API-запрос section:

{"X-API-Key": "qp_live_…", "Content-Type": "application/json"}
{
  "kind": "phone",
  "amount": #{amount},
  "description": "Order #{order_id}",
  "externalOrderId": "#{order_id}",
  "idempotencyKey": "salebot-#{order_id}",
  "customer": { "phone": "#{phone}" }
}
id->qp_invoice_id; status->qp_status; payUrl->qp_pay_url; error->qp_error

#{...} are Salebot variables; use the names from your own bot.

FieldWhy
kind: "phone"The invoice goes straight into the customer's Kaspi.kz app, no link needed. Whole tenge only
amountAmount in tenge: 12000
customer.phoneThe number the customer's Kaspi account is registered to. +7 701 123 45 67, 87011234567, 77011234567 all work
idempotencyKeyIf the customer taps twice or the bot repeats the request, no second invoice is created and the first one comes back. One per order
descriptionThe comment the customer sees in Kaspi

On success qp_status = pending and qp_invoice_id = inv_…. Have the bot write: "An invoice for 12 000 ₸ is in your Kaspi app. Write "Paid" once you have paid."

If qp_error is filled, no invoice was created. For example invalid_phone means a malformed number and kaspi_customer_not_found means the number has no Kaspi account. Either way, ask the customer for the number their Kaspi is registered to.

2. The check-payment block

When the customer writes "Paid" or taps a "Check" button, ask for the invoice state:

Then branch on qp_status with a condition block:

qp_statusMeaningWhat the bot writes
paidPaid"✅ Payment received, thank you!", then carries on with the order
pendingNot paid yet"The invoice is in your Kaspi app; write again once you have paid"
failedKaspi did not accept the invoice: no Kaspi account on the number, or the customer declined"The invoice did not reach this number. Please send the number your Kaspi is registered to" → back to block 1 with the new number
expiredThe invoice expiredBack to block 1 for a new invoice
cancelledYou cancelled it in the cabinetHand over to a manager

When resending to a new number, change idempotencyKey, e.g. salebot-#{order_id}-2; otherwise the old invoice comes back.

3. Payment notices for you

You know about a payment even if the customer never writes "Paid":

Telegram and Instagram bots

On WhatsApp use kind: "phone": the invoice reaches the Kaspi app with no link. If sending a link suits you better on Telegram or VK, drop kind. You then get qp_pay_url (https://qut.kz/pay/inv_…), a page with a QR code and a "Pay in Kaspi" button; have the bot send that link. A QR is valid for about 3 minutes and the page offers a fresh one by itself.

Testing

  1. Create a sandbox key (qp_test_…) in the cabinet and put it into block 1's header.
  2. Place an order in the bot yourself. A test invoice appears in the cabinet.
  3. Open it in the cabinet and press "[Sandbox] paid". The number 77000000404 simulates "customer not in Kaspi".
  4. Write "Paid" to the bot. It should answer "✅ Payment received".
  5. If all works, switch the key to qp_live_….

Common errors

ResponseCauseFix
401 unauthorizedWrong key or missing headerCheck the X-API-Key spelling and that the key is not deleted
403 insufficient_scopeThe key lacks rightsIt needs invoices:write and invoices:read
422 invalid_phoneNot 11 digitsAsk for the number again
422 kaspi_customer_not_foundNo Kaspi account on this numberDo not retry the same number; ask for the Kaspi number
422 amount_must_be_whole_tengeTiyn with kind: "phone"Round to whole tenge
429 tariff_limit_reachedThe plan's monthly limit is used upCabinet → Plan
503 kaspi_session_expiredThe Kaspi cashier connection droppedReconnect the cashier in the cabinet
qp_status = failedDeclined, or Kaspi rejected the invoiceTalk to the customer; resend with a new idempotencyKey if needed

Cost

Included in your Qut Pay plan at no extra charge. Only paid invoices count toward the plan's monthly limit. Kaspi charges its own fee separately. The Salebot plan is separate. Details: pricing.

Help

If it does not work, send a screenshot of the block (hide the key) to WhatsApp +7 778 881 3333 or Telegram @qutpaybot. Full API reference: website integration; for AI agents: api.qut.kz/llms.txt.


Need help? WhatsApp +77788813333 · kazprose@gmail.com · 09:00–21:00 (Алматы)
You can also write from the dashboard: Support.

Qut Pay is an independent service, not affiliated with Kaspi Bank JSC. Kaspi and Kaspi Pay are trademarks of their owner.