> ## Documentation Index
> Fetch the complete documentation index at: https://developer.pagou.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Checkout Link

> Create a hosted checkout link from products (upserted by external_id) or a value-only amount.

Send either `products[]` (each referenced by your own `external_id`) or a value-only `amount` — not
both. Products are upserted by `external_id`, so re-sending the same id updates the product instead
of duplicating it. The response is the final checkout `url`.

For the full integration guide, value-only links, and AI prompts, see
[Create Checkout Links](/payments/checkout-links/create).


## OpenAPI

````yaml api-reference/openapi-v2.json POST /v2/checkout-links
openapi: 3.1.0
info:
  title: API PIX - v2
  description: API for Pagou.ai Gateway
  version: 2.0.0
  contact:
    name: Support
    url: https://pagou.ai
    email: support@pagou.ai
servers:
  - url: https://api.pagou.ai
    description: Production server
  - url: https://api.sandbox.pagou.ai
    description: Sandbox server for testing
security:
  - BearerAuth: []
  - ApiKeyAuth: []
  - BasicAuth: []
paths:
  /v2/checkout-links:
    post:
      tags:
        - API - Checkout Links
      summary: Create a Checkout Link
      description: Create a checkout link
      operationId: postCheckoutLinks
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: integer
                  minimum: 1
                  maximum: 9007199254740991
                currency:
                  default: BRL
                  type: string
                  enum:
                    - BRL
                    - MXN
                    - COP
                    - CLP
                    - ARS
                    - PEN
                    - USD
                    - GTQ
                    - CRC
                    - NIO
                    - PYG
                    - UYU
                    - BOB
                    - PHP
                    - RUB
                    - INR
                    - SAR
                    - AED
                    - KWD
                    - QAR
                    - OMR
                    - KHR
                    - SGD
                    - IDR
                    - KRW
                    - THB
                    - MYR
                    - HKD
                    - CNY
                    - EGP
                    - EUR
                    - GBP
                    - BHD
                    - MAD
                    - AUD
                    - CAD
                    - CHF
                    - NZD
                    - PLN
                    - KZT
                    - UZS
                    - JPY
                    - GLC
                title:
                  type: string
                  minLength: 1
                  maxLength: 255
                products:
                  minItems: 1
                  type: array
                  items:
                    type: object
                    properties:
                      external_id:
                        type: string
                        minLength: 1
                        maxLength: 255
                      name:
                        type: string
                        minLength: 1
                        maxLength: 255
                      price:
                        type: integer
                        minimum: 1
                        maximum: 9007199254740991
                      quantity:
                        default: 1
                        type: integer
                        minimum: 1
                        maximum: 9007199254740991
                      currency:
                        type: string
                        enum:
                          - BRL
                          - MXN
                          - COP
                          - CLP
                          - ARS
                          - PEN
                          - USD
                          - GTQ
                          - CRC
                          - NIO
                          - PYG
                          - UYU
                          - BOB
                          - PHP
                          - RUB
                          - INR
                          - SAR
                          - AED
                          - KWD
                          - QAR
                          - OMR
                          - KHR
                          - SGD
                          - IDR
                          - KRW
                          - THB
                          - MYR
                          - HKD
                          - CNY
                          - EGP
                          - EUR
                          - GBP
                          - BHD
                          - MAD
                          - AUD
                          - CAD
                          - CHF
                          - NZD
                          - PLN
                          - KZT
                          - UZS
                          - JPY
                          - GLC
                      type:
                        type: string
                        enum:
                          - physical
                          - digital
                      description:
                        nullable: true
                        type: string
                      image_url:
                        nullable: true
                        type: string
                        format: uri
                      compare_price:
                        nullable: true
                        type: integer
                        minimum: 1
                        maximum: 9007199254740991
                    required:
                      - external_id
                      - name
                      - price
      responses:
        '201':
          description: HTTP 201 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  requestId:
                    type: string
                  data:
                    type: object
                    properties:
                      url:
                        type: string
                        format: uri
                    required:
                      - url
                    additionalProperties: false
                required:
                  - success
                  - requestId
                  - data
                additionalProperties: false
        '422':
          description: HTTP 422 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  status:
                    type: number
                    enum:
                      - 422
                required:
                  - error
                  - message
                  - status
                additionalProperties: false
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '500':
          description: HTTP 500 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  status:
                    type: number
                    enum:
                      - 500
                required:
                  - error
                  - message
                  - status
                additionalProperties: false
        default:
          description: RFC 7807 Problem Details error response
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - BearerAuth: []
        - ApiKeyAuth: []
        - BasicAuth: []
components:
  schemas:
    ValidationProblemDetails:
      allOf:
        - $ref: '#/components/schemas/ProblemDetails'
        - type: object
          properties:
            errors:
              type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                  message:
                    type: string
                  code:
                    type: string
                additionalProperties: true
          additionalProperties: true
    ProblemDetails:
      type: object
      description: RFC 7807 Problem Details object.
      properties:
        type:
          type: string
          format: uri-reference
        title:
          type: string
        status:
          type: number
        detail:
          type: string
        instance:
          type: string
          format: uri-reference
      required:
        - type
        - title
        - status
        - detail
      additionalProperties: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
    ApiKeyAuth:
      type: apiKey
      in: header
      name: apiKey
    BasicAuth:
      type: http
      scheme: basic
      description: Use Basic auth with username `token` and password `x`.

````