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

# PaymentRequest

> A wallet payment sheet (Apple Pay / Google Pay) driven from your own button — the low-level ceremony `payments.createConfirmationToken` automates when a wallet tile is selected; reach for it directly for custom flows (express buttons, shipping callbacks). `await canMakePayment()` first (it also primes the sheet material), then call `show(type)` synchronously inside the click; the resolved `{ ctok }` is a confirmation token — confirm it server-side exactly like an element-minted one.

<Info>**Upcoming.** These docs cover unreleased development, ahead of any published release. Use the channel picker at the top of the sidebar for the docs of a published release.</Info>

*In development, not yet part of a stable release.*

A **resource** in the [`Payments`](/elements/upcoming/payments/overview) group — a live SDK object minted from the namespace itself, nothing mounted: `whop.payments.paymentRequest.create({ … })` (vanilla) or `useWhop().payments.paymentRequest.create({ … })` (React). The minted instance carries the methods and `on<Event>` subscriptions below.

## Options

Pass these to `whop.payments.paymentRequest.create({ … })`.

<ResponseField name="accountId" type="string" required>
  The seller account (`biz_…`) every client-side call is scoped to.
</ResponseField>

<ResponseField name="currency" type="string" required>
  ISO currency the sheet charges in.
</ResponseField>

<ResponseField name="amount" type="number" required>
  Charge amount in minor units.
</ResponseField>

<ResponseField name="setupFutureUsage" type="&#x22;off_session&#x22; | &#x22;on_session&#x22;">
  Attest save-consent was displayed; rides onto the confirmation token.
</ResponseField>

<ResponseField name="requestPayerEmail" type="boolean">
  Ask the sheet for the payer's email — the confirmation token requires one. Defaults to `true`.
</ResponseField>

<ResponseField name="requestShipping" type="boolean">
  Ask the sheet for a shipping address (and offer `shippingOptions` when given). Defaults to `false`.
</ResponseField>

<ResponseField name="countryCode" type="string">
  The merchant's ISO 3166 country for the Apple Pay sheet. Omit it and the sheet uses the registration country the method matrix publishes on the seller's merchant row; set it only to override that (falls back to 'US' when neither exists).
</ResponseField>

<ResponseField name="lineItems" type="PaymentRequestLineItem[]">
  Line items the sheet lists under the total.
</ResponseField>

<ResponseField name="shippingOptions" type="PaymentRequestShippingOption[]">
  Shipping options the sheet offers when `requestShipping` is set. Display-only — update `amount` from your change handler.
</ResponseField>

## Methods

Call these on the minted instance.

<Warning>`show` must be called synchronously inside the user's click/tap handler — browsers revoke the activation across async hops; await any prerequisites beforehand.</Warning>

### `canMakePayment`

Per wallet: the account's matrix advertises it ∩ this device can pay ∩ (Google) this origin is cleared. Also primes the vendor material `show()` needs — always await it before `show()`.

**Signature:** `() => Promise<WalletAvailability>`

### `show`

Open the wallet sheet, with `canMakePayment()` already awaited — Apple refuses a session constructed outside the gesture stack. USER GESTURE REQUIRED: call this synchronously inside the user's click/tap handler — browsers revoke the activation across async hops; await any prerequisites beforehand.

**Signature:** `(type: "apple_pay" | "google_pay") => Promise<PaymentRequestResult>`

## Events

Subscribe on the minted instance — each `on<Event>(handler)` returns its unsubscribe function.

<Warning>`onShippingAddressChange` handlers must call `updateWith(…)` exactly once per event; `onShippingOptionChange` handlers must call `updateWith(…)` exactly once per event — the flow stalls until the vendor's own timeout otherwise.</Warning>

### `onShippingAddressChange`

The sheet's shipping address changed (redacted pre-authorization: city/state/postal/country only). MUST REPLY EXACTLY ONCE: the handler must call `updateWith(…)` once per event, or the flow stalls until the vendor's own timeout. Returns the unsubscribe function.

**Signature:** `(handler: (ev: ShippingAddressChangeEvent) => void) => () => void`

### `onShippingOptionChange`

The buyer picked a shipping option. Amount-only contract: `updateWith` carries amount/lineItems/shippingOptions/errors. MUST REPLY EXACTLY ONCE: the handler must call `updateWith(…)` once per event, or the flow stalls until the vendor's own timeout. Returns the unsubscribe function.

**Signature:** `(handler: (ev: ShippingOptionChangeEvent) => void) => () => void`

### `onConfirmationToken`

A confirmation token was minted from the sheet (the same result `show()` resolves with). Returns the unsubscribe function.

**Signature:** `(handler: (ev: PaymentRequestResult) => void) => () => void`

### `onCancel`

The buyer dismissed the sheet. Returns the unsubscribe function.

**Signature:** `(handler: () => void) => () => void`
