> ## 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 /payment-intent
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:
  /payment-intent:
    post:
      tags:
        - PaymentIntent
      summary: Create a payment intent
      operationId: createPaymentIntent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePaymentIntentRequest'
      responses:
        '200':
          description: Payment intent created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatePaymentIntentResponse'
        '400':
          description: >-
            Invalid request, missing organization context, or unsupported
            currency
        '401':
          description: Unauthorized – missing or invalid API key
        '404':
          description: Terminal not found
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreatePaymentIntentRequest:
      type: object
      description: >-
        Request body for creating a payment intent. Payment intents represent
        card-present payment requests that are processed by POS terminals.
      properties:
        amount:
          type: number
          format: decimal
          example: 350.5
          description: The amount to charge in MXN. Must be a positive number.
        currency:
          type: string
          enum:
            - MXN
          example: MXN
          description: Currency code. Must be MXN.
        externalId:
          type: string
          example: order_12345_pos
          description: >-
            Your unique identifier for this payment intent. Must be unique per
            organization.
        terminalCode:
          type: string
          example: TERMINAL-001
          description: >-
            Serial number of the target POS terminal. If provided, the payment
            intent is routed to that specific terminal and any other pending
            intents for that terminal are automatically cancelled. If omitted,
            the payment intent is available to any terminal in your
            organization.
        redirectAppId:
          type: string
          maxLength: 255
          example: com.mycompany.pos
          description: >-
            Android application id of the app the Compago POS app returns to
            after the payment finishes (successfully or cancelled). Overrides
            the integration configured locally on the terminal. If omitted, the
            terminal falls back to its local integration configuration. Requires
            the app to be installed on the terminal device.
      required:
        - amount
        - currency
        - externalId
    CreatePaymentIntentResponse:
      type: object
      description: The created payment intent object
      properties:
        id:
          type: string
          format: uuid
          example: aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee
          description: Unique identifier of the payment intent
        status:
          type: string
          enum:
            - PENDING
          description: Initial status is always PENDING
        amount:
          type: number
          format: decimal
          description: The payment amount
        currency:
          type: string
          example: MXN
        externalId:
          type: string
          description: Your external identifier
        redirectAppId:
          type: string
          nullable: true
          example: com.mycompany.pos
          description: >-
            Android application id the terminal returns to after the payment
            finishes, if provided at creation
        organizationId:
          type: string
          format: uuid
          example: 11111111-2222-3333-4444-555555555555
          description: The organization that owns this payment intent
        terminalId:
          type: string
          format: uuid
          example: 66666666-7777-8888-9999-000000000000
          description: The terminal associated with this payment intent, if any
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - status
        - amount
        - currency
        - externalId
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````