> ## 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.

# Create a payment request

> Create a payment request for collecting a payment. The request will be in RequiresPaymentMethod status until a payment method is provided.



## OpenAPI

````yaml https://api.withacclaim.com/openapi.yaml post /payment_requests
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:
    post:
      tags:
        - Payment Requests
      summary: Create a payment request
      description: >-
        Create a payment request for collecting a payment. The request will be
        in RequiresPaymentMethod status until a payment method is provided.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePaymentRequestRequest'
      responses:
        '201':
          description: Payment request created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentRequest'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  schemas:
    CreatePaymentRequestRequest:
      type: object
      properties:
        description:
          type: string
          maxLength: 255
          example: 'Premium payment for policy #POL-2025-001'
          description: Description of the payment request
        reference:
          type: string
          maxLength: 255
          example: ORD-2025-001
          description: Client-supplied identifier for reconciliation
        amount:
          type: integer
          minimum: 1
          example: 125000
          description: Amount in smallest currency unit
        currency:
          type: string
          description: ISO 4217 currency code (3 uppercase letters)
          pattern: ^[A-Z]{3}$
          minLength: 3
          maxLength: 3
          example: USD
        requires_tokenization:
          type: boolean
          default: false
          description: >-
            Whether this payment request requires tokenization of the payment
            method
        allows_tokenization:
          type: boolean
          default: false
          description: >-
            Whether this payment request allows tokenization of the payment
            method
        payer_id:
          type: string
          nullable: true
          maxLength: 255
          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)
        idempotency_key:
          type: string
          nullable: true
          maxLength: 255
          example: idem_ord_2025_001
          description: >-
            Client-supplied idempotency key; reuse is allowed only after the
            prior request failed or was canceled
        metadata:
          type: object
          nullable: true
          description: Optional metadata as key-value pairs
          additionalProperties: true
          example:
            custom_field: value
            source: api
      required:
        - description
        - reference
        - amount
        - currency
    PaymentRequest:
      type: object
      properties:
        id:
          type: string
          example: prq_AbC123XyZ
        status:
          type: string
          enum:
            - RequiresPaymentMethod
            - RequiresAction
            - Processing
            - Authorized
            - Succeeded
            - Failed
            - Canceled
          example: RequiresPaymentMethod
          description: Current status of the payment request
        amount:
          type: integer
          description: Amount in smallest currency unit
          example: 125000
        currency:
          type: string
          description: ISO 4217 currency code
          example: USD
        payer_id:
          type: string
          nullable: true
          example: pyr_AbC123XyZ
          description: ID of the payer associated with this payment request
        description:
          type: string
          example: 'Premium payment for policy #POL-2025-001'
        reference:
          type: string
          example: ORD-2025-001
          description: Client-supplied identifier
        idempotency_key:
          type: string
          nullable: true
          maxLength: 255
          example: idem_ord_2025_001
          description: Client-supplied idempotency key set at creation
        requires_tokenization:
          type: boolean
          example: false
          description: >-
            Whether this payment request requires tokenization of the payment
            method
        allows_tokenization:
          type: boolean
          example: false
          description: >-
            Whether this payment request allows tokenization of the payment
            method
        payment_method:
          type: object
          nullable: true
          description: Payment method associated with this payment request
          additionalProperties: true
        session_identifier:
          type: string
          example: prq_AbC123XyZ_abc123...
          description: External session identifier for this payment request
        shipping_address:
          allOf:
            - $ref: '#/components/schemas/Address'
          nullable: true
          description: Shipping address for this payment request
        failure_code:
          type: string
          nullable: true
          example: card_declined
          description: Error code if the payment request failed
        failure_message:
          type: string
          nullable: true
          example: Card was declined
          description: Human-readable error message if the payment request failed
        expires_at:
          type: string
          format: date-time
          nullable: true
          example: '2025-12-31T23:59:59Z'
          description: When the payment request expires
        completed_at:
          type: string
          format: date-time
          nullable: true
          example: '2025-10-08T18:25:00Z'
          description: When the payment request was completed
        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
        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'
    Address:
      type: object
      required:
        - country
      properties:
        country:
          type: string
          description: ISO 3166-1 alpha-2 country code
          example: US
          minLength: 2
          maxLength: 2
        address1:
          type: string
          nullable: true
          example: 123 Main St
          maxLength: 255
        address2:
          type: string
          nullable: true
          example: Suite 100
          maxLength: 255
        city:
          type: string
          nullable: true
          example: New York
          maxLength: 255
        state:
          type: string
          nullable: true
          example: NY
          maxLength: 255
        postal_code:
          type: string
          nullable: true
          example: '10001'
          maxLength: 255
    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
  responses:
    ErrorResponse:
      description: Error payload.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````