n8n-nodes-base
Version:
Base nodes of n8n
101 lines (97 loc) • 3.29 kB
text/typescript
/**
* Paddle Node - Version 1
* Discriminator: resource=coupon, operation=update
*/
interface Credentials {
paddleApi: CredentialReference;
}
/** Update a coupon */
export type PaddleV1CouponUpdateParams = {
resource: 'coupon';
operation: 'update';
/**
* Either flat or percentage
* @displayOptions.show { jsonParameters: [false] }
* @default couponCode
*/
updateBy?: 'couponCode' | 'group' | Expression<string>;
/**
* Identify the coupon to update
* @displayOptions.show { updateBy: ["couponCode"], jsonParameters: [false] }
*/
couponCode?: string | Expression<string> | PlaceholderValue;
/**
* The name of the group of coupons you want to update
* @displayOptions.show { updateBy: ["group"], jsonParameters: [false] }
*/
group?: string | Expression<string> | PlaceholderValue;
/**
* 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>;
/** Discount
* @default {}
*/
discount?: {
/** Discount Properties
*/
discountProperties?: {
/** The currency must match the balance currency specified in your account
* @displayOptions.show { discountType: ["flat"] }
* @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>;
/** Discount amount
* @displayOptions.show { discountType: ["flat"] }
*/
discountAmount?: number | Expression<number>;
/** Discount amount
* @displayOptions.show { discountType: ["percentage"] }
*/
discountAmount?: number | Expression<number>;
/** Either flat or percentage
* @default flat
*/
discountType?: 'flat' | 'percentage' | Expression<string>;
};
};
/** The coupon will expire on the date at 00:00:00 UTC
*/
expires?: string | Expression<string>;
/** New code to rename the coupon to
*/
newCouponCode?: string | Expression<string> | PlaceholderValue;
/** New group name to move coupon to
*/
newGroup?: string | Expression<string> | PlaceholderValue;
/** Comma-separated list of products e.g. 499531,1234,123546. If blank then remove associated products.
*/
productIds?: string | Expression<string> | PlaceholderValue;
/** 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 PaddleV1CouponUpdateNode = {
type: 'n8n-nodes-base.paddle';
version: 1;
credentials?: Credentials;
config: NodeConfig<PaddleV1CouponUpdateParams>;
};