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) |
includeDelayedSuccessTxn | Boolean | N | To include non realtime transactions set this flag as true (Default : false) |
Response Attributes
Sample Request
This is the sample API request for reference.
curl --location --request POST 'https://api.zaakpay.com/api/v1/ledger' \
--header 'X-API-Key: 3a6d1e46a6bd48a9bb566d2310cdd0ee' \
--header 'Content-Type: application/json' \
--data-raw '{
"startDateTime":"2023-04-27 12:24",
"endDateTime":"2023-04-28 00:00",
"status":"SUCCESS",
"pageNumber":1,
"pageSize":1000,
"includeDelayedSuccessTxn":true
}'
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.
Note:-
- If page number is not provided in the request parameter then by default page number will be 1.
- If page size is not provided in the request parameter then by default page size will be 10.
- Maximum page size allowed is 500.
- Date format - YYYY-MM-dd
Updated over 1 year ago