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

# Prepare a wallet one-click purchase

> Let a customer who paid with Apple Pay or Google Pay confirm a one-click upsell in the wallet sheet. Call it when the upsell page loads.

1. Show Primer's Apple Pay or Google Pay button with `client_token`.
2. After the customer confirms in the wallet sheet, send the wallet's token as `payment_method_token` with `session_id` to `POST /checkout/one_click`.

If `wallet` is `null`, use a regular one-click purchase instead. This call creates no order, and a repeat call returns the same unused session.



## OpenAPI

````yaml /swagger/openapi-billing.json post /checkout/one_click_wallet_session
openapi: 3.0.0
info:
  title: OpenAPI3
  version: 1.0.0
servers:
  - url: https://billing.funnelfox.com/{org_id}/v1
    description: FunnelFox Payments API
    variables:
      org_id:
        default: your-org-id
        description: Your organization ID
security:
  - FunnelFoxSecretKey: []
paths:
  /checkout/one_click_wallet_session:
    post:
      tags:
        - Checkout
      summary: Prepare a wallet one-click purchase
      description: >-
        Let a customer who paid with Apple Pay or Google Pay confirm a one-click
        upsell in the wallet sheet. Call it when the upsell page loads.


        1. Show Primer's Apple Pay or Google Pay button with `client_token`.

        2. After the customer confirms in the wallet sheet, send the wallet's
        token as `payment_method_token` with `session_id` to `POST
        /checkout/one_click`.


        If `wallet` is `null`, use a regular one-click purchase instead. This
        call creates no order, and a repeat call returns the same unused
        session.
      parameters:
        - name: org_id
          in: path
          required: true
          description: Organization ID
          schema:
            type: string
          style: simple
          explode: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OneClickWalletSessionIn'
      responses:
        '200':
          description: Wallet session
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OneClickWalletSessionOut'
      security: []
components:
  schemas:
    OneClickWalletSessionIn:
      properties:
        external_id:
          description: Your unique identifier for the user
          maxLength: 256
          title: Customer Id
          type: string
        pp_ident:
          description: Unique identifier of the price point
          maxLength: 256
          pattern: ^[-A-Za-z_0-9]{1,256}$
          title: price point ident
          type: string
        client_metadata:
          additionalProperties: true
          description: Custom metadata from your client application
          title: Client Metadata
          type: object
      required:
        - external_id
        - pp_ident
      title: OneClickWalletSessionIn
      type: object
    OneClickWalletSessionOut:
      properties:
        wallet:
          description: >-
            The wallet to show the button for. `null` means no wallet
            confirmation for this customer and price point: use a regular
            one-click purchase.
          enum:
            - APPLE_PAY
            - GOOGLE_PAY
          type: string
          title: Wallet
          nullable: true
        reason:
          description: Why `wallet` is `null`.
          enum:
            - no_previous_order
            - not_primer
            - not_wallet
            - unsupported_price_point
          type: string
          default: null
          title: Reason
          nullable: true
        client_token:
          description: Primer client token for the wallet button.
          type: string
          default: null
          title: Client Token
          nullable: true
        session_id:
          description: Send it with the wallet's token to `POST /checkout/one_click`.
          format: uuid
          type: string
          default: null
          title: Session Id
          nullable: true
        order_id:
          description: The ID the order gets when the customer pays.
          format: uuid
          type: string
          default: null
          title: Order Id
          nullable: true
        amount:
          description: >-
            Amount in minor units shown in the wallet sheet and charged, tax
            included when collected.
          type: integer
          default: null
          title: Amount
          nullable: true
        currency:
          description: Currency code in lower case (ISO 4217).
          type: string
          default: null
          title: Currency
          nullable: true
        expires_at:
          description: When the session expires (UTC). Call this endpoint again after it.
          format: date-time
          type: string
          default: null
          title: Expires At
          nullable: true
      required:
        - wallet
      title: OneClickWalletSessionOut
      type: object
  securitySchemes:
    FunnelFoxSecretKey:
      type: apiKey
      in: header
      name: ff-secret-key
      description: Secret key for FunnelFox Payments API. Required for all requests.

````

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