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

> ## Agent Instructions
> For new direct REST integrations, use the v2026-04 surfaces. The @fluid-app FairShare SDK continues to use its own published public-v2025-06 contract.
> Authenticate with the header Authorization: Bearer <token>; public storefront read endpoints require no auth.
> Lists use cursor pagination via the page[cursor] and page[limit] query params; follow meta.pagination.next_cursor until it is null.
> Never use /api/company/v1 or /api/v1 paths, page/per_page params, or offset pagination — they are legacy.
> The OpenAPI specs under api-reference/ are the authoritative contracts; prefer them over prose when in doubt. api-reference/storefront-v2026-04.yaml covers the v2026-04 storefront surface (/api/v202604/... paths); api-reference/auth-v0.yaml covers the unversioned auth surface (/api/... paths — authentication, MFA, social auth, and token exchange); api-reference/checkout-v2026-04.yaml covers the v2026-04 checkout surface (/api/checkout/v2026-04/... paths — carts, cart auth, discounts, items, subscriptions, orders, enrollments, and store config); api-reference/public-v2025-06.yaml covers the Public SDK surface used by the @fluid-app FairShare SDK, including its parallel cart lifecycle, browser integrations, versioned payment callbacks, unversioned public utilities, and the cart price-override operation; api-reference/payment-v2026-04.yaml covers the v2026-04 payment gateway admin surface (/api/payment/v2026-04/... paths, bearer-authenticated — gateway CRUD, gateway purchase/authorize/$0-verify, transaction list/show and capture/void/credit, and merchant payment configuration); api-reference/payments-v2026-04.yaml covers the v2026-04 cart payment surface (/api/payments/v2026-04/carts/{cart_token}/... paths, authenticated by the cart token in the path with no bearer — payment-method selection, VGS card tokenization, 3D Secure verification, and PayPal/Braintree/Klarna/Apple Pay flows); api-reference/commerce-v2026-04.yaml covers the v2026-04 commerce order-editing surface (/api/v202604/orders/{order_id}/edits paths, bearer-authenticated — post-checkout order edits that atomically insert items and add adjustments/discounts, with an optional dry-run preview); api-reference/webhooks-v0.yaml covers the unversioned webhooks surface (/api/... paths — webhook registration, delivery payloads, callback registrations, company events, and webhook/callback schemas).
> Successful responses wrap the resource payload alongside a top-level integer status and a meta object.

# Create customer payment method

> Saves a payment method on the authenticated customer's account. Requires
`type`, `country_code`, and a `payment_method` payload; set
`default_payment_method: true` to make it the default. Requires a customer
bearer token. Returns `422` on validation or tokenization failure and `401`
when unauthenticated.




## OpenAPI

