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

# Create



## OpenAPI

````yaml POST /one-time-payment
openapi: 3.1.0
info:
  title: Compago API
  version: 1.0.0
  description: >-
    Public and private API endpoints for Compago's payment infrastructure. This
    specification currently includes endpoints for one-time payments. More
    endpoints will be added as the platform evolves.
servers:
  - url: https://demo.api.harmony.compago.com/api
  - url: https://api.harmony.compago.com/api
security: []
tags:
  - name: OneTimePayment
    description: Endpoints for creating and processing one-time payment links
  - name: PaymentMethod
    description: >-
      Endpoints for saving cards, charging saved payment methods, and processing
      refunds
  - name: PaymentIntent
    description: >-
      Endpoints for creating and managing card-present payment intents for POS
      terminal integrations
paths:
  /one-time-payment:
    post:
      tags:
        - OneTimePayment
      summary: Create a one-time-payment link
      operationId: createOneTimePayment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOneTimePaymentRequest'
      responses:
        '200':
          description: Link successfully created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateOneTimePaymentResponse'
        '400':
          description: Invalid request or missing organization context
        '401':
          description: Unauthorized – missing or invalid API key
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreateOneTimePaymentRequest:
      type: object
      description: >-
        Request body for creating a one-time payment link. You can redirect the
        user to the resulting URL to complete the payment, the payment will be
        processed by the Compago platform, and then the user will be redirected
        back to the homepage URL provided.
      properties:
        amount:
          type: number
          format: decimal
          example: 100
          description: >-
            The amount to be charged for the one-time payment. Must be a
            positive number.
        currency:
          type: string
          example: MXN
          enum:
            - MXN
            - USD
        externalId:
          type: string
          example: tracking-id-from-your-system
          description: >-
            Optional external ID to track the payment in your system. Must be
            unique for each payment.
        description:
          type: string
          example: Lorem ipsum dolor sit amet
          description: >-
            A description of the payment. This will be displayed to the user
            during the payment process.
        homepageUrl:
          type: string
          format: uri
          description: >-
            The homepage URL of your application to link the user back to your
            application in case they cancel the payment or want to go back. This
            should be a valid URL that your application can handle.
          example: https://app.compago.com/
        redirectUrl:
          type: string
          format: uri
          description: >-
            The URL of your application to redirect the user back to after the
            payment is completed. This should be a valid URL that your
            application can handle.
          example: https://app.compago.com/
        billingInformation:
          $ref: '#/components/schemas/BillingInformation'
        ttlMinutes:
          type: integer
          minimum: 10
          maximum: 2880
          example: 1440
          description: >-
            Optional time-to-live in minutes for the payment link. Minimum 10
            minutes, maximum 2,880 minutes (48 hours). Defaults to 48 hours if
            not specified.
      required:
        - amount
        - currency
        - externalId
        - description
        - homepageUrl
        - redirectUrl
    CreateOneTimePaymentResponse:
      type: object
      properties:
        redirectUrl:
          type: string
          format: uri
      required:
        - redirectUrl
    BillingInformation:
      type: object
      description: Billing information for the one-time payment
      properties:
        email:
          type: string
          format: email
          example: maria.gonzalez@example.com
          description: Customer's email address
        firstName:
          type: string
          example: María
          description: Customer's first name
        lastName:
          type: string
          example: González
          description: Customer's last name
        phoneNumber:
          type: string
          example: '+5215512345678'
          description: Customer's phone number
        address:
          $ref: '#/components/schemas/Address'
      required:
        - email
        - firstName
        - lastName
        - phoneNumber
    Address:
      type: object
      description: Physical address for billing purposes
      properties:
        addressLine:
          type: string
          example: Av. Insurgentes Sur 1234
          description: Street address, including number and street name
        city:
          type: string
          example: Ciudad de México
          description: The city where the address is located
        state:
          type: string
          example: CDMX
          description: The state or province where the address is located
          enum:
            - AGU
            - BCN
            - BCS
            - CAM
            - CHP
            - CHH
            - CDMX
            - COA
            - COL
            - DUR
            - MEX
            - GUA
            - GRO
            - HID
            - JAL
            - MIC
            - MOR
            - NAY
            - NLE
            - OAX
            - PUE
            - QUE
            - ROO
            - SLP
            - SIN
            - SON
            - TAB
            - TAM
            - TLA
            - VER
            - YUC
            - ZAC
        zip:
          type: string
          example: '03100'
          description: Zip code or Postal code where the address is located
      required:
        - addressLine
        - city
        - state
        - zip
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````