# Authentication and accounts (/docs/get-started/keys)



> Most Hubtel HTTP APIs use HTTP Basic authentication. Payment requests also need the relevant account number. SMPP uses its own connection credentials, and the service fulfilment callback uses IP allowlisting.
Choose credentials for the API you need below. Business APIs use a Hubtel merchant account, and lending uses separate myCreditScore credentials.

## Credentials [#credentials]

For HTTP Basic authentication, send the first credential as the username and the second as the password. Use SMPP credentials when binding an SMPP connection.

| API                                | Keys                        | Where to get them                                                                                  |
| ---------------------------------- | --------------------------- | -------------------------------------------------------------------------------------------------- |
| Payments, payouts and verification | API ID and API Key          | [API keys → Payments](/dashboard/api-keys)                                                         |
| Business SMS                       | Client ID and Client Secret | [API keys → SMS](/dashboard/api-keys#sms)                                                          |
| SMPP                               | Client ID and Client Secret | Ask your Retail Systems Engineer, then find them under [API keys → SMPP](/dashboard/api-keys#smpp) |
| Lending                            | API ID and API Key          | myCreditScore Lenders Portal (see [Lending data](/docs/guides/lending))                            |

Your payment keys also cover status checks, refunds, balances, commission services and invoicing.

Set the variables below in your server environment. Keep their values out of source control.

| Example variable                                   | Value                                |
| -------------------------------------------------- | ------------------------------------ |
| `HUBTEL_API_ID`, `HUBTEL_API_KEY`                  | Your payment API ID and API key      |
| `HUBTEL_COLLECTION_ACCOUNT`                        | Collection account number            |
| `HUBTEL_DISBURSEMENT_ACCOUNT`                      | Disbursement account number          |
| `HUBTEL_SMS_CLIENT_ID`, `HUBTEL_SMS_CLIENT_SECRET` | Your SMS client ID and client secret |

These are example environment variable names, not API fields. In guides, replace `example.com` callback and return URLs with your own routes, use a fresh transaction reference, and replace sample customer details. For tests, use [sandbox credentials, hosts and numbers](/docs/testing).

Your HTTP client builds the `Authorization: Basic base64(username:password)` header for you:

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

> **Keep credentials on your server**
> Never put an API key or client secret in a browser, a mobile app or a public repository. For web payments, create the checkout on your server and send only the checkout URL to the browser (see [Online Checkout](/docs/guides/online-checkout)). Quick Send SMS also accepts keys as query parameters; use the POST endpoints instead, so your keys don't end up in logged URLs.
The published [Checkout SDK examples](/docs/guides/checkout-sdk#before-you-start) accept credentials in client code. Their credential scope remains unconfirmed; review that limitation before choosing an SDK.

## Account numbers [#accounts]

Your merchant account has two account numbers for each branch, listed under [Develop → Account IDs](/dashboard/account-ids). Put the one that matches where the money moves in the request path:

| Account                    | What it's for              | Used by                                                                                        |
| -------------------------- | -------------------------- | ---------------------------------------------------------------------------------------------- |
| **Collection** (POS sales) | Receives customer payments | Receive Money, Online Checkout, Direct Debit, invoicing, status checks, refunds, transfers out |
| **Disbursement** (prepaid) | Funds payouts              | Send Money, Send to Bank, commission services                                                  |

To fund payouts from your sales, move money across with a [balance transfer](/docs/guides/balance-transfers).

## Base URLs [#base-urls]

Each API has its own host. Many accept requests only from allowlisted server IP addresses; see [IP allowlisting](/docs/networking).

**Payments**

  | API                                 | Base URL                           |
  | ----------------------------------- | ---------------------------------- |
  | Receive Money, Direct Debit charges | `https://rmp.hubtel.com`           |
  | Direct Debit pre-approval           | `https://preapproval.hubtel.com`   |
  | Online Checkout                     | `https://payproxyapi.hubtel.com`   |
  | Transaction status                  | `https://api-txnstatus.hubtel.com` |
  | Refunds                             | `https://refund-api.hubtel.com`    |
  | Invoicing                           | `https://invoicing.hubtel.com`     |
  | Recurring Invoice                   | `https://rip.hubtel.com`           |

**Payouts**

  | API                      | Base URL                   |
  | ------------------------ | -------------------------- |
  | Send Money, Send to Bank | `https://smp.hubtel.com`   |
  | Payout status            | `https://smrsc.hubtel.com` |
  | Balances and transfers   | `https://trnf.hubtel.com`  |
  | Commission services      | `https://cs.hubtel.com`    |

**Messaging**

  | API          | Base URL                 |
  | ------------ | ------------------------ |
  | Business SMS | `https://sms.hubtel.com` |

**Verification and callbacks**

  | API                         | Base URL                              |
  | --------------------------- | ------------------------------------- |
  | Verification                | `https://rnv.hubtel.com`              |
  | Service fulfilment callback | `https://gs-callback.hubtel.com:9055` |