````yaml /api-reference/checkout-v2026-04.yaml post /api/checkout/v2026-04/customers/me/payment_methods
openapi: 3.1.0
info:
  title: Fluid Checkout API
  description: >-
    **Fluid Checkout API — for building a checkout directly against REST.**


    Use this surface if you are integrating server-to-server or building your
    own

    checkout UI. It covers the full order lifecycle (cart → address → shipping →

    discount → complete → order) plus the logged-in customer's account: saved

    addresses, saved payment methods, order history, loyalty points, and

    subscription management (pause, resume, skip, cancel, retry).


    **The cart token in the URL scopes cart access** — creating a cart, adding

    items, applying a discount, and completing a cart need no bearer token.

    Among the cart operations, a Bearer token is required only for

    `carts/{cart_token}/sync`, `carts/{cart_token}/volume_rep`, and

    `carts/{cart_token}/discount/manual`. Off the cart, a token is required for

    everything under `customers/me` and `subscriptions`, and for the store and

    directory lookups (`store/config`, `store/languages`, `reps`, `users`) and

    `subscription_bundles`. `store/countries` accepts a token but does not

    require one — it returns the same list either way.


    **If you are using the `@fluid-app` FairShare SDK in a theme or storefront,

    you are not calling this surface** — the SDK calls the Fluid Public SDK API

    (`public-v2025-06`). Do not mix the two against one cart: they share the
    same

    cart records and services, but their request shapes differ. See

    [Choosing a cart
    surface](https://docs.fluid.app/api/choosing-a-cart-surface)

    for the operation map and boundary.
  version: v2026-04
  contact:
    email: support@fluid.app
  license:
    name: Proprietary
    identifier: LicenseRef-Proprietary
servers:
  - url: https://api.fluid.app
security: []
tags:
  - name: carts
    description: >-
      Create, read, and mutate checkout carts (email, address, country,
      language, shipping, recalculation, completion).
  - name: cart-auth
    description: >-
      Cart-scoped customer authentication — magic-link challenge, verification,
      identity, and logout.
  - name: cart-discount
    description: >-
      Apply, list, and remove cart discount codes, including admin manual
      discounts.
  - name: cart-items
    description: Add, update, and remove line items on a cart.
  - name: cart-points
    description: Apply and remove loyalty points on a cart.
  - name: customers
    description: The authenticated customer's profile and company memberships.
  - name: customer-addresses
    description: The authenticated customer's saved shipping/billing addresses.
  - name: customer-orders
    description: The authenticated customer's order history.
  - name: customer-payment-methods
    description: The authenticated customer's saved payment methods and tokenization.
  - name: customer-points
    description: The authenticated customer's loyalty point balances.
  - name: directory
    description: Company rep and user directory lookups.
  - name: enrollments
    description: >-
      Public enrollment forms — retrieve a form and submit, update, or upload
      field answers.
  - name: orders
    description: Public order lookup by token.
  - name: products
    description: Public product queries for the storefront checkout.
  - name: store
    description: >-
      Store-level checkout configuration — countries, languages, address fields,
      agreements, drop zones, and Apple Pay domain verification.
  - name: subscriptions
    description: >-
      Manage subscriptions — pause, resume, skip, cancel, reactivate, retry, and
      failed-cycle waivers.
  - name: subscription-bundles
    description: List and create subscription bundles.
paths:
  /api/checkout/v2026-04/customers/me/payment_methods:
    post:
      tags:
        - customer-payment-methods
      summary: Create customer payment method
      description: >
        Saves a payment method on the authenticated customer's account. Requires

        `type`, `country_code`, and a `payment_method` payload; set

        `default_payment_method: true` to make it the default. Requires a
        customer

        bearer token. Returns `422` on validation or tokenization failure and
        `401`

        when unauthenticated.
      operationId: checkout_v2026_04_create_customer_payment_method
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - type
                - country_code
                - payment_method
              properties:
                type:
                  type: string
                  description: Payment method type
                  example: credit_card
                country_code:
                  type: string
                  description: ISO country code for the checkout country
                  example: US
                payment_method:
                  type: object
                  additionalProperties: false
                  required:
                    - token
                  properties:
                    token:
                      type: string
                      description: Tokenized payment credential
                    token_provider:
                      type: string
                      description: Token provider identifier
                    cvv_token:
                      type: string
                      description: Tokenized CVV credential
                    exp_month:
                      type: integer
                      example: 12
                    exp_year:
                      type: integer
                      example: 2028
                    card_holder:
                      type: string
                      description: Cardholder name
                    payment_account_id:
                      description: Payment account ID override
                    bin:
                      type:
                        - string
                        - 'null'
                      description: >-
                        First six digits of the card number forwarded from VGS
                        Collect for brand/BIN persistence.
                      example: '424242'
                    last_four:
                      type:
                        - string
                        - 'null'
                      description: >-
                        Last four digits of the card number, forwarded from VGS
                        Collect for display persistence.
                      example: '4242'
                    card_network:
                      type:
                        - string
                        - 'null'
                      description: >-
                        Card network (e.g. visa, mastercard) forwarded from VGS
                        Collect for brand persistence.
                      example: visa
                default_payment_method:
                  type: boolean
                  description: Whether to set this as the default payment method
                billing_address:
                  type: object
                  additionalProperties: false
                  required:
                    - address1
                    - city
                    - state
                    - zip
                    - country_code
                  properties:
                    address1:
                      type:
                        - string
                        - 'null'
                    address2:
                      type:
                        - string
                        - 'null'
                    city:
                      type:
                        - string
                        - 'null'
                    state:
                      type:
                        - string
                        - 'null'
                    zip:
                      type:
                        - string
                        - 'null'
                    country_code:
                      type:
                        - string
                        - 'null'
                      example: US
                    name:
                      type:
                        - string
                        - 'null'
                browser_info:
                  type: object
                  additionalProperties: true
                  description: >-
                    Flat browser device fingerprint for 3DS authentication, as
                    produced by the checkout client's getBrowserInfo()
                    (fluid-pay-core browserInfoSchema).
                  properties:
                    color_depth:
                      type:
                        - integer
                        - 'null'
                      example: 24
                    screen_height:
                      type:
                        - integer
                        - 'null'
                      example: 1080
                    screen_width:
                      type:
                        - integer
                        - 'null'
                      example: 1920
                    time_zone:
                      type:
                        - integer
                        - 'null'
                      description: Timezone offset in minutes (Date#getTimezoneOffset)
                      example: -300
                    java_enabled:
                      type:
                        - boolean
                        - 'null'
                    java_script_enabled:
                      type:
                        - boolean
                        - 'null'
                    language:
                      type:
                        - string
                        - 'null'
                      example: en-US
                    user_agent:
                      type:
                        - string
                        - 'null'
                    accept_header:
                      type:
                        - string
                        - 'null'
                      example: '*/*'
                payment_account:
                  type:
                    - string
                    - 'null'
                  description: Payment account UUID override
                set_customer_payment_method:
                  type: boolean
                  description: >-
                    When true, binds the payment method to the customer rather
                    than the FluidPay account
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/CheckoutCustomerPaymentMethodCreateResponse
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearer_auth: []
components:
  schemas:
    CheckoutCustomerPaymentMethodCreateResponse:
      type: object
      properties:
        card:
          type: object
          properties:
            active:
              type: boolean
            address_id:
              type:
                - integer
                - 'null'
            billing_address:
              type:
                - object
                - 'null'
              properties:
                name:
                  type:
                    - string
                    - 'null'
                address1:
                  type:
                    - string
                    - 'null'
                address2:
                  type:
                    - string
                    - 'null'
                address3:
                  type:
                    - string
                    - 'null'
                city:
                  type:
                    - string
                    - 'null'
                state:
                  type:
                    - string
                    - 'null'
                postal_code:
                  type:
                    - string
                    - 'null'
                country_code:
                  type:
                    - string
                    - 'null'
                subdivision_code:
                  type:
                    - string
                    - 'null'
            card_network:
              type:
                - string
                - 'null'
            created_at:
              type: string
              format: date-time
            customer_id:
              type:
                - integer
                - 'null'
            cvv_token:
              type:
                - string
                - 'null'
            default:
              type: boolean
            email:
              type:
                - string
                - 'null'
            fingerprint:
              type:
                - string
                - 'null'
            first_six_digits:
              type:
                - string
                - 'null'
            fluid:
              type: boolean
            fluid_pay_account_id:
              type:
                - integer
                - 'null'
            full_name:
              type:
                - string
                - 'null'
            last_four_digits:
              type:
                - string
                - 'null'
            member_id:
              type:
                - string
                - 'null'
              format: uuid
            month:
              type:
                - integer
                - 'null'
            number:
              type:
                - string
                - 'null'
            test:
              type: boolean
            token:
              type: string
            token_provider:
              type: string
            updated_at:
              type: string
              format: date-time
            user_id:
              type:
                - integer
                - 'null'
            uuid_v7:
              type: string
            year:
              type:
                - integer
                - 'null'
          required:
            - active
            - card_network
            - created_at
            - customer_id
            - cvv_token
            - default
            - email
            - fingerprint
            - first_six_digits
            - fluid
            - fluid_pay_account_id
            - full_name
            - last_four_digits
            - member_id
            - month
            - number
            - test
            - token
            - token_provider
            - updated_at
            - user_id
            - uuid_v7
            - year
          additionalProperties: false
        customer:
          type:
            - object
            - 'null'
          properties:
            default_payment_method_id:
              type:
                - integer
                - 'null'
            id:
              type: integer
          required:
            - default_payment_method_id
            - id
          additionalProperties: false
        fluid_pay_account:
          type:
            - object
            - 'null'
          properties:
            default_payment_method_id:
              type:
                - integer
                - 'null'
            id:
              type: integer
          required:
            - default_payment_method_id
            - id
          additionalProperties: false
        meta:
          $ref: '#/components/schemas/Meta'
        payment_method:
          $ref: '#/components/schemas/CheckoutPaymentMethod'
        was_created:
          type: boolean
      required:
        - card
        - fluid_pay_account
        - meta
        - payment_method
        - was_created
      additionalProperties: false
    UnauthorizedResponse:
      type: object
      properties:
        message:
          type: string
      required:
        - message
    ErrorResponse:
      type: object
      additionalProperties: false
      required:
        - error_message
        - errors
        - meta
      properties:
        error_message:
          type: string
        errors:
          $ref: '#/components/schemas/ErrorBag'
        meta:
          $ref: '#/components/schemas/CheckoutMeta'
    Meta:
      type: object
      properties:
        request_id:
          type:
            - string
            - 'null'
        timestamp:
          type: string
          format: date-time
    CheckoutPaymentMethod:
      type: object
      properties:
        au_status:
          type:
            - string
            - 'null'
        billing_address:
          type:
            - object
            - 'null'
          properties:
            address1:
              type:
                - string
                - 'null'
            address2:
              type:
                - string
                - 'null'
            city:
              type:
                - string
                - 'null'
            country_code:
              type:
                - string
                - 'null'
            name:
              type:
                - string
                - 'null'
            postal_code:
              type:
                - string
                - 'null'
            state:
              type:
                - string
                - 'null'
            zip:
              type:
                - string
                - 'null'
          required:
            - address1
            - address2
            - city
            - country_code
            - name
            - postal_code
            - state
            - zip
          additionalProperties: false
        created_at:
          type: string
          format: date-time
        default:
          type: boolean
        details:
          $ref: '#/components/schemas/CheckoutPaymentMethodDetails'
        id:
          type: integer
        payment_title:
          type: string
        payment_type:
          type: string
        source:
          type: string
        updated_at:
          type: string
          format: date-time
      required:
        - au_status
        - billing_address
        - created_at
        - default
        - details
        - id
        - payment_title
        - payment_type
        - source
        - updated_at
      additionalProperties: false
    ErrorBag:
      description: >-
        Validation errors keyed by field, a list of errors, a single error
        message, or null when no structured error details are available.
      anyOf:
        - type: string
        - type: array
          items:
            $ref: '#/components/schemas/ErrorValue'
        - type: object
          additionalProperties:
            $ref: '#/components/schemas/ErrorValue'
        - type: 'null'
    CheckoutMeta:
      type: object
      additionalProperties: false
      required:
        - request_id
        - timestamp
      properties:
        request_id:
          type:
            - string
            - 'null'
        timestamp:
          type: string
          format: date-time
    CheckoutPaymentMethodDetails:
      type: object
      properties:
        card_brand:
          type:
            - string
            - 'null'
        card_network:
          type:
            - string
            - 'null'
        exp_month:
          type:
            - string
            - 'null'
        exp_year:
          type:
            - string
            - 'null'
        id:
          type: integer
        last4_digits:
          type:
            - string
            - 'null'
        last_four:
          type:
            - string
            - 'null'
        logo_url:
          type:
            - string
            - 'null'
        requires_3ds:
          type:
            - boolean
            - 'null'
        type:
          type:
            - string
            - 'null'
        vgs_card_id:
          type:
            - string
            - 'null'
      required:
        - card_brand
        - card_network
        - exp_month
        - exp_year
        - id
        - last4_digits
        - last_four
        - logo_url
        - requires_3ds
        - type
        - vgs_card_id
      additionalProperties: false
    ErrorValue:
      description: A validation or API error value.
      anyOf:
        - type: string
        - type: array
          items:
            type: string
        - type: object
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
    JsonValue:
      description: >-
        Any valid JSON value for provider, integration, theme, metadata, or
        other dynamic payloads whose keys are not fixed by the API contract.
      anyOf:
        - type: string
        - type: number
        - type: boolean
        - type: 'null'
        - type: array
          items:
            $ref: '#/components/schemas/JsonValue'
        - type: object
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      description: Bearer token authentication

````