> ## 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 spend intents

> Lists the calling agent's spend intents for the selected business.

Requires the agent secret key that created them, with `spend:read`.



## OpenAPI

````yaml /openapi/spend.json get /v1/spend_intents
openapi: 3.0.3
info:
  title: Ionic Spend (preview)
  version: 0.1.0-preview
  description: >-
    Spend lets an agent use a business card for a purchase the business
    approves. Amounts are in the smallest currency unit and timestamps are Unix
    seconds. For the full flow, see Build browser purchases with Spend in the
    Ionic docs.
servers:
  - url: https://api.ionicfi.com
    description: Use the API origin Ionic provides for your enabled environment.
security:
  - secretKey: []
paths:
  /v1/spend_intents:
    get:
      summary: List spend intents
      description: |-
        Lists the calling agent's spend intents for the selected business.

        Requires the agent secret key that created them, with `spend:read`.
      operationId: spend_intents_list
      parameters:
        - $ref: '#/components/parameters/IonicAccount'
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/StartingAfter'
        - $ref: '#/components/parameters/Status'
        - $ref: '#/components/parameters/Reference'
      responses:
        '200':
          description: A list of the agent's spend intents.
          headers:
            Cache-Control:
              description: Always no-store, including errors and claim retries.
              schema:
                type: string
                enum:
                  - no-store
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntentList'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          $ref: '#/components/responses/409'
        '422':
          $ref: '#/components/responses/422'
        '429':
          $ref: '#/components/responses/429'
        '503':
          $ref: '#/components/responses/503'
