Curlec X Fund Accounts API

Payout destination accounts (bank, VPA, card) linked to contacts

OpenAPI Specification

curlec-x-fund-accounts-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Razorpay Bills X Fund 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: X Fund Accounts
  description: Payout destination accounts (bank, VPA, card) linked to contacts
paths:
  /fund_accounts:
    post:
      operationId: createFundAccount
      summary: Create a fund account
      description: Create a bank account, VPA, card, or wallet (Amazon Pay) fund account linked to a contact. Fund accounts are immutable after creation. Returns existing record if contact_id + account details all match.
      tags:
      - X Fund Accounts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - contact_id
              - account_type
              properties:
                contact_id:
                  type: string
                account_type:
                  type: string
                  enum:
                  - bank_account
                  - vpa
                  - card
                  - wallet
                bank_account:
                  type: object
                  properties:
                    name:
                      type: string
                    ifsc:
                      type: string
                    account_number:
                      type: string
                vpa:
                  type: object
                  properties:
                    address:
                      type: string
                card:
                  type: object
                  description: Requires PCI DSS compliance
                  properties:
                    name:
                      type: string
                    number:
                      type: string
                    expiry_month:
                      type: string
                    expiry_year:
                      type: string
                    input_type:
                      type: string
                      enum:
                      - razorpay_token
                      - service_provider_token
                      - raw
                    token_id:
                      type: string
                    token:
                      type: string
                wallet:
                  type: object
                  description: Required when account_type=wallet (Amazon Pay only)
                  properties:
                    provider:
                      type: string
                      enum:
                      - amazonpay
                    phone:
                      type: string
                      description: 10-digit phone with country code (mandatory)
                    email:
                      type: string
                    name:
                      type: string
                      minLength: 4
                      maxLength: 120
      responses:
        '200':
          description: Fund account created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FundAccount'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
    get:
      operationId: listFundAccounts
      summary: List fund accounts
      tags:
      - X Fund Accounts
      parameters:
      - name: contact_id
        in: query
        schema:
          type: string
        description: Filter by contact ID to list fund accounts linked to that contact.
      - name: account_type
        in: query
        schema:
          type: string
        description: 'Filter by fund account type: `bank_account`, `vpa`, `card`, or `wallet`.'
      - name: count
        in: query
        schema:
          type: integer
          default: 10
        description: 'Number of fund accounts to return. Default: 10. Maximum: 100.'
      - name: skip
        in: query
        schema:
          type: integer
          default: 0
        description: 'Number of fund accounts to skip. Use for pagination. Default: 0.'
      responses:
        '200':
          description: List of fund accounts
          content:
            application/json:
              schema:
                type: object
                properties:
                  entity:
                    type: string
                    enum:
                    - collection
                  count:
                    type: integer
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/FundAccount'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      description: List fund accounts linked to contacts. Filter by contact ID and/or account type.
  /fund_accounts/{fund_account_id}:
    parameters:
    - name: fund_account_id
      in: path
      required: true
      schema:
        type: string
      description: Unique identifier of the fund account (e.g. `fa_00000000000001`).
    get:
      operationId: fetchFundAccount
      summary: Fetch a fund account
      tags:
      - X Fund Accounts
      responses:
        '200':
          description: Fund account details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FundAccount'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
        '404':
          $ref: '#/components/responses/404'
      description: Fetch details of a specific fund account by its ID.
    patch:
      operationId: activateDeactivateFundAccount
      summary: Activate or deactivate a fund account
      tags:
      - X Fund Accounts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - active
              properties:
                active:
                  type: boolean
      responses:
        '200':
          description: Updated fund account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FundAccount'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
      description: Activate or deactivate a fund account. Fund account details are immutable — only the `active` status can be changed.
components:
  responses:
    '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'
    '500':
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '429':
      description: Rate limit exceeded. Implement exponential backoff with jitter before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    FundAccount:
      type: object
      description: Payout destination linked to a Contact. Immutable after creation.
      properties:
        id:
          type: string
          description: Fund account ID (fa_*)
        entity:
          type: string
          enum:
          - fund_account
        contact_id:
          type: string
        account_type:
          type: string
          enum:
          - bank_account
          - vpa
          - card
          - wallet
        active:
          type: boolean
        batch_id:
          type: string
        bank_account:
          type: object
          properties:
            ifsc:
              type: string
            bank_name:
              type: string
            name:
              type: string
            account_number:
              type: string
        vpa:
          type: object
          properties:
            username:
              type: string
            handle:
              type: string
            address:
              type: string
        card:
          type: object
          properties:
            last4:
              type: string
            network:
              type: string
            type:
              type: string
            issuer:
              type: string
            input_type:
              type: string
              enum:
              - razorpay_token
              - service_provider_token
              - raw
        created_at:
          type: integer
        wallet:
          type: object
          description: Amazon Pay wallet details. Required when account_type=wallet.
          properties:
            provider:
              type: string
              enum:
              - amazonpay
            phone:
              type: string
              description: 10-digit phone with country code, e.g. +919876543210
            email:
              type: string
              format: email
            name:
              type: string
              minLength: 4
              maxLength: 120
              description: 'Wallet holder name. Case-sensitive. Supported: a-z, A-Z, 0-9, space, '', -, _, /, (, ), .'
    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
  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.'