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

# Recharge Request

> Use this API to recharge a mobile number or a direct-to-home (DTH) connection. Send your own unique `reference_id` with every recharge. The API uses it to recognise a recharge that you send again.

In the sandbox environment, you can test with any valid recharge number.

The API returns HTTP 200 for every recharge that it accepts, so read `data.status`:

- `SUCCESS`: The recharge is done. `data.operator_ref` holds the operator's reference when the operator gives one.
- `FAILED`: The recharge did not go through. `data.failure_reason` says why.
- `PROCESSING`: The recharge is still in progress. Do not send it again as a new recharge. Use the [Fetch Recharge Status API](/api-reference/other-apis/recharge-cou/recharge/fetch-recharge-status) with the same `reference_id` to get the final result. You are also notified through the [`RECHARGE_STATUS` webhook](/api-reference/other-apis/bbps-cou/webhooks#recharge_status) when a recharge that was in progress is finalised.

## Recharge funding

The recharge is always paid from your recharge wallet. What you send in `payments` tells the API how the customer paid. For what prefunding and postfunding mean, see [Payment Scenarios](/api-reference/other-apis/bbps-cou/payment-scenarios). The shortfall limit is the maximum amount by which your recharge wallet can go below zero. A recharge that would take the wallet past this limit cannot go through.

The following table shows what the wallet pays in each case:

| Account | With `payments` | Without `payments` |
|---|---|---|
| **Prefunding** | The wallet pays the full `amount`. | The wallet pays the full `amount`. |
| **Postfunding** | The wallet pays the `amount` less `payments[].pg_amount`. The customer's payment goes toward the recharge. | The wallet pays the full `amount`. |

Leave out `payments` when the customer paid another way. Nothing is verified in that case.

When you send `payments`, the Cashfree Payment Gateway payment is verified before the recharge starts. The payment must be successful, must belong to your account, and `pg_amount` must equal the amount captured for the payment less any vendor splits on its order. A payment backs one recharge. If the recharge fails, the customer's payment is refunded.

## Duplicate requests

The following rules apply when you send a recharge with a `reference_id` that you have used before:

- **Same `reference_id`, same details**: The API returns the recharge that it already has, with its current status. It does not create a second recharge. A recharge that you send with a new `reference_id` is a new recharge. To check the result of a recharge, use the Fetch Recharge Status API with its `reference_id`.
- **What counts as the same details**: The same `recharge_number`, `operator`, `amount`, `service_type`, and `payments`. `circle` is not compared.
- **Same `reference_id`, different details**: The API returns a 409 error.
- **A recharge that is `FAILED`**: It stays failed for that `reference_id`.

## Error codes

The following table lists the error codes you may encounter when requesting a recharge:

> [accordion] Error codes
>
> | Code | Description | Type | Status |
> | :- | :- | :- | :- |
> | `request_failed` | The `amount` is not a whole rupee amount greater than 0. Message: `amount must be a whole rupee amount greater than 0` | `invalid_request_error` | 400 |
> | `request_failed` | The `recharge_number` is not a valid Indian mobile number. Message: `recharge_number is not a valid indian mobile number` | `invalid_request_error` | 400 |
> | `request_failed` | Required fields are missing from the request. Message: `amount must not be null, operator must not be blank, recharge_number must not be blank, reference_id must not be blank, service_type must not be blank` | `invalid_request_error` | 400 |
> | `request_failed` | The payment in `payments` cannot be used for this recharge. Message: `payments[0].pg_reference_id is invalid: PG transaction is not successful` | `invalid_request_error` | 400 |
> | `request_failed` | The `x-client-id` or `x-client-secret` is missing or incorrect. Message: `authentication Failed` | `authentication_error` | 401 |
> | `request_failed` | Your account is not set up for recharges, or its recharge access is switched off. Message: `Recharge is not enabled for this account` | `invalid_request_error` | 403 |
> | `request_failed` | The `reference_id` was already used for a different recharge. Message: `reference_id was already used for a different recharge` | `invalid_request_error` | 409 |
> | `request_failed` | The payment is already linked to another recharge. Message: `PG payment already backs another recharge` | `invalid_request_error` | 409 |
> | `request_failed` | You sent too many requests in a short time. Message: `Too many requests from IP. Check headers` | `rate_limit_error` | 429 |
> | `internal_error` | An unexpected error occurred at Cashfree. Message: `internal Server Error` | `api_error` | 500 |
> | `request_failed` | The payment could not be verified right now. Message: `The PG payment could not be verified right now, please retry with the same reference_id` | `api_error` | 503 |


## OpenAPI

````yaml openapi/bbps/recharge-cou.yaml post /bbps/cou/v1/recharge/request
openapi: 3.0.3
info:
  title: Telecom Recharge for Customers (Customer Operating Unit)
  version: 1.0.0
  description: >
    APIs for Agent Institutions to offer mobile and direct-to-home (DTH)
    recharges to their customers as a Customer Operating Unit (COU). These APIs
    enable operator discovery, plan listing, recharge validation, recharge
    requests, and recharge status checks.
servers:
  - url: https://sandbox.cashfree.com
    description: Sandbox (Testing) environment.
  - url: https://api.cashfree.com
    description: Production environment.
security:
  - XClientID: []
    XClientSecret: []
paths:
  /bbps/cou/v1/recharge/request:
    post:
      tags:
        - Recharge
      summary: Recharge Request
      description: >-
        Use this API to recharge a mobile number or a direct-to-home (DTH)
        connection. Send your own unique `reference_id` with every recharge. The
        API uses it to recognise a recharge that you send again.


        In the sandbox environment, you can test with any valid recharge number.


        The API returns HTTP 200 for every recharge that it accepts, so read
        `data.status`:


        - `SUCCESS`: The recharge is done. `data.operator_ref` holds the
        operator's reference when the operator gives one.

        - `FAILED`: The recharge did not go through. `data.failure_reason` says
        why.

        - `PROCESSING`: The recharge is still in progress. Do not send it again
        as a new recharge. Use the [Fetch Recharge Status
        API](/api-reference/other-apis/recharge-cou/recharge/fetch-recharge-status)
        with the same `reference_id` to get the final result. You are also
        notified through the [`RECHARGE_STATUS`
        webhook](/api-reference/other-apis/bbps-cou/webhooks#recharge_status)
        when a recharge that was in progress is finalised.


        ## Recharge funding


        The recharge is always paid from your recharge wallet. What you send in
        `payments` tells the API how the customer paid. For what prefunding and
        postfunding mean, see [Payment
        Scenarios](/api-reference/other-apis/bbps-cou/payment-scenarios). The
        shortfall limit is the maximum amount by which your recharge wallet can
        go below zero. A recharge that would take the wallet past this limit
        cannot go through.


        The following table shows what the wallet pays in each case:


        | Account | With `payments` | Without `payments` |

        |---|---|---|

        | **Prefunding** | The wallet pays the full `amount`. | The wallet pays
        the full `amount`. |

        | **Postfunding** | The wallet pays the `amount` less
        `payments[].pg_amount`. The customer's payment goes toward the recharge.
        | The wallet pays the full `amount`. |


        Leave out `payments` when the customer paid another way. Nothing is
        verified in that case.


        When you send `payments`, the Cashfree Payment Gateway payment is
        verified before the recharge starts. The payment must be successful,
        must belong to your account, and `pg_amount` must equal the amount
        captured for the payment less any vendor splits on its order. A payment
        backs one recharge. If the recharge fails, the customer's payment is
        refunded.


        ## Duplicate requests


        The following rules apply when you send a recharge with a `reference_id`
        that you have used before:


        - **Same `reference_id`, same details**: The API returns the recharge
        that it already has, with its current status. It does not create a
        second recharge. A recharge that you send with a new `reference_id` is a
        new recharge. To check the result of a recharge, use the Fetch Recharge
        Status API with its `reference_id`.

        - **What counts as the same details**: The same `recharge_number`,
        `operator`, `amount`, `service_type`, and `payments`. `circle` is not
        compared.

        - **Same `reference_id`, different details**: The API returns a 409
        error.

        - **A recharge that is `FAILED`**: It stays failed for that
        `reference_id`.
      operationId: requestRecharge
      parameters:
        - in: header
          name: x-api-version
          required: false
          description: >
            API version to be used. Format is YYYY-MM-DD. The only supported
            version for this API is `2025-01-01`. If not specified, `2025-01-01`
            is used.
          schema:
            type: string
            default: '2025-01-01'
            enum:
              - '2025-01-01'
          example: '2025-01-01'
      requestBody:
        description: The recharge to send.
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - reference_id
                - recharge_number
                - operator
                - amount
                - service_type
              properties:
                reference_id:
                  type: string
                  maxLength: 50
                  description: >-
                    Your unique ID for this recharge. Use a new value for every
                    new recharge.
                  example: recharge_ref_001
                recharge_number:
                  type: string
                  maxLength: 20
                  description: >-
                    The mobile number or DTH customer ID to recharge. A mobile
                    number must be a valid Indian mobile number.
                  example: '9876543210'
                operator:
                  type: string
                  maxLength: 50
                  description: >-
                    The operator code, from the Fetch Operators or Fetch
                    Operator Details API.
                  example: JIO
                circle:
                  type: string
                  maxLength: 50
                  description: >-
                    The telecom circle of the number, as returned by the Fetch
                    Operator Details API, for example `Delhi`. It is optional
                    and is not case-sensitive.
                  example: Delhi
                amount:
                  type: number
                  description: >-
                    The recharge amount in rupees. It must be a whole rupee
                    amount greater than 0.
                  example: 299
                service_type:
                  type: string
                  description: The type of recharge.
                  enum:
                    - MOBILE
                    - DTH
                  example: MOBILE
                payments:
                  type: array
                  maxItems: 1
                  description: >-
                    How the customer paid. Send it when the customer paid
                    through Cashfree Payment Gateway. Leave it out when the
                    customer paid another way.
                  items:
                    type: object
                    required:
                      - source
                      - pg_reference_id
                      - pg_amount
                    properties:
                      source:
                        type: string
                        description: The payment source.
                        enum:
                          - CASHFREE_PG
                        example: CASHFREE_PG
                      pg_reference_id:
                        type: string
                        maxLength: 64
                        description: >-
                          The Cashfree Payment Gateway transaction ID of the
                          payment.
                        example: '555001'
                      pg_amount:
                        type: number
                        description: >-
                          The part of the recharge that the customer paid
                          through Cashfree Payment Gateway. It must be greater
                          than 0, have at most 2 decimal places, not be more
                          than `amount`, and equal the amount captured for the
                          payment less any vendor splits on its order.
                        example: 200
            examples:
              without_payment:
                summary: Customer paid another way
                value:
                  reference_id: recharge_ref_001
                  recharge_number: '9876543210'
                  operator: JIO
                  circle: Delhi
                  amount: 299
                  service_type: MOBILE
              with_payment:
                summary: Customer paid through Cashfree Payment Gateway
                value:
                  reference_id: recharge_ref_002
                  recharge_number: '9876543210'
                  operator: JIO
                  circle: Delhi
                  amount: 299
                  service_type: MOBILE
                  payments:
                    - source: CASHFREE_PG
                      pg_reference_id: '555001'
                      pg_amount: 200
      responses:
        '200':
          description: The recharge was accepted. Read `data.status` for its state.
          headers:
            x-api-version:
              $ref: '#/components/headers/x-api-version'
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: >-
                      The status of the API call. Returns `OK` whenever the
                      request is processed, whatever the state of the recharge.
                    example: OK
                  message:
                    type: string
                    description: A message describing the result.
                    example: Recharge request processed
                  data:
                    type: object
                    description: The recharge and its current state.
                    properties:
                      recharge_ref_id:
                        type: string
                        description: The Cashfree ID of the recharge.
                        example: RCH1732450001
                      reference_id:
                        type: string
                        description: The `reference_id` that you sent.
                        example: recharge_ref_001
                      status:
                        type: string
                        description: The state of the recharge.
                        enum:
                          - SUCCESS
                          - FAILED
                          - PROCESSING
                        example: SUCCESS
                      recharge_number:
                        type: string
                        description: The number that was recharged.
                        example: '9876543210'
                      operator:
                        type: string
                        description: The operator code.
                        example: JIO
                      amount:
                        type: number
                        description: The recharge amount, with 2 decimal places.
                        example: 299
                      operator_ref:
                        type: string
                        nullable: true
                        description: >-
                          The operator's reference for the recharge. `null` when
                          the operator has not given one.
                        example: JIO24112400123
                      failure_reason:
                        type: string
                        nullable: true
                        description: >-
                          Why the recharge failed, as free text. The value
                          depends on the cause, so do not match on it. Returned
                          only when the status is `FAILED`, and `null`
                          otherwise.
                        example: null
              examples:
                success:
                  summary: Recharge done
                  value:
                    status: OK
                    message: Recharge request processed
                    data:
                      recharge_ref_id: RCH1732450001
                      reference_id: recharge_ref_001
                      status: SUCCESS
                      recharge_number: '9876543210'
                      operator: JIO
                      amount: 299
                      operator_ref: JIO24112400123
                      failure_reason: null
                processing:
                  summary: Recharge in progress
                  value:
                    status: OK
                    message: Recharge request processed
                    data:
                      recharge_ref_id: RCH1732450001
                      reference_id: recharge_ref_001
                      status: PROCESSING
                      recharge_number: '9876543210'
                      operator: JIO
                      amount: 299
                      operator_ref: null
                      failure_reason: null
                failed:
                  summary: Recharge failed
                  value:
                    status: OK
                    message: Recharge request processed
                    data:
                      recharge_ref_id: RCH1732450001
                      reference_id: recharge_ref_001
                      status: FAILED
                      recharge_number: '9876543210'
                      operator: JIO
                      amount: 299
                      operator_ref: null
                      failure_reason: Recharge could not be processed
        '400':
          description: Bad request error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_amount:
                  summary: Amount is not a whole rupee amount
                  value:
                    message: amount must be a whole rupee amount greater than 0
                    code: request_failed
                    type: invalid_request_error
                invalid_mobile_number:
                  summary: Not a valid Indian mobile number
                  value:
                    message: recharge_number is not a valid indian mobile number
                    code: request_failed
                    type: invalid_request_error
                missing_fields:
                  summary: Required fields are missing
                  value:
                    message: >-
                      amount must not be null, operator must not be blank,
                      recharge_number must not be blank, reference_id must not
                      be blank, service_type must not be blank
                    code: request_failed
                    type: invalid_request_error
                pg_payment_not_successful:
                  summary: The payment cannot be used
                  value:
                    message: >-
                      payments[0].pg_reference_id is invalid: PG transaction is
                      not successful
                    code: request_failed
                    type: invalid_request_error
        '401':
          description: Authentication Error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
        '403':
          description: >-
            Your account is not set up for recharges, or its recharge access is
            switched off.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                institution_not_found:
                  summary: Recharge is not set up for your account
                  value:
                    message: Recharge is not enabled for this account
                    code: request_failed
                    type: invalid_request_error
        '409':
          description: >-
            The `reference_id` or the payment is already used for a different
            recharge.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                reference_id_conflict:
                  summary: The reference_id was used for a different recharge
                  value:
                    message: reference_id was already used for a different recharge
                    code: request_failed
                    type: invalid_request_error
                payment_in_use:
                  summary: The payment backs another recharge
                  value:
                    message: PG payment already backs another recharge
                    code: request_failed
                    type: invalid_request_error
        '429':
          description: Rate Limit Error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitResponse'
        '500':
          description: Internal Server Error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
        '503':
          description: The payment could not be verified right now.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                payment_unavailable:
                  summary: The payment could not be verified
                  value:
                    message: >-
                      The PG payment could not be verified right now, please
                      retry with the same reference_id
                    code: request_failed
                    type: api_error
      x-codeSamples:
        - lang: cURL
          label: Without payment
          source: |-
            curl --request POST \
              --url https://sandbox.cashfree.com/bbps/cou/v1/recharge/request \
              --header 'Content-Type: application/json' \
              --header 'x-api-version: 2025-01-01' \
              --header 'x-client-id: <api-key>' \
              --header 'x-client-secret: <api-key>' \
              --data '{
                "reference_id": "recharge_ref_001",
                "recharge_number": "9876543210",
                "operator": "JIO",
                "circle": "Delhi",
                "amount": 299,
                "service_type": "MOBILE"
              }'
        - lang: cURL
          label: With a Cashfree Payment Gateway payment
          source: |-
            curl --request POST \
              --url https://sandbox.cashfree.com/bbps/cou/v1/recharge/request \
              --header 'Content-Type: application/json' \
              --header 'x-api-version: 2025-01-01' \
              --header 'x-client-id: <api-key>' \
              --header 'x-client-secret: <api-key>' \
              --data '{
                "reference_id": "recharge_ref_002",
                "recharge_number": "9876543210",
                "operator": "JIO",
                "circle": "Delhi",
                "amount": 299,
                "service_type": "MOBILE",
                "payments": [
                  {
                    "source": "CASHFREE_PG",
                    "pg_reference_id": "555001",
                    "pg_amount": 200
                  }
                ]
              }'
