2023-01-27 03:22:44 -08:00
import type { INodeProperties } from 'n8n-workflow' ;
2020-08-25 01:50:39 -07:00
2021-12-03 00:44:16 -08:00
export const couponOperations : INodeProperties [ ] = [
2020-08-25 01:50:39 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-08-25 01:50:39 -07:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'coupon' ] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
options : [
{
name : 'Create' ,
value : 'create' ,
2022-05-06 14:01:25 -07:00
description : 'Create a coupon' ,
2022-07-10 13:50:51 -07:00
action : 'Create a coupon' ,
2020-08-25 01:50:39 -07:00
} ,
{
2022-09-07 07:51:14 -07:00
name : 'Get Many' ,
2020-08-25 01:50:39 -07:00
value : 'getAll' ,
2022-09-13 03:36:36 -07:00
description : 'Get many coupons' ,
2022-09-08 08:10:13 -07:00
action : 'Get many coupons' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'Update' ,
value : 'update' ,
2022-05-06 14:01:25 -07:00
description : 'Update a coupon' ,
2022-07-10 13:50:51 -07:00
action : 'Update a coupon' ,
2020-08-25 01:50:39 -07:00
} ,
] ,
default : 'create' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-08-25 01:50:39 -07:00
2021-12-03 00:44:16 -08:00
export const couponFields : INodeProperties [ ] = [
2020-08-25 01:51:16 -07:00
/* -------------------------------------------------------------------------- */
/* coupon:create */
/* -------------------------------------------------------------------------- */
2020-08-25 01:50:39 -07:00
{
displayName : 'Coupon Type' ,
name : 'couponType' ,
type : 'options' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'coupon' ] ,
2022-12-29 03:20:43 -08:00
operation : [ 'create' ] ,
2022-08-17 08:50:24 -07:00
jsonParameters : [ false ] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
default : 'checkout' ,
2022-08-17 08:50:24 -07:00
description :
'Either product (valid for specified products or subscription plans) or checkout (valid for any checkout)' ,
2020-08-25 01:50:39 -07:00
options : [
{
name : 'Checkout' ,
2020-10-22 06:46:03 -07:00
value : 'checkout' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'Product' ,
2020-10-22 06:46:03 -07:00
value : 'product' ,
2020-08-25 01:50:39 -07:00
} ,
2020-10-22 06:46:03 -07:00
] ,
2020-08-25 01:50:39 -07:00
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'Product Names or IDs' ,
2020-08-25 01:50:39 -07:00
name : 'productIds' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getProducts' ,
} ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'coupon' ] ,
2022-12-29 03:20:43 -08:00
operation : [ 'create' ] ,
2022-08-17 08:50:24 -07:00
couponType : [ 'product' ] ,
jsonParameters : [ false ] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
2022-04-22 09:29:51 -07:00
default : [ ] ,
2022-08-17 08:50:24 -07:00
description :
2024-09-12 07:53:36 -07:00
'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>.' ,
2020-08-25 01:50:39 -07:00
required : true ,
} ,
{
displayName : 'Discount Type' ,
name : 'discountType' ,
type : 'options' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'coupon' ] ,
2022-12-29 03:20:43 -08:00
operation : [ 'create' ] ,
2022-08-17 08:50:24 -07:00
jsonParameters : [ false ] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
default : 'flat' ,
2022-05-06 14:01:25 -07:00
description : 'Either flat or percentage' ,
2020-08-25 01:50:39 -07:00
options : [
{
name : 'Flat' ,
2020-10-22 06:46:03 -07:00
value : 'flat' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'Percentage' ,
2020-10-22 06:46:03 -07:00
value : 'percentage' ,
2020-08-25 01:50:39 -07:00
} ,
2020-10-22 06:46:03 -07:00
] ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'Discount Amount Currency' ,
name : 'discountAmount' ,
type : 'number' ,
2020-09-17 07:22:24 -07:00
default : 1 ,
2022-05-06 14:01:25 -07:00
description : 'Discount amount in currency' ,
2020-08-25 01:50:39 -07:00
typeOptions : {
2020-10-22 06:46:03 -07:00
minValue : 1 ,
2020-08-25 01:50:39 -07:00
} ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'coupon' ] ,
2022-12-29 03:20:43 -08:00
operation : [ 'create' ] ,
2022-08-17 08:50:24 -07:00
discountType : [ 'flat' ] ,
jsonParameters : [ false ] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
} ,
{
displayName : 'Discount Amount %' ,
name : 'discountAmount' ,
type : 'number' ,
2020-09-17 07:22:24 -07:00
default : 1 ,
2022-05-06 14:01:25 -07:00
description : 'Discount amount in percentage' ,
2020-08-25 01:50:39 -07:00
typeOptions : {
minValue : 1 ,
2020-10-22 06:46:03 -07:00
maxValue : 100 ,
2020-08-25 01:50:39 -07:00
} ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'coupon' ] ,
2022-12-29 03:20:43 -08:00
operation : [ 'create' ] ,
2022-08-17 08:50:24 -07:00
discountType : [ 'percentage' ] ,
jsonParameters : [ false ] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
} ,
{
displayName : 'Currency' ,
name : 'currency' ,
type : 'options' ,
default : 'EUR' ,
2022-05-06 14:01:25 -07:00
description : 'The currency must match the balance currency specified in your account' ,
2020-08-25 01:50:39 -07:00
options : [
{
name : 'ARS' ,
2020-10-22 06:46:03 -07:00
value : 'ARS' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'AUD' ,
2020-10-22 06:46:03 -07:00
value : 'AUD' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'BRL' ,
2020-10-22 06:46:03 -07:00
value : 'BRL' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'CAD' ,
2020-10-22 06:46:03 -07:00
value : 'CAD' ,
2020-08-25 01:50:39 -07:00
} ,
2020-08-25 01:51:16 -07:00
{
name : 'CHF' ,
2020-10-22 06:46:03 -07:00
value : 'CHF' ,
2020-08-25 01:51:16 -07:00
} ,
2020-08-25 01:50:39 -07:00
{
name : 'CNY' ,
2020-10-22 06:46:03 -07:00
value : 'CNY' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'CZK' ,
2020-10-22 06:46:03 -07:00
value : 'CZK' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'DKK' ,
2020-10-22 06:46:03 -07:00
value : 'DKK' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'EUR' ,
2020-10-22 06:46:03 -07:00
value : 'EUR' ,
2020-08-25 01:50:39 -07:00
} ,
2020-08-25 01:51:16 -07:00
{
name : 'GBP' ,
2020-10-22 06:46:03 -07:00
value : 'GBP' ,
2020-08-25 01:51:16 -07:00
} ,
2020-08-25 01:50:39 -07:00
{
name : 'HKD' ,
2020-10-22 06:46:03 -07:00
value : 'HKD' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'HUF' ,
2020-10-22 06:46:03 -07:00
value : 'HUF' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'INR' ,
2020-10-22 06:46:03 -07:00
value : 'INR' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'JPY' ,
2020-10-22 06:46:03 -07:00
value : 'JPY' ,
2020-08-25 01:50:39 -07:00
} ,
2020-08-25 01:51:16 -07:00
{
name : 'KRW' ,
2020-10-22 06:46:03 -07:00
value : 'KRW' ,
2020-08-25 01:51:16 -07:00
} ,
2020-08-25 01:50:39 -07:00
{
name : 'MXN' ,
2020-10-22 06:46:03 -07:00
value : 'MXN' ,
2020-08-25 01:50:39 -07:00
} ,
{
2020-08-25 01:51:16 -07:00
name : 'NOK' ,
2020-10-22 06:46:03 -07:00
value : 'NOK' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'NZD' ,
2020-10-22 06:46:03 -07:00
value : 'NZD' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'PLN' ,
2020-10-22 06:46:03 -07:00
value : 'PLN' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'RUB' ,
2020-10-22 06:46:03 -07:00
value : 'RUB' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'SEK' ,
2020-10-22 06:46:03 -07:00
value : 'SEK' ,
2020-08-25 01:50:39 -07:00
} ,
{
2020-08-25 01:51:16 -07:00
name : 'SGD' ,
2020-10-22 06:46:03 -07:00
value : 'SGD' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'THB' ,
2020-10-22 06:46:03 -07:00
value : 'THB' ,
2020-08-25 01:50:39 -07:00
} ,
{
2020-08-25 01:51:16 -07:00
name : 'TWD' ,
2020-10-22 06:46:03 -07:00
value : 'TWD' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'USD' ,
2020-10-22 06:46:03 -07:00
value : 'USD' ,
2020-08-25 01:50:39 -07:00
} ,
2020-08-25 01:51:16 -07:00
{
name : 'ZAR' ,
2020-10-22 06:46:03 -07:00
value : 'ZAR' ,
2020-08-25 01:51:16 -07:00
} ,
2020-08-25 01:50:39 -07:00
] ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'coupon' ] ,
2022-12-29 03:20:43 -08:00
operation : [ 'create' ] ,
2022-08-17 08:50:24 -07:00
discountType : [ 'flat' ] ,
jsonParameters : [ false ] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
} ,
{
displayName : 'JSON Parameters' ,
name : 'jsonParameters' ,
type : 'boolean' ,
default : false ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'coupon' ] ,
operation : [ 'create' ] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
} ,
{
2022-05-20 14:47:24 -07:00
displayName : 'Additional Fields' ,
2020-08-25 01:50:39 -07:00
name : 'additionalFieldsJson' ,
type : 'json' ,
typeOptions : {
alwaysOpenEditWindow : true ,
} ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'coupon' ] ,
operation : [ 'create' ] ,
jsonParameters : [ true ] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Attributes in JSON form' ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'coupon' ] ,
operation : [ 'create' ] ,
jsonParameters : [ false ] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
default : { } ,
options : [
{
displayName : 'Allowed Uses' ,
name : 'allowedUses' ,
type : 'number' ,
default : 1 ,
2022-08-17 08:50:24 -07:00
description :
'Number of times a coupon can be used in a checkout. This will be set to 999,999 by default, if not specified.' ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'Coupon Code' ,
name : 'couponCode' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Will be randomly generated if not specified' ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'Coupon Prefix' ,
name : 'couponPrefix' ,
type : 'string' ,
default : '' ,
description : 'Prefix for generated codes. Not valid if coupon_code is specified.' ,
} ,
2020-08-25 01:51:16 -07:00
{
displayName : 'Description' ,
name : 'description' ,
type : 'string' ,
default : '' ,
description : 'Description of the coupon. This will be displayed in the Seller Dashboard.' ,
} ,
2020-08-25 01:50:39 -07:00
{
displayName : 'Expires' ,
name : 'expires' ,
type : 'dateTime' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The coupon will expire on the date at 00:00:00 UTC' ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'Group' ,
name : 'group' ,
type : 'string' ,
typeOptions : {
minValue : 1 ,
2020-10-22 06:46:03 -07:00
maxValue : 50 ,
2020-08-25 01:50:39 -07:00
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The name of the coupon group this coupon should be assigned to' ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'Number of Coupons' ,
name : 'numberOfCoupons' ,
type : 'number' ,
default : 1 ,
description : 'Number of coupons to generate. Not valid if coupon_code is specified.' ,
} ,
{
2020-08-25 01:51:16 -07:00
displayName : 'Recurring' ,
name : 'recurring' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
2022-08-17 08:50:24 -07:00
description :
'If the coupon is used on subscription products, this indicates whether the discount should apply to recurring payments after the initial purchase' ,
2020-08-25 01:50:39 -07:00
} ,
] ,
} ,
2020-08-25 01:51:16 -07:00
/* -------------------------------------------------------------------------- */
/* coupon:getAll */
/* -------------------------------------------------------------------------- */
2020-08-25 01:50:39 -07:00
{
displayName : 'Product ID' ,
name : 'productId' ,
type : 'string' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'coupon' ] ,
2022-12-29 03:20:43 -08:00
operation : [ 'getAll' ] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
default : '' ,
required : true ,
2022-05-06 14:01:25 -07:00
description : 'The specific product/subscription ID' ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'getAll' ] ,
resource : [ 'coupon' ] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'getAll' ] ,
resource : [ 'coupon' ] ,
returnAll : [ false ] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
typeOptions : {
minValue : 1 ,
maxValue : 500 ,
} ,
default : 100 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-08-25 01:50:39 -07:00
} ,
2020-08-25 01:51:16 -07:00
/* -------------------------------------------------------------------------- */
/* coupon:update */
/* -------------------------------------------------------------------------- */
2020-08-25 01:50:39 -07:00
{
2022-06-03 10:23:49 -07:00
displayName : 'Update By' ,
2020-08-25 01:50:39 -07:00
name : 'updateBy' ,
type : 'options' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'coupon' ] ,
2022-12-29 03:20:43 -08:00
operation : [ 'update' ] ,
2022-08-17 08:50:24 -07:00
jsonParameters : [ false ] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
default : 'couponCode' ,
2022-05-06 14:01:25 -07:00
description : 'Either flat or percentage' ,
2020-08-25 01:50:39 -07:00
options : [
{
name : 'Coupon Code' ,
2020-10-22 06:46:03 -07:00
value : 'couponCode' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'Group' ,
2020-10-22 06:46:03 -07:00
value : 'group' ,
2020-08-25 01:50:39 -07:00
} ,
2020-10-22 06:46:03 -07:00
] ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'Coupon Code' ,
name : 'couponCode' ,
type : 'string' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'coupon' ] ,
operation : [ 'update' ] ,
updateBy : [ 'couponCode' ] ,
jsonParameters : [ false ] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
default : '' ,
description : 'Identify the coupon to update' ,
} ,
{
displayName : 'Group' ,
name : 'group' ,
type : 'string' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'coupon' ] ,
operation : [ 'update' ] ,
updateBy : [ 'group' ] ,
jsonParameters : [ false ] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The name of the group of coupons you want to update' ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'JSON Parameters' ,
name : 'jsonParameters' ,
type : 'boolean' ,
default : false ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'coupon' ] ,
operation : [ 'update' ] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
} ,
{
2020-08-25 01:51:16 -07:00
displayName : 'Additional Fields' ,
2020-08-25 01:50:39 -07:00
name : 'additionalFieldsJson' ,
type : 'json' ,
typeOptions : {
alwaysOpenEditWindow : true ,
} ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'coupon' ] ,
operation : [ 'update' ] ,
jsonParameters : [ true ] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Attributes in JSON form' ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'coupon' ] ,
operation : [ 'update' ] ,
jsonParameters : [ false ] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
default : { } ,
options : [
{
displayName : 'Allowed Uses' ,
name : 'allowedUses' ,
type : 'number' ,
default : 1 ,
2022-08-17 08:50:24 -07:00
description :
'Number of times a coupon can be used in a checkout. This will be set to 999,999 by default, if not specified.' ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'Discount' ,
name : 'discount' ,
type : 'fixedCollection' ,
2022-04-22 09:29:51 -07:00
default : { } ,
2020-08-25 01:50:39 -07:00
options : [
{
displayName : 'Discount Properties' ,
name : 'discountProperties' ,
values : [
{
displayName : 'Currency' ,
name : 'currency' ,
type : 'options' ,
default : 'EUR' ,
2022-08-17 08:50:24 -07:00
description :
'The currency must match the balance currency specified in your account' ,
2020-08-25 01:50:39 -07:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
discountType : [ 'flat' ] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
options : [
{
name : 'ARS' ,
2020-10-22 06:46:03 -07:00
value : 'ARS' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'AUD' ,
2020-10-22 06:46:03 -07:00
value : 'AUD' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'BRL' ,
2020-10-22 06:46:03 -07:00
value : 'BRL' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'CAD' ,
2020-10-22 06:46:03 -07:00
value : 'CAD' ,
2020-08-25 01:50:39 -07:00
} ,
2020-08-25 01:51:16 -07:00
{
name : 'CHF' ,
2020-10-22 06:46:03 -07:00
value : 'CHF' ,
2020-08-25 01:51:16 -07:00
} ,
2020-08-25 01:50:39 -07:00
{
name : 'CNY' ,
2020-10-22 06:46:03 -07:00
value : 'CNY' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'CZK' ,
2020-10-22 06:46:03 -07:00
value : 'CZK' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'DKK' ,
2020-10-22 06:46:03 -07:00
value : 'DKK' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'EUR' ,
2020-10-22 06:46:03 -07:00
value : 'EUR' ,
2020-08-25 01:50:39 -07:00
} ,
2020-08-25 01:51:16 -07:00
{
name : 'GBP' ,
2020-10-22 06:46:03 -07:00
value : 'GBP' ,
2020-08-25 01:51:16 -07:00
} ,
2020-08-25 01:50:39 -07:00
{
name : 'HKD' ,
2020-10-22 06:46:03 -07:00
value : 'HKD' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'HUF' ,
2020-10-22 06:46:03 -07:00
value : 'HUF' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'INR' ,
2020-10-22 06:46:03 -07:00
value : 'INR' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'JPY' ,
2020-10-22 06:46:03 -07:00
value : 'JPY' ,
2020-08-25 01:50:39 -07:00
} ,
2020-08-25 01:51:16 -07:00
{
name : 'KRW' ,
2020-10-22 06:46:03 -07:00
value : 'KRW' ,
2020-08-25 01:51:16 -07:00
} ,
2020-08-25 01:50:39 -07:00
{
name : 'MXN' ,
2020-10-22 06:46:03 -07:00
value : 'MXN' ,
2020-08-25 01:50:39 -07:00
} ,
{
2020-08-25 01:51:16 -07:00
name : 'NOK' ,
2020-10-22 06:46:03 -07:00
value : 'NOK' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'NZD' ,
2020-10-22 06:46:03 -07:00
value : 'NZD' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'PLN' ,
2020-10-22 06:46:03 -07:00
value : 'PLN' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'RUB' ,
2020-10-22 06:46:03 -07:00
value : 'RUB' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'SEK' ,
2020-10-22 06:46:03 -07:00
value : 'SEK' ,
2020-08-25 01:50:39 -07:00
} ,
{
2020-08-25 01:51:16 -07:00
name : 'SGD' ,
2020-10-22 06:46:03 -07:00
value : 'SGD' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'THB' ,
2020-10-22 06:46:03 -07:00
value : 'THB' ,
2020-08-25 01:50:39 -07:00
} ,
{
2020-08-25 01:51:16 -07:00
name : 'TWD' ,
2020-10-22 06:46:03 -07:00
value : 'TWD' ,
2020-08-25 01:50:39 -07:00
} ,
{
name : 'USD' ,
2020-10-22 06:46:03 -07:00
value : 'USD' ,
2020-08-25 01:50:39 -07:00
} ,
{
2020-08-25 01:51:16 -07:00
name : 'ZAR' ,
2020-10-22 06:46:03 -07:00
value : 'ZAR' ,
2020-08-25 01:50:39 -07:00
} ,
2020-08-25 01:51:16 -07:00
] ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'Discount Amount Currency' ,
name : 'discountAmount' ,
type : 'number' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Discount amount' ,
2020-08-25 01:50:39 -07:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
discountType : [ 'flat' ] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
typeOptions : {
2020-10-22 06:46:03 -07:00
minValue : 0 ,
2020-08-25 01:50:39 -07:00
} ,
} ,
{
displayName : 'Discount Amount Percentage' ,
name : 'discountAmount' ,
type : 'number' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Discount amount' ,
2020-08-25 01:50:39 -07:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
discountType : [ 'percentage' ] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
typeOptions : {
minValue : 0 ,
2020-10-22 06:46:03 -07:00
maxValue : 100 ,
2020-08-25 01:50:39 -07:00
} ,
} ,
2020-08-25 01:51:16 -07:00
{
displayName : 'Discount Type' ,
name : 'discountType' ,
type : 'options' ,
default : 'flat' ,
2022-05-06 14:01:25 -07:00
description : 'Either flat or percentage' ,
2020-08-25 01:51:16 -07:00
options : [
{
name : 'Flat' ,
2020-10-22 06:46:03 -07:00
value : 'flat' ,
2020-08-25 01:51:16 -07:00
} ,
{
name : 'Percentage' ,
2020-10-22 06:46:03 -07:00
value : 'percentage' ,
2020-08-25 01:51:16 -07:00
} ,
2020-10-22 06:46:03 -07:00
] ,
2020-08-25 01:51:16 -07:00
} ,
2020-08-25 01:50:39 -07:00
] ,
} ,
] ,
} ,
{
displayName : 'Expires' ,
name : 'expires' ,
type : 'dateTime' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The coupon will expire on the date at 00:00:00 UTC' ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'New Coupon Code' ,
name : 'newCouponCode' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'New code to rename the coupon to' ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'New Group Name' ,
name : 'newGroup' ,
type : 'string' ,
typeOptions : {
minValue : 1 ,
2020-10-22 06:46:03 -07:00
maxValue : 50 ,
2020-08-25 01:50:39 -07:00
} ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'New group name to move coupon to' ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'Product IDs' ,
name : 'productIds' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Comma-separated list of products e.g. 499531,1234,123546. If blank then remove associated products.' ,
2020-08-25 01:50:39 -07:00
} ,
{
displayName : 'Recurring' ,
name : 'recurring' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
// eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether
2022-08-17 08:50:24 -07:00
description :
'If the coupon is used on subscription products, this indicates whether the discount should apply to recurring payments after the initial purchase' ,
2020-08-25 01:50:39 -07:00
} ,
] ,
} ,
2021-12-03 00:44:16 -08:00
] ;