> ## 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 Payment

> Creates a payment that, in a single request, collects the funds from the user (pay-in) and sends them to a destination account (payout).

#### Request

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

#### Request Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| asset | string | Yes | Fiat currency (e.g. `COP`). |
| amount | number | Yes | Amount of the payment. |
| paymentMethod | string | Yes | Rail used to collect the funds (e.g. `PSE`, `BREB`). |
| bank | string | No | Bank `code` from **GET /admin/banks**. Required for `PSE`. |
| destinationId | uuid | No | Registered, `APPROVED` destination account. Send this or `accountExternalId`. |
| accountExternalId | string | No | External identifier of the destination account. |
| transactionPurpose | string | No | Description of the payment. |
| redirectUrl | string | No | Where the user returns after paying. |

#### Response

| Field | Description |
| --- | --- |
| id | Identifier of the payment. |
| status | Initial status (`PENDING`). |
| asset / amount | Amount of the payment. |
| paymentMethod | Rail used. |
| pseLink | Payment link for `PSE`. |
| brebKey / ownerName | Bre-B key and account holder to pay, for `BREB`. |



## OpenAPI

````yaml /stack/openapi.json post /api/v1/admin/fiats/{user_id}/payment
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/{user_id}/payment:
    post:
      tags:
        - Payments
      summary: Create Payment
      description: >-
        Creates a payment that, in a single request, collects the funds from the
        user (pay-in) and sends them to a destination account (payout).


        #### Request


        | Field | Type | Required | Description |

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

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

        | user_id | Path | Yes | User who pays. |


        #### Request Body


        | Field | Type | Required | Description |

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

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

        | amount | number | Yes | Amount of the payment. |

        | paymentMethod | string | Yes | Rail used to collect the funds (e.g.
        `PSE`, `BREB`). |

        | bank | string | No | Bank `code` from **GET /admin/banks**. Required
        for `PSE`. |

        | destinationId | uuid | No | Registered, `APPROVED` destination
        account. Send this or `accountExternalId`. |

        | accountExternalId | string | No | External identifier of the
        destination account. |

        | transactionPurpose | string | No | Description of the payment. |

        | redirectUrl | string | No | Where the user returns after paying. |


        #### Response


        | Field | Description |

        | --- | --- |

        | id | Identifier of the payment. |

        | status | Initial status (`PENDING`). |

        | asset / amount | Amount of the payment. |

        | paymentMethod | Rail used. |

        | pseLink | Payment link for `PSE`. |

        | brebKey / ownerName | Bre-B key and account holder to pay, for `BREB`.
        |
      operationId: create-payment
      parameters:
        - name: user_id
          in: path
          required: true
          description: ''
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                asset:
                  type: string
                amount:
                  type: integer
                paymentMethod:
                  type: string
                bank:
                  type: string
                destinationId:
                  type: string
                transactionPurpose:
                  type: string
            example:
              asset: COP
              amount: 400000
              paymentMethod: PSE
              bank: '{{pse_bank_code}}'
              destinationId: '{{destination_account_id}}'
              transactionPurpose: Cuota mensual
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  status:
                    type: string
                  paymentMethod:
                    type: string
                  asset:
                    type: string
                  amount:
                    type: integer
                  pseLink:
                    type: string
              examples:
                fiats-payment:
                  summary: fiats/payment
                  value:
                    id: 39cd20e4-a52a-48b1-9463-667b14cc9e5e
                    status: CASHININIT
                    paymentMethod: PSE
                    asset: COP
                    amount: 400000
                    pseLink: >-
                      https://registro.desarrollo.pse.com.co/PSENF/index.html?enc=cl6nXJFR92YL6Sj62YhibLe0COmiYV0boEbmUEwR%2bfI%3d
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Access token from POST /api/v1/client/token.

````