components:
  parameters:
    IonicAccount:
      name: Ionic-Account
      in: header
      required: false
      schema:
        $ref: '#/components/schemas/AccountID'
      description: >-
        Required for delegated Connect requests; omit for direct business
        requests. Selector is not authorization.
    Limit:
      name: limit
      in: query
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 20
    StartingAfter:
      name: starting_after
      in: query
      schema:
        type: string
        minLength: 1
        maxLength: 255
      description: >-
        Visible resource ID in the same account/mode/actor/filter scope. Created
        descending, then ID descending. Invalid/hidden cursor returns
        invalid_cursor without existence disclosure.
    Status:
      name: status
      in: query
      schema:
        $ref: '#/components/schemas/SpendStatus'
    Reference:
      name: reference
      in: query
      schema:
        type: string
        minLength: 1
        maxLength: 200
        pattern: .*\S.*
      description: Exact application reference; not unique and not an idempotency key.
  schemas:
    IntentList:
      type: object
      additionalProperties: false
      properties:
        object:
          type: string
          enum:
            - list
        data:
          type: array
          items:
            $ref: '#/components/schemas/SpendIntent'
        has_more:
          type: boolean
      required:
        - object
        - data
        - has_more
    AccountID:
      type: string
      pattern: ^mer_[A-Za-z0-9]{14}$
    SpendStatus:
      type: string
      enum:
        - pending_approval
        - approved
        - declined
        - claimed
        - expired
        - canceled
        - issuance_unknown
        - blocked
    SpendIntent:
      type: object
      additionalProperties: false
      properties:
        id:
          $ref: '#/components/schemas/IntentID'
        object:
          type: string
          enum:
            - spend_intent
        account_id:
          $ref: '#/components/schemas/AccountID'
        agent_id:
          $ref: '#/components/schemas/AgentID'
        livemode:
          type: boolean
        version:
          type: integer
          minimum: 1
        action:
          type: string
          enum:
            - payment
            - save_card
            - replace_card
        card_id:
          $ref: '#/components/schemas/CardID'
        purpose:
          type: string
          minLength: 1
          maxLength: 1000
          pattern: .*\S.*
        seller:
          $ref: '#/components/schemas/Seller'
        amount:
          type: integer
          minimum: 0
          maximum: 9007199254740991
        currency:
          type: string
          pattern: ^[a-z]{3}$
        billing_details:
          $ref: '#/components/schemas/BillingDetails'
        reference:
          type: string
          minLength: 1
          maxLength: 200
          pattern: .*\S.*
          nullable: true
        status:
          $ref: '#/components/schemas/SpendStatus'
        allowed_hosts:
          $ref: '#/components/schemas/AllowedHosts'
        approval_url:
          type: string
          minLength: 10
          maxLength: 2048
          pattern: ^https://[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?(?:/[^\s?#]*)?$
          description: >-
            Absolute HTTPS URL; no userinfo, port, query, fragment or
            whitespace. Return destinations require registration where
            specified. Seller pre-registration is not required when the caller
            supplies allowed_hosts.
          nullable: true
        return_url:
          type: string
          minLength: 10
          maxLength: 2048
          description: >-
            Where a platform's Agent asked the owner be returned after deciding:
            an absolute URL on one of the platform's approved origins, or null.
            The Ionic approval page sends the owner there with
            spend_intent={id}; the redirect is not proof of the decision, so
            read the intent. Only a platform's delegated Agent can set it.
          nullable: true
        created:
          $ref: '#/components/schemas/Timestamp'
        approval_expires_at:
          description: >-
            Server-selected deadline for the owner to approve a pending intent,
            in Unix seconds. This deadline does not shorten a claim window that
            starts after approval.
          allOf:
            - $ref: '#/components/schemas/Timestamp'
        approved_at:
          type: integer
          minimum: 0
          description: Unix epoch seconds. Equality with a deadline is expired.
          format: int64
          nullable: true
        claimed_at:
          type: integer
          minimum: 0
          description: Unix epoch seconds. Equality with a deadline is expired.
          format: int64
          nullable: true
        canceled_at:
          type: integer
          minimum: 0
          description: Unix epoch seconds. Equality with a deadline is expired.
          format: int64
          nullable: true
        claim_expires_at:
          type: integer
          minimum: 0
          description: >-
            approved_at + claim_within_seconds, in Unix seconds; null before
            approval. Preserve the original deadline in later states. It is
            independent of the pending-approval deadline; same-key recovery
            after this deadline remains subject to original credential expiry
            and current authority.
          format: int64
          nullable: true
        credential_expires_at:
          type: integer
          minimum: 0
          description: Unix epoch seconds. Equality with a deadline is expired.
          format: int64
          nullable: true
        claim_replay_available:
          type: boolean
        credential_exposure:
          type: string
          enum:
            - none
            - possible
            - issued
        claim_within_seconds:
          $ref: '#/components/schemas/ClaimWithinSeconds'
        approvals:
          type: array
          minItems: 0
          maxItems: 3
          items:
            $ref: '#/components/schemas/SpendApproval'
          description: >-
            Every required human approval, in decision order. The card owner's
            approval (business, or owner for a direct Agent) is always present
            and decides last, except on a blocked request (decision 0110), which
            no one can decide: there the list is empty.
        limit_breaches:
          type: array
          maxItems: 30
          items:
            $ref: '#/components/schemas/SpendLimitBreach'
          description: >-
            Limits exceeded when evaluated; empty when within every limit.
            Budgets cap approvals, not merchant charges.
        blocked_at:
          type: integer
          minimum: 0
          format: int64
          nullable: true
          description: >-
            When a blocking limit rule ended the request, in Unix seconds: at
            creation or at the final approval (decision 0110). Null on every
            other status.
      required:
        - id
        - object
        - account_id
        - agent_id
        - livemode
        - version
        - action
        - card_id
        - purpose
        - seller
        - amount
        - currency
        - billing_details
        - reference
        - status
        - allowed_hosts
        - approval_url
        - return_url
        - created
        - approval_expires_at
        - approved_at
        - claimed_at
        - canceled_at
        - claim_expires_at
        - credential_expires_at
        - claim_replay_available
        - credential_exposure
        - claim_within_seconds
        - approvals
        - limit_breaches
        - blocked_at
      description: >-
        Credential/approval state, never merchant payment status. Unknown
        issuance preserves credential_exposure=possible even after cancellation.
        Null credential_expires_at means no verified expiry is known, not that
        exposure ended.
    BoundaryError:
      type: object
      additionalProperties: false
      properties:
        error:
          type: object
          additionalProperties: false
          properties:
            code:
              type: string
              minLength: 1
              maxLength: 100
              pattern: .*\S.*
            message:
              type: string
              minLength: 1
              maxLength: 1000
              pattern: .*\S.*
            retryable:
              type: boolean
          required:
            - code
            - message
      required:
        - error
    SpendError:
      type: object
      additionalProperties: false
      properties:
        error:
          type: object
          additionalProperties: false
          properties:
            code:
              type: string
              minLength: 1
              maxLength: 100
              pattern: .*\S.*
            message:
              type: string
              minLength: 1
              maxLength: 1000
              pattern: .*\S.*
            retryable:
              type: boolean
            spend_intent:
              allOf:
                - $ref: '#/components/schemas/SpendIntent'
              description: 'Present only on limit_exceeded: the saved, blocked request.'
          required:
            - code
            - message
            - retryable
      required:
        - error
      description: >-
        Existing Ionic error envelope. Spend errors always include retryable.
        Authentication/Connect middleware retains its existing envelope and may
        omit retryable.
    IntentID:
      type: string
      pattern: ^spi_[A-Za-z0-9]{14}$
    AgentID:
      type: string
      pattern: ^agt_[A-Za-z0-9]{14}$
    CardID:
      type: string
      pattern: ^spcard_[A-Za-z0-9]{14}$
    Seller:
      type: object
      additionalProperties: false
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 200
          pattern: .*\S.*
        checkout_url:
          $ref: '#/components/schemas/HTTPSURL'
      required:
        - name
        - checkout_url
    BillingDetails:
      type: object
      additionalProperties: false
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 200
          pattern: .*\S.*
        email:
          type: string
          format: email
          maxLength: 254
        address:
          $ref: '#/components/schemas/Address'
      required:
        - name
        - address
    AllowedHosts:
      type: array
      minItems: 1
      maxItems: 20
      uniqueItems: true
      items:
        type: string
        maxLength: 253
        pattern: >-
          ^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+$
        not:
          anyOf:
            - pattern: ^[0-9.]+$
            - pattern: \.(local|internal|localhost)$
      description: >-
        Exact plaintext reveal destinations. Supply 1-20 distinct lowercase
        public DNS hosts on create to avoid seller pre-registration. Null,
        empty, wildcard, URL, port, path, IP and local/internal names are
        rejected. The actual hosts are customer-approved and immutable;
        redirects do not expand them. Not a whole-browser network allowlist,
        merchant-legitimacy check, or merchant-account/amount constraint.
    Timestamp:
      type: integer
      minimum: 0
      description: Unix epoch seconds. Equality with a deadline is expired.
      format: int64
    ClaimWithinSeconds:
      type: integer
      minimum: 1
      maximum: 86400
      default: 300
      description: >-
        Seconds after approved_at within which the first claim must complete.
        Resolved and frozen at creation, shown during approval, and returned on
        the intent. Does not extend credential TTL. The supported range is 1-300
        seconds; a larger valid duration returns HTTP 422
        claim_window_unsupported before intent creation. Null and out-of-range
        values are invalid.
    SpendApproval:
      type: object
      additionalProperties: false
      properties:
        authority:
          type: string
          enum:
            - owner
            - platform
            - business
          description: >-
            Party whose human approval is required: owner for a direct Agent's
            own Account, platform for a delegated Agent's owner, business for
            the Account whose card is used.
        status:
          type: string
          enum:
            - pending
            - approved
            - declined
        over_limit:
          type: boolean
          description: >-
            True when this party must explicitly approve exceeding one of its
            own limits.
        decided_at:
          type: integer
          minimum: 0
          description: Unix epoch seconds.
          format: int64
          nullable: true
      required:
        - authority
        - status
        - over_limit
        - decided_at
      description: >-
        One required human approval. Platform decisions precede the business
        decision; the business decides last. Approver identity is shown only in
        authenticated Ionic owner routes.
    SpendLimitBreach:
      type: object
      additionalProperties: false
      properties:
        authority:
          type: string
          enum:
            - owner
            - platform
            - business
          description: >-
            Party whose human approval is required: owner for a direct Agent's
            own Account, platform for a delegated Agent's owner, business for
            the Account whose card is used.
        limit_id:
          type: string
          pattern: ^alm_[0-9A-Za-z]{14}$
        rule:
          type: object
          additionalProperties: false
          properties:
            type:
              type: string
              enum:
                - max_amount
                - window_amount
                - window_count
            window:
              type: string
              enum:
                - 1h
                - 24h
                - 7d
                - 30d
              nullable: true
          required:
            - type
            - window
        limit:
          type: integer
          minimum: 1
          maximum: 9007199254740991
          description: Minor units for amount rules; a count for window_count.
        usage:
          type: integer
          minimum: 0
          maximum: 9007199254740991
          description: >-
            Approved card access already counted in the window when the breach
            was evaluated. Not money spent.
        requested:
          type: integer
          minimum: 0
          maximum: 9007199254740991
        on_breach:
          type: string
          enum:
            - hold
            - block
          description: >-
            What the rule does when exceeded: hold asks for an explicit
            approval, block refuses the request (decision 0110).
      required:
        - authority
        - limit_id
        - rule
        - limit
        - usage
        - requested
        - on_breach
      description: >-
        A limit this request exceeds. Frozen when evaluated; the matching
        approval covers only this overage.
    HTTPSURL:
      type: string
      minLength: 10
      maxLength: 2048
      pattern: ^https://[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?(?:/[^\s?#]*)?$
      description: >-
        Absolute HTTPS URL; no userinfo, port, query, fragment or whitespace.
        Return destinations require registration where specified. Seller
        pre-registration is not required when the caller supplies allowed_hosts.
    Address:
      type: object
      additionalProperties: false
      properties:
        line1:
          type: string
          minLength: 1
          maxLength: 200
          pattern: .*\S.*
        line2:
          type: string
          maxLength: 200
        city:
          type: string
          minLength: 1
          maxLength: 100
          pattern: .*\S.*
        state:
          type: string
          maxLength: 100
        postal_code:
          type: string
          minLength: 1
          maxLength: 32
          pattern: .*\S.*
        country:
          type: string
          pattern: ^[A-Z]{2}$
      required:
        - line1
        - city
        - postal_code
        - country
  responses:
    '400':
      description: >-
        The request is invalid, for example `invalid_request`, `invalid_cursor`,
        or a missing `Idempotency-Key`.
      headers:
        Cache-Control:
          description: Always no-store, including errors and claim retries.
          schema:
            type: string
            enum:
              - no-store
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BoundaryError'
    '401':
      description: The API key is missing, invalid, expired, or revoked.
      headers:
        Cache-Control:
          description: Always no-store, including errors and claim retries.
          schema:
            type: string
            enum:
              - no-store
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BoundaryError'
    '403':
      description: >-
        The key or agent doesn't have access, for example `action_not_enabled`,
        `ACCOUNT_ACCESS_DENIED`, or `setup_access_denied`.
      headers:
        Cache-Control:
          description: Always no-store, including errors and claim retries.
          schema:
            type: string
            enum:
              - no-store
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BoundaryError'
    '404':
      description: The object doesn't exist, or the key can't see it.
      headers:
        Cache-Control:
          description: Always no-store, including errors and claim retries.
          schema:
            type: string
            enum:
              - no-store
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BoundaryError'
    '409':
      description: >-
        `idempotency_conflict`, `claim_key_conflict`, `claim_in_progress`, or
        `issuance_unknown`. See [Recover without creating another
        purchase](/guides/spend-platform-integration#recover-without-creating-another-purchase).
      headers:
        Cache-Control:
          description: Always no-store, including errors and claim retries.
          schema:
            type: string
            enum:
              - no-store
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SpendError'
    '422':
      description: >-
        The request can't be completed: `checkout_unsupported`,
        `approval_required`, `limit_exceeded`, `intent_not_claimable`,
        `intent_expired`, `checkout_configuration_unavailable`,
        `claim_window_unsupported`, `currency_not_allowed`, or
        `setup_session_expired`. See [Recover without creating another
        purchase](/guides/spend-platform-integration#recover-without-creating-another-purchase).
      headers:
        Cache-Control:
          description: Always no-store, including errors and claim retries.
          schema:
            type: string
            enum:
              - no-store
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SpendError'
    '429':
      description: Too many requests. Wait for `Retry-After`.
      headers:
        Cache-Control:
          description: Always no-store, including errors and claim retries.
          schema:
            type: string
            enum:
              - no-store
        Retry-After:
          description: Seconds to wait before a safe retry.
          schema:
            type: integer
            minimum: 1
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BoundaryError'
    '503':
      description: >-
        The service is temporarily unavailable and the request wasn't processed.
        Retry with the same `Idempotency-Key`.
      headers:
        Cache-Control:
          description: Always no-store, including errors and claim retries.
          schema:
            type: string
            enum:
              - no-store
        Retry-After:
          description: Seconds to wait before a safe retry.
          schema:
            type: integer
            minimum: 1
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BoundaryError'
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      description: >-
        Backend secret key for hosted setup; Agent secret key for card inventory
        and every spending-request operation. A delegated request also selects
        the authorized business through Ionic-Account. Machine keys cannot
        approve requests.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.