> ## Documentation Index
> Fetch the complete documentation index at: https://razorpay-881012b3.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch All Instant Settlements With Payout Details

> Fetch All Instant Settlements with Payout Details using Razorpay Payments API.

<div style={{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"0.35rem 0.9rem",border:"1px solid rgba(128,128,128,0.28)",borderRadius:"0.5rem",padding:"0.45rem 0.75rem",margin:"0 0 1.25rem",fontSize:"0.875rem"}}>
  <span style={{fontWeight:600}}>Available in</span>
  <span>🇮🇳 India</span>
  <span>🇸🇬 Singapore</span>
  <span>🇺🇸 United States</span>
</div>

Use this endpoint to retrieve payout details as part of the response for all instant settlements.

<RequestExample>
  ```bash Curl theme={null}
  curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET]\
  - X GET \
  https://api.razorpay.com/v1/settlements/ondemand?expand[]=ondemand_payouts
  ```

  ```java Java theme={null}
  RazorpayClient razorpay = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");

  JSONObject option = new JSONObject();
  option("expand[], "ondemand_payouts");

  List<Settlement> settlement = instance.settlement.fetchAllDemand(options);
  ```

  ```ruby Ruby theme={null}
  require "razorpay"
  Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET')

  para_attr = {"expand[]": "ondemand_payouts"}

  Razorpay::Settlement.fetch_all_ondemand_settlement(para_attr)
  ```

  ```php PHP theme={null}
  $api = new Api($key_id, $secret);

  $api->settlement->fetchAllOndemandSettlement(["expand[]"=> "ondemand_payouts"]);
  ```

  ```javascript Node.js theme={null}
  var instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' })

  options = {"expand[]": "ondemand_payouts"}

  instance.settlements.fetchAllOndemandSettlement(options)
  ```

  ```python Python theme={null}
  import razorpay
  client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET"))

  param = {
   "expand[]": "ondemand_payouts"
  }

  client.settlement.fetch_all_ondemand_settlement(options)
  ```

  ```go Go theme={null}
  import ( razorpay "github.com/razorpay/razorpay-go" )
  client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET")

  param:= map[string]interface{}{
   "expand[]": "ondemand_payouts",
  }

  body, err := client.Settlement.FetchAllOnDemandSettlement(param, nil)
  ```

  ```csharp .NET theme={null}
  RazorpayClient client = new RazorpayClient(your_key_id, your_secret);

  Dictionary<string, object> settlementRequest = new Dictionary<string, object>();
  settlementRequest.Add("expand[]", "ondemand_payouts");

  List<Settlement> settlement = client.Settlement.FetchAllDemand(settlementRequest);
  ```

  ```bash CLI theme={null}
  razorpay settlements instant-list --expand ondemand_payouts
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "entity": "collection",
    "count": 2,
    "items": [
      {
        "id": "setlod_FNj7g2YS5J67Rz",
        "entity": "settlement.ondemand",
        "amount_requested": 200000,
        "amount_settled": 199410,
        "amount_pending": 0,
        "amount_reversed": 0,
        "fees": 590,
        "tax": 90,
        "currency": "INR",
        "settle_full_balance": false,
        "status": "processed",
        "description": "Need this to make vendor payments.",
        "notes": {
          "notes_key_1": "Tea, Earl Grey, Hot",
          "notes_key_2": "Tea, Earl Grey, decaf."
        },
        "created_at": 1596771429,
        "ondemand_payouts": {
          "entity": "collection",
          "count": 1,
          "items": [
            {
              "id": "setlodp_FNj7g2cbvw8ueO",
              "entity": "settlement.ondemand_payout",
              "initiated_at": 1596771430,
              "processed_at": 1596778752,
              "reversed_at": null,
              "amount": 200000,
              "amount_settled": 199410,
              "fees": 590,
              "tax": 90,
              "utr": "022011173948",
              "status": "processed",
              "created_at": 1596771429
            }
          ]
        }
      },
      {
        "id": "setlod_FJOp0jOWlalIvt",
        "entity": "settlement.ondemand",
        "amount_requested": 300000,
        "amount_settled": 299114,
        "amount_pending": 0,
        "amount_reversed": 0,
        "fees": 886,
        "tax": 136,
        "currency": "INR",
        "settle_full_balance": false,
        "status": "processed",
        "description": "Need this to buy stock.",
        "notes": {
          "notes_key_1": "Tea, Earl Grey, Hot",
          "notes_key_2": "Tea, Earl Grey, decaf."
        },
        "created_at": 1595826576,
        "ondemand_payouts": {
          "entity": "collection",
          "count": 1,
          "items": [
            {
              "id": "setlodp_FJOp0jTqoZdGen",
              "entity": "settlement.ondemand_payout",
              "initiated_at": 1595826577,
              "processed_at": 1595826588,
              "reversed_at": null,
              "amount": 300000,
              "amount_settled": 299114,
              "fees": 886,
              "tax": 136,
              "utr": "020910199316",
              "status": "processed",
              "created_at": 1595826576
            }
          ]
        }
      }
    ]
  }
  ```

  ```json Failure theme={null}
  {
    "error": {
      "code": "BAD_REQUEST_ERROR",
      "description": "The api key provided is invalid",
      "source": "NA",
      "step": "NA",
      "reason": "NA",
      "metadata": {}
    }
  }
  ```
