> ## 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 (v1 — deprecated)

> Legacy PayIn endpoint. Always returns a hosted payment_url. Deprecated — use POST /api/v2/payin for new integrations.

> [!WARNING]
>
> **This endpoint is deprecated.** Use [`POST /api/v2/payin`](https://docs.v2.topup.com.co/api-reference/payin/post-initiate-transaction) for all new integrations. PayIn v2 supports checkout, direct, and hybrid payment experiences without separate backoffice configuration.

Initialize a PayIn transaction using the legacy **v1** API.

This version always returns a hosted **`payment_url`** for the customer to complete payment (traditional checkout). With the merchant **BackToBack** flag, some methods return a different B2B shape instead. Direct and hybrid flows without that flag are available only in [PayIn v2](https://docs.v2.topup.com.co/api-reference/payin.md).

```bash theme={null}
curl --request POST 'https://api-empresas.uat.topup.com.co/production/api/v1/payin' \
--header 'Token-Top: your_auth_token' \
--header 'Authorization: Basic your_auth_key' \
--header 'Content-Type: application/json' \
--data-raw '{
    "reference": "3cNPNGbX7meiMppXzVz7g781ysektqq5X",
    "amount": 5000,
    "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": 5000,
            "currency": "COP",
            "payment_method": "ALL_METHODS",
            "redirect_url": "https://your-domain.com/payment/success",
            "ipn_url": "https://your-domain.com/webhook",
            "description": "Test PayIn"
        }
    }
}
```

## Migration to v2

| v1 behavior | v2 equivalent |
| - | - |
| Hosted checkout (`payment_url`) | Same — use v2 without extra fields |
| Back-to-back PSE (backoffice flag) | Send `customer_data.bank` + `customer_data.person_type` with `payment_method: "PSE"` |
| Back-to-back SPEI (Mexico, merchant flag) | Send `payment_method: "SPEI"` — v2 returns hybrid `payment_url` + `payment_information` |
| Separate B2B configuration | Not required in v2 |

See [PayIn API (v2)](https://docs.v2.topup.com.co/api-reference/payin.md) and [Colombia PayIn](https://docs.v2.topup.com.co/docs/co/payin.md) for method-specific v2 examples.

## 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), e.g. `COP`, `PEN`, `MXN`.

**country** `string` *required*

Two-letter country code (ISO 3166-1 alpha-2), e.g. `CO`, `PE`, `MX`.

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

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

**description** `string` *required*

Transaction description or purpose.

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

Customer identification and contact details (`legal_doc`, `legal_doc_type`, `phone_code`, `phone_number`, `email`, `full_name`).

**expiration\_time** `integer`

Payment link expiration time in minutes

**ipn\_url** `string` *required*

URL for receiving webhook notifications

**redirect\_url** `string` *required*

URL to redirect after payment completion

## Response

**ticket** `string`

Unique transaction identifier

**payment\_url** `string`

Hosted checkout URL to redirect the customer

**transaction** `object`

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


## OpenAPI

````yaml post /api/v1/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/v1/payin:
    post:
      tags:
        - PayIn
      summary: Initiate PayIn Transaction (v1 — deprecated)
      description: >-
        Legacy PayIn endpoint. Always returns a hosted payment_url. Deprecated —
        use POST /api/v2/payin for new integrations.
      operationId: initiatePayInV1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - reference
                - amount
                - currency
                - country
                - payment_method
                - description
                - customer_data
                - ipn_url
                - redirect_url
              properties:
                reference:
                  type: string
                amount:
                  type: number
                currency:
                  type: string
                  example: COP
                country:
                  type: string
                  example: CO
                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
                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
                      transaction:
                        type: object
        '422':
          description: Validation error
      deprecated: true
      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.