> ## Documentation Index
> Fetch the complete documentation index at: https://www.bitnob.dev/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Bitnob has two APIs. The Business API (payouts, cards, trading, virtual accounts, stablecoin and bitcoin transfers) is at https://api.bitnob.com. The Enterprise API (non-custodial wallets) is at https://api.platform.bitnob.com.
> Business API auth: sign every request with HMAC-SHA256 and send four headers: `X-Auth-Client` (your client ID), `X-Auth-Timestamp` (Unix seconds), `X-Auth-Nonce` (16 random bytes, hex), and `X-Auth-Signature`, the hex HMAC-SHA256 of `CLIENT_ID:TIMESTAMP:NONCE:BODY` keyed with your client secret. BODY is the exact request body string you send, or an empty string. A missing header, a bad signature, or a timestamp more than about 5 minutes off returns `401`.
> Enterprise API auth: send your key in the `X-API-Key` header. Write requests such as creating a transaction also need an `Idempotency-Key` header, or they fail with `idempotency_key_required` before anything happens.
> Sandbox and production share the Business API base URL. The credentials you sign with select the environment, and `GET /api/whoami` returns it in `data.environment`. Use sandbox credentials in sample code and tests, and never put live credentials in code.
> Amounts are strings unless stated otherwise. Never parse them into floats. Balances, transactions, withdrawals (`POST /api/withdrawals`) and virtual accounts use integer strings in the smallest unit: satoshis for BTC, 6 decimals for USDT and USDC, kobo for NGN, and cents for KES and UGX (100 is 1 KES or 1 UGX). A mobile money collection takes `amount` as a JSON integer in cents.
> Payouts and trading use decimal strings in major units: a payout quote `amount` of `"1"` is 1 USDT, and a trading `quantity` of `"0.0001"` is 0.0001 BTC. Payout responses also carry `cent_amount`, the settlement amount in minor units.
> Card amounts are micro-units (1 USD = 1,000,000). Send them as JSON integers. Card responses return them as integer strings, and card webhooks as integers.
> Generate a unique `reference` for each money movement before the first attempt, and reuse it on retries. A reused reference returns `409` on payout quotes (`ALREADY_EXISTS`), withdrawals (`DUPLICATE_KEY_ERROR`) and card creation (`ALREADY_EXISTS`). It returns the existing record on NGN-pair trading orders, NGN virtual accounts and active mobile money collections. On a mobile money collection that has closed or failed it returns `409` `DUPLICATE_REFERENCE`. It isn't checked on crypto-pair trading orders, so look the order up with `GET /api/trading/orders/{reference}` before resending.
> Quotes expire at `expires_at`; read it from the response instead of assuming a window. An expired trading quote returns `422` `PRECONDITION_FAILED`, and an expired payout quote returns `400` `VALIDATION_ERROR`. Create a new quote rather than retrying. A payout quote can be initialized once, and a trading quote is consumed by the order that fills it.
> Webhooks: verify the `x-bitnob-signature` header, the hex HMAC-SHA512 of the raw request body keyed with your webhook secret, before parsing JSON. Compare in constant time and de-duplicate on `event_id`. A successful API response means accepted: confirm the outcome from the webhook, such as `payouts.withdrawal.success`.
> Errors return `status`, `code` and `detail`. Branch on `code`, never on `detail`. Since the November 5, 2026 response format change, each company gets either the current or the new error codes until its cutoff date, so handle both: `PROVIDER_ERROR` or `PROCESSING_ERROR`, and `BVN_PROVIDER_UNAVAILABLE` or `BVN_VERIFICATION_UNAVAILABLE`. A body that fails to parse returns `{"error": {"code": "BAD_REQUEST"}}`.

# How card issuance works

> Card issuance runs through regulated partners: your call creates a pending card, the issuer activates it, and a webhook confirms it.

Issuing a card is one API call, but the card is created at a regulated issuing bank, not inside Bitnob. Understanding that hop explains everything about how issuance behaves: why a card starts `pending`, why the webhook is the source of truth, and why customer identity details are required up front.

## The issuance flow

```mermaid theme={null}
%%{init: {'theme':'base','themeVariables':{'primaryColor':'#E6F7F2','primaryTextColor':'#004233','primaryBorderColor':'#00A57F','lineColor':'#00A57F','secondaryColor':'#CCEEE5','tertiaryColor':'#F2FCF9','fontFamily':'inherit'}}}%%
flowchart TD
    A[POST /api/cards] --> B[Card record created<br/>status: pending]
    B --> C[Issuer creates the card]
    C --> D[virtualcard.created.completed<br/>status: active]
    C --> E[virtualcard.created.failed]
```

