Paysharp APIs are built using REST architecture, featuring predictable, resource-oriented URLs. Our APIs accept JSON-formatted requests, return JSON responses, and utilize standard HTTP verbs, response codes, and authentication methods.
You can integrate Paysharp APIs in both sandbox (testing) and production (live) environments. Separate base URLs and API tokens are provided for each environment.
For every API request, include the following headers:
API tokens can be generated from your merchant dashboard.
Create a dynamic QR code for an order. The QR code can be scanned and payable from any UPI app, the customer only able to pay the requested amount for the requested order.
Request
| Parameters | Range | Datatype | Required | Description |
|---|---|---|---|---|
| orderId | Max 36 | string | Y | Unique identifier to identify order |
| amount | Min 1 - No Max limit | number | Y | Amount for the order (Paysharp does not set any maximum amount limits; the maximum amount limit may vary based on the MCC code up to 1 Lac / 2 Lac / 5 Lac / Or any upper limits set by NPCI) |
| customerId | Max 36 | string | Y | Unique identifier to identify customer |
| customerName | Max 100 | string | N | Customer name |
| customerMobileNo | Max 10 | string | Y | Customer Mobile No. |
| customerEmail | Max 100 | string | N | Customer email address |
| remarks | Max 35 | string | Y | Remark for the transaction. Recommend to pass orderId / invoiceId |
Response
| Parameters | Datatype | Description |
|---|---|---|
| paysharpReferenceNo | string | Payment reference number for the payment |
| qrCode | string | Base64 string version of dynamic QR code for the order. |
| orderId | string | Returns the request value |
| amount | number | Returns the request value |
| customerId | string | Returns the request value |
| customerName | string | Returns the request value |
| customerMobileNo | string | Returns the request value |
| customerEmail | string | Returns the request value |
| remarks | string | Returns the request value |
Request
{
"orderId" : "APR8910005",
"amount" : 500,
"customerId" : "C_1112",
"customerName" : "Ram",
"customerMobileNo" : "9111100000",
"customerEmail" : "",
"remarks" : "Invoice No - APR8910005"
}
Response
{
"code" : 200,
"message" : "success",
"data" : {
"paysharpReferenceNo" : "upidedc619auJz3YB096Se7Zh",
"qrCode" : "data:image/png;base64,/9j/4...",
"orderId" : "APR8910005",
"amount" : 500,
"customerId" : "C_1112",
"customerName" : "Ram",
"customerMobileNo" : "9111100000",
"customerEmail" : "",
"remarks" : "Invoice No - APR8910005"
}
}
Our system will call your webhook url and post the payment status when payment is received. In case your webhook does not respond, our system marks the call as failed. Your webhook should respond in JSON format with content-type: application/json.
Payment Success Case
| Parameters | Datatype | Description |
|---|---|---|
| orderId | string | Returns the order Id |
| customerId | string | Returns the customer Id for the order |
| amount | number | Amount for the order |
| fee | number | Fee for the transaction |
| tax | number | Tax for the transaction fee |
| totalFee | number | Sum of fee and tax |
| netAmount | number | Actual amount after deducting fee and tax. |
| paysharpReferenceNo | string | Payment reference number for the transaction |
| utrNumber | string | Unique transaction number provided by Bank |
| transactionDate | datetime | Transaction date in ISO 8601 format |
| status | string | Status should be SUCCESS |
| remarks | string | Remark for the transaction provided by the merchant on create order. |
| attemptCount | number | Number of times the webhook invoked(Only returned for webhook response) |
| source | string | UPI_DYNAMIC_QR_API - For the transactions created via UPI_DYNAMIC_QR_API |
Payment Non Success Case
| Parameters | Datatype | Description |
|---|---|---|
| orderId | string | Returns the order Id |
| customerId | string | Returns the customer Id for the order |
| amount | number | For non-success case always returns as 0 |
| paysharpReferenceNo | string | Payment reference number for the transaction |
| status | string |
ON PROGRESS FAILED PENDING EXPIRED |
| attemptCount | number | Number of times the webhook invoked(Only returned for webhook response) |
| failureCode | string | Failure code returned by bank |
| failureReason | string | Failure reason(description) returned by bank |
| source | String | UPI_DYNAMIC_QR_API - For the transactions created via UPI_DYNAMIC_QR_API |
Response Body Sent by Paysharp for Success Case
{
"orderId" : "202001051004",
"customerId" : "C_1112",
"amount" : 500,
"fee" : 5,
"tax" : 0.90,
"totalFee" : 5.90,
"netAmount" : 494.10,
"paysharpReferenceNo" : "upidedc619auJz3YB096Se7Zh",
"utrNumber" : "228200422398",
"transactionDate" : "2021-02-20T11:25:51+05:30",
"status" : "SUCCESS",
"remarks" : "Invoice No - APR8910005",
"attemptCount" : 1,
"source" : "UPI_DYNAMIC_QR_API"
}
Response Body Sent by Paysharp for Non Success Case
{
"orderId" : "202001051004",
"customerId" : "C_1112",
"amount" : 0,
"paysharpReferenceNo" : "upidedc619auJz3YB096Se7Zh",
"status" : "FAILED",
"remarks" : "Invoice No - 202001051004",
"attemptCount" : 1,
"failureCode" : "EC00100NA",
"failureReason" : "Transaction fail: Invalid MPIN",
"source" : "UPI_DYNAMIC_QR_API"
}
Expected Acknowledgement from merchant webhook
Response status
Http Status: 200
Response Body
{
"code" : 200,
"message" : "success"
}
Http Status Code: 200 - Success
400 - Error
Sample Error Response
{
"code" : 400,
"errorCode" : 6001,
"message" : "Unable to create order, order exits with the same orderId"
}
Possible Errors
| Error Codes | Error Messages |
|---|---|
| 6001 | Unable to create order, order exits with the same orderId |
| 6002 | order not found |
| 6003 | Unable to send collection request, Invalid customerVPA |
| 6004 | Amount should be minimum |
| 6500 | Bank server not available |
Login to your Sandbox / Production environment and download from the Settings -> Configuration page.