Payments
The hosted payment page
Section titled “The hosted payment page”Send checkout with a return_url in POST /payments (and an embed_origin to show the page in an iframe) and the payment comes with checkout.url, our page for the payer on your account’s own domain, in your brand. The Hosted payment page guide covers the request, the way back, the iframe and the WebView cases and the page’s options.
The amount
Section titled “The amount”amount is in the currency’s smallest unit (paise for INR). Each payment method has a least and a most amount in your market, and our team may set narrower ones on your account: below is 400 amount_too_small, above 400 amount_too_large, with param: amount and a message that names the limit and its currency. In India a UPI payment is now at least ₹200.00 (20000), unless your account has a higher limit of its own.
Traffic type
Section titled “Traffic type”Tell us with traffic_type in POST /payments whose deposit a payment is: ftd, the customer’s first deposit with you, or std, a subsequent one. A payment without it is ftd, so mark subsequent deposits std. The payment keeps the type for good, answers it in traffic_type (in its webhooks too), and GET /payments?traffic_type=std lists one type.
- Our team can turn either type off on your account, and on again. A payment of a type turned off is
400 traffic_type_disabledwithparam: traffic_type, and nothing is made. Withftdoff, a request withouttraffic_typeis refused too. - Turning a type off stops new payments only: payments already made, and their hosted pages, carry on.
- A value other than
ftdorstd, the empty one too, is400 parameter_invalid.
Fraud prevention and the outcome
Section titled “Fraud prevention and the outcome”customer takes optional fields that help our checks tell a scam from an honest customer, in every market: where the customer signed in with you from (login_ip), and their device (device_id) and browser (user_agent). Every payment answers outcome.type, authorized or blocked, as Stripe’s charge.outcome, and failure_code, blocked on a blocked payment and null on any other. A blocked payment is answered 201 and is failed from the start. Fraud prevention has each field, why it helps, and what to show your customer.
What arrived and what to credit
Section titled “What arrived and what to credit”Once a payment is succeeded it says what arrived and what you credit your customer. Each of these is null until then.
amount_paid: what arrived from the payer’s bank, in the smallest unit.amount_credited: what to credit your customer. It is the amount you asked for when the payer paid exactlyamount_payable, andamount_paidotherwise. Credit this. (amount_receivedis the same amount, under its first name.)amount_mismatch:truewhen the payer paid other thanamount_payable, soamount_creditedisamount_paidrather than the amount you asked for.
This is how Stripe has amount_received beside amount: what arrived can differ from what you asked for.
The payment’s version
Section titled “The payment’s version”version grows with every change of a payment you can see in it (every event we send you is one) and with every new value you confirm it with, even one that leaves its status as it was, never with a check of ours alone, and it may skip numbers. A hosted payment’s checkout.status and checkout.opened_at follow its page, and change without it. Of two copies of the same payment, the one with the higher version is the newer: a webhook event’s data.object has the version of that event, so an event whose version is lower than one you already processed is an older change, and you can ignore it.
Confirming a payment
Section titled “Confirming a payment”When your payer tells you they paid and gives you the transaction’s reference (in India, the 12-digit UTR their UPI app shows), you can pass it on with POST /payments/{id}/confirmations. It is optional: we match payments without it. We keep what you send with the payment, as your payer’s word, for our checks and our team. A payment’s confirmation_fields name the fields your market takes and the pattern each must match.
- A confirmation is not proof. A payment waiting for the payer is
processingafter it and staysprocessingwhile we look for its money: it succeeds when we see it, and fails if we have not seen it when the market’s late-payment window closes: 24 hours by default, counted from when it becameprocessingor from itsexpires_at, whichever is later. - The answer is
200with the payment, whether or not its money arrived yet: a payment that succeeds comes as the webhook eventpayment.succeeded. The same value again on the same payment answers it again and records nothing new, and so does the reference of the bank transaction that paid it, after it succeeded too; another value is kept beside the first. - A UTR is one UPI transaction, so it confirms one payment: a value confirmed on another payment of your account that has not succeeded or failed, or the reference of the bank transaction that paid another payment of your account, is
409 reference_already_used. One that does not match the field’s pattern is400 parameter_invalid. - A payment takes at most 3 different values: more is
400 parameter_invalid. A value you sent holds until its payment succeeded or failed (an expired one holds it too): once it has, it can confirm another payment, unless it is the reference of the transaction that paid it. - An expired payment takes the confirmation and stays
expired: if the money arrives in time, it still succeeds. A payment that succeeded or failed refuses one:409 payment_final. - A method with no
confirmation_fieldstakes none:400 confirmation_not_supported.
Endpoints
GET/paymentsListPaymentsPOST/paymentsCreatePaymentGET/payments/{id}GetPaymentPOST/payments/{id}/confirmationsConfirmPayment
Loading the reference…