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

# POST Initiate PayIn Transaction (v2)

> Create a PayIn transaction. Returns payment_url, payment_information, or both depending on payment_method and request fields.

> [!NOTE]
>
> This is the **recommended** PayIn endpoint. The legacy v1 endpoint (`POST /api/v1/payin`) is [deprecated](https://docs.v2.topup.com.co/api-reference/payin/v1-deprecated.md).

Initialize a PayIn transaction using **API v2** (`POST /api/v2/payin`).

The response includes `payment_url`, `payment_information`, or both depending on the payment method and request fields. See [PayIn API](https://docs.v2.topup.com.co/api-reference/payin.md#payment-experiences) and [Colombia PayIn](https://docs.v2.topup.com.co/docs/co/payin.md) for method-specific examples (e.g. PSE checkout vs direct).

```bash theme={null}
curl --request POST 'https://api-empresas.uat.topup.com.co/production/api/v2/payin' \
--header 'Token-Top: your_auth_token' \
--header 'Authorization: Basic your_auth_key' \
--header 'Content-Type: application/json' \
--data-raw '{
    "reference": "3cNPNGbX7meiMppXzVz7g781ysektqq5X",
    "amount": 50000,
    "currency": "COP",
    "country": "CO",
    "payment_method": "ALL_METHODS",
    "description": "Test PayIn",
    "customer_data": {
        "legal_doc": "1234567890",
        "legal_doc_type": "CC",
        "phone_code": "57",
        "phone_number": "3121234567",
        "email": "customer@example.com",
        "full_name": "John Doe"
    },
    "expiration_time": 720,
    "ipn_url": "https://your-domain.com/webhook",
    "redirect_url": "https://your-domain.com/payment/success"
}'
```

```json theme={null}
{
    "code": "01",
    "status": "SUCCESS",
    "message": "Operacion exitosa",
    "data": {
        "ticket": "8BNsCFva1NKPqy2",
        "date": "2025-10-15 17:58:36",
        "payment_url": "https://link.uat.topup.com.co/payments/main?s=8BNsCFva1NKPqy2",
        "transaction": {
            "reference": "3cNPNGbX7meiMppXzVz7g781ysektqq5X",
            "amount": 50000,
            "currency": "COP",
            "payment_method": "ALL_METHODS",
            "redirect_url": "https://your-domain.com/payment/success",
            "ipn_url": "https://your-domain.com/webhook",
            "description": "Test PayIn"
        }
    }
}
```

## Required Headers

**Token-Top** `string` *required*

Your merchant authentication token

**Authorization** `string` *required*

Basic authentication key

**Content-Type** `string` *required*

Must be "application/json"

## Request Body Parameters

**reference** `string` *required*

Your unique transaction reference

**amount** `number` *required*

Transaction amount in the specified currency.

**currency** `string` *required*

Three-letter currency code (ISO 4217): `COP`, `PEN`, `MXN`, `GTQ`, or `HNL`.

**country** `string` *required*

Two-letter country code (ISO 3166-1 alpha-2): `CO`, `PE`, `MX`, `GT`, or `HN`. Must match the merchant country and currency.

**payment\_method** `string` *required*

Payment method. See [Country-Specific Information](https://docs.v2.topup.com.co/docs/introduction.md#country-specific-information) for available payment methods.

**description** `string` *required*

Transaction description or purpose.

**customer\_data** `object` *required*

**Customer data object**

**legal\_doc** `string` *required*

The customer's legal document number

**legal\_doc\_type** `string` *required*

The type of legal document provided. See [Country-Specific Information](https://docs.v2.topup.com.co/docs/introduction.md#country-specific-information) for available document types.

**phone\_code** `string` *required*

Country code for the customer's phone number (e.g., `57`, `51`)

**phone\_number** `string` *required*

The customer's phone number, excluding the country code

**email** `string` *required*

The customer's email address

**full\_name** `string` *required*

The customer's full name as it appears on official documents

**bank** `string`

PSE direct only — bank code from `GET /api/v1/pse/banks`. Required together with `person_type`.

**person\_type** `string`

PSE direct only — `NATURAL` or `JURIDICA`. Required together with `bank`.

**expiration\_time** `integer`

Payment link expiration time in minutes

**ipn\_url** `string`

URL for receiving webhook notifications

**redirect\_url** `string`

URL to redirect after payment completion

## Response

**ticket** `string`

Unique transaction identifier (TumiPay ticket)

**date** `string`

Transaction creation timestamp

**payment\_url** `string`

Hosted checkout URL when the method uses Checkout or Hybrid mode

**payment\_information** `object`

Provider payment data when the method uses Direct or Hybrid mode

**transaction** `object`

Echo of request metadata (reference, amount, currency, payment\_method, urls)


## OpenAPI

````yaml post /api/v2/payin
openapi: 3.0.0
info:
  title: PayIn API
  version: 2.0.0
  description: >-
    PayIn v2 is the recommended API. v1 is deprecated — migrate to POST
    /api/v2/payin for checkout, direct, and hybrid payment experiences.
servers:
  - url: https://api-empresas.uat.topup.com.co/production
    description: UAT server
security: []
paths:
  /api/v2/payin:
    post:
      tags:
        - PayIn
      summary: Initiate PayIn Transaction (v2)
      description: >-
        Create a PayIn transaction. Returns payment_url, payment_information, or
        both depending on payment_method and request fields.
      operationId: initiatePayInV2
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - reference
                - amount
                - currency
                - country
                - payment_method
                - description
                - customer_data
              properties:
                reference:
                  type: string
                amount:
                  type: number
                currency:
                  type: string
                  example: COP
                country:
                  type: string
                  description: ISO 3166-1 alpha-2 country code
                  example: CO
                  enum:
                    - CO
                    - PE
                    - MX
                    - GT
                    - HN
                payment_method:
                  type: string
                description:
                  type: string
                customer_data:
                  type: object
                  required:
                    - legal_doc
                    - legal_doc_type
                    - phone_code
                    - phone_number
                    - email
                    - full_name
                  properties:
                    legal_doc:
                      type: string
                    legal_doc_type:
                      type: string
                    phone_code:
                      type: string
                    phone_number:
                      type: string
                    email:
                      type: string
                      format: email
                    full_name:
                      type: string
                    bank:
                      type: string
                      description: PSE direct — bank code
                    person_type:
                      type: string
                      enum:
                        - NATURAL
                        - JURIDICA
                expiration_time:
                  type: integer
                ipn_url:
                  type: string
                  format: uri
                redirect_url:
                  type: string
                  format: uri
      responses:
        '200':
          description: Transaction created
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  status:
                    type: string
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      ticket:
                        type: string
                      date:
                        type: string
                      payment_url:
                        type: string
                      payment_information:
                        type: object
                      transaction:
                        type: object
        '422':
          description: Validation error
      security:
        - Token-Top: []
          BasicAuth: []
components:
  securitySchemes:
    Token-Top:
      type: apiKey
      name: Token-Top
      in: header
    BasicAuth:
      type: http
      scheme: basic

````

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