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

# Create Payout Sweep

> Sweeps the available fiat balances of all your users into a single payout to one destination account. One operation is created per source user, grouped under a `batchId`.

#### Request

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| Authorization | Header | Yes | `Bearer <access_token>` obtained from **POST /api/v1/client/token**. |

#### Request Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| amount | number | Yes | Total amount to sweep (> 0). |
| currency | string | Yes | Fiat currency (e.g. `COP`). |
| destinationId | uuid | Yes | Destination account. It must be active and in the same currency. |
| paymentMethod | string | No | `ACH` (default), `PSE`, `BANK` or `BREB`. |
| idempotencyKey | string | No | Unique value to safely retry; a repeated key returns the existing batch. |

#### Response (201)

| Field | Description |
| --- | --- |
| batchId | Identifier of the sweep. |
| status | `PENDING`. |
| currency / amount | Amount swept. |
| paymentMethod | Rail used. |
| destinationId | Destination account. |
| operationIds | Operations created, one per source user. |

#### Errors

| Status | When |
| --- | --- |
| 400 | Invalid request, unsupported rail, currency mismatch or not enough available balance. |
| 403 | The destination account is not active. |
| 404 | The destination account does not exist. |
| 502 | The payout provider returned an error. |



## OpenAPI

````yaml /stack/openapi.json post /api/v1/admin/fiats/payout/sweep
openapi: 3.1.0
info:
  title: Kravata Stack API
  version: '2.0'
  description: >-
    Kravata Stack API: users, accounts, custody wallets, liquidity ramps and
    fiat payments.
servers:
  - url: https://test-api-kore.kravata.co
    description: Test
  - url: https://partners-api.kravata.co
    description: Production (mTLS + IP allowlist)
security:
  - bearerAuth: []
tags:
  - name: Authentication
  - name: Users
  - name: Accounts
  - name: Earn
  - name: Custody
  - name: Liquidity Ramps
  - name: Payments
  - name: Webhooks
paths:
  /api/v1/admin/fiats/payout/sweep:
    post:
      tags:
        - Payments
      summary: Create Payout Sweep
      description: >-
        Sweeps the available fiat balances of all your users into a single
        payout to one destination account. One operation is created per source
        user, grouped under a `batchId`.


        #### Request


        | Field | Type | Required | Description |

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

        | Authorization | Header | Yes | `Bearer <access_token>` obtained from
        **POST /api/v1/client/token**. |


        #### Request Body


        | Field | Type | Required | Description |

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

        | amount | number | Yes | Total amount to sweep (> 0). |

        | currency | string | Yes | Fiat currency (e.g. `COP`). |

        | destinationId | uuid | Yes | Destination account. It must be active
        and in the same currency. |

        | paymentMethod | string | No | `ACH` (default), `PSE`, `BANK` or
        `BREB`. |

        | idempotencyKey | string | No | Unique value to safely retry; a
        repeated key returns the existing batch. |


        #### Response (201)


        | Field | Description |

        | --- | --- |

        | batchId | Identifier of the sweep. |

        | status | `PENDING`. |

        | currency / amount | Amount swept. |

        | paymentMethod | Rail used. |

        | destinationId | Destination account. |

        | operationIds | Operations created, one per source user. |


        #### Errors


        | Status | When |

        | --- | --- |

        | 400 | Invalid request, unsupported rail, currency mismatch or not
        enough available balance. |

        | 403 | The destination account is not active. |

        | 404 | The destination account does not exist. |

        | 502 | The payout provider returned an error. |
      operationId: create-payout-sweep
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: integer
                currency:
                  type: string
                destinationId:
                  type: string
                paymentMethod:
                  type: string
            example:
              amount: 150000
              currency: COP
              destinationId: '{{destination_account_id}}'
              paymentMethod: ACH
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  batchId:
                    type: string
                  status:
                    type: string
                  currency:
                    type: string
                  amount:
                    type: integer
                  paymentMethod:
                    type: string
                  destinationId:
                    type: string
                  operationIds:
                    type: array
                    items:
                      type: string
              examples:
                fiats-payout-sweep:
                  summary: fiats/payout/sweep
                  value:
                    batchId: 6cfcbf31-2fb6-464a-bece-6a36dabf63af
                    status: PENDING
                    currency: COP
                    amount: 150000
                    paymentMethod: ACH
                    destinationId: 07587d1d-2df0-4043-b6a0-6f974ea4d533
                    operationIds:
                      - e49a5de9-b59e-4018-90b7-68ffc65a3ca4
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Access token from POST /api/v1/client/token.

````