Documentation
Get Started
  • Welcome
  • Affiliate Promo Codes Setup
    • Stripe Checkout
    • Stripe API
    • Setting a Default Coupon Code
  • Affiliate Links Setup
    • Stripe API
    • Stripe Payment Links
  • Integrations
    • Memberstack
    • Outseta
    • MemberSpace
  • Payouts
    • Payouts Overview
    • PayPal Mass Payments
    • Wise Batch Payments
  • Frequently Asked Questions
Powered by GitBook
On this page

Was this helpful?

  1. Affiliate Promo Codes Setup

Stripe API

PreviousStripe CheckoutNextSetting a Default Coupon Code

Last updated 1 year ago

Was this helpful?

We also support promo code tracking if you're not using Stripe Checkout. If you're creating Stripe subscriptions directly by calling the Stripe API, it's straightforward to apply a Stripe promo code to a subscription at the time of subscription creation. This is a great option for mobile apps using Stripe that want to do affiliate tracking. App stores generally block affiliate link tracking, and promo codes are a great workaround.

Add a Promo Code During Subscription Creation

On your checkout screen, include a field where users can enter a promo code. On submission, call the , and include the code parameter in your API call. From that API response, you will get the promo code ID, which looks like promo_...

Then, when calling the , include the promotion_code parameter and set it equal to the promo code ID from the first step.

Note that you can also apply a promo code using the , and we will be able to attribute referrals the same way as if you used the subscription creation API.

Subscription Creation Request Body Example
{
  customer: 'cus_Na6dX7aXxi11N4',
  items: [
    {
      price: 'price_1MowQULkdIwHu7ixraBm864M',
    },
  ],
  promotion_code: 'promo_1MiM6KLkdIwHu7ixrIaX4wgn'
}

Once you've added the ability to add promo codes to your subscriptions, move on to .

promotion codes list API
subscription creation API
subscription update API
Setting a Default Coupon Code