2020-08-25 01:50:39 -07:00
import {
INodeProperties ,
} from 'n8n-workflow' ;
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 : {
resource : [
'coupon' ,
] ,
} ,
} ,
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
} ,
{
name : 'Get All' ,
value : 'getAll' ,
2022-05-06 14:01:25 -07:00
description : 'Get all coupons' ,
2022-07-10 13:50:51 -07:00
action : 'Get all 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 : {
resource : [
'coupon' ,
] ,
operation : [
2020-10-22 06:46:03 -07:00
` create ` ,
2020-08-25 01:50:39 -07:00
] ,
jsonParameters : [
2020-10-22 06:46:03 -07:00
false ,
] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
default : 'checkout' ,
2022-05-06 14:01:25 -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 : {
resource : [
'coupon' ,
] ,
operation : [
2020-10-22 06:46:03 -07:00
` create ` ,
2020-08-25 01:50:39 -07:00
] ,
couponType : [
'product' ,
] ,
jsonParameters : [
2020-10-22 06:46:03 -07:00
false ,
] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
2022-04-22 09:29:51 -07:00
default : [ ] ,
2022-07-14 13:05:11 -07:00
description : '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-examples/expressions/">expression</a>.' ,
2020-08-25 01:50:39 -07:00
required : true ,
} ,
{
displayName : 'Discount Type' ,
name : 'discountType' ,
type : 'options' ,
displayOptions : {
show : {
resource : [
'coupon' ,
] ,
operation : [
2020-10-22 06:46:03 -07:00
` create ` ,
2020-08-25 01:50:39 -07:00
] ,
jsonParameters : [
2020-10-22 06:46:03 -07:00
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 : {
resource : [
'coupon' ,
] ,
operation : [
2020-10-22 06:46:03 -07:00
` create ` ,
2020-08-25 01:50:39 -07:00
] ,
discountType : [
'flat' ,
] ,
jsonParameters : [
2020-10-22 06:46:03 -07:00
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 : {
resource : [
'coupon' ,
] ,
operation : [
2020-10-22 06:46:03 -07:00
` create ` ,
2020-08-25 01:50:39 -07:00
] ,
discountType : [
'percentage' ,
] ,
jsonParameters : [
2020-10-22 06:46:03 -07:00
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 : {
resource : [
'coupon' ,
] ,
operation : [
2020-10-22 06:46:03 -07:00
` create ` ,
2020-08-25 01:50:39 -07:00
] ,
discountType : [
'flat' ,
] ,
jsonParameters : [
2020-10-22 06:46:03 -07:00
false ,
] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
} ,
{
displayName : 'JSON Parameters' ,
name : 'jsonParameters' ,
type : 'boolean' ,
default : false ,
displayOptions : {
show : {
resource : [
'coupon' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
} ,
{
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 : {
resource : [
'coupon' ,
] ,
operation : [
'create' ,
] ,
jsonParameters : [
true ,
] ,
} ,
} ,
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 : {
resource : [
'coupon' ,
] ,
operation : [
'create' ,
] ,
jsonParameters : [
2020-10-22 06:46:03 -07:00
false ,
] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
default : { } ,
options : [
{
displayName : 'Allowed Uses' ,
name : 'allowedUses' ,
type : 'number' ,
default : 1 ,
description : 'Number of times a coupon can be used in a checkout. This will be set to 999,999 by default, if not specified.' ,
} ,
{
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-05-06 14:01:25 -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 : {
resource : [
'coupon' ,
] ,
operation : [
2020-10-22 06:46:03 -07:00
` 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 : {
operation : [
'getAll' ,
] ,
resource : [
'coupon' ,
] ,
} ,
} ,
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 : {
operation : [
'getAll' ,
] ,
resource : [
'coupon' ,
] ,
returnAll : [
false ,
] ,
} ,
} ,
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 : {
resource : [
'coupon' ,
] ,
operation : [
2020-10-22 06:46:03 -07:00
` update ` ,
2020-08-25 01:50:39 -07:00
] ,
jsonParameters : [
false ,
] ,
} ,
} ,
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 : {
resource : [
'coupon' ,
] ,
operation : [
2020-10-22 06:46:03 -07:00
'update' ,
2020-08-25 01:50:39 -07:00
] ,
updateBy : [
2020-10-22 06:46:03 -07:00
'couponCode' ,
2020-08-25 01:50:39 -07:00
] ,
jsonParameters : [
false ,
] ,
} ,
} ,
default : '' ,
description : 'Identify the coupon to update' ,
} ,
{
displayName : 'Group' ,
name : 'group' ,
type : 'string' ,
displayOptions : {
show : {
resource : [
'coupon' ,
] ,
operation : [
2020-10-22 06:46:03 -07:00
'update' ,
2020-08-25 01:50:39 -07:00
] ,
updateBy : [
2020-10-22 06:46:03 -07:00
'group' ,
2020-08-25 01:50:39 -07:00
] ,
jsonParameters : [
false ,
] ,
} ,
} ,
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 : {
resource : [
'coupon' ,
] ,
operation : [
'update' ,
] ,
} ,
} ,
} ,
{
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 : {
resource : [
'coupon' ,
] ,
operation : [
'update' ,
] ,
jsonParameters : [
true ,
] ,
} ,
} ,
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 : {
resource : [
'coupon' ,
] ,
operation : [
'update' ,
] ,
jsonParameters : [
2020-10-22 06:46:03 -07:00
false ,
] ,
2020-08-25 01:50:39 -07:00
} ,
} ,
default : { } ,
options : [
{
displayName : 'Allowed Uses' ,
name : 'allowedUses' ,
type : 'number' ,
default : 1 ,
description : 'Number of times a coupon can be used in a checkout. This will be set to 999,999 by default, if not specified.' ,
} ,
{
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-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
displayOptions : {
show : {
discountType : [
'flat' ,
] ,
} ,
} ,
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 : {
discountType : [
'flat' ,
] ,
} ,
} ,
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 : {
discountType : [
'percentage' ,
] ,
} ,
} ,
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 : '' ,
description : 'Comma-separated list of products e.g. 499531,1234,123546. If blank then remove associated products.' ,
} ,
{
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-05-06 14:01:25 -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
] ;