n8n-nodes-base
Version:
Base nodes of n8n
96 lines (92 loc) • 3.41 kB
text/typescript
/**
* Paddle Node - Version 1
* Discriminator: resource=coupon, operation=create
*/
interface Credentials {
paddleApi: CredentialReference;
}
/** Create a coupon */
export type PaddleV1CouponCreateParams = {
resource: 'coupon';
operation: 'create';
/**
* Either product (valid for specified products or subscription plans) or checkout (valid for any checkout)
* @displayOptions.show { jsonParameters: [false] }
* @default checkout
*/
couponType?: 'checkout' | 'product' | Expression<string>;
/**
* Comma-separated list of product IDs. Required if coupon_type is product. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.
* @displayOptions.show { couponType: ["product"], jsonParameters: [false] }
* @default []
*/
productIds?: string[];
/**
* Either flat or percentage
* @displayOptions.show { jsonParameters: [false] }
* @default flat
*/
discountType?: 'flat' | 'percentage' | Expression<string>;
/**
* Discount amount in currency
* @displayOptions.show { discountType: ["flat"], jsonParameters: [false] }
* @default 1
*/
discountAmount?: number | Expression<number>;
/**
* The currency must match the balance currency specified in your account
* @displayOptions.show { discountType: ["flat"], jsonParameters: [false] }
* @default EUR
*/
currency?: 'ARS' | 'AUD' | 'BRL' | 'CAD' | 'CHF' | 'CNY' | 'CZK' | 'DKK' | 'EUR' | 'GBP' | 'HKD' | 'HUF' | 'INR' | 'JPY' | 'KRW' | 'MXN' | 'NOK' | 'NZD' | 'PLN' | 'RUB' | 'SEK' | 'SGD' | 'THB' | 'TWD' | 'USD' | 'ZAR' | Expression<string>;
/**
* JSON Parameters
* @default false
*/
jsonParameters?: boolean | Expression<boolean>;
/**
* Attributes in JSON form
* @displayOptions.show { jsonParameters: [true] }
*/
additionalFieldsJson?: IDataObject | string | Expression<string>;
/**
* Additional Fields
* @displayOptions.show { jsonParameters: [false] }
* @default {}
*/
additionalFields?: {
/** Number of times a coupon can be used in a checkout. This will be set to 999,999 by default, if not specified.
* @default 1
*/
allowedUses?: number | Expression<number>;
/** Will be randomly generated if not specified
*/
couponCode?: string | Expression<string> | PlaceholderValue;
/** Prefix for generated codes. Not valid if coupon_code is specified.
*/
couponPrefix?: string | Expression<string> | PlaceholderValue;
/** Description of the coupon. This will be displayed in the Seller Dashboard.
*/
description?: string | Expression<string> | PlaceholderValue;
/** The coupon will expire on the date at 00:00:00 UTC
*/
expires?: string | Expression<string>;
/** The name of the coupon group this coupon should be assigned to
*/
group?: string | Expression<string> | PlaceholderValue;
/** Number of coupons to generate. Not valid if coupon_code is specified.
* @default 1
*/
numberOfCoupons?: number | Expression<number>;
/** If the coupon is used on subscription products, this indicates whether the discount should apply to recurring payments after the initial purchase
* @default false
*/
recurring?: boolean | Expression<boolean>;
};
};
export type PaddleV1CouponCreateNode = {
type: 'n8n-nodes-base.paddle';
version: 1;
credentials?: Credentials;
config: NodeConfig<PaddleV1CouponCreateParams>;
};