components:
  headers:
    x-api-version:
      schema:
        type: string
        format: YYYY-MM-DD
        enum:
          - '2025-01-01'
      description: >-
        The API version used to process this request, echoed back in the
        response.
  schemas:
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: A description of the error explaining what went wrong.
        code:
          type: string
          description: >-
            An error code for the failure. Use the HTTP status code and the
            `message` to decide how to handle an error.
        type:
          type: string
          description: The category of the error indicating the class of failure.
    UnauthorizedResponse:
      type: object
      properties:
        message:
          type: string
          description: A description of the error explaining what went wrong.
          example: authentication Failed
        code:
          type: string
          description: >-
            An error code identifying the specific failure. Use this to handle
            errors programmatically.
          example: request_failed
        type:
          type: string
          description: The category of the error indicating the class of failure.
          example: authentication_error
    RateLimitResponse:
      type: object
      properties:
        message:
          type: string
          description: A description of the error explaining what went wrong.
          example: Too many requests from IP. Check headers
        code:
          type: string
          description: >-
            An error code identifying the specific failure. Use this to handle
            errors programmatically.
          example: request_failed
        type:
          type: string
          description: The category of the error indicating the class of failure.
          example: rate_limit_error
    InternalServerErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: A description of the error explaining what went wrong.
          example: internal Server Error
        code:
          type: string
          description: >-
            An error code identifying the specific failure. Use this to handle
            errors programmatically.
          example: internal_error
        type:
          type: string
          description: The category of the error indicating the class of failure.
          example: api_error
  securitySchemes:
    XClientID:
      type: apiKey
      in: header
      name: x-client-id
      description: >-
        Your unique client identifier issued by Cashfree. You can find this in
        your [Merchant
        Dashboard](https://merchant.cashfree.com/verificationsuite/developers/api-keys).
    XClientSecret:
      type: apiKey
      in: header
      name: x-client-secret
      description: >-
        Your unique client secret issued by Cashfree. Keep this confidential and
        never expose it in client-side code. You can find this in your [Merchant
        Dashboard](https://merchant.cashfree.com/verificationsuite/developers/api-keys).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.