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

# Completar pago con tasa certificada

> Continúa la aplicación de un pago `needs_certified_rate` con una conversión certificada y documentos explícitos.



## OpenAPI

````yaml /openapi/integrations-v1.json post /integrations/v1/{companyId}/payments/{externalPaymentId}/certified-rate
openapi: 3.1.0
info:
  title: Cobrix API de integraciones
  version: 1.0.0
  description: >-
    API firmada para sincronizar clientes, documentos de cobro, links y pagos
    verificados. Los campos monetarios terminados en Minor usan unidades
    menores.
  license:
    name: Propietaria
    url: https://cobrix.co/terms
servers:
  - url: https://api.cobrix.co/api
    description: Producción
  - url: https://sandbox-api.cobrix.co/api
    description: Sandbox
security:
  - bearerAuth: []
tags:
  - name: Clientes
    description: Identidades externas vinculadas al source de la llave.
  - name: Documentos de cobro
    description: Documentos o cargos importados desde un sistema externo.
  - name: Links de cobro
    description: Sesiones de checkout para documentos abiertos.
  - name: Pagos
    description: Pagos verificados y su aplicación financiera.
paths:
  /integrations/v1/{companyId}/payments/{externalPaymentId}/certified-rate:
    post:
      tags:
        - Pagos
      summary: Completar pago con tasa certificada
      description: >-
        Continúa la aplicación de un pago `needs_certified_rate` con una
        conversión certificada y documentos explícitos.
      operationId: completePaymentCertifiedRate
      parameters:
        - $ref: '#/components/parameters/CompanyId'
        - $ref: '#/components/parameters/ExternalPaymentId'
        - $ref: '#/components/parameters/IdempotencyKey'
        - $ref: '#/components/parameters/CobrixTimestamp'
        - $ref: '#/components/parameters/CobrixSignature'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CertifiedRateRequest'
      responses:
        '201':
          description: Pago actualizado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentDetail'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/Unprocessable'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    CompanyId:
      name: companyId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Empresa vinculada a la llave.
    ExternalPaymentId:
      name: externalPaymentId
      in: path
      required: true
      schema:
        type: string
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      schema:
        type: string
        minLength: 1
      description: Identificador estable de la operación.
    CobrixTimestamp:
      name: Cobrix-Timestamp
      in: header
      required: true
      schema:
        type: string
        pattern: ^[0-9]{10}$
      description: Segundos Unix dentro de una ventana de cinco minutos.
    CobrixSignature:
      name: Cobrix-Signature
      in: header
      required: true
      schema:
        type: string
        pattern: ^v1=[a-f0-9]{64}$
      description: HMAC-SHA256 de timestamp, método, ruta y cuerpo crudo.
  schemas:
    CertifiedRateRequest:
      type: object
      required:
        - refCurrency
        - refAmountMinor
        - exchangeRateUsed
        - documents
      properties:
        refCurrency:
          type: string
          enum:
            - USD
            - VES
            - usd
            - ves
        refAmountMinor:
          type: number
          minimum: 1
        exchangeRateUsed:
          type: string
          pattern: ^[0-9]+(?:\.[0-9]+)?$
          maxLength: 19
        effectiveAt:
          type: string
          format: date-time
        documents:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/PaymentDocumentRequest'
      example:
        refCurrency: USD
        refAmountMinor: 2025
        exchangeRateUsed: '52.08'
        effectiveAt: '2026-07-14T16:00:00Z'
        documents:
          - externalDocumentId: invoice-1001
            amountMinor: 2025
    PaymentDetail:
      allOf:
        - $ref: '#/components/schemas/PaymentSummary'
        - type: object
          required:
            - documents
          properties:
            exchangeRateId:
              type: string
              format: uuid
            exchangeRateUsed:
              type: string
            documents:
              type: array
              items:
                $ref: '#/components/schemas/PaymentDocumentResult'
    PaymentDocumentRequest:
      type: object
      required:
        - externalDocumentId
      properties:
        externalDocumentId:
          type: string
          minLength: 1
        amountMinor:
          type: number
          minimum: 1
    PaymentSummary:
      type: object
      required:
        - paymentId
        - source
        - externalPaymentId
        - companyCustomerId
        - amountMinor
        - paymentCurrency
        - applicationCurrency
        - status
        - totalAppliedMinor
        - creditCreatedMinor
      properties:
        paymentId:
          type: string
          format: uuid
        source:
          type: string
        externalPaymentId:
          type: string
        companyCustomerId:
          type: string
          format: uuid
        customer:
          $ref: '#/components/schemas/PaymentCustomer'
        amountMinor:
          type: integer
        paymentCurrency:
          type: string
        applicationCurrency:
          type: string
        status:
          $ref: '#/components/schemas/PublicPaymentStatus'
        paymentStatus:
          type: string
        totalAppliedMinor:
          type: integer
        creditCreatedMinor:
          type: integer
        pendingReason:
          type: string
        paidAt:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    PaymentDocumentResult:
      type: object
      required:
        - invoiceId
        - externalDocumentId
        - currency
        - appliedMinor
        - balanceMinor
        - status
      properties:
        invoiceId:
          type: string
          format: uuid
        externalDocumentId:
          type: string
        currency:
          type: string
        appliedMinor:
          type: integer
        balanceMinor:
          type: integer
        status:
          type: string
          enum:
            - applied
            - partially_applied
            - paid
            - requires_certified_rate
            - not_applied
    IntegrationError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            requestId:
              type:
                - string
                - 'null'
    PaymentCustomer:
      type: object
      required:
        - customerId
        - companyCustomerId
      properties:
        customerId:
          type: string
          format: uuid
        companyCustomerId:
          type: string
          format: uuid
        name:
          type: string
        email:
          type: string
    PublicPaymentStatus:
      type: string
      enum:
        - applied
        - partially_applied
        - credited
        - needs_certified_rate
        - no_open_documents
        - failed
        - already_processed
  responses:
    BadRequest:
      description: Payload, firma o idempotencia faltante
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/IntegrationError'
    Unauthorized:
      description: Llave o firma inválida
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/IntegrationError'
          example:
            error:
              code: invalid_api_key
              message: The API key is missing or invalid.
              requestId: req-1001
    Forbidden:
      description: Empresa o scope no autorizado
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/IntegrationError'
    NotFound:
      description: Recurso no encontrado dentro del source
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/IntegrationError'
    Conflict:
      description: Conflicto de idempotencia o estado financiero
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/IntegrationError'
    Unprocessable:
      description: La operación no cumple las reglas de negocio
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/IntegrationError'
    RateLimited:
      description: Límite por llave y ruta excedido
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/IntegrationError'
          example:
            error:
              code: rate_limited
              message: Too many requests for this API key.
              requestId: req-1001
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Cobrix API key
      description: Llave cbx_live creada para el partner.

````