Ledger API

Download data of all your transactions for a given date

Zaakpay provides functionality to fetch and download detailed transaction data category wise in bulk for a particular date through API with pagination and authorisation.

Authorisation has to be done using API key which can be generate via Merchant Dashboard.

Ledger API

Purpose: This API is used to fetch transaction details which were performed on a particular date with authorisation and pagination.

Request URL: {HOST}/api/v1/ledger

Environment details:

Staging Server: https://zaakstaging.zaakpay.com
Live Server: https://api.zaakpay.com

Request Type: POST
Endpoint: /api/v1/ledger

Request Header

This key will be used to authorise the API request , merchant can generate API KEY from Zaakpay Dashboard.

Header Name

Value

X-API-Key

xxx39ad7bc6f4xxxb1d9010d06485xxx

Request Attributes

Fields DataType Mandatory Description
startDateTime LocalDateTime Y Start date time in “yyyy-MM-dd HH:mm” format
endDateTime LocalDateTime Y End date time in “yyyy-MM-dd HH:mm” format
status String Y Status of transactions requested. Possible Values SUCCESS, FAILED, PENDING,ALL.
pageNumber Integer N Page number of paginated records (Default: 1)
pageSize Integer N Number of records in a page (Default: 1000, Max: 10000)

Response Attributes

Fields Description
txnInitiatedDate Date on which Transaction was initiated in yyyy-MM-dd HH:mm:ss format.
txnLastUpdatedDate Date on which Transaction was Last updated in yyyy-MM-dd HH:mm:ss format.
txnSuccessDate Date on which Transaction was successful in yyyy-MM-dd HH:mm:ss format.
status Status of transaction i.e Success or Failure.
state Zaakpay internal state code of transaction ID.
stateDescription Zaakpay internal state code description.
responseCode It is a max 3 digits Zaakpay’s Response code.
responseDescription It is a description of Zaakpay’s Response code. E.g. Description of Response code 100 is “The transaction was completed successfully”.
orderid Unique transaction identifier for merchant.
txnid Zaakpay internal unique transaction ID.
amount Transaction amount in Rupees.
brand Brand or card network eg: MASTERCARD.
cardType Type of Card used for transactioneg: DEBIT/CREDIT.
buyerName As received with the request.
buyerEmail As received with the request.
bankName Issuing Bank name.
cardNumber Encrypted Card Number which is used in transaction.
paymentSource Source from where transaction done like Net Banking, Debit Card, Credit Card.
refundDetail Refund Details object with refundReferenceNumber, createdAt and amount.

Sample Request

This is the sample API request for reference.

curl -X POST \
  https://zaakstaging.zaakpay.com/api/v1/ledger \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'postman-token: 0ca59eed-315a-db29-d00c-0583b2c9165e' \
  -H 'x-api-key: 55ffc9b8e0c340dba097223ba38c5a87' \
  -d '{
"startDateTime":"2021-12-15 00:00",
"endDateTime":"2021-12-15 14:55",
"status":"SUCCESS",
"pageNumber":1,
"pageSize":200
}'

Sample Response

This is a API's sample Success and Failure response for reference.

