- Hosted payment link: Yuno hosts the whole page. You only create the link.
- Lite SDK: you render the checkout in your page and quote the tax from your backend.
How it works
- You create the link or the checkout session with
external_subscription: the Stripe customer and the prices to sell. Yuno does not create anything in Stripe yet. - The customer sees the local price. When the customer’s country has a published rate, the page opens in the local currency with the rate, and the customer can switch to the price’s currency and back. Only USD prices are converted.
- The customer gives the billing address. The country is always asked. The postal code is asked for the United States and Canada. A business can add its name and tax ID to get the business treatment (for example, reverse charge in the EU).
- Yuno quotes the tax with Stripe Tax every time the country, postal code or tax ID changes, and shows the total. A tax quote is valid for 30 minutes; after that the page quotes again before charging.
- The customer pays the quoted total, in the selected currency, through your routing.
- Yuno creates the subscription in Stripe: the customer, the prices, the card as the default payment method, and the first invoice marked paid with the quoted tax. A declined payment creates nothing in Stripe.
Before you start
- Prices in USD if you use local price: FX quotes only convert from USD.
- Stripe Tax registrations where you collect tax. Without a registration Stripe answers that no tax applies. To charge VAT to consumers in the EU, Stripe needs an OSS registration.
- A Yuno customer for the buyer (
customer_payer.id): Yuno uses its country to choose the local currency.
Option 1: hosted payment link
Create the link withlocal_pricing, tax_collection and external_subscription. See Create payment link.
amount.valuemust be the subtotal of the prices, in their currency (price times quantity, added up). If it is not, the link opens but the payment is refused withTAX_QUOTE_INVALIDwhen the customer pays.- The local currency comes from the customer’s country, then from the country of their billing address. Without a country, the link opens in the price’s currency.
local_pricingandtax_collectionare independent: you can use one without the other.- A link that collects taxes never applies a promotion.
checkout_url of the response to the customer. The errors the page can show are listed in Hosted checkout errors.
Option 2: Lite SDK
- Create the checkout session with
tax_collection: trueandexternal_subscription(customer_idanditems). See Create checkout session. - Start the checkout with
onBillingAddressChanged. The SDK calls it when the billing changes; your backend quotes the tax with Create tax quote and you return the total. See Checkouts with taxes. - Create the payment in
createPaymentwith the quoted total asamount,vault_on_success: true,customer_payer.id,external_subscription.customer_id, and one entry per line of the quote inadditional_data.order.taxes, each withsource: YUNO_TAX_QUOTEand the lasttax_quote_id. See Create payment.
taxable_amount as tax_base:
Testing in sandbox
- Use your Stripe test account with Stripe Tax active and at least one registration, for example New York: a buyer with postal code
10001gets 8.875% sales tax. - A buyer in a country without registration gets
NO_TAX. - Check the result in Stripe: a new subscription in the price’s currency and its first invoice paid, with the tax.
Good to know
- Quotes expire. The tax quote lasts 30 minutes and the FX quote until its
expires_at. An expired quote is never charged: the page quotes again and the customer confirms the new total. - Renewals are in the price’s currency. The local price applies only to the first payment.
- Refunds. A refund of the first payment adds a credit note to its invoice in Stripe. The subscription stays active: cancel it in Stripe if the customer should not be charged again.
- Tax IDs. The tax ID the customer gives is saved on the Stripe customer, so the next invoices keep the business treatment.