---
title: "Create a QR code"
method: POST
path: "/payments/qr_codes"
tags: ["QR Codes"]
---

# Create a QR code

`POST /payments/qr_codes`

Create a UPI QR code for accepting digital payments. Only upi_qr type is supported (on-demand feature; requires merchant activation). single_use QR codes require fixed_amount=true and close_by maximum is 45 days. multiple_use QR codes have no expiry restriction.

## Request body

- object
  - `type` 'upi_qr', required — QR code type. Only upi_qr is supported (on-demand feature requiring merchant activation).
  - `name` string, required — Label for the QR code.
  - `usage` 'single_use' | 'multiple_use', required — single_use: auto-closes after first successful payment (requires fixed_amount=true). multiple_use: stays open for multiple payments.
  - `fixed_amount` boolean, required — true: fixed amount QR (required for single_use). false: customer enters amount at scan time.
  - `payment_amount` integer — Fixed payment amount in paise. Required when fixed_amount=true.
  - `description` string
  - `customer_id` string — Associate QR code with a customer (cust_*).
  - `close_by` integer — Unix timestamp for auto-close. Maximum 45 days from creation for single_use.
  - `notes` Notes — Key-value pairs for storing custom metadata. Maximum 15 pairs. Each key and value must not exceed 256 characters.

## Response `200`

QR code created.

- QrCode
  - `id` string — Unique QR code identifier. Prefix: qr_
  - `entity` 'qr_code'
  - `name` string — Label for the QR code.
  - `description` string
  - `image_url` string — Hosted URL of the QR code image.
  - `payment_amount` integer — Fixed payment amount in paise. Null for variable-amount QR codes.
  - `status` 'active' | 'closed'
  - `usage_type` 'single_use' | 'multiple_use'
  - `close_by` integer — Unix timestamp when the QR code will auto-close.
  - `closed_at` integer — Unix timestamp when the QR code was closed.
  - `close_reason` 'on_demand' | 'paid' — Why the QR code was closed.
  - `customer_id` string — Associated customer ID (cust_*).
  - `payments_amount_received` integer — Total amount received via this QR code (paise).
  - `payments_count_received` integer — Number of payments received.
  - `notes` Notes — Key-value pairs for storing custom metadata. Maximum 15 pairs. Each key and value must not exceed 256 characters.
  - `created_at` integer

## Other responses

- `400` — Bad request. Invalid parameters or missing required fields.
- `401` — Authentication failed. Invalid or missing API key credentials.
- `429` — Rate limit exceeded. Implement exponential backoff with jitter before retrying.

---

[API](https://skmtc.net/razorpay/apis/razorpay-api.md) · [All operations](https://skmtc.net/razorpay/apis/razorpay-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/razorpay/razorpay-api/revisions/824ca9e6faef/schema)