{
   "success":true,
   "data":{
      "isNextPageAvailable":false,
      "transactions":[
         {
            "txnInitiatedDate":"2020-09-19 11:53:32",
            "txnLastUpdatedDate":"2020-09-19 11:53:56",
            "txnSuccessDate":"2020-09-19 11:53:56",
            "status":"SUCCESS",
            "state":7,
            "stateDescription":"Captured",
            "responseCode":100,
            "responseDescription":"The transaction was completed successfully. ",
            "orderId":"JK6461235428",
            "txnId":"ZP5afa4a80d109c",
            "amountInRupees":248.00,
            "brand":null,
            "cardType":null,
            "buyerName":"Test buyer",
            "buyerEmail":"[email protected]",
            "bankName":"INSTAMOJO_NET",
            "cardNumber":null,
            "paymentSource":"Net Banking",
            "refundDetail":null
         },
         {
            "txnInitiatedDate":"2020-07-17 14:56:05",
            "txnLastUpdatedDate":"2020-07-17 15:40:36",
            "txnSuccessDate":"2020-07-17 14:56:25",
            "status":"SUCCESS",
            "state":22,
            "stateDescription":"Partial Refund Initiated",
            "responseCode":100,
            "responseDescription":"The transaction was completed successfully. ",
            "orderId":"ZPLive1594977943739",
            "txnId":"ZP5aa9fbf10caa1",
            "amountInRupees":10.00,
            "brand":"AMERICAN EXPRESS",
            "cardType":"CREDIT",
            "buyerName":"Parekh",
            "buyerEmail":"[email protected]",
            "bankName":"AMERICAN EXPRESS",
            "cardNumber":"3021xxxxxxxx0000",
            "paymentSource":"Card",
            "refundDetail":[
               {
                  "refundReferenceNumber":"REF5aa9fc333cb3b",
                  "createdAt":"2020-07-17 14:57:26",
                  "amount":5.00
               },
               {
                  "refundReferenceNumber":"REF5aaa05e405a8a",
                  "createdAt":"2020-07-17 15:40:44",
                  "amount":2.00
               }
            ]
         },
         {
            "txnInitiatedDate":"2021-06-01 13:17:33",
            "txnLastUpdatedDate":"2021-06-01 13:29:39",
            "txnSuccessDate":null,
            "status":"FAILED",
            "state":6,
            "stateDescription":"Declined",
            "responseCode":183,
            "responseDescription":"Unfortunately the transaction has failed.Please try again. Transaction has failed",
            "orderId":"ZPLive1622533618653",
            "txnId":"ZP5c3af8e0fe0ea",
            "amountInRupees":3.00,
            "brand":"VISA",
            "cardType":"CREDIT",
            "buyerName":"Daksh",
            "buyerEmail":"[email protected]",
            "bankName":"HDFC",
            "cardNumber":"401200xxxxxx1112",
            "paymentSource":"Card",
            "refundDetail":null
         },
         {
            "txnInitiatedDate":"2021-06-01 13:42:02",
            "txnLastUpdatedDate":"2021-06-01 13:44:00",
            "txnSuccessDate":null,
            "status":"PENDING",
            "state":2,
            "stateDescription":"Processing",
            "responseCode":null,
            "responseDescription":null,
            "orderId":"ZPLive1622535095806",
            "txnId":"ZP5c3afe5975756",
            "amountInRupees":3.00,
            "brand":"VISA",
            "cardType":"CREDIT",
            "buyerName":"Daksh",
            "buyerEmail":"[email protected]",
            "bankName":"HDFC",
            "cardNumber":"401200xxxxxx1112",
            "paymentSource":"Card",
            "refundDetail":null
         }
      ]
   }
}
{
   "success":false,
   "message":{
      "code":"1030",
      "text":"PageSize exceeds the limit 10000"
   }
}
{
   "success":false,
   "message":{
      "code":"1036",
      "text":"Something went wrong"
   }
}

Ledger API: Error Codes

These are the Ledger API Error codes. For more info, Please download the Documentation Directly from here.

Error Code Error Description
100 API key value can not be empty.
112 X-API-KEY not correct.
1026 Start or End date fields not present in request.
1027 Status is not present in request or is invalid.
1028 Invalid date time format.
1029 Invalid pageSize or pageNumber.
1030 PageSize exceeds the limit 10000.
1031 Start date time cannot be less than end date time.
1032 Start date cannot be older than 6 months.
1033 End date cannot be greater than current date.
1034 Duration between start and end date time should be less than limit 24 hrs.
1035 No record found.
1036 Something went wrong.

🚧

Note:-

  1. If page number is not provided in the request parameter then by default page number will be 1.
  2. If page size is not provided in the request parameter then by default page size will be 10.
  3. Maximum page size allowed is 500.
  4. Date format - YYYY-MM-dd

Did this page help you?