> ## Documentation Index
> Fetch the complete documentation index at: https://walletconnect-pay-docs-tomiir-buyer-checkout-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Confirm a payment

> Submit the selected option and executed action results to confirm the payment.



## OpenAPI

````yaml POST /v1/gateway/payment/{id}/confirm
openapi: 3.0.3
info:
  title: WalletConnect Pay API (Gateway)
  description: >-
    Gateway API for wallets to fulfill WalletConnect Pay payments (API-first /
    non-SDK flow).
  version: 0.0.0
servers:
  - url: https://api.pay.walletconnect.com
security:
  - API Key: []
paths:
  /v1/gateway/payment/{id}/confirm:
    post:
      tags:
        - Gateway
      summary: Confirm a payment
      description: >-
        This endpoint confirms a payment and submits it to the blockchain for
        processing.
      operationId: confirm_payment_handler
      parameters:
        - name: Api-Key
          in: header
          required: true
          schema:
            type: string
        - name: App-Id
          in: header
          required: false
          schema:
            type: string
        - name: id
          in: path
          description: Payment ID
          required: true
          schema:
            $ref: '#/components/schemas/PaymentId'
        - name: maxPollMs
          in: query
          description: Maximum time to long-poll for payment status, in milliseconds.
          required: false
          schema:
            type: integer
            nullable: true
            format: int64
            minimum: 0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfirmPaymentRequest'
            example:
              collectedData:
                fields:
                  - id: fullName
                    value: John Smith
                  - id: dob
                    value: '1990-01-01'
                  - id: tosConfirmed
                    value: 'true'
              optionId: opt_123
              results:
                - data:
                    - '0x123'
                  type: walletRpc
      responses:
        '200':
          description: Payment confirmed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConfirmPaymentResponse'
              example:
                isFinal: true
                pollInMs: null
                status: succeeded
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Payment not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    PaymentId:
      type: string
      description: Payment ID
    ConfirmPaymentRequest:
      type: object
      required:
        - optionId
        - results
      properties:
        collectedData:
          allOf:
            - $ref: '#/components/schemas/CollectDataResult'
          nullable: true
        optionId:
          type: string
          description: ID of the option to confirm
        results:
          type: array
          items:
            $ref: '#/components/schemas/ConfirmPaymentResult'
    ConfirmPaymentResponse:
      type: object
      required:
        - status
        - isFinal
      properties:
        isFinal:
          type: boolean
          description: >-
            True if the payment is in a final state and no longer requires
            polling
        pollInMs:
          type: integer
          nullable: true
          format: int64
          description: >-
            Time to poll for payment status, in milliseconds. Not present if the
            payment is in a final state.
          minimum: 0
        status:
          $ref: '#/components/schemas/PaymentStatus'
          description: Payment status
    ErrorResponse:
      type: object
      description: Standard error response structure for API errors.
      required:
        - code
        - message
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
    CollectDataResult:
      type: object
      required:
        - fields
      properties:
        fields:
          type: array
          items:
            $ref: '#/components/schemas/CollectDataFieldResult'
    ConfirmPaymentResult:
      oneOf:
        - type: object
          required:
            - data
            - type
          properties:
            data:
              type: array
              items: {}
            type:
              type: string
              enum:
                - walletRpc
    PaymentStatus:
      type: string
      description: Payment status representing the lifecycle of a payment.
      enum:
        - requires_action
        - processing
        - succeeded
        - failed
        - expired
    ErrorCode:
      type: string
      description: Standard error codes for API responses.
      enum:
        - rate_limited
        - invalid_params
        - params_validation
        - payment_not_found
        - internal_error
        - invalid_api_key
        - unauthorized
        - forbidden
        - invalid_state
        - missing_api_key
        - missing_merchant_api_key
        - missing_merchant_id
        - header_not_ascii
        - not_sandbox_api_key
        - merchant_not_found
        - merchant_exists
        - api_key_not_found
    CollectDataFieldResult:
      type: object
      required:
        - id
        - value
      properties:
        id:
          type: string
        value:
          type: string
  securitySchemes:
    API Key:
      type: apiKey
      in: header
      name: Api-Key

````