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

# Unique identifier

> passdata.metaData and the unique_id query parameter

Many integrations key wallet cards by an **external member identifier** (for example `memberId`, account number, or loyalty ID).

## On create (issue-wallet)

Store your external key in `passdata.metaData` when issuing a card:

```json theme={null}
{
  "person": {
    "firstName": "Alex",
    "lastName": "Member",
    "email": "member@example.com"
  },
  "passdata": {
    "points": 0,
    "metaData": {
      "memberId": "1001"
    }
  }
}
```

The field name inside `metaData` must match the **unique field** configured for your brand (Bambu sets this during onboarding).

## On lookup and update

Use the same value as the `unique_id` query parameter:

```http theme={null}
GET /{brand_id}/programs/{program_id}/wallets?unique_id=1001
PATCH /{brand_id}/programs/{program_id}/wallets?unique_id=1001
```

`email` is supported only when email is configured as the brand's unique identifier. Prefer `unique_id` for new integrations.

## Update by pass ID

If you saved `passId` from the issue-wallet response, you can update without `unique_id`:

```http theme={null}
PATCH /{brand_id}/wallets/{pass_id}
```

## Common mistakes

| Mistake                                             | Result                                         |
| --------------------------------------------------- | ---------------------------------------------- |
| Issue twice with the same `unique_id`               | Duplicate or conflict depending on brand rules |
| `unique_id` does not match `metaData` at issue time | 404 or wrong card                              |
| Using production token against sandbox API          | 401 Unauthorized                               |
