Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript: Add support for discounts on Session.create #1044

Merged
merged 1 commit into from
Oct 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions types/2020-08-27/Checkout/Sessions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,11 @@ declare module 'stripe' {
*/
customer_email?: string;

/**
* The coupon or promotion code to apply to this session. Currently, only up to one may be specified.
*/
discounts?: Array<SessionCreateParams.Discount>;

/**
* Specifies which fields in the response should be expanded.
*/
Expand Down Expand Up @@ -659,6 +664,18 @@ declare module 'stripe' {
namespace SessionCreateParams {
type BillingAddressCollection = 'auto' | 'required';

interface Discount {
/**
* The ID of the coupon to apply to this session.
*/
coupon?: string;

/**
* The ID of a promotion code to apply to this session.
*/
promotion_code?: string;
}

interface LineItem {
/**
* The amount to be collected per unit of the line item. If specified, must also pass `currency` and `name`.
Expand Down