Prepay Accounts
  • Welcome!
  • Quick Start
  • API Reference
    • Balance Accounts
      • Transactions
      • Recharge settings
      • Refunds
Powered by GitBook
On this page
  1. API Reference
  2. Balance Accounts

Transactions

PreviousBalance AccountsNextRecharge settings

Last updated 1 year ago

  • GETGet List of Transactions for an Account
  • POSTAdd funds to an account
  • POSTRecord account usage

Get List of Transactions for an Account

get

Retrieve a paginated list of transactions for a specific account.

Authorizations
Path parameters
accountIdstringRequired

Unique identifier of the account

Query parameters
pageintegerOptional

Page number of the transactions list

pageSizeintegerOptional

Number of transactions per page

Responses
200
A list of transactions for the specified account
application/json
404
Account not found
get
GET /v1/account/{accountId}/transactions HTTP/1.1
Host: api.example.com
api_key: YOUR_API_KEY
Accept: */*
{
  "transactions": [
    {
      "id": "text",
      "type": "recharge",
      "amount": 1,
      "timestamp": "2025-05-18T07:57:14.948Z"
    }
  ],
  "total": 1,
  "totalPages": 1,
  "currentPage": 1
}

Add funds to an account

post

Endpoint to add funds to a specific account. This involves a payment transaction which, upon successful completion, updates the account balance.

Authorizations
Path parameters
accountIdstringRequired

Account ID

Body
amountnumber · floatRequiredExample: 100
Responses
200
Funds added successfully
application/json
400
Invalid input or account not found
post
POST /v1/account/{accountId}/transactions/add-funds HTTP/1.1
Host: api.example.com
api_key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 14

{
  "amount": 100
}
{
  "transaction_id": "txn_123456789",
  "updated_balance": 200
}

Record account usage

post

Endpoint to record the usage of services against an account.

Authorizations
Path parameters
accountIdstringRequired

Account ID

Body
detailsstringRequiredExample: 100 tokens
amountnumber · floatRequiredExample: 15.75
datestring · timestampRequiredExample: 2010-01-01 00.00:00
metadataobjectOptional
Responses
200
Usage recorded successfully
application/json
400
Invalid input or account not found
post
POST /v1/account/{accountId}/transactions/record-usage HTTP/1.1
Host: api.example.com
api_key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 82

{
  "details": "100 tokens",
  "amount": 15.75,
  "date": "2010-01-01 00.00:00",
  "metadata": {}
}
{
  "status": "Usage recorded successfully",
  "new_balance": 284.25
}