Paymagic API Document
Version 3.0
Table Of Contents:
Table Of Contents:
1. Initiate Intent Transaction API
Method
Headers
Request Body
Response
2. Transaction status API
Method
Headers
Request Body
Response - Pending status
Response - Success status
Response - Failed status
3. Webhook/Callback Format
.
1. Initiate Intent Transaction API
Using this API, we can create the QR Intent string. Once we get the success
response in the API then using that link the customer can make the payment.
API URL: {{BASE_URL}}/api/v3/payin/ext/txn/initiate
Method
POST
Headers
1. secret-key
2. client-id
3. Content-Type: application/json
Key Value Mandatory
secret-key We will provide the secret key Yes
client-id We will provide the Client Id Yes
Request Body
"orderId": "21563343766145268653363",
"amount": 1.00,
}
Key Value Mandatory
Amount What amount needs to be Yes
collected from the customer.
EX: 1.00(Decimal is
mandatory)
orderId It is a unique order ID Yes
needed to generate by a
merchant.
Response
{
"timestamp": "2023-08-04T17:25:42.574Z",
"statusCode": 200,
"status": "OK",
"message": "Order Created Successfully",
"success": true,
"data": {
"paymentUrl": "upi://pay?pa=is1.kames-
lp@finobank&pn=klfgames&mc=6012&tr=537073754266935296&tn=app&am
=1.00&mode=04&tid=537073754266935296",
"phonepe_link": "phonepe://pay?pa=is1.kames-
lp@finobank&pn=klfgames&mc=6012&tr=537073754266935296&tn=app&am
=1.00&mode=04&tid=537073754266935296”,
"paytm_link": "paytmmp://pay?pa=is1.kames-
lp@finobank&pn=klfgames&mc=6012&tr=537073754266935296&tn=app&am
=1.00&mode=04&tid=537073754266935296,
"gpay_link": "tez://pay?pa=is1.kames-
lp@finobank&pn=klfgames&mc=6012&tr=537073754266935296&tn=app&am
=1.00&mode=04&tid=537073754266935296",
"txnId": "C41AAXN95V0B",
"orderId": "21563343766145268653363",
"txnStatus": "INITIATED",
}
Key Value Mandatory
Transaction Unique Transaction Id Yes
Ref Id
(txnId)
orderId Given While creating the Yes
Transaction
paymentUrl This link will as help to open
all upi application installed in
device
Phonepe Link This link will directly open
the phonepe application
Gpay Link This link will directly open
the Google pay application
Paytm Link This link will directly open
the Paytm application
2. Transaction status API
Using this API we can get the status of the transaction. For this we have to
pass the order id of the transaction.
API URL: {{BASE_URL}}/api/v3/payin/ext/txn/status
Method
GET
Headers
1. secret-key
2. client-id
3. Content-Type: application/json
4. order-id
Key Value Mandatory
secret-key We will provide the secret key Yes
client-id We will provide the Client Id Yes
order-Id Given While creating the Yes
Transaction
Response - Initiated status
{
"timestamp": "2023-08-04T17:27:36.170Z",
"statusCode": 200,
"status": "OK",
"message": "Txn details fetched successfully",
"success": true,
"data": {
"txnId": "C41AAXN95V0B",
"amount": “1.0”,
"orderId": "21563343766145268653363",
"txnStatus": "Initiated"
}
Response - Success status
{
"timestamp": "2023-08-04T17:27:36.170Z",
"statusCode": 200,
"status": "OK",
"message": " Txn details fetched successfully ",
"success": true,
"data": {
"txnStatus ": "Success",
"amount": “1.0”,
"orderId": "2156253343766145268653363",
"txnId": "C41AAXN95V0BB"
}
}
Response - Failed status
{
"timestamp": "2023-08-04T17:27:36.170Z",
"statusCode": 200,
"status": "OK",
"message": " Txn details fetched successfully ",
"success": true,
"data": {
"orderId": "2156253343766145268653363",
" txnStatus ": "Failed",
"amount": “1.0”,
"txnId": " C41AAXN95V0BB "
}
}
3. Webhook/Callback Format
Merchants need to provide Webhook url to us. We will configure from our
end.
Once the transaction status gets updated, we will update the status through
this Callback. Whatever status we got from the bank. We will update the same to
merchants.
{
"txnId": "C41AAXN95V0BB",
"amount": 733,
"orderId": "2156253343766145268653363",
"txnStatus": " Success / Failed"
}
Key Value Mandatory
Amount What we gave while creating Yes
the transaction
txnId Unique Transaction Id Yes
orderId Given While creating the Yes
Transaction
txnStatus Status of the transaction Success/ Failed
Note: In webhook responses, the amount parameter is given in paisas (1INR = 100paisa).
*********END**********