</ResponseExample>

## Query Parameters

<ParamField query="expand[]=ondemand_payouts" type="string">
  Pass this if you want to fetch payout details as part of the response for all instant settlements.
</ParamField>

<ParamField query="from" type="integer">
  Unix timestamp (in seconds) from when instant settlements are to be retrieved.
</ParamField>

<ParamField query="to" type="integer">
  Unix timestamp (in seconds) till when instant settlements are to be retrieved.
</ParamField>

<ParamField query="count" type="integer">
  Number of instant settlement records to be retrieved.

  * Default value: `10`.
  * Possible values: `1` to `100`.
  * This can be used for pagination, in combination with `skip`.
</ParamField>

<ParamField query="skip" type="integer">
  Number of instant settlement records to be skipped.

  * Default value: `0`.
  * This can be used for pagination, in combination with `count`.
</ParamField>

## Response Parameters

<ResponseField name="id" type="string">
  The unique identifier of the instant settlement transaction. For example, `setlod_FNj7g2YS5J67Rz`.
</ResponseField>

<ResponseField name="entity" type="string">
  Indicates the type of entity. Here it is `settlement.ondemand`.
</ResponseField>

<ResponseField name="amount_requested" type="integer">
  The settlement amount, in paise, requested by you. For example, `200000`.
</ResponseField>

<ResponseField name="amount_settled" type="integer">
  Total amount (minus fees and tax), in paise, settled to the bank account. For example, `199410`.
</ResponseField>

<ResponseField name="amount_pending" type="integer">
  Portion of the requested amount, in paise, yet to be settled to you.
</ResponseField>

<ResponseField name="amount_reversed" type="integer">
  Portion of the requested amount, in paise, that was not settled to you. This amount is reversed to your PG current balance.
</ResponseField>

<ResponseField name="fees" type="integer">
  Total amount (fees+tax), in paise, deducted for the instant settlement. For example, `590`.
</ResponseField>

<ResponseField name="tax" type="integer">
  Total tax, in paise, charged for the fee component. For example, `90`.
</ResponseField>

<ResponseField name="currency" type="string">
  The 3-letter ISO currency code for the settlement. Here it is `INR`.
</ResponseField>

<ResponseField name="settle_full_balance" type="boolean">
  Possible values:

  * `true`:  Razorpay will settle the maximum amount possible. Values passed in the `amount` parameter are ignored.
  * `false` (default): Razorpay will settle the amount requested in the `amount` parameter.
</ResponseField>

<ResponseField name="status" type="string">
  Indicates the state of the instant settlement. Possible values:

  * `created`: The instant settlement request has been created.
  * `initiated`: The instant settlement process has been initiated.
  * `partially_processed`: The instant settlement is being processed.
  * `processed`: The instant settlement has been processed and the amount has been transferred to your bank account.
  * `reversed`: The instant settlement could not be processed for some reason and the amount has been transferred back to your PG balance.
</ResponseField>

<ResponseField name="description" type="string">
  This is a custom note you can pass for the instant settlement for your reference. For example, `Need this to make vendor payments.`.
</ResponseField>

<ResponseField name="notes" type="object">
  Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, `"note_key": "Beam me up Scotty”`.
</ResponseField>

<ResponseField name="created_at" type="integer">
  Unix timestamp at which the instant settlement was created. For example, `1596771429`.
</ResponseField>

<ResponseField name="ondemand_payouts" type="object">
  List of payouts created for the instant settlement.
</ResponseField>

<ResponseField name="entity" type="string">
  Indicates the type of `ondemand_payouts` entity. Here it is `collection`.
