# Stripe API

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 [promotion codes list API](https://stripe.com/docs/api/promotion_codes/list), 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 [subscription creation API](https://docs.stripe.com/api/subscriptions/create), 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 [subscription update API](https://docs.stripe.com/api/subscriptions/update), and we will be able to attribute referrals the same way as if you used the subscription creation API.

{% code title="Subscription Creation Request Body Example" %}

```javascript
{
  customer: 'cus_Na6dX7aXxi11N4',
  items: [
    {
      price: 'price_1MowQULkdIwHu7ixraBm864M',
    },
  ],
  promotion_code: 'promo_1MiM6KLkdIwHu7ixrIaX4wgn'
}
```

{% endcode %}

Once you've added the ability to add promo codes to your subscriptions, move on to [Setting a Default Coupon Code](https://docs.promotekit.com/affiliate-promo-codes-setup/setting-a-default-coupon-code).
