> ## 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.

# silentPurchase(options)

> Charge a customer's saved payment method without showing a payment form

Charges the customer's saved payment method for a price point without showing
any payment UI. Use it for
[one-click payments](/docs/billing/payments-management.md#one-click-payment), such as
an upsell right after a purchase.

The customer needs a saved payment method from an earlier purchase.
`silentPurchase()` is available only on the `Billing` object, so call it as
`Billing.silentPurchase()`.

> [!WARNING]
>
> `true` means FunnelFox Payments accepted the request. It doesn't confirm the
> charge: a declined payment also returns `true`. Confirm the purchase with
> [FunnelFox Payments webhooks](/docs/develop/webhooks-billing.md) before you grant
> access.

## Parameters

**orgId** `string` *required*

Your organization ID. This method doesn't read
[configure()](/docs/develop/configure.md).

**baseUrl** `string` *required*

The API base URL. Use `https://billing.funnelfox.com` unless you point to a
custom backend.

**priceId** `string` *required*

The price point identifier to charge for.

**externalId** `string` *required*

Your identifier for the customer. It must match the customer who made the
earlier purchase.

**clientMetadata** `object` *required*

Custom metadata attached to the order. Values must be strings, numbers, or
booleans. Pass `{}` if you have none.

## Returns

A `Promise<boolean>`:

* **`true`**: FunnelFox Payments accepted the request. Check the result with
  webhooks.
* **`false`**: FunnelFox Payments rejected the request.

The promise rejects with an `APIError` when the customer already owns the
product. Learn more about
[double-purchase prevention](/docs/billing/settings.md#double-purchase-prevention).
It also rejects with an `APIError` or `NetworkError` when the request fails.

> [!NOTE]
>
> `silentPurchase()` doesn't run 3DS. A charge that needs 3DS doesn't complete.

## Example

```javascript theme={null}
import { Billing } from '@funnelfox/billing';

try {
  const accepted = await Billing.silentPurchase({
    orgId: 'your-org-id',
    baseUrl: 'https://billing.funnelfox.com',
    priceId: 'price_upsell',
    externalId: 'user_456',
    clientMetadata: { source: 'upsell' },
  });

  if (accepted) {
    // Wait for the FunnelFox Payments webhook before granting access
  }
} catch (error) {
  console.error('One-click purchase failed:', error.message);
}
```


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