> ## 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 Pay-In

> Creates a pay-in to collect fiat from one of your users. For `PSE`, the response includes the `pseLink` the user must open to pay.

#### 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 |
| --- | --- | --- | --- |
| amount | number | Yes | Amount to collect. |
| currency | string | Yes | Fiat currency (`COP`). |
| paymentMethod | string | No | Rail used to collect (e.g. `PSE`, `NEQUI`, `DAVIPLATA`). |
| bank | string | No | Bank `code` from **GET /admin/banks**. Required for `PSE`. |
| redirectUrl | string | No | Where the user returns after paying. |
| phone | string | No | Phone number, for `NEQUI` / `DAVIPLATA`. |
| externalReference | string | No | Your own reference for reconciliation. |
| expirationDate | string | No | Expiration of the payment request. |

#### Response

| Field | Description |
| --- | --- |
| id | Identifier of the pay-in. |
| status | Initial status (`PENDING`). |
| currency / amount | Amount to collect. |
| paymentMethod | Rail used. |
| pseLink | Payment link for `PSE`. |
| externalReference | Your reference, if sent. |



## OpenAPI

````yaml /stack/openapi.json post /api/v1/admin/fiats/{user_id}/payin
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}/payin:
    post:
      tags:
        - Payments
      summary: Create Pay-In
      description: >-
        Creates a pay-in to collect fiat from one of your users. For `PSE`, the
        response includes the `pseLink` the user must open to pay.


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

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

        | amount | number | Yes | Amount to collect. |

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

        | paymentMethod | string | No | Rail used to collect (e.g. `PSE`,
        `NEQUI`, `DAVIPLATA`). |

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

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

        | phone | string | No | Phone number, for `NEQUI` / `DAVIPLATA`. |

        | externalReference | string | No | Your own reference for
        reconciliation. |

        | expirationDate | string | No | Expiration of the payment request. |


        #### Response


        | Field | Description |

        | --- | --- |

        | id | Identifier of the pay-in. |

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

        | currency / amount | Amount to collect. |

        | paymentMethod | Rail used. |

        | pseLink | Payment link for `PSE`. |

        | externalReference | Your reference, if sent. |
      operationId: create-pay-in
      parameters:
        - name: user_id
          in: path
          required: true
          description: ''
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: integer
                currency:
                  type: string
                bank:
                  type: string
                redirectUrl:
                  type: string
            example:
              amount: 100000
              currency: COP
              bank: '{{pse_bank_code}}'
              redirectUrl: https://app.kravata.co/
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  status:
                    type: string
                  currency:
                    type: string
                  amount:
                    type: integer
                  paymentMethod:
                    type: string
                  pseLink:
                    type: string
              examples:
                fiats-payin:
                  summary: fiats/payin
                  value:
                    id: 2a6777d2-a9d6-426d-b4e5-edd5124b613e
                    status: CASHININIT
                    currency: COP
                    amount: 100000
                    paymentMethod: PSE
                    pseLink: >-
                      https://registro.desarrollo.pse.com.co/PSENF/index.html?enc=lndJwmelhJEXv02LyLwiExk%2fJuRztgJmSlsbEKi04Ug%3d
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Access token from POST /api/v1/client/token.

````