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

# Confirm a swap



## OpenAPI

````yaml /openapi.yaml post /api/integrations/swaps/{intentId}/confirm
openapi: 3.1.0
info:
  title: COP By Integrations API
  version: 0.1.0
  description: |
    Non-custodial Celo API for partners. Prepare swaps and BRE-B COP payouts;
    the user signs from their wallet. Confirm with the transaction hash.
servers:
  - url: http://localhost:3000
    description: Local Next.js app
  - url: https://app.copby.co
    description: Production (replace if your origin differs)
security:
  - bearerAuth: []
tags:
  - name: BRE-B
    description: Quote, KYC, and COP payouts via Bridge Bre-B
  - name: Swaps
    description: Prepare and confirm onchain COPm swaps
  - name: Webhooks
    description: Bridge callbacks. Not authenticated with a partner key.
paths:
  /api/integrations/swaps/{intentId}/confirm:
    post:
      tags:
        - Swaps
      summary: Confirm a swap
      operationId: confirmSwap
      parameters:
        - name: intentId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - txHash
              properties:
                txHash:
                  $ref: '#/components/schemas/TxHash'
      responses:
        '200':
          description: Confirmed swap
        '401':
          $ref: '#/components/responses/Unauthorized'
        '409':
          $ref: '#/components/responses/BrebError'
components:
  schemas:
    TxHash:
      type: string
      pattern: ^0x[a-fA-F0-9]{64}$
    ErrorBody:
      type: object
      properties:
        error:
          type: string
        errorCode:
          type: string
          enum:
            - below_minimum
            - needs_kyc
            - destination_mismatch
            - requote
            - tx_hash_reused
            - otp_invalid
            - mercado_cerrado
            - invalid_webhook_signature
  responses:
    Unauthorized:
      description: Missing or invalid integration API key
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
    BrebError:
      description: API error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Integration API key. Send as `Bearer copby_live_pk_…`.

````