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

# Confirm a payment request

> Confirm a payment request to complete the payment lifecycle. The payment request must be in RequiresPaymentMethod or RequiresAction status. This can be used when collecting a payment method to create and process a payment. The payment request status updates based on the result.



## OpenAPI

````yaml https://api.withacclaim.com/openapi.yaml post /payment_requests/{payment_request_id}/confirm
openapi: 3.1.0
info:
  title: Acclaim API
  version: 1.0.0
  description: >
    Payments infrastructure built for the insurance industry. This specification
    describes

    the core resources and operations for treasury accounts, payouts, funding,
    and more.


    Authentication uses a secret API key passed as a Bearer token. The API is
    JSON-only

    and available via HTTPS only.
servers:
  - url: https://api.withacclaim.com/v1
security:
  - bearerAuth: []
tags:
  - name: Treasury / Treasury Accounts
    description: Manage treasury accounts and balances.
  - name: Payees
    description: Manage recipients of payouts.
  - name: Payout Methods
    description: Manage payout methods (e.g. bank accounts) for a payee.
  - name: Payouts
    description: Create and track individual payouts.
  - name: Payout Batches
    description: Create and track groups of payouts.
  - name: Treasury / Funding
    description: Move funds between settlement accounts and treasury accounts.
  - name: Payment Requests
    description: Create and manage payment requests for collecting payments.
  - name: Setup Requests
    description: Create and manage setup requests for securely storing payment methods.
  - name: Refunds
    description: Create and manage refunds for payments.
  - name: Payers
    description: Create and manage payers for payment collection.
  - name: Payment Methods
    description: Manage payment methods (e.g. cards, bank accounts) for a payer.
