Transaction
This document describes the transactional APIs for UPI Credit.
#
Create a transaction to a UPI QRThis API end-point can be used to initiate a transaction towards a QR code.
#
API Definition- Request
- Response
POST https://sdk.bharatx.tech/service/payments/merchant/transactions/instant
Headers:Authorization: Basic abcde=Content-Type: application/json
Body:{ "userPhoneNumber":"+919999999999", "merchantTransactionId":"string", "amount":1000, "target":"QR", "QR":{ "data":"upi//pay?pn=bharatx" }}
userPhoneNumber
: the phone number of the user with country codemerchantTransactionId
: unique transaction ID supplied by the merchantamount
: The amount to be transferredtarget
: must be "QR" or "partner"QR
is required fortarget="QR"
QR.data
: The data scanned as such from a QR Scanner
Headers:Content-Type: application/json
Body:{ "initiationRequest": { "userPhoneNumber":"+919999999999", "merchantTransactionId":"string", "amount":1000, "target":"QR", "QR":{ "data":"upi//pay?pn=bharatx" } }, "transactionStatus":"PENDING"}
initiationRequest
: The request as received by the servertransactionStatus
: The current status of the transaction can be one of "PENDING", "SUCCESS", "FAILURE"
#
Check the status of the TransactionThe status of the transaction can be obtained using the API described below. In addition to that, merchants can configure webhook URLs on the dashboard to receive the transaction state changes notification directly as an S2S call.
#
API Definition- Request
- Response
- Webhook Payload
GET https://sdk.bharatx.tech/service/payments/merchant/transactions/status?merchantTransactionId=string
Headers:Authorization: Basic abcde=
merchantTransactionId
: the transaction ID provided by the merchant while initiating the transaction
Headers:Content-Type: application/json
Body:{ "status":"string"}
status
: can be one off "PENDING", "SUCCESS" or "FAILURE"
Headers:Content-Type: application/jsonX-Signature: abcd=
Body:{ "merchantTransactionId":"string", "status":"string"}
status
: can be one off "PENDING", "SUCCESS" or "FAILURE"merchantTransactionId
: the transaction ID provided by the merchant while creating the transactionX-Signature
: it is the sha256 hash of the payload+serverApiKey
encoded in base64. Merchants should use this to verify the credibility of the request.