---
title: "Generate Wallet Barcode"
method: POST
path: "/api/v1/simulation/wallets/{walletId}/barcodes"
tags: ["Simulations"]
---

# Generate Wallet Barcode

`POST /api/v1/simulation/wallets/{walletId}/barcodes`

## Request

- Base URL: `https://merchant-api.accruesavings.com`
- URL: `https://merchant-api.accruesavings.com/api/v1/simulation/wallets/{walletId}/barcodes`
- Auth: none declared. Required headers: `Client-ID`, `Authorization`
- TypeScript: <https://skmtc.dev/byaccrue/apis/accrue-merchant-api/docs/api/v1/simulation/wallets/:walletId/barcodes/post.ts> (a function with typed inputs; its response is checked against the schema)

Generate a barcode for a wallet in testing environments.

  The barcode `lookUpId` can be used when creating payment intents or when fetching the barcode via [Get Wallet Barcode](/api#tag/Simulations/operation/getWalletBarcode).

  **This endpoint is only available in development, sandbox, and local testing environments.**

## Path parameters

- `walletId` string, uuid, required: Wallet ID

## Headers

- `Client-ID` string, uuid, required: The unique identifier of the client making the request. This header is required to retrieve the client-specific configuration and ensure that the response is tailored to the client's settings and permissions.
- `Authorization` string, uuid, required: Secure secret to access privileged endpoints.

## Request body

- object
  - `data` GenerateWalletBarcode: Generate Wallet Barcode request
    - `id` string, uuid, required: Unique identifier for the object.
    - `type` 'GenerateWalletBarcode', required
    - `attributes` object, required
      - `expiresAt` string, date-time: When the barcode should expire. Omit for default expiration.
      - `usageLimit` integer: Maximum number of times the barcode can be used. Omit for unlimited.
      - `reuseActive` boolean: If true, reuses an active barcode when one exists instead of creating a new one.

## Response `201`

Created

- GenerateWalletBarcodeResponse
  - `data` WalletBarcode, required: WalletBarcode
    - `id` string, uuid, required: Unique identifier for the object.
    - `type` 'WalletBarcode', required
    - `attributes` object, required
      - `lookUpId` string, required: Lookup identifier for the barcode. Used when creating payment intents or fetching the barcode.
      - `expiresAt` string, date-time, nullable, required: When the barcode expires. Null if no expiry.
      - `usageLimit` integer, nullable: Maximum number of times the barcode can be used. Null if unlimited.
      - `usageCount` integer: Number of times the barcode has been used. Present in list/generate responses.
      - `referenceId` string, nullable: External reference ID. Present when fetching barcode by lookUpId.
      - `createdAt` string, date-time, required
      - `updatedAt` string, date-time, required

## Other responses

- `400`: Bad Request
- `404`: Wallet not found

---

[API](https://skmtc.dev/byaccrue/apis/accrue-merchant-api.md) - [All operations](https://skmtc.dev/byaccrue/apis/accrue-merchant-api/llms.txt) - [OpenAPI document](https://skmtc.dev/byaccrue/apis/accrue-merchant-api/revisions/3e2d97ef2e6e?raw)
