# Reconciliation and status checks (/docs/guides/reconciliation)



> Check the status of any payment that has no final result after 5 minutes, then update your order. Every payment integration must do this.
**Before you start**

- **A Hubtel business with a merchant account**: Business APIs work through your business's merchant account. If you don't have one yet, sign up and set it up first. [Create one at business.hubtel.com](https://business.hubtel.com)
- **API ID and API key**: They identify you on every request. Send them using HTTP Basic authentication. [Payment keys](/dashboard/api-keys)
- **Collection account number**: This is where your customers' payments arrive. You'll add it to the request URL. [Account IDs](/dashboard/account-ids)
- **An allowlisted server IP address**: Send your server's public IP address to Hubtel to get it allowlisted. Until then, your requests return 403 Forbidden or time out. [IP allowlisting](/docs/networking)

Don't have these yet? [Start in the sandbox](/dashboard/keys) with your test keys while you set them up.

Callbacks usually arrive within 30 seconds, but delivery isn't guaranteed. You must check the status of any payment without a final callback after 5 minutes. Schedule a job to check unresolved orders older than 5 minutes; running it every minute is one option. Make order updates idempotent so a callback and a status check cannot fulfil the same order twice.

For each unresolved order:

1. Request its status using the original reference.
2. If the request fails or the response is incomplete, keep the order unresolved and retry on a later run. Record repeated failures for investigation.
3. For `Paid`, match the returned reference and amount to the stored order, then fulfil once.
4. For `Unpaid`, keep checking or escalate for investigation. This status alone does not distinguish pending, failed and expired payments.
5. For `Refunded`, update your records and follow your refund workflow.

The contract does not define a timeout after which `Unpaid` becomes a final failure. Don't mark a payment failed solely because 30 minutes have passed, or create another charge while its outcome is unknown.

## Check a collection's status [#transaction-status]

[Check a collection's status](/docs/api/v1/transaction-status/get-transaction-status) works for payments made through Online Checkout, the Checkout SDK, Direct Receive Money, Direct Debit and Programmable Services. Implementing it is mandatory.

```bash
curl "https://api-txnstatus.hubtel.com/transactions/$HUBTEL_COLLECTION_ACCOUNT/status?clientReference=order-1042" \
  -u "$HUBTEL_API_ID:$HUBTEL_API_KEY"
```

* Put your **collection account number** in the path.
* Identify the payment with `clientReference` (recommended), `hubtelTransactionId` or `networkTransactionId`.
* Only allowlisted server IPs can reach this endpoint in production. Other addresses get `403` or a timeout; see [IP allowlisting](/docs/networking).

```json
{
  "message": "Successful",
  "responseCode": "0000",
  "data": {
    "date": "2024-04-25T21:45:48.4740964Z",
    "status": "Paid",
    "transactionId": "7fd01221faeb41469daec7b3561bddc5",
    "externalTransactionId": "0000006824852622",
    "paymentMethod": "mobilemoney",
    "clientReference": "order-1042",
    "currencyCode": null,
    "amount": 45,
    "charges": 0.88,
    "amountAfterCharges": 45,
    "isFulfilled": null
  }
}
```

`transactionId` is Hubtel's ID and `externalTransactionId` is the network's reference. `currencyCode` and `isFulfilled` can be `null`.

Payouts and balance transfers have their own status checks: [Check a payout's status](/docs/api/v1/send-money/get-payout-status) and [Get a transfer's status](/docs/api/v1/balance-transfers/get-transfer-status). Invoices use [Get an invoice's status](/docs/api/v1/invoicing/get-invoice-status).

## Status values [#status-values]

| `status`   | Meaning                                                 | Do                                           |
| ---------- | ------------------------------------------------------- | -------------------------------------------- |
| `Paid`     | Money received                                          | Fulfil once                                  |
| `Unpaid`   | No confirmed payment; may be pending, failed or expired | Keep unresolved; check again or investigate  |
| `Refunded` | The payment was [refunded](/docs/guides/refunds)        | Reverse fulfilment as your business requires |

Status Check responses use camelCase (`responseCode`, `data`), unlike Receive Money's PascalCase. See [Field casing](/docs/conventions#casing).
