Settlement API Reference

Limited Preview - Right now Settlement API is on invite only basis, Click here to join the waiting list

Introduction

Paysharp APIs are organized around REST. Our API has predictable resource-oriented URLs, accepts JSON requests and returns JSON response, and uses standard HTTP response codes, authentication, and verbs.

You can use our APIs in the sandbox(testing) and production(live) environments. We provide two different API urls and tokens for sandbox and production(live).

Pass API token and content-type for all the requests in header, API token can be generated from merchant dashboard.

  • content-type: application/json
  • authorization: Bearer <Token>

Settlement Status API

By calling the API, able to get the settlement status for the settlementId.

  • URL: /settlements/{settlementId}
  • Method: GET

Request

Parameters Range Datatype Required Description
settlementId Min 32 - Max 32 string Y Unique identifier to identify the settlement

Response

Parameters Datatype Description
isSettlementFileReady boolean Represents true, if settlement file is available for download via API. If it is false means file not yet generated or not available.
settlementProduct string

Settlement product could be any of the below. It represents the settlement belongs to which product.

  • UPI
  • VIRTUAL_ACCOUNT ( coming soon )
settlementDate datetime Settlement date in ISO 8601 format.
settlementId string Unique Id generated by Paysharp to track every settlement.
settlementAccountName string Settlement account holder name.
settlementAccountNo string Merchant's settlement bank account number. but due to privacy reason, first 4 digits and followed by asterisk will be returned.
settlementIFSCCode string Merchant's settlement bank account's IFSC code.
settlementUTRNo string Unique transaction number provided by Bank for the settlement.
settlementMode string Settlement mode might be NEFT or RTGS.
settlementStatus string The settlement status always will be "SUCCESS" Paysharp send the settlement notification once receive settlement confirmation as success from the beneficiary bank.
settlementAmount number Amount settled for the settlement.
totalTransactions number Total number of transactions processed in the settlement (In merchant dashboard, in settlement page able to view or download all the transactions processed for the settlement).
totalFee number Total fee charged for all the transactions settled in the settlement.
totalTax number Total tax charged for all the transactions settled in the settlement.
totalNetFee number Sum of both total fee and tax charged for all the transactions settled in the settlement.

Response

{

   "code" :   200,

   "message" :   "success",

   "data" : {  

"isSettlementFileReady" :   true,

"settlementProduct" :   "UPI",

"settlementDate" :   "2024-12-05T15:32:35+05:30",

"settlementId" :   "STLMNT9aUQoX9aAAAB1qn7AHNY0AuOYd",

"settlementAccountName" :   "Ram",

"settlementAccountNo" :   "22****100",

"settlementIFSCCode" :   "HDFC0000001",

"settlementUTRNo" :   N2020715167004,

"settlementMode" :   "NEFT",

"settlementStatus" :   "SUCCESS",

"settlementAmount" :   217,

"totalTransactions" :   3,

"totalFee" :   3,

"totalTax" :   0.54,

"totalNetFee" :   3.54

}

}

Settlement File API

By calling the API, able to get the settlement file url for the settlementId. Settlement files are only availble from 1st Jan 2025.

  • URL: /settlements/{settlementId}/file
  • Method: GET

Request

Parameters Range Datatype Required Description
settlementId Min 32 - Max 32 string Y Unique identifier to identify the payment link status.

Response

Parameters Datatype Description
settlementId string Unique Id generated by Paysharp to track every settlement.
isSettlementFileReady boolean Represents true, if settlement file is available for download via API. If it is false means file not yet generated or not available.
settlementFileUrl string Settlement file url for the settlementId. The url will expire after one hour. We recommend to call the API, get the url and download the settlement file (Returned only if isSettlementFileReady parameter is true).

Response Body Sent by Paysharp for File Ready Case

{

   "code" :   200,

   "message" :   "success",

   "data" : {  

"settlementId" :   "STLMNT9aUQoX9aAAAB1qn7AHNY0AuOYd",

"isSettlementFileReady" :   true,

"settlementFileUrl" :   "https://sandbox.paysharp.co.in/upi-settlement/STLMNT9p2aIRLAdncX7fg4Ier1F4sY6b....."

}

}

Response Body Sent by Paysharp for File Not Ready Case

{

   "code" :   200,

   "message" :   "success",

   "data" : {  

"settlementId" :   "STLMNT9aUQoX9aAAAB1qn7AHNY0AuOYd",

"isSettlementFileReady" :   false

}

}

Settlement Webhook

Our system will call your webhook url and post the settlement details once settlement is successful. To enable the settlement API you can enable from the dashboard, Settlement API is applicable to all products not specific to one product in the settlement API you will get product code to recognize the settlement belongs to which product. 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

Request

Parameters Datatype Description
isSettlementFileReady boolean Represents true, if settlement file is available for download via API. If it is false means file not yet generated or not available.
settlementProduct string Settlement product could be any of the below. It represents the settlement belongs to which product.
  • UPI
  • VIRTUAL_ACCOUNT
