Skip to main content
When Stripe hosts your payment page through Stripe Checkout Sessions, your server holds the shopper’s points in Scrip, creates a one-time Stripe coupon for that discount, and attaches the coupon to the Checkout Session. Before following this guide, configure your asset’s value_per_unit, initialize the scrip and stripe clients, and wire up scrip.stripe.handleEvent using Pay with points at checkout with Stripe.

Hold points and start a session

Stripe Checkout does not let you subtract a fixed amount directly from line items. Instead, scrip.stripe.applyPointsToCheckoutSession holds the points and returns two values: couponParams for creating a one-time Stripe coupon, and a sessionParams helper that attaches that coupon and Scrip metadata to your Checkout Session parameters.
result.sessionParams sets discounts to your one-time $20.00 coupon, attaches scrip_redemption_ids metadata to both the Checkout Session and its underlying PaymentIntent, and sets expires_at. Subscribe your Stripe webhook endpoint to these Checkout Session events and pass them to scrip.stripe.handleEvent: applyPointsToCheckoutSession adds three session-specific options alongside the standard applyPoints options: The Scrip hold must outlive the Checkout Session. applyPointsToCheckoutSession rejects a ttlSeconds that ends less than 1 minute after the session, as well as a sessionExpiresInSeconds outside Stripe’s 30-minute to 24-hour range. Create the Stripe coupon and Checkout Session right after applyPointsToCheckoutSession returns. If an existing hold is too close to expiring to cover a new Checkout Session, the SDK returns hold_ending_soon. Call applyPointsToCheckoutSession again with replaces set to result.redemptionIds to place a fresh hold. All other return statuses match applyPoints. On a page refresh, reuse the open Checkout Session for that cart rather than creating another one. Multiple open sessions for the same cart share one Scrip hold: if the unused session expires first, its checkout.session.expired webhook releases the hold. If the shopper then pays on the other session, handleEvent tries to redeem the points again (retaken) or reports points_unavailable if the points were spent elsewhere. See Act on what handleEvent returns. The minimum-charge check evaluates orderTotal minus the applied points. If points cover the full orderTotal, applyPointsToCheckoutSession places the hold and returns fully_covered without building a zero-dollar session. Skip Stripe and finish the order with completeWithoutPayment.

If a session expires

When a Checkout Session expires, Stripe sends checkout.session.expired and handleEvent releases the points (cancelled). To let the shopper try again, start a new Checkout Session and pass the previous hold IDs in replaces.

Promotion codes on Checkout Sessions

Stripe Checkout allows only one coupon or promotion code per session. Because result.sessionParams uses that discount slot for points and overwrites any discounts field you pass, a shopper cannot enter a Stripe promotion code and apply points on the same Checkout Session. If your store supports promotion codes alongside points, apply your promotion on your server before calling applyPointsToCheckoutSession: reduce the line_items prices by the promotion discount and pass that discounted subtotal as orderTotal. The Checkout Session then carries a single Stripe coupon for the points on top of your already-discounted items. With PaymentIntents, Stripe does not use a coupon for points, so this limit does not apply: your server calculates any promotion discounts and passes the final card charge as the PaymentIntent amount.

PaymentIntents integration

Full reference for applyPoints, handleEvent, timeouts, and refunds.

Add the checkout points widget

Mount a points control on a custom PaymentIntents checkout page.