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

# Wallet Passes

> Manage wallet pass templates and send push notifications via the Management API

# Wallet Passes

Query wallet pass templates, list wallet passes for customers, and send push notifications to wallet pass holders.

## List Templates

Retrieve wallet pass templates for a specific shop.

```bash theme={null}
GET /v1/management/wallet-passes/templates
```

<ParamField query="shop_identifier" type="string" required>
  The shop identifier
</ParamField>

**Required permission:** `wallet_pass_template:read`

### Example Request

```bash theme={null}
curl -X GET "https://api.rxscale.com/v1/management/wallet-passes/templates?shop_identifier=my-shop" \
  -H "X-API-Key: your-api-key-here"
```

### Response

```json theme={null}
{
  "data": [
    {
      "uid": "wpt-abc123",
      "display_name": "Loyalty Card",
      "pass_type": "generic",
      "shop_identifier": "my-shop"
    }
  ],
  "total": 1
}
```

## List Wallet Passes

Retrieve wallet passes for a specific shop customer and shop combination.

```bash theme={null}
GET /v1/management/wallet-passes
```

<ParamField query="shop_customer_id" type="string" required>
  The shop customer ID
</ParamField>

<ParamField query="shop_identifier" type="string" required>
  The shop identifier
</ParamField>

<ParamField query="wallet_pass_template_uid" type="string">
  Optional template UID to filter by
</ParamField>

**Required permission:** `wallet_pass:read`

### Example Request

```bash theme={null}
curl -X GET "https://api.rxscale.com/v1/management/wallet-passes?shop_customer_id=cust-123&shop_identifier=my-shop" \
  -H "X-API-Key: your-api-key-here"
```

### Response

```json theme={null}
{
  "data": [
    {
      "uid": "wp-abc123",
      "wallet_pass_template_uid": "wpt-abc123",
      "shop_customer_id": "cust-123",
      "status": "active"
    }
  ],
  "total": 1
}
```

## Send Push Notifications

Send push notifications to one or more wallet pass holders. Accepts a batch of notifications.

```bash theme={null}
POST /v1/management/wallet-passes/push-notifications
```

**Required permission:** `wallet_pass_push_notification:write`

### Request Body

The request body is a JSON array of notification objects.

```json theme={null}
[
  {
    "wallet_pass_uid": "wp-abc123",
    "message": "Your prescription is ready for pickup!"
  },
  {
    "wallet_pass_uid": "wp-def456",
    "message": "Hello {first_name}, your order has been shipped."
  }
]
```

| Field             | Type   | Required | Description                                                      |
| ----------------- | ------ | -------- | ---------------------------------------------------------------- |
| `wallet_pass_uid` | string | Yes      | UID of the wallet pass to send the notification to               |
| `message`         | string | Yes      | Push notification message text (supports `{field}` placeholders) |

### Example Request

```bash theme={null}
curl -X POST "https://api.rxscale.com/v1/management/wallet-passes/push-notifications" \
  -H "X-API-Key: your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "wallet_pass_uid": "wp-abc123",
      "message": "Your prescription is ready for pickup!"
    }
  ]'
```

### Response (201 Created)

```json theme={null}
{
  "data": [
    {
      "uid": "wpn-abc123",
      "wallet_pass_uid": "wp-abc123",
      "message": "Your prescription is ready for pickup!",
      "status": "queued"
    }
  ],
  "total": 1
}
```

### Error Responses

| Status Code | Description                                                                  |
| ----------- | ---------------------------------------------------------------------------- |
| `400`       | Invalid body format, empty array, validation error, or wallet pass not found |
| `403`       | Missing `wallet_pass_push_notification:write` permission                     |
