Get Recent Transactions
Retrieves a paginated list of the most recent transactions for the authenticated user.
Get Recent Transactions
GET
https://dev.mytpe.app/api/v2/mytpe-pay/transaction/recentRetrieves a paginated list of the most recent transactions across all Mytpe Pay instances for the authenticated user.
Authentication
Authentication: API Key (X-API-KEY + X-API-SECRET headers)
This endpoint requires authentication using X-API-KEY and X-API-SECRET headers.
X-API-KEY: {your_api_key}
X-API-SECRET: {your_api_secret}Request Parameters
Query Parameters
Prop
Type
Example Request
curl -X GET "https://dev.mytpe.app/api/v2/mytpe-pay/transaction/recent?per_page=10" \
-H "X-API-KEY: {your_api_key}" \
-H "X-API-SECRET: {your_api_secret}" \
-H "Accept: application/json"const response = await fetch('https://dev.mytpe.app/api/v2/mytpe-pay/transaction/recent?per_page=10', {
method: 'GET',
headers: {
'X-API-KEY': '{your_api_key}',
'X-API-SECRET': '{your_api_secret}',
'Accept': 'application/json'
}
});
const data = await response.json();
console.log(data);import requests
params = {
'per_page': 10
}
headers = {
'X-API-KEY': '{your_api_key}',
'X-API-SECRET': '{your_api_secret}',
'Accept': 'application/json'
}
response = requests.get(
'https://dev.mytpe.app/api/v2/mytpe-pay/transaction/recent',
params=params,
headers=headers
)
data = response.json()
print(data)Example Success Response
200 OK
{
"success": true,
"message": "Recent transactions retrieved successfully",
"data": {
"current_page": 1,
"data": [
{
"id": "txn-001",
"transactionable_id": "link-123",
"transactionable_type": "App\\Models\\MytpePayLink",
"amount": "5000.00",
"status": "completed",
"payment_method": "online",
"environment": "development",
"metadata": {
"original_slug": "demo-link",
"payment_link_id": "link-123",
"payment_mode": "reusable"
},
"name": "John Doe",
"email": "john@example.com",
"phone_number": "05912345678",
"gateway_message": "Transaction approved",
"order_number": "ORD123456",
"order_id": "gw-order-001",
"approval_code": "AUTH123",
"created_at": "2026-01-10T14:30:00.000Z",
"updated_at": "2026-01-10T14:35:00.000Z",
"transactionable": {
"id": "link-123",
"mytpe_pay_id": "instance-001",
"title": "Demo Payment Link",
"details": "Sample payment link",
"logo": null,
"slug": "demo-link",
"type": "static",
"amount": null,
"status": "active",
"payment_mode": "reusable",
"max_payments": null,
"successful_payments_count": 5,
"metadata": null,
"created_at": "2026-01-01T00:00:00.000Z",
"updated_at": "2026-01-10T14:35:00.000Z",
"payment_link": "https://frontdev.mytpe.app/pay/demo-link"
}
}
],
"first_page_url": "https://dev.mytpe.app/api/v2/mytpe-pay/transaction/recent?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "https://dev.mytpe.app/api/v2/mytpe-pay/transaction/recent?page=1",
"links": [
{
"url": null,
"label": "\u00ab Previous",
"active": false
},
{
"url": "https://dev.mytpe.app/api/v2/mytpe-pay/transaction/recent?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next \u00bb",
"active": false
}
],
"next_page_url": null,
"path": "https://dev.mytpe.app/api/v2/mytpe-pay/transaction/recent",
"per_page": 10,
"prev_page_url": null,
"to": 1,
"total": 1
}
}Response Fields
Transaction Object
Each transaction in the data array contains the following fields:
Prop
Type
Cross-Instance Transactions
This endpoint returns transactions from all your Mytpe Pay instances, sorted by most recent first. Use the transactionable.mytpe_pay_id field to identify which instance each transaction belongs to.
Order Fulfillment Rule
Only fulfill orders when status is strictly "completed". Do not ship items or deliver services for "pending" or "processing" transactions as they may still fail.
Error Responses
401 Authentication Failed
{
"errors": [
{
"status": "401",
"code": "API_KEY_INVALID",
"title": "Invalid API key",
"detail": "Authentication failed. Please check your API credentials."
}
]
}Use Cases
This endpoint is essential for:
- Transaction Dashboard: Display recent activity across all payment terminals
- Activity Monitoring: Track all payments in real-time
- Multi-Instance Overview: See transactions from all your instances in one place
- Customer Support: Quickly locate recent transactions for customer inquiries
- Reconciliation: Cross-reference with accounting systems
Filtering by Instance
To get transactions for a specific instance, use the payment link transactions endpoint instead: /api/v2/mytpe-pay/links/{id}/transactions