> For the complete documentation index, see [llms.txt](https://stablemesh.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stablemesh.gitbook.io/docs/home/stablemesh-doc/developers/api/cards.md).

# Cards

All card endpoints are `POST` under `/v1`, authenticated with the `X-API-KEY` header. Cards are issued on a Visa BIN and funded from your account's USDT balance.

> **Make funding calls retry-safe.** Send an `Idempotency-Key` header on `card/create`, `card/deposit`, `card/freeze`, `card/unfreeze`, and `card/cancel` so a retried request never creates a second card or double-debits. See [Idempotency](/docs/home/stablemesh-doc/developers/api/idempotency.md).

***

## List available BINs

`POST /v1/card/binList`

Returns the card BINs enabled for your account.

**Request** `{}`

**Response**

```json
{
  "availableCardBinList": [
    {
      "id": "VISA-EFI-454924",
      "title": "Ether Card",
      "cardNetwork": "Visa",
      "enabled": true
    }
  ]
}
```

***

## Create a card

`POST /v1/card/create`

Issues a new card and funds it from your USDT balance. The requested `amount` is deducted from your USDT balance; the card is credited the net (after any deposit fee).

**Request**

```json
{
  "amount": 50,
  "currency": "USDT",
  "binId": "VISA-EFI-454924",
  "alias": "Marketing card"
}
```

| Field      | Required | Description                                   |
| ---------- | -------- | --------------------------------------------- |
| `amount`   | yes      | Initial load, deducted from your USDT balance |
| `currency` | yes      | `USDT`                                        |
| `binId`    | no       | Defaults to the card BIN `VISA-EFI-454924`    |
| `alias`    | no       | A label for the card                          |

**Response** — the created card object

```json
{
  "cardId": "card_xxx",
  "binId": "VISA-EFI-454924",
  "cardStatus": "ACTIVE",
  "maskedCardNo": "**** **** **** 2222",
  "cardBrand": "Visa"
}
```

**Example**

```bash
curl -X POST https://api.stablemesh.io/v1/card/create \
  -H "X-API-KEY: $SMK_KEY" -H "Content-Type: application/json" \
  -d '{"amount":50,"currency":"USDT","alias":"Marketing card"}'
```

Common errors: `3001 ASSET_NOT_ENOUGH` (USDT balance too low), `4009 CARD_OUT_OF_INVENTORY` (no card inventory available — contact support), `8001 DEPOSIT_AMOUNT_TOO_SMALL`.

***

## List cards

`POST /v1/card/list`

**Request**

```json
{ "status": "ACTIVE" }
```

`status` is optional; omit to return all cards. Values: `ACTIVE`, `FROZEN`, etc.

**Response**

```json
{
  "cardList": [
    {
      "cardId": "card_xxx",
      "binId": "VISA-EFI-454924",
      "cardStatus": "ACTIVE",
      "maskedCardNo": "**** **** **** 2222",
      "availableBalance": 49.0,
      "frozenAmount": 0,
      "currency": "USD"
    }
  ]
}
```

***

## Card detail

`POST /v1/card/detail` — full detail for one card.

**Request** `{ "cardId": "card_xxx" }` → returns the card detail object.

***

## Card balance

`POST /v1/card/asset` — the card's balance.

**Request** `{ "cardId": "card_xxx" }`

**Response**

```json
{ "availableAmount": "49", "frozenAmount": "0", "currency": "USD" }
```

***

## Top up a card

`POST /v1/card/deposit`

Adds funds to an existing card by **deducting from your USDT balance**.

**Request**

```json
{ "cardId": "card_xxx", "amount": 100, "currency": "USDT" }
```

| Field      | Required | Description                                      |
| ---------- | -------- | ------------------------------------------------ |
| `cardId`   | yes      | Card to fund                                     |
| `amount`   | yes      | Positive amount, deducted from your USDT balance |
| `currency` | no       | Defaults to `USDT`                               |

**Response** `{ "code": 0, "message": "ok" }`

Common errors: `3001 ASSET_NOT_ENOUGH`, `4001 CARD_NOT_FOUND`.

***

## Reveal sensitive info

`POST /v1/card/sensitiveInfo` — returns PAN, CVV, and expiry.

**Request** `{ "cardId": "card_xxx" }`

{% hint style="warning" %}
Sensitive card data is PCI-scoped. Only request it when you need to display or use the full card number, and never log or persist it.
{% endhint %}

***

## Freeze / Unfreeze / Cancel

`POST /v1/card/freeze` · `POST /v1/card/unfreeze` · `POST /v1/card/cancel`

Each takes the same body and returns the standard success envelope.

**Request** `{ "cardId": "card_xxx" }`

**Response** `{ "code": 0, "message": "ok" }`

```bash
curl -X POST https://api.stablemesh.io/v1/card/freeze \
  -H "X-API-KEY: $SMK_KEY" -H "Content-Type: application/json" \
  -d '{"cardId":"card_xxx"}'
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://stablemesh.gitbook.io/docs/home/stablemesh-doc/developers/api/cards.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
