Skip to main content

Check Collection Status

This endpoint allows you to check the current status of a payment collection transaction. Use this to verify whether a transaction has been completed, is still pending, or has failed.

Endpoint

GET /collections/status/{transactionId}

Path Parameters

ParameterTypeRequiredDescription
transactionIdstringYesThe unique ID of the transaction to check

Headers

HeaderValueRequiredDescription
AuthorizationBearer YOUR_API_KEYYesYour API authorization token

Example Request

const checkStatus = async (transactionId) => {
try {
const response = await fetch(`https://pay.computerstore.ug/api/v1/collections/status/${transactionId}`, {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});

const data = await response.json();
console.log(data);
} catch (error) {
console.error('Error:', error);
}
};

// Example usage
checkStatus('e870f17f-090b-40d6-9eb0-a1d683591917');

Response Parameters

The response includes the same structure as the create collection endpoint:

ParameterTypeDescription
successbooleanIndicates if the request was processed successfully
messagestringHuman-readable description of the result
payloadobjectContains all the transaction details
statusCodenumberHTTP status code of the response

Payload Object

FieldTypeDescription
idstringUnique transaction identifier
balanceIdstringIdentifier for the merchant balance
amountnumberTransaction amount
currencystringCurrency code (currently only UGX supported)
payerstringPhone number of the customer
payeeNotestring or nullNote for merchant reference
providerstringPayment provider (AIRTEL_UG or MTN_UG)
externalIdstring or nullMerchant-provided reference ID
statusstringTransaction status (PENDING, SUCCESS, FAILED, ROLLED_BACK)
messagestring or nullAdditional information about the transaction status
payerMessagestring or nullMessage shown to the customer
payerNamestring or nullName of the customer if available
createdAtstringISO timestamp of when the transaction was created

Example Response

{
"success": true,
"message": "",
"payload": {
"id": "e870f17f-090b-40d6-9eb0-a1d683591917",
"balanceId": "cm63k6vw50004sea47kkdv78s",
"amount": 500,
"currency": "UGX",
"payer": "+256706859041",
"payeeNote": "ZenFii Hotspot System",
"provider": "AIRTEL_UG",
"externalId": "order-20250520-001",
"status": "FAILED",
"message": "The Request ID is invalid/Already processed.",
"payerMessage": "Payment for internet subscription",
"payerName": "MUJUNI INNOCENT",
"createdAt": "2025-05-20T18:55:51.336Z"
},
"statusCode": 200
}

Status Codes

CodeDescription
200Request successful
400Bad request - invalid transaction ID format
401Unauthorized - check your API key
404Transaction not found
500Server error occurred

Transaction Statuses

The transaction can have one of the following statuses:

StatusDescription
PENDINGThe transaction is awaiting customer authorization
SUCCESSThe transaction was successful and funds have been collected
FAILEDThe transaction failed (customer rejected, insufficient funds, etc.)
ROLLED_BACKThe transaction was initially successful but has been reversed

Notes

  • It's recommended to poll this endpoint periodically for transactions in PENDING status
  • Alternatively, you can rely on webhook notifications to be informed of status changes
  • If a transaction remains in PENDING status for too long, it will eventually time out and change to FAILED
  • The status will never change from SUCCESS or FAILED to PENDING