Transactions API
Endpoints for managing payment transactions.
Create Transaction
POST /api/transaction/create
Create a new payment transaction.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
amount | Long | Yes | Amount in cents |
currency | String | Yes | ISO 4217 currency code |
channelId | Long | Yes | Payment channel ID |
description | String | No | Transaction description |
metadata | Object | No | Custom metadata |
customerId | Long | No | Customer ID |
invoiceId | Long | No | Invoice ID |
Response
{
"code": 200,
"message": "Transaction created",
"data": {
"id": "TXN2026081800001",
"amount": 100000,
"currency": "USD",
"status": "PENDING",
"channelId": 1,
"description": "Test payment",
"createdTime": "2026-08-18T10:00:00Z"
}
}
Retrieve Transaction
GET /api/transaction/detail
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | String | Yes | Transaction ID |
Response
{
"code": 200,
"data": {
"id": "TXN2026081800001",
"amount": 100000,
"currency": "USD",
"status": "SUCCESS",
"channelId": 1,
"channelName": "Stripe",
"description": "Test payment",
"createdTime": "2026-08-18T10:00:00Z",
"updatedTime": "2026-08-18T10:05:00Z"
}
}
List Transactions
GET /api/transaction/list
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page | Integer | Page number (default: 1) |
pageSize | Integer | Items per page (default: 20, max: 100) |
status | String | Filter by status |
channelId | Long | Filter by channel |
startDate | String | Start date (YYYY-MM-DD) |
endDate | String | End date (YYYY-MM-DD) |
userId | Long | Filter by user |
Response
{
"code": 200,
"data": [
{
"id": "TXN2026081800001",
"amount": 100000,
"currency": "USD",
"status": "SUCCESS",
"channelName": "Stripe",
"createdTime": "2026-08-18T10:00:00Z"
}
],
"pagination": {
"page": 1,
"pageSize": 20,
"total": 1,
"totalPages": 1
}
}
Transaction Status Codes
| Status | Description |
|---|---|
PENDING | Awaiting processing |
PROCESSING | Being processed |
SUCCESS | Completed successfully |
FAILED | Processing failed |
REFUNDED | Fully or partially refunded |
CANCELLED | Cancelled by user/system |