Curlec Virtual Accounts API

Virtual bank accounts and UPI VPAs that accept NEFT/RTGS/IMPS/UPI payments (Smart Collect). Each incoming payment creates a BankTransfer entity. Supports Third Party Validation (TPV) to restrict payers, and VPA receivers (Smart Collect 2.0). Auto-closes after 90 days of inactivity.

OpenAPI Specification

curlec-virtual-accounts-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Razorpay Bills Virtual Accounts API
  version: 1.0.0
  description: Razorpay payment gateway APIs for accepting payments, managing orders, processing refunds, payouts, and subscriptions. All amounts are in the smallest currency sub-unit (e.g. paise for INR). Supports 180+ payment methods including UPI, cards, netbanking, wallets, and EMI.
  termsOfService: https://razorpay.com/terms/
  contact:
    name: Razorpay Support
    url: https://razorpay.com/support/
    email: support@razorpay.com
  license:
    name: Proprietary
    url: https://razorpay.com/terms/
  x-logo:
    url: https://razorpay.com/favicon.png
  x-auth-environments:
    test:
      keyPrefix: rzp_test_
      description: Test mode — keys prefixed rzp_test_. Same API endpoint (https://api.razorpay.com/v1). No real money movement. Use test card numbers from https://razorpay.com/docs/payments/payments/test-card-details/.
    live:
      keyPrefix: rzp_live_
      description: Live mode — keys prefixed rzp_live_. Real money movement. Requires KYC and business activation on the Razorpay Dashboard.
servers:
- url: https://api.razorpay.com/v1
  description: Production
security:
- basicAuth: []
- oauth2:
  - read_only
tags:
- name: Virtual Accounts
  description: Virtual bank accounts and UPI VPAs that accept NEFT/RTGS/IMPS/UPI payments (Smart Collect). Each incoming payment creates a BankTransfer entity. Supports Third Party Validation (TPV) to restrict payers, and VPA receivers (Smart Collect 2.0). Auto-closes after 90 days of inactivity.
paths:
  /virtual_accounts:
    post:
      operationId: createVirtualAccount
      summary: Create a Virtual Account
      description: 'Create a virtual bank account (and optionally a VPA) for accepting NEFT/RTGS/IMPS/UPI payments. Set amount_expected=0 to accept any amount. Auto-closes after 90 days of inactivity. Maximum close_by timestamp: 2147483647.'
      tags:
      - Virtual Accounts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - receivers
              - description
              properties:
                receivers:
                  type: object
                  required:
                  - types
                  properties:
                    types:
                      type: array
                      items:
                        type: string
                        enum:
                        - bank_account
                        - vpa
                      description: Receiver types. bank_account creates a virtual bank account. vpa creates a UPI VPA (Smart Collect 2.0, requires feature flag).
                description:
                  type: string
                  description: Purpose of the virtual account.
                amount:
                  type: integer
                  description: Expected amount in paise. Set to 0 to accept any amount.
                customer_id:
                  type: string
                  description: Link to an existing customer (cust_*).
                close_by:
                  type: integer
                  description: 'Unix timestamp to auto-close the account. Maximum: 2147483647.'
                notes:
                  $ref: '#/components/schemas/Notes'
      responses:
        '200':
          description: Virtual Account created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualAccount'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '429':
          $ref: '#/components/responses/429'
    get:
      operationId: listVirtualAccounts
      summary: List Virtual Accounts
      description: Retrieve a paginated list of virtual accounts with optional filters.
      tags:
      - Virtual Accounts
      parameters:
      - name: from
        in: query
        schema:
          type: integer
        description: Unix timestamp filter (start).
      - name: to
        in: query
        schema:
          type: integer
        description: Unix timestamp filter (end).
      - name: count
        in: query
        schema:
          type: integer
          default: 10
          maximum: 100
        description: 'Number of records to return. Default: 10. Maximum: 100.'
      - name: skip
        in: query
        schema:
          type: integer
          default: 0
        description: 'Number of records to skip. Use for pagination. Default: 0.'
      responses:
        '200':
          description: List of Virtual Accounts.
          content:
            application/json:
              schema:
                type: object
                properties:
                  entity:
                    type: string
                  count:
                    type: integer
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/VirtualAccount'
        '401':
          $ref: '#/components/responses/401'
        '429':
          $ref: '#/components/responses/429'
  /virtual_accounts/{id}:
    get:
      operationId: fetchVirtualAccount
      summary: Fetch a Virtual Account
      description: Retrieve details of a specific virtual account.
      tags:
      - Virtual Accounts
      parameters:
      - name: id
        in: path
        required: true
        description: Virtual Account ID (va_*).
        schema:
          type: string
      responses:
        '200':
          description: Virtual Account details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualAccount'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
    patch:
      operationId: updateVirtualAccount
      summary: Update a Virtual Account
      description: Update the amount_expected or close_by timestamp on an active virtual account.
      tags:
      - Virtual Accounts
      parameters:
      - name: id
        in: path
        required: true
        description: Virtual Account ID (va_*).
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: integer
                  description: New expected amount in paise.
                close_by:
                  type: integer
                  description: 'New close timestamp. Maximum: 2147483647.'
                description:
                  type: string
      responses:
        '200':
          description: Virtual Account updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualAccount'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  /virtual_accounts/{id}/close:
    post:
      operationId: closeVirtualAccount
      summary: Close a Virtual Account
      description: Manually close an active virtual account so it no longer accepts payments.
      tags:
      - Virtual Accounts
      parameters:
      - name: id
        in: path
        required: true
        description: Virtual Account ID (va_*).
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - status
              properties:
                status:
                  type: string
                  enum:
                  - closed
                  description: Must be 'closed' to close the account.
      responses:
        '200':
          description: Virtual Account closed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualAccount'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  /virtual_accounts/{id}/payments:
    get:
      operationId: fetchVirtualAccountPayments
      summary: Fetch payments for a Virtual Account
      description: Retrieve all payments received by a virtual account. Returns Payment objects.
      tags:
      - Virtual Accounts
      parameters:
      - name: id
        in: path
        required: true
        description: Virtual Account ID (va_*).
        schema:
          type: string
      responses:
        '200':
          description: List of payments for the virtual account.
          content:
            application/json:
              schema:
                type: object
                properties:
                  entity:
                    type: string
                  count:
                    type: integer
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/Payment'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  /virtual_accounts/{id}/receivers:
    post:
      operationId: addVpaReceiver
      summary: Add a VPA receiver to a Virtual Account
      description: Add a UPI VPA receiver to an existing virtual account (Smart Collect 2.0). Requires the VPA receiver feature to be enabled on the merchant account.
      tags:
      - Virtual Accounts
      parameters:
      - name: id
        in: path
        required: true
        description: Virtual Account ID (va_*).
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - types
              properties:
                types:
                  type: array
                  items:
                    type: string
                    enum:
                    - vpa
                  description: Must contain 'vpa'.
      responses:
        '200':
          description: VPA receiver added. Returns the updated VirtualAccount.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualAccount'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  /virtual_accounts/{va_id}/allowed_payers:
    post:
      operationId: addAllowedPayer
      summary: Add an allowed payer (TPV)
      description: Whitelist a specific payer bank account or VPA for a virtual account (Smart Collect with Third Party Validation). Only whitelisted payers can successfully pay into this virtual account.
      tags:
      - Virtual Accounts
      parameters:
      - name: va_id
        in: path
        required: true
        description: Virtual Account ID (va_*).
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - type
              properties:
                type:
                  type: string
                  enum:
                  - bank_account
                  - vpa
                  description: Type of allowed payer.
                bank_account:
                  type: object
                  description: Required if type=bank_account.
                  properties:
                    ifsc:
                      type: string
                    account_number:
                      type: string
                vpa:
                  type: object
                  description: Required if type=vpa.
                  properties:
                    address:
                      type: string
                      description: Full UPI VPA address (e.g., user@upi).
      responses:
        '200':
          description: Allowed payer added.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualAccount'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  /virtual_accounts/{va_id}/allowed_payers/{id}:
    delete:
      operationId: deleteAllowedPayer
      summary: Delete an allowed payer (TPV)
      description: Remove a payer from the whitelist of a virtual account (Smart Collect TPV). The payer will no longer be able to make payments to this virtual account.
      tags:
      - Virtual Accounts
      parameters:
      - name: va_id
        in: path
        required: true
        description: Virtual Account ID (va_*).
        schema:
          type: string
      - name: id
        in: path
        required: true
        description: Allowed payer ID to remove.
        schema:
          type: string
      responses:
        '200':
          description: Allowed payer removed.
          content:
            application/json:
              schema:
                type: object
                description: Empty object on success.
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
  /payments/{id}/bank_transfer:
    get:
      operationId: fetchBankTransfer
      summary: Fetch bank transfer details for a payment
      description: Retrieve the BankTransfer entity associated with a payment received via a Virtual Account. Contains the UTR number, payer bank account details, and transfer mode.
      tags:
      - Virtual Accounts
      parameters:
      - name: id
        in: path
        required: true
        description: Payment ID (pay_*).
        schema:
          type: string
      responses:
        '200':
          description: Bank transfer details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankTransfer'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
components:
  schemas:
    UpiDetails:
      type: object
      properties:
        payer_account_type:
          type: string
        vpa:
          type: string
          description: 'Customer UPI VPA (Virtual Payment Address). Example: user@upi.'
        flow:
          type: string
          description: 'UPI flow used: collect, intent, or in_app.'
    VirtualAccount:
      type: object
      description: 'A virtual bank account or VPA that accepts NEFT/RTGS/IMPS/UPI payments (Smart Collect). Each payment creates a BankTransfer entity. Auto-closes after 90 days of inactivity. Prefix: va_'
      properties:
        id:
          type: string
          description: 'Virtual account ID. Prefix: va_'
        name:
          type: string
          description: Display name of the virtual account.
        entity:
          type: string
          enum:
          - virtual_account
        description:
          type: string
          description: Purpose or description of the virtual account.
        amount_expected:
          type: integer
          description: Expected payment amount in paise. 0 means any amount is accepted.
        amount_paid:
          type: integer
          description: Total amount received so far in paise.
        status:
          type: string
          enum:
          - active
          - closed
          description: active = accepting payments; closed = no longer accepting payments.
        receivers:
          type: array
          description: Payment receivers assigned to this virtual account. Can include bank_account (ba_*) and/or vpa (vpa_*) receivers.
          items:
            type: object
            properties:
              id:
                type: string
                description: 'Receiver ID. Prefix: ba_ for bank account, vpa_ for VPA.'
              entity:
                type: string
                enum:
                - bank_account
                - vpa
              ifsc:
                type: string
                description: IFSC code (bank accounts only).
              bank_name:
                type: string
                description: Bank name (bank accounts only).
              name:
                type: string
                description: Account holder name (bank accounts) or VPA address (VPAs).
              notes:
                $ref: '#/components/schemas/Notes'
              account_number:
                type: string
                description: Virtual account number (bank accounts only).
              username:
                type: string
                description: UPI username part of the VPA (VPAs only).
              handle:
                type: string
                description: UPI handle (e.g., razorpay) (VPAs only).
              flow:
                type: string
                enum:
                - upi_qr
                description: Flow type for VPA receivers.
        close_by:
          type: integer
          description: 'Unix timestamp by which the account will auto-close. Maximum value: 2147483647.'
        closed_at:
          type: integer
          description: Unix timestamp when the account was closed.
        customer_id:
          type: string
          description: Customer ID linked to this virtual account (cust_*).
        notes:
          $ref: '#/components/schemas/Notes'
        created_at:
          type: integer
    Notes:
      type: object
      description: Key-value pairs for storing custom metadata. Maximum 15 pairs. Each key and value must not exceed 256 characters.
      additionalProperties:
        type: string
      maxProperties: 15
    BankTransfer:
      type: object
      description: 'A payment received into a Virtual Account via bank transfer (NEFT/RTGS/IMPS/UPI). Created automatically when a payer sends funds to the virtual account. Prefix: bt_'
      properties:
        id:
          type: string
          description: 'Bank transfer ID. Prefix: bt_'
        entity:
          type: string
          enum:
          - bank_transfer
        payment_id:
          type: string
          description: Razorpay payment ID generated for this bank transfer (pay_*).
        mode:
          type: string
          enum:
          - NEFT
          - RTGS
          - IMPS
          - UPI
          description: Transfer mode used by the payer.
        amount:
          type: integer
          description: Amount received in paise.
        payer_bank_account:
          type: object
          description: Payer's bank account details.
          properties:
            id:
              type: string
            entity:
              type: string
              enum:
              - bank_account
            ifsc:
              type: string
            bank_name:
              type: string
            name:
              type: string
              description: Account holder name.
            notes:
              $ref: '#/components/schemas/Notes'
            account_number:
              type: string
        bank_reference:
          type: string
          description: UTR (Unique Transaction Reference) number from the bank.
        virtual_account_id:
          type: string
          description: Virtual account that received this transfer (va_*).
        virtual_account:
          $ref: '#/components/schemas/VirtualAccount'
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: 'Error code. Examples: BAD_REQUEST_ERROR, GATEWAY_ERROR, SERVER_ERROR.'
            description:
              type: string
            source:
              type: string
              description: Where the error originated (e.g. business, gateway).
            step:
              type: string
            reason:
              type: string
              description: 'Machine-readable reason. Examples: insufficient_funds, invalid_expiry_date, declined_by_bank.'
            metadata:
              type: object
            field:
              type: string
    CardDetails:
      type: object
      properties:
        id:
          type: string
          description: Card token identifier (card_*).
        entity:
          type: string
        name:
          type: string
          description: Cardholder name.
        last4:
          type: string
          description: Last 4 digits of the card number.
        network:
          type: string
          description: 'Card network. Examples: Visa, MasterCard, RuPay, Amex.'
        type:
          type: string
          description: 'Card type: credit or debit.'
        issuer:
          type: string
          description: 4-character code of the issuing bank.
        emi:
          type: boolean
          description: Whether EMI is available on this card.
        sub_type:
          type: string
          description: Card sub-type (e.g. consumer, corporate).
    Payment:
      type: object
      properties:
        id:
          type: string
          description: 'Unique payment identifier. Prefix: pay_'
        entity:
          type: string
          enum:
          - payment
        amount:
          type: integer
          description: Payment amount in paise.
        currency:
          type: string
        status:
          type: string
          enum:
          - created
          - authorized
          - captured
          - refunded
          - failed
          description: 'created: initiated. authorized: bank approved, not yet captured. captured: funds collected. refunded: fully refunded. failed: transaction failed.'
        order_id:
          type: string
          description: Associated order ID (order_*).
        invoice_id:
          type: string
        international:
          type: boolean
        method:
          type: string
          enum:
          - card
          - netbanking
          - wallet
          - emi
          - upi
        amount_refunded:
          type: integer
          description: Total refunded amount in paise.
        refund_status:
          type: string
          enum:
          - 'null'
          - partial
          - full
        captured:
          type: boolean
        description:
          type: string
        card_id:
          type: string
        card:
          $ref: '#/components/schemas/CardDetails'
        bank:
          type: string
          description: 'Bank code for netbanking. Example: HDFC.'
        wallet:
          type: string
          description: 'Wallet name. Examples: paytm, mobikwik.'
        vpa:
          type: string
        upi:
          $ref: '#/components/schemas/UpiDetails'
        email:
          type: string
        contact:
          type: string
        customer_id:
          type: string
        token_id:
          type: string
        notes:
          $ref: '#/components/schemas/Notes'
        fee:
          type: integer
          description: Razorpay fee charged (paise).
        tax:
          type: integer
          description: GST on the fee (paise).
        error_code:
          type: string
        error_description:
          type: string
        error_source:
          type: string
        error_step:
          type: string
        error_reason:
          type: string
        acquirer_data:
          $ref: '#/components/schemas/AcquirerData'
        created_at:
          type: integer
    AcquirerData:
      type: object
      properties:
        rrn:
          type: string
          description: Bank RRN (Retrieval Reference Number).
        authentication_reference_number:
          type: string
        bank_transaction_id:
          type: string
        transaction_id:
          type: string
  responses:
    '429':
      description: Rate limit exceeded. Implement exponential backoff with jitter before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '404':
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '400':
      description: Bad request. Invalid parameters or missing required fields.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '401':
      description: Authentication failed. Invalid or missing API key credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: HTTP Basic authentication using your Razorpay API key pair. Use key_id as the username and key_secret as the password. Encode as Base64(key_id:key_secret). Keys are environment-scoped (Test vs Live). Obtain keys at https://dashboard.razorpay.com/app/keys. Keys are case-sensitive.
    oauth2:
      type: oauth2
      description: OAuth 2.0 via the Razorpay MCP server (mcp.razorpay.com). Supports Authorization Code with PKCE (S256) for user-delegated access and Client Credentials for server-to-server access. Tokens expire in 3600 seconds. Dynamic Client Registration available at the registration endpoint. For integration setup see https://razorpay.com/docs/build/llm-docs/mcp-server/oauth.md.
      flows:
        authorizationCode:
          authorizationUrl: https://mcp.razorpay.com/authorize
          tokenUrl: https://mcp.razorpay.com/token
          refreshUrl: https://mcp.razorpay.com/token
          scopes:
            read_only: Read-only access to Razorpay account data (payments, orders, refunds, payouts, subscriptions, invoices)
        clientCredentials:
          tokenUrl: https://mcp.razorpay.com/token
          scopes:
            read_only: Read-only access to Razorpay account data (payments, orders, refunds, payouts, subscriptions, invoices)
externalDocs:
  description: Razorpay API Documentation
  url: https://razorpay.com/docs/api/
x-tagGroups:
- name: Core Payments
  tags:
  - Orders
  - Payments
  - Refunds
  - Payment Downtimes
- name: Payment Collection
  tags:
  - Payment Links
  - QR Codes
- name: Billing & Subscriptions
  tags:
  - Items
  - Invoices
  - Plans
  - Subscriptions
- name: Customer Management
  tags:
  - Customers
  - Documents
- name: Finance & Reconciliation
  tags:
  - Settlements
  - Instant Settlements
  - Disputes
- name: Route & Marketplace
  tags:
  - Linked Accounts
  - Transfers
- name: Smart Collect
  tags:
  - Virtual Accounts
- name: Partners & Onboarding
  tags:
  - Partner Accounts
  - Partner Products
  - Partner Stakeholders
  - Partner Documents
  - Partner Webhooks
- name: Bills
  tags:
  - Bills
- name: RazorpayX
  tags:
  - X Contacts
  - X Fund Accounts
  - X Account Validation
  - X Banking Balances
  - X Payouts
  - X Payout Links
  - X Transactions
x-rateLimit:
  description: Razorpay does not publish specific rate limits. If you receive HTTP 429, implement exponential backoff with jitter and retry. Add randomisation to avoid thundering-herd effects.
  throttleStatus: 429
  strategy: exponential backoff with jitter
x-pagination:
  description: All list endpoints return at most 100 records per call (1000 for settlement recon). Use count and skip together to paginate. Date range filters (from/to) use Unix timestamps in seconds.
  example: GET /payments?from=1700000000&to=1700086400&count=100&skip=100
x-amountEncoding:
  description: 'All monetary amounts are in the smallest currency sub-unit. For INR: 1 rupee = 100 paise, so ₹500 = 50000. Minimum for INR is 100 paise (₹1). Three-decimal currencies (KWD, BHD, OMR): drop last decimal digit. Zero-decimal currencies (JPY): pass value as-is.'