</ResponseField>

<ResponseField name="count" type="integer">
  The number of items in the array. For example, `1`.
</ResponseField>

<ResponseField name="items" type="array">
  List of payouts created for the instant settlement.
</ResponseField>

<ResponseField name="id" type="string">
  The unique identifier for the payout. For example, `setlodp_FNj7g2cbvw8ueO`.
</ResponseField>

<ResponseField name="entity" type="string">
  Indicates the type of `items` entity. Here it is `settlement.ondemand_payout`.
</ResponseField>

<ResponseField name="initiated_at" type="integer">
  Unix timestamp at which the payout was initiated. For example, `1596771430`.
</ResponseField>

<ResponseField name="processed_at" type="integer">
  Unix timestamp at which the payout was processed. For example, `1596778752`.
</ResponseField>

<ResponseField name="reversed_at" type="integer">
  Unix timestamp at which the payout was reversed. For example, `1596778752`.
</ResponseField>

<ResponseField name="amount" type="integer">
  The amount, in paise, settled through this payout. For example, `200000`.
</ResponseField>

<ResponseField name="amount_settled" type="integer">
  Amount (minus fees and tax), in paise, settled through this payout. For example, `199410`.
</ResponseField>

<ResponseField name="fees" type="integer">
  Amount (fees+tax), in paise, deducted for this payout. For example, `590`.
</ResponseField>

<ResponseField name="tax" type="integer">
  Tax charged, in paise, for the fee component. For example, `90`.
</ResponseField>

<ResponseField name="utr" type="string">
  The unique transaction number linked to a payout.
</ResponseField>

<ResponseField name="status" type="string">
  Status of the payout. Possible values:

  * `created`: The payout has been created.
  * `initiated`: The payout has been initiated.
  * `processed`: The payout has been processed. The amount has been transferred to your bank account.
  * `reversed`: The payout has been reversed. The amount has been transferred back to your PG balance.
</ResponseField>

<ResponseField name="created_at" type="integer">
  Unix timestamp at which the payout was created.
</ResponseField>

## Errors

<AccordionGroup>
  <Accordion title="The API {key/secret} provided is invalid.">
    **Code:** `4xx`

    The API credentials passed in the API call differ from the ones generated on the Dashboard.

    **Solution:** The API keys must be active and entered correctly with no whitespace before or after.
  </Accordion>

  <Accordion title="The requested URL was not found on the server.">
    **Code:** `400`

    Instant Settlement is not enabled on the merchant account, so the endpoint is not routable.

    **Solution:** Enable Instant Settlements from the Razorpay Dashboard before calling this API.
  </Accordion>

  <Accordion title="The count may not be greater than 100.">
    **Code:** `400`

    The `count` query parameter exceeds the maximum allowed value of 100.

    **Solution:** Pass a `count` value of 100 or fewer.
  </Accordion>

  <Accordion title="The expand array must contain 'ondemand_payouts'.">
    **Code:** `400`

    The `expand[]` parameter contains an invalid value.

    **Solution:** Pass `expand[]=ondemand_payouts` as the only supported expand option for this endpoint.
  </Accordion>

  <Accordion title="The from must be an integer.">
    **Code:** `400`

    The `from` query parameter was passed as a non-integer value.

    **Solution:** Pass `from` as a Unix timestamp in seconds (integer).
  </Accordion>

  <Accordion title="The from must be between 946684800 and 4765046400.">
    **Code:** `400`

    The `from` value is outside the allowed Unix-timestamp range (1 Jan 2000 to 31 Dec 2120).

    **Solution:** Pass a `from` value within the supported range, in seconds since epoch.
  </Accordion>

  <Accordion title="The to must be an integer.">
    **Code:** `400`

    The `to` query parameter was passed as a non-integer value.

    **Solution:** Pass `to` as a Unix timestamp in seconds (integer).
  </Accordion>

  <Accordion title="The to must be between 946684800 and 4765046400.">
    **Code:** `400`

    The `to` value is outside the allowed Unix-timestamp range (1 Jan 2000 to 31 Dec 2120).

    **Solution:** Pass a `to` value within the supported range, in seconds since epoch.
  </Accordion>

  <Accordion title="The skip must be an integer.">
    **Code:** `400`

    The `skip` query parameter was passed as a non-integer value.

    **Solution:** Pass `skip` as a non-negative integer indicating the number of records to skip.
  </Accordion>
</AccordionGroup>
