# Do not edit
openapi: 3.1.0
info:
  title: Flex Cards API
  version: '2026-10-23'
  summary: Cards
servers:
  - url: https://api.flex.one
security:
  - apiKey: []
paths:
  /cards:
    get:
      summary: List cards
      tags:
        - Endpoints
      operationId: getCards
      description: |
        List and filter cards across organizations you have permission to access.

        For public API access, requires `cards:read` in each requested organization. See
        [Authentication](/get-started/authentication/) for permissions and [Pagination &
        filtering](/fundamentals/pagination/) for listing resources.

        Set the `Accept` header to `text/csv` to download your cards as a CSV file.
      responses:
        '200':
          description: OK
          headers:
            Content-Disposition:
              schema:
                type: string
              description: Attachment filename for CSV downloads.
          content:
            application/json:
              schema:
                title: CardList
                type: object
                description: |
                  A page of cards.
                required:
                  - data
                  - metadata
                properties:
                  data:
                    description: |
                      The cards returned on this page.
                    type: array
                    items:
                      title: CardItem
                      type: object
                      description: |
                        An instrument for spending money, assigned to an account and a person.
                      required:
                        - id
                        - organizationId
                        - cardholderId
                        - type
                        - status
                        - form
                        - network
                        - expirationMonth
                        - expirationYear
                        - createdAt
                        - lastModifiedAt
                      properties:
                        id:
                          type: string
                          format: uuid
                          description: |
                            The unique identifier for the card.
                        organizationId:
                          type: string
                          format: uuid
                          description: |
                            The identifier of the organization that owns the card.
                        financialAccountId:
                          type: string
                          format: uuid
                          description: |
                            The identifier of the account the card spends against. For a Flex Reward Card, this is its
                            linked banking account. A business credit card can reference an account that is not available
                            through the Accounts API. Omitted when the account linkage cannot be resolved.
                        cardholderId:
                          type: string
                          format: uuid
                          description: |
                            The identifier of the person the card was issued to, called its cardholder. See
                            [Persons](/reference/persons/).
                        cardholderName:
                          type: string
                          description: |
                            The cardholder's full name. Omitted when no name is available.
                        name:
                          type: string
                          description: |
                            The display name assigned to the card. Omitted when no name is set.
                        type:
                          description: |
                            `rewardCard` identifies a Flex Reward Card; `businessCreditCard` identifies a business credit
                            card with net-60 payment terms.
                          title: CardProductType
                          type: string
                          enum:
                            - businessCreditCard
                            - rewardCard
                        status:
                          description: |
                            `pending` means the card has not been activated, `active` means it is activated and not frozen
                            or closed, `inactive` means it is frozen, and `closed` means it has been permanently cancelled.
                          title: CardStatus
                          type: string
                          enum:
                            - active
                            - closed
                            - inactive
                            - pending
                        form:
                          description: |
                            `physical` is a physical card; `virtual` is a card issued for use without a physical card.
                          title: CardForm
                          type: string
                          enum:
                            - physical
                            - virtual
                        network:
                          description: |
                            The payment network: `mastercard` or `visa`.
                          title: CardNetwork
                          type: string
                          enum:
                            - mastercard
                            - visa
                        lastFour:
                          type: string
                          description: |
                            The last four digits of the card number. Omitted until the card has been activated.
                        expirationMonth:
                          type: integer
                          minimum: 1
                          maximum: 12
                          description: |
                            The expiration month, from 1 (January) through 12 (December).
                        expirationYear:
                          type: integer
                          description: |
                            The four-digit expiration year.
                        spendLimit:
                          description: |
                            The configured per-card spending limit. Omitted when no per-card limit is configured. Other
                            account restrictions can still apply.
                          title: CardSpendLimit
                          type: object
                          required:
                            - amount
                            - interval
                          properties:
                            amount:
                              description: |
                                The maximum amount the card can spend during the configured interval.
                              title: CardAmount
                              type: object
                              required:
                                - amount
                                - scale
                              properties:
                                amount:
                                  type: integer
                                  format: int64
                                  description: |
                                    The integer monetary amount, interpreted using `scale`.
                                scale:
                                  type: integer
                                  description: |
                                    The number of decimal places in `amount`.
                                currency:
                                  type: string
                                  default: USD
                                  description: |
                                    The ISO 4217 currency code. Defaults to `USD`.
                            interval:
                              type: string
                              description: |
                                The period the limit applies to: `daily`, `weekly`, `monthly`, `quarterly`, or `annually`.
                                `lifetime` applies across the life of the card.
                              enum:
                                - annually
                                - daily
                                - lifetime
                                - monthly
                                - quarterly
                                - weekly
                        activatedAt:
                          type: string
                          format: date-time
                          description: |
                            When the card was activated. Omitted if it has not been activated.
                        closedAt:
                          type: string
                          format: date-time
                          description: |
                            When the card was permanently cancelled. Omitted when no closure date is recorded.
                        createdAt:
                          type: string
                          format: date-time
                          description: |
                            When the card was created.
                        lastModifiedAt:
                          type: string
                          format: date-time
                          description: |
                            When the card was last modified.
                        pan:
                          type: string
                          description: |
                            Full card number. Only available in a [Reveal Session](/reference/cards/viewing-sensitive-details/).
                        cvv:
                          type: string
                          description: |
                            Card security code. Only available in a [Reveal Session](/reference/cards/viewing-sensitive-details/).
                  metadata:
                    description: |
                      Pagination details. See [Pagination & filtering](/fundamentals/pagination/).
                    title: CardListMetadata
                    type: object
                    required:
                      - pageSize
                      - sort
                    properties:
                      pageSize:
                        description: |
                          The requested maximum number of cards per page.
                        type: integer
                      sort:
                        description: |
                          The applied sort direction: `asc` or `desc`.
                        type: string
                        enum:
                          - asc
                          - desc
                      nextToken:
                        type: string
                        description: |
                          The cursor for the next page. Omitted when there are no more results. See [Pagination &
                          filtering](/fundamentals/pagination/).
              examples:
                virtualRewardCard:
                  summary: Active virtual Reward Card
                  value:
                    data:
                      - id: 8c5146d7-8229-4ef4-96c0-55ddbd6d587b
                        organizationId: 3f8bbfa2-9257-4a7e-86d3-df1797b8e143
                        financialAccountId: 470195c7-4cf3-4df3-9f92-80848be0a3ad
                        cardholderId: 92608f75-a040-4341-a49d-f0de8daacdf1
                        cardholderName: Alex Morgan
                        name: Software subscriptions
                        type: rewardCard
                        status: active
                        form: virtual
                        network: visa
                        lastFour: '4242'
                        expirationMonth: 11
                        expirationYear: 2029
                        spendLimit:
                          amount:
                            amount: 100000
                            scale: 2
                            currency: USD
                          interval: monthly
                        activatedAt: '2026-11-16T14:00:00.000Z'
                        createdAt: '2026-11-16T14:00:00.000Z'
                        lastModifiedAt: '2026-11-16T14:00:00.000Z'
                    metadata:
                      pageSize: 25
                      sort: desc
            text/csv:
              schema:
                type: string
                format: binary
        '400':
          description: |
            Invalid parameter, unsupported filter or sort field, or unresolvable pagination cursor. Public
            API requests also require an API version of `2026-09-10` or later.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardRequestError'
        '401':
          description: Missing or invalid authentication.
        '403':
          description: |
            The request lacks the permissions required for this operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardRequestError'
        '429':
          description: Too Many Requests, the rate limit was exceeded. Carries a `Retry-After` header in whole seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardRequestError'
      parameters:
        - in: query
          name: organizationIds
          schema:
            type: array
            maxItems: 100
            items:
              type: string
              format: uuid
          style: form
          explode: true
          description: |
            Filter by organization IDs. Maximum 100. Omit to include all organizations available to you.
            Requesting an organization you cannot access returns `403`.
        - in: query
          name: cardholderIds
          schema:
            type: array
            maxItems: 100
            items:
              type: string
              format: uuid
          style: form
          explode: true
          description: |
            Filter by the IDs of people the cards were issued to. Maximum 100.
        - in: query
          name: financialAccountIds
          schema:
            type: array
            maxItems: 100
            items:
              type: string
              format: uuid
          style: form
          explode: true
          description: |
            Filter by the account IDs reported in `financialAccountId` on the cards. Maximum 100.
        - in: query
          name: ids
          schema:
            type: array
            maxItems: 100
            items:
              type: string
              format: uuid
          style: form
          explode: true
          description: |
            Filter by card IDs. Maximum 100.
        - in: query
          name: forms
          schema:
            type: array
            maxItems: 2
            items:
              $ref: '#/components/schemas/CardForm'
          style: form
          explode: true
          description: |
            Filter by `physical` or `virtual` cards. Maximum 2 values.
        - in: query
          name: statuses
          schema:
            type: array
            maxItems: 4
            items:
              $ref: '#/components/schemas/CardStatus'
          style: form
          explode: true
          description: |
            Filter by card status. `pending` means the card has not been activated, `active` means it is
            activated and not frozen or closed, `inactive` means it is frozen, and `closed` means it has
            been permanently cancelled. Maximum 4 values.
        - in: query
          name: types
          schema:
            type: array
            maxItems: 4
            items:
              $ref: '#/components/schemas/CardProductType'
          style: form
          explode: true
          description: |
            Filter by card type. `rewardCard` identifies a Flex Reward Card; `businessCreditCard` identifies
            a business credit card with net-60 payment terms. Maximum 4 values.
        - in: query
          name: createdAtGte
          schema:
            type: string
            format: date-time
          description: |
            Include cards created at or after this timestamp.
        - in: query
          name: createdAtLte
          schema:
            type: string
            format: date-time
          description: |
            Include cards created at or before this timestamp.
        - in: query
          name: nextToken
          schema:
            type: string
            maxLength: 64
          description: |
            The pagination cursor. A malformed cursor, or one that no longer identifies an accessible card,
            returns `400`. See [Pagination & filtering](/fundamentals/pagination/).
        - name: pageSize
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
          description: |
            The maximum number of cards per page. Defaults to 25; minimum 1, maximum 100.
        - name: sort
          in: query
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
          description: |
            The sort direction: `asc` or `desc`. For public API requests, defaults to `desc`.
        - name: sortBy
          in: query
          required: false
          schema:
            type: string
            enum:
              - createdAt
            default: createdAt
          description: |
            The field to sort by. Public API requests support `createdAt` only, which is the default; other
            values return `400`.
        - $ref: '#/components/parameters/flexVersion'
    post:
      summary: Create card
      tags:
        - Endpoints
      operationId: createCard
      description: |
        Issue a virtual card to a person in your organization. You must have permission to issue cards
        for that organization. The account you provide determines the card type.

        For public API access, requires `cards:write` in that organization. See
        [Authentication](/get-started/authentication/) for permissions and
        [Idempotency](/fundamentals/idempotency/) for retrying writes.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCardRequest'
            examples:
              virtualRewardCard:
                summary: Issue a virtual card with a $1,000 monthly limit
                value:
                  cardholderId: 92608f75-a040-4341-a49d-f0de8daacdf1
                  financialAccountId: 470195c7-4cf3-4df3-9f92-80848be0a3ad
                  name: Software subscriptions
                  spendLimit:
                    amount:
                      amount: 100000
                      scale: 2
                      currency: USD
                    interval: monthly
                  idempotencyKey: create-software-subscriptions-001
      responses:
        '201':
          description: |
            The created card. For public API requests, a successful idempotency replay returns the same card
            in its current state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardItem'
              examples:
                virtualRewardCard:
                  summary: Created virtual Reward Card
                  value:
                    id: 8c5146d7-8229-4ef4-96c0-55ddbd6d587b
                    organizationId: 3f8bbfa2-9257-4a7e-86d3-df1797b8e143
                    financialAccountId: 470195c7-4cf3-4df3-9f92-80848be0a3ad
                    cardholderId: 92608f75-a040-4341-a49d-f0de8daacdf1
                    cardholderName: Alex Morgan
                    name: Software subscriptions
                    type: rewardCard
                    status: active
                    form: virtual
                    network: visa
                    lastFour: '4242'
                    expirationMonth: 11
                    expirationYear: 2029
                    spendLimit:
                      amount:
                        amount: 100000
                        scale: 2
                        currency: USD
                      interval: monthly
                    activatedAt: '2026-11-16T14:00:00.000Z'
                    createdAt: '2026-11-16T14:00:00.000Z'
                    lastModifiedAt: '2026-11-16T14:00:00.000Z'
        '400':
          description: |
            Invalid request, incompatible account and cardholder, inactive cardholder, unavailable virtual
            card type, or an account restriction that prevents issuance. See the response fields for
            details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardRequestError'
        '403':
          description: |
            The request lacks the permissions required for this operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardRequestError'
        '404':
          description: |
            The cardholder is not accessible for this operation, the account cannot be used to issue cards,
            or the card from a prior request is no longer accessible during a replay.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardRequestError'
        '409':
          description: |
            The idempotency key was used for a different request, another attempt is in progress, or
            issuance cannot continue with this idempotency key. See `flexErrorCode` when present.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardRequestError'
        '429':
          description: Too Many Requests, the rate limit was exceeded. Carries a `Retry-After` header in whole seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardRequestError'
        '503':
          description: |
            Issuance could not complete because a required service or card-data security check was
            unavailable. See the response fields for details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardRequestError'
      parameters:
        - $ref: '#/components/parameters/flexVersion'
  /cards/{cardId}:
    get:
      summary: Get card
      tags:
        - Endpoints
      operationId: getCard
      description: |
        Retrieve a card by its ID. You must have permission to view the card.

        For public API access, requires `cards:read` in the card's organization. See
        [Authentication](/get-started/authentication/).
      parameters:
        - in: path
          name: cardId
          required: true
          schema:
            type: string
            format: uuid
          description: |
            The unique identifier of the card.
        - $ref: '#/components/parameters/flexVersion'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardItem'
              examples:
                virtualRewardCard:
                  summary: Active virtual Reward Card
                  value:
                    id: 8c5146d7-8229-4ef4-96c0-55ddbd6d587b
                    organizationId: 3f8bbfa2-9257-4a7e-86d3-df1797b8e143
                    financialAccountId: 470195c7-4cf3-4df3-9f92-80848be0a3ad
                    cardholderId: 92608f75-a040-4341-a49d-f0de8daacdf1
                    cardholderName: Alex Morgan
                    name: Software subscriptions
                    type: rewardCard
                    status: active
                    form: virtual
                    network: visa
                    lastFour: '4242'
                    expirationMonth: 11
                    expirationYear: 2029
                    spendLimit:
                      amount:
                        amount: 100000
                        scale: 2
                        currency: USD
                      interval: monthly
                    activatedAt: '2026-11-16T14:00:00.000Z'
                    createdAt: '2026-11-16T14:00:00.000Z'
                    lastModifiedAt: '2026-11-16T14:00:00.000Z'
        '400':
          description: Bad Request — cardId is uuid-shaped but is not a valid uuid, or the `flex-version` could not be resolved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardRequestError'
        '401':
          description: Missing or invalid authentication.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardRequestError'
        '403':
          description: |
            The request lacks the permissions required for this operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardRequestError'
        '404':
          description: |
            No card is visible with this ID, or the path does not contain a UUID-shaped card ID.
        '429':
          description: Too Many Requests, the rate limit was exceeded. Carries a `Retry-After` header in whole seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardRequestError'
    patch:
      summary: Update card
      tags:
        - Endpoints
      operationId: updateCard
      description: |
        Freeze or unfreeze a card, change its spending limit, or permanently close it. You must have
        permission to make the requested change.

        For public API access, requires `cards:write` to freeze, unfreeze, or change spending limits, or
        `cards:terminate` to close the card. See [Authentication](/get-started/authentication/) for
        permissions and [Idempotency](/fundamentals/idempotency/) for retrying writes.
      parameters:
        - description: |
            The unique identifier of the card to update.
          in: path
          name: cardId
          required: true
          schema:
            type: string
            format: uuid
        - $ref: '#/components/parameters/flexVersion'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCardRequest'
            examples:
              freezeCard:
                summary: Freeze the card
                value:
                  status: inactive
                  idempotencyKey: freeze-software-subscriptions-001
      responses:
        '200':
          description: |
            The card in its current state. For public API requests, an idempotency replay also returns the
            current state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardItem'
              examples:
                freezeCard:
                  summary: Frozen virtual Reward Card
                  value:
                    id: 8c5146d7-8229-4ef4-96c0-55ddbd6d587b
                    organizationId: 3f8bbfa2-9257-4a7e-86d3-df1797b8e143
                    financialAccountId: 470195c7-4cf3-4df3-9f92-80848be0a3ad
                    cardholderId: 92608f75-a040-4341-a49d-f0de8daacdf1
                    cardholderName: Alex Morgan
                    name: Software subscriptions
                    type: rewardCard
                    status: inactive
                    form: virtual
                    network: visa
                    lastFour: '4242'
                    expirationMonth: 11
                    expirationYear: 2029
                    spendLimit:
                      amount:
                        amount: 100000
                        scale: 2
                        currency: USD
                      interval: monthly
                    activatedAt: '2026-11-16T14:00:00.000Z'
                    createdAt: '2026-11-16T14:00:00.000Z'
                    lastModifiedAt: '2026-11-16T14:05:00.000Z'
        '400':
          description: |
            Bad Request. The cardId is not a uuid, the body changes nothing, the card is in a
            status this operation cannot move it out of, `closed` arrives alongside a spend
            limit, or a spend limit names a non-unlimited interval without a positive amount.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardRequestError'
        '403':
          description: |
            The request lacks the permissions required for this operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardRequestError'
        '404':
          description: Not Found. The caller has no visible card with this id
        '409':
          description: |
            The idempotency key was used for a different request, or a request with that idempotency key is
            still running.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardRequestError'
        '429':
          description: Too Many Requests, the rate limit was exceeded. Carries a `Retry-After` header in whole seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardRequestError'
  /reveal-sessions:
    post:
      summary: Create a reveal session
      description: |
        Creates a short-lived token for retrieving full card numbers and security codes. Send card requests with this token to the `revealBaseUrl` in the response, not to the API host. Your API key is never sent to that address.

        The token works only for `GET /cards` and `GET /cards/{cardId}` sent to `revealBaseUrl`, and it expires five minutes after it is created. It covers each organization where your API key holds both `cards:read` and `cards:reveal` and card reveal is enabled. Create the session with an API key. The token is returned once: a retry with the same `idempotencyKey` returns the session without it.
      tags:
        - Endpoints
      operationId: createRevealSession
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRevealSessionRequest'
            examples:
              revealSession:
                summary: Create a card reveal session
                value:
                  idempotencyKey: reveal-cards-001
      responses:
        '201':
          description: The created reveal session.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RevealSession'
              examples:
                revealSession:
                  summary: New card reveal session
                  description: The token and reveal URL are illustrative. Use the values returned by your request.
                  value:
                    id: f8e27a40-60ba-442d-a4b1-e068f454f384
                    token: <REVEAL_TOKEN>
                    tokenType: Bearer
                    scope: cards:reveal
                    organizationIds:
                      - 3f8bbfa2-9257-4a7e-86d3-df1797b8e143
                    expiresAt: '2026-11-16T14:05:00.000Z'
                    revealBaseUrl: https://example.secure.url.flex.one
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '403':
          description: The request was not made with an API key, or the key holds both `cards:read` and `cards:reveal` in no organization where card reveal is enabled.
        '409':
          description: The `idempotencyKey` was already used with a different request, or the session it created has expired.
        '429':
          description: Too Many Requests — the rate limit was exceeded. Carries a `Retry-After` header in whole seconds
      parameters: []
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
  parameters:
    flexVersion:
      in: header
      name: flex-version
      required: false
      example: '2026-10-23'
      schema:
        type: string
        pattern: ^\d{4}-\d{2}-\d{2}$
  schemas:
    CardAmount:
      description: |
        A monetary amount. See [Amounts](/fundamentals/amounts/) for the shared representation.
      title: CardAmount
      type: object
      required:
        - amount
        - scale
      properties:
        amount:
          type: integer
          format: int64
          description: |
            The integer monetary amount, interpreted using `scale`.
        scale:
          type: integer
          description: |
            The number of decimal places in `amount`.
        currency:
          type: string
          default: USD
          description: |
            The ISO 4217 currency code. Defaults to `USD`.
    CardForm:
      title: CardForm
      type: string
      description: |
        `physical` is a physical card; `virtual` is a card issued for use without a physical card.
      enum:
        - physical
        - virtual
    CardItem:
      title: CardItem
      type: object
      description: |
        An instrument for spending money, assigned to an account and a person.
      required:
        - id
        - organizationId
        - cardholderId
        - type
        - status
        - form
        - network
        - expirationMonth
        - expirationYear
        - createdAt
        - lastModifiedAt
      properties:
        id:
          type: string
          format: uuid
          description: |
            The unique identifier for the card.
        organizationId:
          type: string
          format: uuid
          description: |
            The identifier of the organization that owns the card.
        financialAccountId:
          type: string
          format: uuid
          description: |
            The identifier of the account the card spends against. For a Flex Reward Card, this is its
            linked banking account. A business credit card can reference an account that is not available
            through the Accounts API. Omitted when the account linkage cannot be resolved.
        cardholderId:
          type: string
          format: uuid
          description: |
            The identifier of the person the card was issued to, called its cardholder. See
            [Persons](/reference/persons/).
        cardholderName:
          type: string
          description: |
            The cardholder's full name. Omitted when no name is available.
        name:
          type: string
          description: |
            The display name assigned to the card. Omitted when no name is set.
        type:
          $ref: '#/components/schemas/CardProductType'
          description: |
            `rewardCard` identifies a Flex Reward Card; `businessCreditCard` identifies a business credit
            card with net-60 payment terms.
        status:
          $ref: '#/components/schemas/CardStatus'
          description: |
            `pending` means the card has not been activated, `active` means it is activated and not frozen
            or closed, `inactive` means it is frozen, and `closed` means it has been permanently cancelled.
        form:
          $ref: '#/components/schemas/CardForm'
          description: |
            `physical` is a physical card; `virtual` is a card issued for use without a physical card.
        network:
          $ref: '#/components/schemas/CardNetwork'
          description: |
            The payment network: `mastercard` or `visa`.
        lastFour:
          type: string
          description: |
            The last four digits of the card number. Omitted until the card has been activated.
        expirationMonth:
          type: integer
          minimum: 1
          maximum: 12
          description: |
            The expiration month, from 1 (January) through 12 (December).
        expirationYear:
          type: integer
          description: |
            The four-digit expiration year.
        spendLimit:
          $ref: '#/components/schemas/CardSpendLimit'
          description: |
            The configured per-card spending limit. Omitted when no per-card limit is configured. Other
            account restrictions can still apply.
        activatedAt:
          type: string
          format: date-time
          description: |
            When the card was activated. Omitted if it has not been activated.
        closedAt:
          type: string
          format: date-time
          description: |
            When the card was permanently cancelled. Omitted when no closure date is recorded.
        createdAt:
          type: string
          format: date-time
          description: |
            When the card was created.
        lastModifiedAt:
          type: string
          format: date-time
          description: |
            When the card was last modified.
        pan:
          type: string
          description: |
            Full card number. Only available in a [Reveal Session](/reference/cards/viewing-sensitive-details/).
        cvv:
          type: string
          description: |
            Card security code. Only available in a [Reveal Session](/reference/cards/viewing-sensitive-details/).
    CardNetwork:
      title: CardNetwork
      type: string
      description: |
        The payment network: `mastercard` or `visa`.
      enum:
        - mastercard
        - visa
    CardProductType:
      title: CardProductType
      type: string
      description: |
        `rewardCard` identifies a Flex Reward Card; `businessCreditCard` identifies a business credit
        card with net-60 payment terms.
      enum:
        - businessCreditCard
        - rewardCard
    CardRequestError:
      title: CardRequestError
      type: object
      description: |
        An error response. See [Errors](/fundamentals/errors/).
      required:
        - statusCode
        - message
      properties:
        statusCode:
          description: |
            The HTTP status code.
          type: integer
        message:
          description: |
            A description of the error.
          type: string
        errors:
          description: |
            Additional details keyed by the affected field, or by `message` for request-level errors.
          type: object
          additionalProperties:
            type: string
        flexErrorCode:
          description: |
            A machine-readable error code, when available. `CARD_ISSUANCE_CARDHOLDER_CARD_LIMIT` means the
            cardholder has reached the active-card limit; `CARD_ISSUANCE_CARDHOLDER_BIRTH_DATE_REQUIRED`
            means a date of birth is needed before the first card can be issued.
            `CARD_ISSUANCE_DENIED_BY_ACCESS_RESTRICTION` means an account restriction prevents issuance, and
            `CARD_ISSUANCE_ACCESS_GATE_UNAVAILABLE` means that restriction check could not complete.
            `CARD_ISSUANCE_TOKENIZATION_UNAVAILABLE` means secure card data could not be prepared;
            `CARD_ISSUANCE_TOKENIZATION_GATE_UNAVAILABLE` means the security eligibility check could not
            complete; `CARD_ISSUANCE_TOKENIZATION_REJECTED` means a card-data security check failed;
            `CARD_ISSUANCE_TOKENIZATION_SUSPENDED` means issuance is suspended after such a failure.
            `CARD_ISSUANCE_TOKENIZATION_ATTEMPT_IN_PROGRESS` means another issuance attempt is running;
            `CARD_ISSUANCE_TOKENIZATION_ATTEMPTS_EXHAUSTED` means the idempotency key reached its attempt
            limit;
            `CARD_ISSUANCE_IDEMPOTENCY_KEY_IN_USE` means a card is already associated with that idempotency
            key; `CARD_ISSUANCE_TOKEN_PAYLOAD_CONFLICT` means the card processor already holds this card under
            a different request; `CARD_ISSUANCE_CARDHOLDER_TOKEN_CONFLICT` means it holds this cardholder under
            another account, or cannot read it back.
          type: string
    CardSpendLimit:
      title: CardSpendLimit
      type: object
      description: |
        The configured per-card spending limit.
      required:
        - amount
        - interval
      properties:
        amount:
          $ref: '#/components/schemas/CardAmount'
          description: |
            The maximum amount the card can spend during the configured interval.
        interval:
          type: string
          description: |
            The period the limit applies to: `daily`, `weekly`, `monthly`, `quarterly`, or `annually`.
            `lifetime` applies across the life of the card.
          enum:
            - annually
            - daily
            - lifetime
            - monthly
            - quarterly
            - weekly
    CardStatus:
      title: CardStatus
      type: string
      description: |
        `pending` means the card has not been activated, `active` means it is activated and not frozen
        or closed, `inactive` means it is frozen, and `closed` means it has been permanently cancelled.
      enum:
        - active
        - closed
        - inactive
        - pending
    CreateCardRequest:
      title: CreateCardRequest
      type: object
      description: |
        The person, account, and optional spending limit for a new virtual card.
      required:
        - cardholderId
        - financialAccountId
        - idempotencyKey
      properties:
        cardholderId:
          type: string
          format: uuid
          description: |
            The ID of an active person in the account's organization.
        financialAccountId:
          type: string
          format: uuid
          description: |
            The account to issue against. For a Flex Reward Card, use its linked banking account ID from the
            Accounts API. For a business credit card, use the financial account ID linked to an open Lead
            Net-60 credit line; these credit accounts are not currently returned by the Accounts API. The
            account and cardholder must belong to the same organization.
        name:
          type: string
          minLength: 1
          maxLength: 100
          description: |
            An optional display name for the card, from 1 to 100 characters.
        spendLimit:
          $ref: '#/components/schemas/WritableCardSpendLimit'
          description: |
            An optional per-card spending limit. Omit for no per-card limit; account restrictions still
            apply.
        idempotencyKey:
          type: string
          minLength: 1
          maxLength: 255
          description: |
            An idempotency key of 1 to 255 characters for this issuance request. For public API requests, a
            successful replay returns the same card in its current state without issuing another card.
            Reusing the idempotency key with different request fields returns `409`. See
            [Idempotency](/fundamentals/idempotency/).
    CreateRevealSessionRequest:
      title: CreateRevealSessionRequest
      type: object
      properties:
        idempotencyKey:
          type: string
          minLength: 1
          maxLength: 255
          description: Idempotency key for safe client retries
      required:
        - idempotencyKey
    RevealSession:
      title: RevealSession
      type: object
      properties:
        id:
          type: string
          format: uuid
        token:
          type: string
          description: Bearer token for card requests to `revealBaseUrl`. Returned only in the response that creates the session.
        tokenType:
          $ref: '#/components/schemas/RevealSessionTokenType'
        scope:
          $ref: '#/components/schemas/RevealSessionScope'
        organizationIds:
          type: array
          description: The organizations whose cards the token can read.
          items:
            type: string
            format: uuid
        expiresAt:
          type: string
          format: date-time
        revealBaseUrl:
          type: string
          format: uri
          description: Send card requests made with `token` to this base URL, not to the API host.
      required:
        - id
        - tokenType
        - scope
        - organizationIds
        - expiresAt
        - revealBaseUrl
    RevealSessionScope:
      title: RevealSessionScope
      type: string
      enum:
        - cards:reveal
    RevealSessionTokenType:
      title: RevealSessionTokenType
      type: string
      enum:
        - Bearer
    UpdateCardRequest:
      title: UpdateCardRequest
      type: object
      description: |
        Changes to apply to a card. Provide `status`, `spendLimit`, or both. Closing a card must be
        requested without a spending-limit change.
      required:
        - idempotencyKey
      properties:
        status:
          description: |
            The requested status. `inactive` freezes the card, `active` unfreezes it, and `closed`
            permanently cancels it. Omit to leave status unchanged. A pending card cannot be frozen or
            unfrozen; a closed card cannot be reopened. Closing cannot be combined with `spendLimit`. For
            public API requests, closing requires `cards:terminate`.
          $ref: '#/components/schemas/WritableCardStatus'
        spendLimit:
          description: |
            The per-card limit to set or remove. Omit to leave it unchanged. A limit can be set before
            activation, but cannot be changed on a closed card or while its account's card program is
            delinquent.
          $ref: '#/components/schemas/WritableCardSpendLimit'
        idempotencyKey:
          type: string
          minLength: 1
          maxLength: 255
          description: |
            An idempotency key of 1 to 255 characters for this update. For public API requests, a successful
            replay returns the card's current state without applying the update again. Reusing the
            idempotency key for another card or different request fields returns `409`. See
            [Idempotency](/fundamentals/idempotency/).
    WritableCardSpendLimit:
      title: WritableCardSpendLimit
      type: object
      description: |
        A per-card spending limit to set or remove.
      required:
        - interval
      properties:
        amount:
          $ref: '#/components/schemas/CardAmount'
          description: |
            The spending limit. Must be positive unless `interval` is `unlimited`, in which case it is
            ignored.
        interval:
          type: string
          description: |
            The period the limit applies to: `daily`, `weekly`, `monthly`, `quarterly`, or `annually`.
            `lifetime` applies across the life of the card. Use `unlimited` to remove the per-card limit.
          enum:
            - annually
            - daily
            - lifetime
            - monthly
            - quarterly
            - unlimited
            - weekly
    WritableCardStatus:
      title: WritableCardStatus
      type: string
      description: |
        `active` unfreezes the card, `inactive` freezes it, and `closed` permanently cancels it. For
        public API requests, cancellation requires `cards:terminate`; freezing and unfreezing require
        `cards:write`.
      enum:
        - active
        - closed
        - inactive
tags:
  - name: Endpoints
