Skip to main content

Get transaction info

Retrieve a single transaction by its ID or reference. You must provide at least one of transactionId or reference.
GET https://api.tagpay.ng/v1/transaction/info

Query parameters

transactionId
string
The UUID of the transaction. Takes precedence over reference when both are provided.
reference
string
The unique reference string assigned to the transaction.
You must supply either transactionId or reference. Requests that omit both will receive a 400 error.

Response

status
boolean
true when the request succeeded.
transaction
object
The matching transaction record.
curl --request GET \
  --url "https://api.tagpay.ng/v1/transaction/info?reference=TXN-20240401-001" \
  --header "Authorization: Bearer <token>"
{
  "status": true,
  "transaction": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "reference": "TXN-20240401-001",
    "type": "DEBIT",
    "status": "success",
    "amount": 500000,
    "fee": 1000,
    "vat": 75,
    "total": 501075,
    "currency": "NGN",
    "category": "BANK_TRANSFER",
    "description": "Transfer to Access Bank",
    "source": "wallet_001",
    "destination": "0123456789",
    "balance_before": 1000000,
    "balance_after": 498925,
    "metadata": {},
    "createdAt": "2024-04-01T10:30:00.000Z",
    "updatedAt": "2024-04-01T10:30:05.000Z"
  }
}

Get batch transaction details

Retrieve the details of a single batch transaction by its reference.
GET https://api.tagpay.ng/v1/transaction/batch/:reference

Path parameters

reference
string
required
The reference of the batch transaction.

Response

status
boolean
true when the request succeeded.
data
object
The batch transaction record. Internal fields mode and merchantId are excluded.
curl --request GET \
  --url "https://api.tagpay.ng/v1/transaction/batch/BATCH-20240401-001" \
  --header "Authorization: Bearer <token>"
{
  "status": true,
  "data": {
    "id": "d4e5f6a7-b8c9-0123-defa-234567890123",
    "reference": "BATCH-20240401-001",
    "type": "DEBIT",
    "status": "success",
    "totalAmount": 5000000,
    "totalCount": 10,
    "category": "BATCH_BANK_TRANSFER",
    "createdAt": "2024-04-01T14:00:00.000Z",
    "updatedAt": "2024-04-01T14:05:30.000Z"
  }
}

Approve a pending transaction

Approve a pending transaction that is at or above your user’s configured approval limit. You cannot approve a transaction you initiated unless you are the merchant account owner.
POST https://api.tagpay.ng/v1/transaction/approve

Request body

transactionId
string
required
The UUID of the pending transaction to approve.

Response

status
boolean
true when the approval succeeded.
message
string
Confirmation message: "Transaction successfully approved.".
This action is irreversible once the underlying transfer has been processed. Ensure you have verified the transaction details before approving.
curl --request POST \
  --url "https://api.tagpay.ng/v1/transaction/approve" \
  --header "Authorization: Bearer <token>" \
  --header "Content-Type: application/json" \
  --data '{
    "transactionId": "c3d4e5f6-a7b8-9012-cdef-123456789012"
  }'
{
  "status": true,
  "message": "Transaction successfully approved."
}

Reverse a transaction

Reverse a completed transaction and credit the originating wallet. This endpoint is restricted to admin users only.
POST https://api.tagpay.ng/v1/transaction/reverse
This endpoint requires admin-level access. Merchant tokens will receive a 403 Forbidden response. Only transactions in a pending state can be reversed.

Request body

reference
string
The reference string of the transaction to reverse. Provide either this or transactionId.
transactionId
string
The UUID of the transaction to reverse. Takes precedence when both fields are present.

Response

status
boolean
true when the reversal succeeded.
message
string
Confirmation message: "Transaction successfully reversed".
The reversal creates a corresponding CREDIT transaction with reference prefixed r- (e.g. r-TXN-20240401-001) and marks the original transaction as failed.
curl --request POST \
  --url "https://api.tagpay.ng/v1/transaction/reverse" \
  --header "Authorization: Bearer <admin-token>" \
  --header "Content-Type: application/json" \
  --data '{
    "reference": "TXN-20240401-001"
  }'
{
  "status": true,
  "message": "Transaction successfully reversed"
}

Remove a pending transaction

Cancel and remove a pending transaction. The transaction status is set to CANCELLED.
DELETE https://api.tagpay.ng/v1/transaction/:transactionId

Path parameters

transactionId
string
required
The UUID of the pending transaction to cancel.

Response

status
boolean
true when the cancellation succeeded.
message
string
Confirmation message: "Transaction successfully declined.".
curl --request DELETE \
  --url "https://api.tagpay.ng/v1/transaction/c3d4e5f6-a7b8-9012-cdef-123456789012" \
  --header "Authorization: Bearer <token>"
{
  "status": true,
  "message": "Transaction successfully declined."
}