Transactions API

v1.0 • REST • JSON

Full CRUD management for transaction accounts. Create, retrieve, update, and delete transaction records with built-in pagination and role-based access control support.

GET POST PUT DELETE 5 Endpoints
Base URL https://bogusapi.com/api/transactions
GET /api/transactions 200 OK

Get All Transactions

Retrieves a paginated list of all transactions in the system. Use the pageNumber and pageSize query parameters to navigate large result sets. The response envelope includes total count and page metadata.

Query Parameters
ParameterTypeDefaultDescription
pageNumber integer 1 Page number, 1-based index. Values below 1 are treated as 1.
pageSize integer 10 Number of records per page, from 1 to 100. Values outside this range are clamped.
Response: 200 OK
GET /api/transactions/{id} 200 OK

Get Single Transaction

Fetch the full profile for a specific transaction using their numeric ID. Returns all transaction fields including assigned role names and account metadata.

Path Parameters
ParameterTypeRequiredDescription
id integer Required Unique transaction identifier
Response: 200 OK
GET /api/transactions/{id} 404 Not Found

Transaction Not Found

Returned when the requested transaction ID does not exist in the system. Use this example to test error-handling logic and build graceful fallback UI for missing transaction resources.

Response: 404 Not Found
POST /api/payments/capture 200 OK

Create Transaction

Captures an existing payment: marks it as Paid and records a Charge transaction for the full payment amount. Returns 200 OK with the new transaction, or 404 Not Found if the payment does not exist.

Request Body
Field Type Required Description
paymentId integer Required Payment id
Body
Response: 200 OK
PUT /api/transactions/{id} 200 OK

Update Transaction

Fully replaces an existing transaction's data with the values in the request body. type must be Charge, Refund or Adjustment. If gatewayReference is omitted, the current reference is kept. A successful update returns 200 OK with response body.

Request Body
Field Type Required Description
paymentId integer Required Payment id
amount decimal Required Amount
type string Required Type
status string Required Status
gatewayReference string Optional Gateway reference
Body
Response: 200 OK
DELETE /api/transactions/{id} 204 No Content

Delete Transaction

Permanently removes a transaction by its ID. Returns 409 Conflict if the transaction has refunds, because financial history is kept. This action cannot be undone.

Path Parameters
ParameterTypeRequiredDescription
id integer Required ID of the transaction to delete
Response: 204 No Content