settlementDate datetime Settlement date in ISO 8601 format.
settlementId string Unique Id generated by Paysharp to track every settlement.
settlementAccountName string Settlement account holder name.
settlementAccountNo string Merchant's settlement bank account number. but due to privacy reason, first 4 digits and followed by asterisk will be returned.
settlementIFSCCode string Merchant's settlement bank account's IFSC code.
settlementUTRNo string Unique transaction number provided by Bank for the settlement.
settlementMode string Settlement mode might be NEFT or RTGS.
settlementStatus string The settlement status always will be "SUCCESS" Paysharp send the settlement notification once receive settlement confirmation as success from the beneficiary bank.
settlementAmount number Amount settled for the settlement.
totalTransactions number Total number of transactions processed in the settlement (In merchant dashboard, in settlement page able to view or download all the transactions processed for the settlement).
totalFee number Total fee charged for all the transactions settled in the settlement.
totalTax number Total tax charged for all the transactions settled in the settlement.
totalNetFee number Sum of both total fee and tax charged for all the transactions settled in the settlement.
attemptCount number Number of times the webhook invoked.

Response

This is the expected response from the merchant's webhook for the successful acknowledgement. HTTP response code should be 200 and response body in JSON format as mentioned below. In case Paysharp receives a different HTTP status code or response body, Paysharp system considers it as failure and retry webhook call based on retry configuration.

Parameters Datatype Description
code number Merchant's webhook should always respond with 200 as code for successful acknowledgement.
message string Merchant's webhook should always respond with "success" as message for successful acknowledgement.

Example

Two examples provided for two products, only "settlementProduct" value will be the difference

Example for UPI Settlement Case

{

   "isSettlementFileReady" :   true,

   "settlementProduct" :   "UPI",

   "settlementDate" :   "2024-03-27T22:25:51+05:30",

   "settlementId" :   "STLMNTCL2YJ3yeS7bPbbpQbaWlfny7QX",

   "settlementAccountName" :   "ABC Solutions",

   "settlementAccountNo" :   "1102****",

   "settlementIFSCCode" :   "HDFC0000001",

   "settlementUTRNo" :   "N2020015167004",

   "settlementMode" :   "NEFT",

   "settlementStatus" :   "SUCCESS",

   "settlementAmount" :   199.65,

   "totalTransactions" :   3,

   "totalFee" :   4.50,

   "totalTax" :   0.81,

   "totalNetFee" :   5.31,

   "attemptCount" :   1

}

Example for Virtual Account Settlement Case

{

   "isSettlementFileReady" :   true,

   "settlementProduct" :   "VIRTUAL_ACCOUNT",

   "settlementDate" :   "2024-03-27T22:25:51+05:30",

   "settlementId" :   "STLMNTCL3YJ3yeS7bPbbpQbaWlfny7QX",

   "settlementAccountName" :   "ABC Solutions",

   "settlementAccountNo" :   "1102****",

   "settlementIFSCCode" :   "HDFC0000001",

   "settlementUTRNo" :   "N2020715167004",

   "settlementMode" :   "NEFT",

   "settlementStatus" :   "SUCCESS",

   "settlementAmount" :   199.65,

   "totalTransactions" :   3,

   "totalFee" :   4.50,

   "totalTax" :   0.81,

   "totalNetFee" :   5.31,

   "attemptCount" :   1

}

Response

This is the exact JSON response expected from the merchant's webhook with HTTP status code as 200

    {  

"code" :   200,

"message" :   "success"

   }

Settlement File Format

Settlement file is a csv file can be downloadable from the Settlement file API, format described below.

UPI Settlement File Format

Parameters Datatype Description
Transaction Date datetime Transaction date in ISO 8601 format.
OrderId string Unique identifier to identify order.
CustomerId string Unique identifier to identify customer.
Name string Customer name.
Paysharp Reference No. string Payment reference number for the transaction.
UTR No. string Unique transaction number provided by Bank.
Amount number Amount for the order.
Fee number Fee for the transaction.
Tax number Tax for the transaction fee.
Total fee number Sum of fee and tax.
Net Amount number Actual amount after deducting fee and tax.

Virtual Account Settlement File Format

Parameters Datatype Description
Transaction Date datetime Transaction date in ISO 8601 format.
Name string Customer name.
Virtual Account No. string Payment Virutal number.
Customer No. string Customer number.
UTR No. string Unique transaction number provided by Bank.
Reference No string Payment reference number for the transaction.
Amount number Amount for the order.
Fee number Fee for the transaction.
Tax number Tax for the transaction fee.
Net Amount number Actual amount after deducting fee and tax.

Error Codes

Http Status Code: 200 - Success

400 - Error

Sample Error Response

     {

      "code" :   400,

      "errorCode" :   8001,

      "message" :   "Settlement not found"

    }

Error Codes and Messages

Error Codes Error Messages
8001 Settlement not found.
8002 Settlement date not in valid range.

Other Possible Common Errors

Http Status Code: 401 - Error

     {

      "code" :   401,

      "errorCode" :   "",

      "message" :   "Access denied"

    }

Common Error Codes

Error Codes Error Messages
401
  • Access denied.
  • Product not enabled for this account.
  • You are not allowed to access this API as per your account policy.
  • API not enabled for this account/product.
  • IP address not whitelisted.
  • Postman Collection

    Login to your Sandbox / Production environment and download from the Settings -> Configuration page.