Stripe Payments

Create a subscription

Creates a Stripe Subscription for recurring payments. Returns clientSecret for frontend payment confirmation.

post/v1/payments/create-subscription

Request body

priceIdstring required

Stripe Price ID

planIdstring required

Internal plan identifier

emailstring required

Customer email

userIdstring required

Firebase user ID

webUserIdstring

Web user ID from tracking system

customerIdstring

Existing Stripe Customer ID (if customer was created earlier)

promotionCodestring

Stripe Promotion Code ID (promo_...) applied to the first invoice. If set, takes precedence over coupon.

couponstring

Stripe Coupon ID applied to the subscription (e.g. percent_off, duration once). Ignored if promotionCode is set.

Example request

{
  "priceId": "price_xxx",
  "planId": "premium_yearly",
  "email": "user@example.com",
  "customerId": "cus_xxx",
  "promotionCode": "promo_1TN5jQACV98ZMZrYJdJO9PgM",
  "coupon": "1UVQZFHK"
}

Response

Subscription created successfully

clientSecretstring required

Client secret from subscription latest invoice

subscriptionIdstring required

Stripe Subscription ID

customerIdstring required

Stripe Customer ID

Example response

{
  "clientSecret": "pi_xxx_secret_xxx",
  "subscriptionId": "sub_xxx",
  "customerId": "cus_xxx"
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.