Transactions
Get Transactions Endpoint
Retrieve a list of merchant transactions with pagination.
Endpoint: GET /api/transactions
Headers:
Authorization: Bearer YOUR_API_TOKEN
Query Parameters:
page(number, optional): Page number for pagination (default: 1)limit(number, optional): Number of items per page (default: 10)
Response:
{
"status": "success",
"message": "Transactions fetched successfully",
"data": {
"meta": {
"total": 20,
"per_page": 10,
"current_page": 1,
"last_page": 2,
"first_page": 1,
"first_page_url": "/?page=1",
"last_page_url": "/?page=2",
"next_page_url": "/?page=2",
"previous_page_url": null
},
"data": [
{
"id": 1,
"transactionId": 123,
"type": "deposit",
"merchantTokenId": 1,
"userId": 1,
"createdAt": "2024-01-15T10:00:00.000Z",
"updatedAt": "2024-01-15T10:00:00.000Z",
"transaction": {
"id": 123,
"userId": 1,
"walletId": 1,
"amount": 1000,
"fee": 35,
"type": "deposit",
"status": "completed",
"reference": "API_DEP_1_1234567890",
"createdAt": "2024-01-15T10:00:00.000Z",
"updatedAt": "2024-01-15T10:00:00.000Z"
}
}
]
}
}
Get Single Transaction Endpoint
Retrieve details of a specific merchant transaction by its ID.
Endpoint: GET /api/transactions/:id
Headers:
Authorization: Bearer YOUR_API_TOKEN
Parameters:
id(number, required): The ID of the transaction to retrieve.
Response:
{
"status": "success",
"message": "Transaction fetched successfully",
"data": {
"id": 1,
"transactionId": 123,
"type": "deposit",
"merchantTokenId": 1,
"userId": 1,
"createdAt": "2024-01-15T10:00:00.000Z",
"updatedAt": "2024-01-15T10:00:00.000Z",
"transaction": {
"id": 123,
"userId": 1,
"walletId": 1,
"amount": 1000,
"fee": 35,
"type": "deposit",
"status": "completed",
"reference": "API_DEP_1_1234567890",
"createdAt": "2024-01-15T10:00:00.000Z",
"updatedAt": "2024-01-15T10:00:00.000Z"
}
}
}