Reporting API
Overview
The Reporting API provides access to transaction and batch details. You can fetch reporting data from ECRYPT and display reporting details within your environment. This guide will walk you through how to use the API, the necessary parameters, and the structure of requests and responses.
Authentication
All requests to the API require a Reporting API key, which should be included in the request headers. Use the following format for authentication:
Header: X-API-Key
Value: Your unique ECRYPT Reporting API Key
Endpoints
1. Get Transaction Detail
Endpoint: GET https://reportinguiapi.v2.ecrypt.com/api/transactions/{{transaction_id}}
Description: Fetch details of a specific transaction by providing the transaction_id.
Request:
GET /api/transactions/{transaction_id} HTTP/1.1
Host: reportinguiapi.v2.ecrypt.com
X-API-Key: your_api_key
Response
The response can include the following transaction details below:
transactionId
type
tender
paymentName
paymentNetwork
paymentAccount
paymentAccountExpiry
payamentAccountRouting
amount
authorizationAmount
capturedAmount
gratuityAmount
surchargeAmount
settlementAmount
voidedAmount
referenceTransactionId
approvalCode
avsCode
cvvCode
enhanced
status
created
date-time
Example:
{
"transactionId": 230021901,
"type": "SALE",
"tender": "CREDITCARD",
"paymentName": "A TEST",
"paymentNetwork": "MC",
"paymentAccount": "5***********1111",
"paymentAccountExpiry": "1025",
"amount": 29.9500,
"authorizationAmount": 29.9500,
"capturedAmount": 29.9500,
"gratuityAmount": 0.0000,
"surchargeAmount": 0.0000,
"settlementAmount": 29.9500,
"approvalCode": "123456",
"avsCode": "N",
"cvvCode": "M",
"status": "SETTLED",
"created": "2024-09-30T17:55:23"
}
2. Get Batch Detail
Endpoint: POST https://reportinguiapi.v2.ecrypt.com/api/batchdetail
Description: Retrieve a list of transactions within a specific batch by providing the batch ID.
Request
POST /api/batchdetail HTTP/1.1
Host: reportinguiapi.v2.ecrypt.com
X-API-Key: your_api_key
Content-Type: application/json
{
"id": {{batch_id}},
"page": 1,
"pageSize": 1000,
"sortOrder": "desc",
"sortColumn": "Id"
}
Body Parameters:
id: Batch ID number.
page: The page number (pagination).
pageSize: The number of records per page (maximum 1000).
sortOrder: Sorting order (e.g., asc or desc).
sortColumn: Column to sort by (e.g., Id)
Response
{
"id": 82382801,
"page": 1,
"pageSize": 1000,
"sortOrder": "desc",
"sortColumn": "Id"
}
Response:
{
"id": 82382801,
"transactions": {
"items": [
{
"transactionId": 229764501,
"type": "SALE",
"tender": "CREDITCARD",
"paymentName": "JJ TEST",
"paymentNetwork": "VI",
"paymentAccount": "4***********1111",
"paymentAccountExpiry": "1025",
"amount": 125.0000,
"authorizationAmount": 125.0000,
"capturedAmount": 125.0000,
"gratuityAmount": 0.0000,
"surchargeAmount": 0.0000,
"settlementAmount": 125.0000,
"approvalCode": "123456",
"avsCode": "N",
"cvvCode": "M",
"status": "SETTLED",
"created": "2024-09-29T17:16:24"
},
{
"transactionId": 229743301,
"type": "SALE",
"tender": "CREDITCARD",
"paymentName": "John Doe",
"paymentNetwork": "VI",
"paymentAccount": "4***********1111",
"paymentAccountExpiry": "1025",
"amount": 6.0000,
"authorizationAmount": 6.0000,
"capturedAmount": 6.0000,
"gratuityAmount": 0.0000,
"surchargeAmount": 0.0000,
"settlementAmount": 6.0000,
"approvalCode": "123456",
"cvvCode": "M",
"status": "SETTLED",
"created": "2024-09-29T14:14:23"
}
],
"page": 1,
"pageSize": 1000,
"totalCount": 2
}
}
3. Get Batch
Endpoint: POST https://reportinguiapi.v2.ecrypt.com/api/batch
Description: Fetch a list of batch IDs based on a date range.
Request:
POST /api/batch HTTP/1.1
Host: reportinguiapi.v2.ecrypt.com
X-API-Key: your_api_key
Content-Type: application/json
{
"page": 1,
"pageSize": 100,
"sortOrder": "desc",
"startDate": "mm-dd-yyyy",
"endDate": "mm-dd-yyyy"
}
Body Parameters:
page: The page number (pagination).
ageSize: Number of records per page (maximum 1000).
sortOrder: Sorting order (e.g., asc or desc).
startDate: Start date for batch search.
endDate: End date for batch search.
Response:
{
"batches": {
"items": [
{
"id": 82382801,
"closed": "2024-09-30T02:00:00",
"status": "COMPLETED"
}
],
"page": 1,
"pageSize": 1000,
"totalCount": 1
}
}
Usage Notes
Pagination: Both the batchdetail and batch endpoints support pagination using page and pageSize parameters. Adjust these to navigate through large datasets.
Sorting: The batchdetail and batch endpoints allow sorting results by specifying sortOrder and sortColumn.
Search: The search function is based on UTC time.
Updated 12 months ago