Your [Create card](https://www.bitnob.dev/api-reference/cards/create-card.md) call returns immediately with the card in status `pending` and `created_status: processing`. The issuer then provisions the card, usually within seconds. `virtualcard.created.completed` confirms it is `active`; only then are the PAN, CVV, and expiry retrievable via [Get secure card details](https://www.bitnob.dev/api-reference/cards/get-secure-card-details.md).

Treat the webhook, not the HTTP response, as the signal to show the card to a user.

## Verify the cardholder first

Every card belongs to a verified customer, and the issuing bank requires that customer's identity: name, date of birth, ID document, and address. Run each cardholder through [Card KYC](https://www.bitnob.dev/api-reference/cards/card-kyc.md) before you create a card for them. Approval returns a `customer_id`, which you pass to Create card. Because the identity details were captured during KYC, you don't send them again.

Cards are virtual only.

Higher volumes or limits can require additional cardholder verification.

## Card programs

Every card belongs to a card program. You choose it with `card_program` when you run [Card KYC](https://www.bitnob.dev/api-reference/cards/card-kyc.md) and when you [create the card](https://www.bitnob.dev/api-reference/cards/create-card.md), and every card returns it. A program must be enabled for your company before you can use it; otherwise the request returns `400`.

| Program | What it is | Funding | Card KYC |
| - | - | - | - |
| `prepaid` | Virtual prepaid card. | From your company balance at creation, \$2 to \$2,500. | `POST /api/cards/kyc` with `card_program: "prepaid"`. |
| `collateral` | A cardholder's own card, backed by a deposit. | No opening amount; spending power comes from the deposit. | `POST /api/cards/kyc` with `card_program: "collateral"`. The cardholder finishes on the hosted page in `completion_link`. |
| `collateral_business` | Business cards that draw on one shared company pool. | The company pool. | [Corporate KYB](https://www.bitnob.dev/api-reference/cards/start-corporate-kyb.md). |
| `prepaid_platinum` | Virtual prepaid USD Visa card. | From your company balance at creation, \$5 to \$2,500. The first \$5 is the card's preloaded balance, which can't be withdrawn. See [The preloaded balance](#the-preloaded-balance). | `POST /api/cards/kyc` with an identity document and `id_front_image`, or a `bvn` or `nin`. |
| `prepaid_premium` | Virtual prepaid USD Visa card, premium range. | As `prepaid_platinum`. | As `prepaid_platinum`. |

When you leave `card_program` out you get `prepaid`. `prepaid_platinum` and `prepaid_premium` must always be named.

### `prepaid_platinum` and `prepaid_premium`

* **One verification covers both.** A customer approved for either program can be issued cards in both.
* **Individuals only.** The customer must be an `individual`. Send a document (`passport`, `national_id`, `drivers_license`, `voters_card` or `vnin`) with `id_front_image`, or a `bvn` or `nin`, which takes no image and needs `country: "NGA"`.
* **Already verified for prepaid cards? No second KYC.** A customer approved through card KYC for the default `prepaid` program can be issued `prepaid_platinum` and `prepaid_premium` cards straight away, as long as they haven't been through KYC for these programs. Create card verifies them with what they already submitted. A customer verified with a document needs its `id_front_image` on file; otherwise Create card returns `400` with `status=documents_missing`, and you run Card KYC for the program.
* **Create by `customer_id`.** Pass the `customer_id` of an approved customer to Create card; an inline `customer` is refused.
* **Card details come as a secure link.** [Get secure card details](https://www.bitnob.dev/api-reference/cards/get-secure-card-details.md) is always encrypted for these programs, and the decrypted details carry `secure_view_url`, a link that shows the card number and CVV for about a minute. See [Cards shown through a secure link](https://www.bitnob.dev/docs/card-issuing/decrypt-card-details.md#cards-shown-through-a-secure-link).

#### The preloaded balance

Every `prepaid_platinum` and `prepaid_premium` card comes with \$5 already on it. That \$5 is part of the card's balance, not added on top: the opening `amount` you send is the card's total balance, and the card is loaded with that amount minus the \$5.

For example, create a card with an opening amount of \$20. The card has its preloaded \$5, \$15 is loaded on top, and its balance is \$20.

The preloaded \$5 can't be withdrawn: a withdrawal from the card always leaves at least \$5 on it.

#### Offline transactions by country

For compliance and risk reasons, `prepaid_platinum` and `prepaid_premium` cards (card numbers starting with 404 or 493) can't be used for offline transactions by cardholders from the countries and regions below. Online and other transactions still follow the program's rules and the review of each transaction.

**Restricted markets:** Bangladesh, Belarus, Cuba, India, Indonesia, Iran, Iraq, Mainland China, Morocco, Nepal, North Korea, Russia, Syria, Turkey, the United States, and the Crimea, Donetsk and Luhansk regions of Ukraine.

**Sanctioned countries and regions:** Afghanistan, Belarus, the Central African Republic, Cuba, the Democratic Republic of the Congo, the Dominican Republic, Guinea-Bissau, Haiti, Iran, Iraq, Lebanon, Libya, Mali, Myanmar, North Korea, Russia, Somalia, South Sudan, Sudan, Syria, Venezuela, Yemen, and Zimbabwe.

This list can change as compliance policies change. We'll announce any update in the [changelog](https://www.bitnob.dev/changelog.md).

## What creating a card costs

Create card takes the opening `amount` from your company balance, plus two fees: the \$1.00 card creation fee, and the top-up fee on the opening amount (\$1.00 flat below \$100, 1% at \$100 and above). They show up as separate ledger entries: a `CARD_TOPUP` carrying the top-up fee, and a `CARD_CREATION_FEES` debit. A \$2.00 card therefore needs \$4.00.

If your balance can't cover all three, Create card fails before anything is issued:

```json theme={null}
{
  "type": "https://api.bitnob.com/errors/VALIDATION_ERROR",
  "title": "Validation Error",
  "status": 400,
  "detail": "Insufficient company balance for card creation: required 4.00, available 0.11 USDC",
  "code": "VALIDATION_ERROR",
  "extensions": {
    "error_code": "COMPANY_INSUFFICIENT_BALANCE",
    "currency": "USDC",
    "required": "4.00",
    "available": "0.11"
  }
}
```

`extensions.currency` tells you which balance was checked, and `required` is the full amount including fees. Top that balance up, then retry.

## What kind of card you get

| Property | Value |
| - | - |
| Scheme | Visa |
| Form | Virtual, delivered instantly |
| Currency | USD |
| Spend scope | Online (card-not-present), plus in-store tap-to-pay via Apple or Google Wallet when contactless is enabled |
| 3DS | Supported on `prepaid_platinum` and `prepaid_premium`: the code is sent to your webhook, and you show it to the cardholder. See [3DS codes](https://www.bitnob.dev/docs/card-issuing/webhook-payloads.md#3ds-codes). Not supported on other programs. |
| Cards per customer | Up to 3 at a time. Pending and frozen cards count; terminated and failed cards don't. |
| Billing address | Returned in `billing_address`. `prepaid_platinum` and `prepaid_premium` cards return the cardholder's own address from card KYC; other prepaid cards return a fixed US address. |

## When to issue

| Scenario | Pattern |
| - | - |
| User wants to shop online | One general-purpose card linked to their account, reused across merchants. |
| Subscriptions | A persistent card left active for recurring charges. |
| Business spend | Per-employee or per-department cards, each funded with only what that person needs. |
| One-time purchase | A disposable card, terminated after use. |
| Payout-to-spend | Issue and fund a card at payout time instead of transferring fiat. |

Creating a card is not idempotent by customer: calling create twice makes two cards. A reused `reference` is refused with `409` `ALREADY_EXISTS`. Track active cards per customer in your own system, or check with [List cards](https://www.bitnob.dev/api-reference/cards/list-cards.md), filtering by `customer_id`, before issuing.

## Common questions

> [accordion] How long does creation take?
>
> Usually seconds. The card is `pending` until the issuer confirms; `virtualcard.created.completed` is the activation signal.

> [accordion] Can a user have multiple cards?
>
> Yes, up to 3 per customer at any time. Pending and frozen cards count; terminated and failed cards don't.

> [accordion] Are cards reusable?
>
> Yes, until frozen, terminated, or expired. See [Freeze, unfreeze, or terminate a card](https://www.bitnob.dev/docs/card-issuing/card-status-management.md).

> [accordion] What does creation cost?
>
> \$1.00 per card, charged once from your company balance when the card is created, whether or not it's ever funded. Funding the card has its own fee. See [Fees and decline rules](https://www.bitnob.dev/docs/card-issuing/card-fees.md).

Ready to build? [Issue your first card](https://www.bitnob.dev/docs/card-issuing/issue-your-first-card.md) walks the whole lifecycle, and [Create card](https://www.bitnob.dev/api-reference/cards/create-card.md) has the full request schema.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.