paths:
  /payment_requests/{payment_request_id}/confirm:
    post:
      tags:
        - Payment Requests
      summary: Confirm a payment request
      description: >-
        Confirm a payment request to complete the payment lifecycle. The payment
        request must be in RequiresPaymentMethod or RequiresAction status. This
        can be used when collecting a payment method to create and process a
        payment. The payment request status updates based on the result.
      parameters:
        - $ref: '#/components/parameters/PaymentRequestId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePaymentRequestRequest'
      responses:
        '201':
          description: >-
            Payment attempt created (includes nested payment when the charge
            succeeded).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentAttempt'
        '400':
          description: >-
            Bad request - payment request cannot be confirmed (e.g., missing
            payer or payment method, wrong status, or processing error).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Payment request not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  parameters:
    PaymentRequestId:
      name: payment_request_id
      in: path
      required: true
      schema:
        type: string
      description: ID of the payment request.
  schemas:
    UpdatePaymentRequestRequest:
      type: object
      properties:
        description:
          type: string
          nullable: true
          maxLength: 255
          example: 'Updated premium payment for policy #POL-2025-001'
          description: Description of the payment request
        reference:
          type: string
          nullable: true
          maxLength: 255
          example: ORD-2025-002
          description: Client-supplied identifier for reconciliation
        amount:
          type: integer
          nullable: true
          minimum: 1
          example: 20000
          description: >-
            Amount in smallest currency unit (must provide both amount and
            currency)
        currency:
          type: string
          nullable: true
          description: >-
            ISO 4217 currency code (3 uppercase letters, must provide both
            amount and currency)
          pattern: ^[A-Z]{3}$
          minLength: 3
          maxLength: 3
          example: USD
        requires_tokenization:
          type: boolean
          nullable: false
          description: >-
            Whether this payment request requires tokenization of the payment
            method
        allows_tokenization:
          type: boolean
          nullable: false
          description: >-
            Whether this payment request allows tokenization of the payment
            method
        expires_at:
          type: string
          nullable: true
          format: date-time
          example: '2025-12-31T23:59:59Z'
          description: When the payment request expires (ISO 8601 date-time string)
        payer_id:
          type: string
          nullable: true
          example: pyr_AbC123XyZ
          description: ID of the payer to associate with this payment request
        payment_method_id:
          type: string
          nullable: true
          maxLength: 255
          example: pm_AbC123XyZ
          description: >-
            ID of an existing payment method to use (must belong to the payer if
            payer_id is provided)
        payment_method:
          type: object
          nullable: true
          description: Payment method data (e.g., payment_token, payment_method type)
          additionalProperties: true
        ip_address:
          type: string
          nullable: true
          example: 192.168.1.1
          description: IP address of the client making the payment
        user_agent:
          type: string
          nullable: true
          example: Mozilla/5.0...
          description: User agent string of the client making the payment
        metadata:
          type: object
          nullable: true
          description: Optional metadata as key-value pairs
          additionalProperties: true
          example:
            custom_field: value
            source: api
      required: []
    PaymentAttempt:
      type: object
      properties:
        id:
          type: string
          example: pat_AbC123XyZ
        payment_request_id:
          type: string
          example: prq_Def456UvW
          description: ID of the payment request this attempt belongs to
        payment_id:
          type: string
          nullable: true
          example: pay_GhI789JkL
          description: ID of the received payment when the attempt succeeded
        payment:
          allOf:
            - $ref: '#/components/schemas/Payment'
          nullable: true
          description: Received payment when the attempt succeeded
        payer_id:
          type: string
          example: pyr_GhI789JkL
          description: ID of the payer for this payment attempt
        status:
          type: string
          enum:
            - Pending
            - Processing
            - Succeeded
            - Failed
          example: Succeeded
          description: Current status of the payment attempt
        amount:
          type: integer
          description: Amount in smallest currency unit
          example: 125000
        currency:
          type: string
          description: ISO 4217 currency code
          example: USD
        reference:
          type: string
          example: ORD-2025-001
          description: Client-supplied identifier
        description:
          type: string
          nullable: true
          example: 'Premium payment for policy #POL-2025-001'
        processor_transaction_id:
          type: string
          nullable: true
          example: txn_processor_123
          description: Processor transaction ID from the payment processor
        failure_code:
          type: string
          nullable: true
          example: card_declined
          description: Error code if the attempt failed
        failure_message:
          type: string
          nullable: true
          example: Card was declined
          description: Human-readable error message if the attempt failed
        created_at:
          type: string
          format: date-time
          example: '2025-10-08T18:20:31Z'
        updated_at:
          type: string
          format: date-time
          example: '2025-10-08T18:25:00Z'
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: invalid_request
            message:
              type: string
              example: 'Missing required field: amount'
            details:
              type: object
              additionalProperties: true
            request_id:
              type: string
              example: req_7lYt4o2x
    Payment:
      type: object
      properties:
        id:
          type: string
          example: pay_AbC123XyZ
        payment_request_id:
          type: string
          nullable: true
          example: prq_Def456UvW
          description: ID of the payment request this payment belongs to
        payer_id:
          type: string
          nullable: true
          example: pyr_GhI789JkL
          description: ID of the payer making the payment
        status:
          type: string
          enum:
            - Succeeded
            - PartiallyRefunded
            - Refunded
            - Reversed
          example: Succeeded
          description: Lifecycle status of received funds
        amount:
          type: integer
          description: Amount in smallest currency unit
          example: 125000
        currency:
          type: string
          description: ISO 4217 currency code
          example: USD
        reference:
          type: string
          example: ORD-2025-001
          description: Client-supplied identifier
        description:
          type: string
          nullable: true
          example: 'Premium payment for policy #POL-2025-001'
          description: Description of the payment
        processor_transaction_id:
          type: string
          nullable: true
          example: txn_processor_123
          description: Processor transaction ID from the payment processor
        created_at:
          type: string
          format: date-time
          example: '2025-10-08T18:20:31Z'
        updated_at:
          type: string
          format: date-time
          example: '2025-10-08T18:25:00Z'
  responses:
    ErrorResponse:
      description: Error payload.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````