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

# List an invoice's payment attempts

> Returns the collection attempts recorded for an invoice, newest first. The list is not paginated; the retry policy bounds attempts to a handful per invoice.



## OpenAPI

````yaml /openapi/invoices.yaml get /invoices/{id}/payment_attempts
openapi: 3.0.3
info:
  title: Ionic Invoices API
  version: '2026-05-30'
  description: |
    Invoices and invoice items.

    An invoice item is a pending charge recorded against a customer. When an
    invoice is created for that customer, every pending item in the invoice
    currency is drained onto the new draft as a line. A draft can be edited
    freely; finalizing it assigns a gapless, per-merchant/mode sequential number
    (for example `INV-000001`), applies tax, freezes the lines, and opens the
    invoice. Drafts carry no number, so an abandoned draft never consumes one
    and the finalized sequence is always contiguous.

    All monetary amounts are integers in the currency's minor unit (for example
    cents for USD). Timestamps are Unix epoch seconds. Identifiers are opaque,
    prefixed strings: invoices are `inv_…`, invoice items `ii_…`, and invoice
    lines `il_…`.

    Authentication uses a merchant secret key as a bearer token. Read endpoints
    require the `invoices:read` permission; write endpoints require
    `invoices:write`. The mode of the key (test or live) scopes which invoices
    and invoice items it can see, mutate, and drain. Live invoice numbers use
    `INV-000001` style labels; test invoice numbers use `TEST-INV-000001`.
    Mutating endpoints accept an optional `Idempotency-Key` header.

    Errors are returned as `{ "error": { "code": "...", "message": "..." } }`.
    A malformed path identifier returns 400. Concurrent updates are retried
    automatically; if they still conflict, the API returns 409 and the request
    can be retried.
servers:
  - url: '{baseUrl}/v1'
    variables:
      baseUrl:
        default: https://api.ionicfi.com
        description: API base URL for your environment.
security:
  - secretKey: []
tags:
  - name: Invoices
    description: Create, finalize, and manage invoices.
  - name: Invoice Items
    description: Pending charges that drain onto a customer's next invoice.
paths:
  /invoices/{id}/payment_attempts:
    parameters:
      - $ref: '#/components/parameters/InvoiceId'
    get:
      tags:
        - Invoices
      summary: List an invoice's payment attempts
      description: >-
        Returns the collection attempts recorded for an invoice, newest first.
        The list is not paginated; the retry policy bounds attempts to a handful
        per invoice.
      operationId: invoices_list_payment_attempts
      responses:
        '200':
          description: The invoice's payment attempts, newest first.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoicePaymentAttemptList'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/InvoiceNotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - secretKey:
            - invoices:read
components:
  parameters:
    InvoiceId:
      name: id
      in: path
      required: true
      description: The invoice id (`inv_…`).
      schema:
        type: string
  schemas:
    InvoicePaymentAttemptList:
      type: object
      required:
        - data
        - object
      properties:
        object:
          type: string
          enum:
            - list
        data:
          type: array
          items:
            $ref: '#/components/schemas/InvoicePaymentAttempt'
    InvoicePaymentAttempt:
      type: object
      description: One automatic-collection attempt recorded against an invoice.
      required:
        - attempted_at
        - created_at
        - id
        - invoice
        - livemode
        - object
        - status
      properties:
        id:
          type: string
          description: The invoice payment attempt id.
        object:
          type: string
          enum:
            - invoice_payment_attempt
          description: Always `invoice_payment_attempt`.
        invoice:
          type: string
          description: The parent invoice (`inv_…`) this attempt was made against.
        status:
          type: string
          enum:
            - pending
            - succeeded
            - failed
            - blocked
          description: >-
            `pending` means the final outcome is not known yet. Retrieve the
            attempts again before retrying.
        failure_code:
          type: string
          nullable: true
          description: >-
            Machine-readable decline or block reason, such as
            `insufficient_funds`.
        failure_message:
          type: string
          nullable: true
          description: >-
            A human-readable failure detail. Nullable; may be empty even when
            `failure_code` is set.
        payment_method:
          type: string
          nullable: true
          description: >-
            The payment method (`pm_…`) used for the attempt. Null when the
            attempt was blocked before a payment method was reached, for example
            with no pinned method.
        payment_intent:
          type: string
          nullable: true
          description: >-
            The payment intent (`pi_…`) created for the attempt. Null when the
            attempt was blocked before a payment intent was created.
        livemode:
          type: boolean
          description: Mirrors the parent invoice's mode.
        attempted_at:
          type: integer
          description: Unix epoch seconds when the attempt executed.
        created_at:
          type: integer
          description: >-
            Unix epoch seconds when the attempt was recorded. Normally equal to
            `attempted_at`.
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: A stable, machine-readable error code.
            message:
              type: string
  responses:
    BadRequest:
      description: The request was malformed or failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INVALID_DATA
              message: invalid currency
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: The key lacks the required permission, or the merchant is not active.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InvoiceNotFound:
      description: No invoice with that id is visible to this key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: INVOICE_NOT_FOUND
              message: invoice not found
    RateLimited:
      description: Too many requests. Honour the `Retry-After` header before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalError:
      description: |
        The API could not return a successful response. For a mutating request,
        retrieve the resource before retrying because the operation may have
        completed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      description: 'A merchant secret key (`sk_…`) sent as `Authorization: Bearer <key>`.'

````