Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Developer tools
Get started
Payments
Finance automation
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Overview
About Stripe payments
Upgrade your integration
Payments analytics
Online payments
OverviewFind your use caseManaged Payments
Use Payment Links
Build a checkout page
    Overview
    Quickstarts
    Customise look and feel
    Collect additional information
    Collect taxes
    Dynamically update checkout
    Manage your product catalogue
    Subscriptions
    Manage payment methods
    Let customers pay in their local currency
    Add discounts, upsells, and optional items
      Add discounts
      Configure subscription upsells
      Configure cross-sells
      Configure optional items
      Let customers complete orders for free
      Display yearly prices in monthly terms
    Set up future payments
    Save payment details during payment
    Manually approve payments on your server
    After the payment
    Elements with Checkout Sessions API beta changelog
    Migrate from legacy Checkout
    Migrate Checkout to use Prices
Build an advanced integration
Build an in-app integration
Payment Methods
Add payment methods
Manage payment methods
Faster checkout with Link
Payment interfaces
Payment Links
Checkout
Web Elements
In-app Elements
Payment scenarios
Custom payment flows
Flexible acquiring
Orchestration
In-person payments
Terminal
Other Stripe products
Financial Connections
Crypto
Climate
HomePaymentsBuild a checkout pageAdd discounts, upsells, and optional items

No-cost orders

Accept orders for no-cost line items or apply 100% off discounts for one-off payments.

Copy page

You can process no-cost orders for one-off payments with no-cost line items or discounts for 100% off with coupons and customer-facing promotion codes.

Note

You must be on API version 2023-08-16 or later to process no-cost orders using the Checkout Sessions API.

Create a Checkout Session with no-cost line items

Create a Price with a unit_amount of 0, and pass it into the line items array of the Checkout Session. See Products and prices for more information on creating prices.

You can also use the price_data parameter of the line_items array to pass in a free price.

If the total amount is 0, Checkout doesn’t collect a payment method from the customer.

Command Line
cURL
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d "line_items[0][price_data][unit_amount]"=0 \ -d "line_items[0][price_data][product_data][name]"="Free t-shirt" \ -d "line_items[0][price_data][currency]"=usd \ -d "line_items[0][quantity]"=1 \ -d mode=payment \ --data-urlencode success_url="https://example.com/success" \ --data-urlencode cancel_url="https://example.com/cancel"

If the customer property isn’t set, the Checkout Session automatically creates a new Customer object. This means guest customers aren’t supported.

Create a discount

Alternatively, create a coupon and a promotion code to allow customers to complete orders for free.

Create a coupon

Create a Coupon that makes your Checkout Session free. For example, you can create a 100% off coupon.

Command Line
cURL
curl https://api.stripe.com/v1/coupons \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d percent_off=100 \ -d duration=once

To create a session with an applied discount, pass the coupon ID in the coupon parameter of the discounts array.

Command Line
cURL
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d "line_items[0][price_data][unit_amount]"=2000 \ -d "line_items[0][price_data][product_data][name]"=T-shirt \ -d "line_items[0][price_data][currency]"=usd \ -d "line_items[0][quantity]"=1 \ -d "discounts[0][coupon]"=
{{COUPON_ID}}
\ -d mode=payment \ --data-urlencode success_url="https://example.com/success" \ --data-urlencode cancel_url="https://example.com/cancel"

You can also create a free Checkout Session by applying a coupon for an amount equal to or exceeding the Checkout Session total.

Create a promotion code

Promotion codes are customer-facing codes created on top of coupons. You can share these codes with customers who can enter them into Checkout to apply a discount. Create a promotion code from a 100% off coupon to allow customers to create orders for free.

Command Line
cURL
curl https://api.stripe.com/v1/promotion_codes \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d coupon=
{{COUPON_ID}}
\ -d code=FREECODE

Enable user-redeemable promotion codes using the allow_promotion_codes parameter in a Checkout Session. This enables a field in Checkout to allow users to enter promotion codes.

Command Line
cURL
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d "line_items[0][price_data][unit_amount]"=2000 \ -d "line_items[0][price_data][product_data][name]"=T-shirt \ -d "line_items[0][price_data][currency]"=usd \ -d "line_items[0][quantity]"=1 \ -d mode=payment \ -d allow_promotion_codes=true \ --data-urlencode success_url="https://example.com/success" \ --data-urlencode cancel_url="https://example.com/cancel"

Customers can also check out for free if they apply a promotion code for an amount equal to or exceeding the Checkout Session total. For more ways to apply discounts, see Add discounts.

Handle completed orders

After the Checkout Session completes, you can make a request for the finalized line items and their quantities. If your customer removes a line item, it also removes it from the line items response. See the Fulfillment guide to learn how to create an event handler to handle completed Checkout Sessions.

Common mistake

To fulfill no-cost orders, make sure to handle the checkout.session.completed event rather than PaymentIntent events. Completed Checkout Sessions that are free won’t have an associated PaymentIntent.

You can see your completed no-cost orders in the Dashboard. The no-cost orders tab only appears if you have at least one completed no-cost order.

OptionalPayment links and pricing tables

Was this page helpful?
YesNo
Need help? Contact Support.
Join our early access programme.
Check out our changelog.
Questions? Contact Sales.
LLM? Read llms.txt.
Powered by Markdoc