n8n-nodes-base
Version:
Base nodes of n8n
49 lines (45 loc) • 1.51 kB
text/typescript
/**
* Stripe Node - Version 1
* Discriminator: resource=coupon, operation=create
*/
interface Credentials {
stripeApi: CredentialReference;
}
/** Create a charge */
export type StripeV1CouponCreateParams = {
resource: 'coupon';
operation: 'create';
/**
* How long the discount will be in effect
* @default once
*/
duration?: 'forever' | 'once' | Expression<string>;
/**
* Whether the coupon discount is a percentage or a fixed amount
* @default percent
*/
type?: 'fixedAmount' | 'percent' | Expression<string>;
/**
* Amount in cents to subtract from an invoice total, e.g. enter <code>100</code> for $1.00
* @displayOptions.show { type: ["fixedAmount"] }
* @default 0
*/
amountOff?: number | Expression<number>;
/**
* Three-letter ISO currency code, e.g. <code>USD</code> or <code>EUR</code>. It must be a <a href="https://stripe.com/docs/currencies">Stripe-supported currency</a>. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.
* @displayOptions.show { type: ["fixedAmount"] }
*/
currency?: string | Expression<string>;
/**
* Percentage to apply with the coupon
* @displayOptions.show { type: ["percent"] }
* @default 1
*/
percentOff?: number | Expression<number>;
};
export type StripeV1CouponCreateNode = {
type: 'n8n-nodes-base.stripe';
version: 1;
credentials?: Credentials;
config: NodeConfig<StripeV1CouponCreateParams>;
};