From 4e756251df69cc0e1c13e898a3cf4a1d347dd843 Mon Sep 17 00:00:00 2001 From: Anshu Mishra Date: Thu, 25 Sep 2025 12:04:40 +0530 Subject: [PATCH 1/6] PROMO-1256: Added prefix, suffix and code_length fields for bulk coupon api /v3/promotions/{promotion id}/codegen --- reference/promotions.v3.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/reference/promotions.v3.yml b/reference/promotions.v3.yml index e15ea101e..4b21e3a65 100644 --- a/reference/promotions.v3.yml +++ b/reference/promotions.v3.yml @@ -320,6 +320,24 @@ paths: example: 5 minimum: 0 maximum: 100000 + prefix: + pattern: '[A-Z0-9_-]' + type: string + description: 'The fixed text or characters that will appear at the beginning of every generated coupon code. Only capital letters, numbers, underscores and hyphens are allowed.' + example: PRE- + maxLength: 20 + suffix: + pattern: '[A-Z0-9_-]' + type: string + description: 'The fixed text or characters that will appear at the end of every generated coupon code. Only capital letters, numbers, underscores and hyphens are allowed.' + example: _POST + maxLength: 20 + code_length: + type: integer + description: 'The length of the random string to be generated for each coupon code. The value must be between 6 and 20. The total length of each generated coupon code is calculated as: `code_length` + length of `prefix` + length of `suffix`. The maximum total length of a coupon code is 50.' + example: 10 + minimum: 6 + maximum: 20 required: true responses: '201': From bc5b78b2e06e19e85bb3ad9fe8795addcec4d2f0 Mon Sep 17 00:00:00 2001 From: Anshu Mishra Date: Thu, 25 Sep 2025 13:00:55 +0530 Subject: [PATCH 2/6] PROMO-1256: addressed PR comments --- reference/promotions.v3.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/reference/promotions.v3.yml b/reference/promotions.v3.yml index 4b21e3a65..666d30058 100644 --- a/reference/promotions.v3.yml +++ b/reference/promotions.v3.yml @@ -323,21 +323,21 @@ paths: prefix: pattern: '[A-Z0-9_-]' type: string - description: 'The fixed text or characters that will appear at the beginning of every generated coupon code. Only capital letters, numbers, underscores and hyphens are allowed.' - example: PRE- + description: 'The fixed text that will appear at the beginning of every generated coupon code. Only capital letters, numbers, underscores and hyphens are allowed.' + example: PRE maxLength: 20 suffix: pattern: '[A-Z0-9_-]' type: string - description: 'The fixed text or characters that will appear at the end of every generated coupon code. Only capital letters, numbers, underscores and hyphens are allowed.' - example: _POST + description: 'The fixed text that will appear at the end of every generated coupon code. Only capital letters, numbers, underscores and hyphens are allowed.' + example: POST maxLength: 20 code_length: type: integer - description: 'The length of the random string to be generated for each coupon code. The value must be between 6 and 20. The total length of each generated coupon code is calculated as: `code_length` + length of `prefix` + length of `suffix`. The maximum total length of a coupon code is 50.' + description: 'The length of the random string to be generated for each coupon code. The value must be between 6 and 16. The total length of each generated coupon code is calculated as: `code_length` + length of `prefix` + length of `suffix`. The maximum total length of a coupon code is 50.' example: 10 minimum: 6 - maximum: 20 + maximum: 16 required: true responses: '201': From b585610568c859673838f2bece35f8fd3a6af9af Mon Sep 17 00:00:00 2001 From: Anshu Mishra Date: Mon, 29 Sep 2025 07:56:52 +0530 Subject: [PATCH 3/6] PROMO-1256: addressed PR comments --- reference/promotions.v3.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/promotions.v3.yml b/reference/promotions.v3.yml index 666d30058..04d9f4afb 100644 --- a/reference/promotions.v3.yml +++ b/reference/promotions.v3.yml @@ -334,7 +334,7 @@ paths: maxLength: 20 code_length: type: integer - description: 'The length of the random string to be generated for each coupon code. The value must be between 6 and 16. The total length of each generated coupon code is calculated as: `code_length` + length of `prefix` + length of `suffix`. The maximum total length of a coupon code is 50.' + description: 'The length of the random string to be generated for each coupon code. The value must be between 6 and 16. The default length is 16. The total length of each generated coupon code is calculated as: `code_length` + length of `prefix` + length of `suffix`. The maximum total length of a coupon code is 50.' example: 10 minimum: 6 maximum: 16 From 92b93c613c0b7396c15de80bf1c81a27f26758f1 Mon Sep 17 00:00:00 2001 From: Anshu Mishra Date: Tue, 30 Sep 2025 10:04:16 +0530 Subject: [PATCH 4/6] PROMO-1257: Added optional delimiter field for bulk coupon api /v3/promotions/{promotion id}/codegen --- reference/promotions.v3.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/promotions.v3.yml b/reference/promotions.v3.yml index 04d9f4afb..bc2d9a17f 100644 --- a/reference/promotions.v3.yml +++ b/reference/promotions.v3.yml @@ -332,6 +332,12 @@ paths: description: 'The fixed text that will appear at the end of every generated coupon code. Only capital letters, numbers, underscores and hyphens are allowed.' example: POST maxLength: 20 + delimiter: + pattern: '[_-]' + type: string + description: 'An optional single character (_ or -) that will be placed between the prefix and the randomly generated code, and again between the randomly generated code and the suffix. It will only be applied if a valid prefix or suffix is present.' + example: _ + maxLength: 1 code_length: type: integer description: 'The length of the random string to be generated for each coupon code. The value must be between 6 and 16. The default length is 16. The total length of each generated coupon code is calculated as: `code_length` + length of `prefix` + length of `suffix`. The maximum total length of a coupon code is 50.' From 2a2d7bbbf66262fea01fd08274cdae6b9dfe13c2 Mon Sep 17 00:00:00 2001 From: Anshu Mishra Date: Tue, 7 Oct 2025 13:08:43 +0530 Subject: [PATCH 5/6] PROMO-1296 Added exclude_characters field for bulk coupon api /v3/promotions/{promotion id}/codegen --- reference/promotions.v3.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/promotions.v3.yml b/reference/promotions.v3.yml index bc2d9a17f..0ea2cc17e 100644 --- a/reference/promotions.v3.yml +++ b/reference/promotions.v3.yml @@ -338,6 +338,12 @@ paths: description: 'An optional single character (_ or -) that will be placed between the prefix and the randomly generated code, and again between the randomly generated code and the suffix. It will only be applied if a valid prefix or suffix is present.' example: _ maxLength: 1 + exclude_characters: + pattern: '[A-Z0-9]' + type: array + description: 'An optional array of single length string elements to exclude from the generated coupon codes. Only capital letters and numbers are allowed. The default value is an empty array [].' + example: ["1", "2", "3", "4", "5", "A", "B", "C", "D", "E"] + maxLength: 26 code_length: type: integer description: 'The length of the random string to be generated for each coupon code. The value must be between 6 and 16. The default length is 16. The total length of each generated coupon code is calculated as: `code_length` + length of `prefix` + length of `suffix`. The maximum total length of a coupon code is 50.' From 121a50b642cf0f9a2da42cf6eade2ac408cafe9d Mon Sep 17 00:00:00 2001 From: Anshu Mishra Date: Tue, 7 Oct 2025 13:17:33 +0530 Subject: [PATCH 6/6] PROMO-1296 Added required sibling items field for type:array --- reference/promotions.v3.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/promotions.v3.yml b/reference/promotions.v3.yml index 0ea2cc17e..6734bfd0d 100644 --- a/reference/promotions.v3.yml +++ b/reference/promotions.v3.yml @@ -341,6 +341,8 @@ paths: exclude_characters: pattern: '[A-Z0-9]' type: array + items: + type: string description: 'An optional array of single length string elements to exclude from the generated coupon codes. Only capital letters and numbers are allowed. The default value is an empty array [].' example: ["1", "2", "3", "4", "5", "A", "B", "C", "D", "E"] maxLength: 26