Low-level, headless checkout session for a page that draws its own PayPal button. load() creates the checkout session from lineItems; show("paypal", { termsAccepted: true }) sends the buyer to PayPal — a pop-up window on desktop, the whole tab on phones — and resolves with the payment once the buyer approves. With paymentMethodOptions.paypal.requestShipping, PayPal asks the buyer for a shipping address and the account’s webhook subscribed to shipping_address.changed prices each one on your server while the buyer is on PayPal; the payment is created only after the buyer approves, at that price. After a full-page redirect the promise never settles; read the outcome from redirectUrl’s payment and status query parameters instead.
This page documents @whop/elements@1.10.0 and @whop/elements-react@1.10.0.
Since v1.10.0.Create this Checkout resource without mounting an element: whop.checkout.checkoutSession.create({ … }) in vanilla or useWhop().checkout.checkoutSession.create({ … }) in React.
Where the buyer lands after PayPal when the tab was redirected, with payment and status appended: succeeded, canceled, failed, or processing while Whop is still finishing the charge (read the payment from your server to see it settle). On desktop the pop-up closes instead and show() settles.
Your own string keys and values, up to 40, kept on the checkout session and copied onto the payment it creates, so they come back on the payment and its webhooks, for example ad and affiliate attribution. They are set from the buyer’s browser, so never rely on them for prices or fulfilment.
Set to off_session to save the buyer’s PayPal account so your server can charge it later without the buyer, for example for a one-click upsell. PayPal asks the buyer to agree to future payments while they approve. Set it only after telling the buyer their PayPal account will be saved.
Options for one payment method. paypal.requestShipping has PayPal ask the buyer for a shipping address. When the account has an enabled https webhook subscribed to shipping_address.changed, Whop calls it for each address and charges the totals it replies with. Defaults to false.
Create the checkout session from lineItems. Calling it again answers the same session. show() loads it first when it has not been loaded. terms is what the buyer accepts by paying: show its links (the seller’s published policies and Whop’s buyer terms) next to your button, and when terms.required is true, have the buyer actively accept them, for example with a checkbox. requirements lists what the session needs before it can be paid: anything other than email, terms and, with paypal.requestShipping, shipping_address cannot be collected here, so show() refuses it.ReturnsPromise<CheckoutSessionLoaded>
Call it synchronously in your PayPal button’s click handler: on desktop it opens the pop-up there, and a pop-up opened later is blocked. Pass termsAccepted: true only when load()’s terms.links were shown next to the button for this press, and, when terms.required is true, the buyer actively accepted them. Resolves with { payment } once the buyer approves and Whop charges. Rejects with an error whose code is attestation_required without termsAccepted, requirements_unsupported when the session needs something PayPal cannot collect (see load()’s requirements), payment_request_cancelled when the buyer cancels or closes PayPal, seller_pricing_unavailable when the account cannot price this payment through its webhook (it does not handle its own tax, or the cart has a promo code, buyer fee, marketplace split or a plan that renews), or payment_failed otherwise. On phones the tab goes to PayPal and the promise never settles. Call synchronously during user activation. Await prerequisites first because browsers revoke activation across asynchronous steps.Parameters