How the SDK works
The experience
As the customer types their card number, the SDK checks eligibility in the background. If an offer matches, it appears inside the card form — already applied, read-only:
A shimmer/skeleton shows while the check is running
The offer renders with its title, offer code chip, description, and an "Applied ✓" state
If the card isn't eligible (or the offer was already used on that card), nothing is shown and checkout continues normally at full price
The same happens when a customer selects a saved card or pays via Click to Pay.
What happens under the hood
Step by step:
Trigger — the SDK runs the check only when the payment-methods list response tells it to (
sdk_next_action: eligibility_check). This is controlled server-side per merchant; there is no SDK flag to set.Debounce — eligibility fires 300 ms after the customer stops typing a valid card number; further typing aborts the in-flight request.
Eligibility call — the SDK calls
POST /payments/{payment_id}/eligibilitywith the card number (or, for saved cards, the payment token). The response contains the eligible offer, its quote reference, and the discountednet_amount.Display — the first eligible offer is rendered auto-applied inside the card form.
Confirm — on pay, the SDK automatically attaches
offer_details: { offer_quote_ids: [...] }to the confirm call. This works across all card paths: new card, standalone card element, saved card + CVC, and Click to Pay.Result — the payment response carries
net_amount,amount_received(discounted), andapplied_offer(offer ID, amount, currency).
Showing the discount in your own order summary (optional)
The SDK renders the offer inside the payment element. If you also want your surrounding page — cart total, order summary — to reflect the discount, subscribe to the appliedOffersInfo event.
1. Opt in via the element options:
2. Listen for the event:
The event fires whenever the applied offer changes — including when it clears (customer switches to an ineligible card). The payload always contains at most one offer.
After confirm, always treat the payment response as the source of truth for amounts: net_amount, amount_received, and applied_offer. The event is for display while the customer is still on the page.
Styling
The offer notice uses your existing SDK theme. The success accent (checkmark, "Applied" label) comes from the colorSuccess appearance variable:
All offer strings (e.g. "Card offer", "Applied", "Checking eligible offers…") are localized in every SDK locale.
Scope and limitations
New card entry
Vault tokenized card collection
Saved cards
Non-card payment methods
Click to Pay
Multiple selectable offers (best offer is auto-applied)
FAQs
Does the eligibility check slow down checkout? No. It runs in parallel while the customer finishes the form, debounced to one request. If it is still running when the customer hits Pay, submit waits briefly for the result.
What does the customer see if the Offer Engine is down? Nothing — no offer is shown and checkout proceeds normally at full price. Payments are never blocked by the offers system.
Can the customer remove the offer? The offer is auto-applied and read-only in the current version.
Last updated
Was this helpful?

