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 physical addresses
      Charge for shipping
      Collect phone numbers
      Add custom fields
      Collect consent for promotional emails
        Compliant promotional emails
    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
    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 pageCollect additional information

Collect consent for promotional emailsUS only

Learn how to collect permission from customers so that you can send them promotional emails.

Copy page

Promotional emails are often sent to inform customers of new products and to share coupons and discounts. For example, you can use them to subscribe customers to company newsletters or send cart abandonment emails.

Collect consent for promotional emails

Collect consent from customers to send them promotional emails

To protect consumers from unwanted spam, customers must agree to receiving promotional emails before you can contact them. Checkout helps you collect the necessary consent, where applicable, to send promotional emails. Learn more about promotional email requirements.

Collect consent

You can collect promotional email consent with Stripe Checkout when you create the session:

Command Line
cURL
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d "line_items[0][price]"=
{{PRICE_ID}}
\ -d "line_items[0][quantity]"=2 \ -d customer=
{{CUSTOMER_ID}}
\ -d mode=payment \ --data-urlencode success_url="https://example.com/success" \ --data-urlencode cancel_url="https://example.com/cancel" \ -d "consent_collection[promotions]"=auto

When consent_collection.promotions='auto', Checkout dynamically displays a checkbox for collecting the customer’s consent to promotional content.

Note

When the checkbox is shown, the default state depends on the customer’s country and the country your business is based in. Data privacy laws vary by jurisdiction, so Checkout disables or limits this feature when local regulations prohibit it.

Store consent and email address

The Checkout Session’s consent attribute records whether or not the session collected promotional consent from the customer.

As customers complete purchases, keep track of which customers consent to promotional content. You can create or update an existing webhook handler to do this. Listen to the checkout.session.completed event, check for the consent.promotions status, and then store email addresses for customers who give consent.

Node
// Find your endpoint's secret in your Dashboard's webhook settings const endpointSecret = 'whsec_...'; // Using Express const app = require('express')(); // Use body-parser to retrieve the raw body as a buffer const bodyParser = require('body-parser'); const recordPromotionalEmailConsent = (email, promoConsent) => { // TODO: fill me in console.log("Recording promotional email consent", email, promoConsent); } app.post('/webhook', bodyParser.raw({type: 'application/json'}), (request, response) => { const payload = request.body; const sig = request.headers['stripe-signature']; let event; try { event = stripe.webhooks.constructEvent(payload, sig, endpointSecret); } catch (err) { return response.status(400).send(`Webhook Error: ${err.message}`); } // Handle the checkout.session.completed event if (event.type === 'checkout.session.completed') { const session = event.data.object; const promoConsent = session.consent?.promotions; const email = session.customer_details.email; // Record whether or not the customer has agreed to receive promotional emails recordPromotionalEmailConsent(email, promoConsent) // Handle order fulfillment } response.status(200).end(); });

After you’ve configured Checkout to collect consent for sending customers promotional content, you can recover abandoned carts by following up with leads for customers that left the checkout flow before completing payment.

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