From 1f450374fa080cc72269266fb20aed56df3e055b Mon Sep 17 00:00:00 2001 From: Anshu Mishra Date: Thu, 25 Sep 2025 12:04:40 +0530 Subject: [PATCH 1/2] PROMO-1256 PROMO-1257 PROMO-1296: Added prefix, suffix, delimiter, exclude_characters and code_length fields for bulk coupon api /v3/promotions/{promotion id}/codegen --- reference/promotions.v3.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/reference/promotions.v3.yml b/reference/promotions.v3.yml index e15ea101e..f2e9ad2f1 100644 --- a/reference/promotions.v3.yml +++ b/reference/promotions.v3.yml @@ -320,6 +320,38 @@ paths: example: 5 minimum: 0 maximum: 100000 + prefix: + pattern: '[A-Z0-9_-]' + type: string + 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 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 + exclude_characters: + type: array + items: + type: string + pattern: '[A-Z0-9]' + 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.' + example: 10 + minimum: 6 + maximum: 16 required: true responses: '201': From 8b190e43c63c1ebbbc486c34112c40cf39d1146e Mon Sep 17 00:00:00 2001 From: Anshu Mishra Date: Mon, 13 Oct 2025 07:02:00 +0530 Subject: [PATCH 2/2] addressed PR comments --- reference/promotions.v3.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reference/promotions.v3.yml b/reference/promotions.v3.yml index f2e9ad2f1..4ffd2d60a 100644 --- a/reference/promotions.v3.yml +++ b/reference/promotions.v3.yml @@ -323,19 +323,19 @@ paths: prefix: pattern: '[A-Z0-9_-]' type: string - description: 'The fixed text that will appear at the beginning of every generated coupon code. Only capital letters, numbers, underscores and hyphens are allowed.' + 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 that will appear at the end of every generated coupon code. Only capital letters, numbers, underscores and hyphens are allowed.' + 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.' + 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: @@ -343,12 +343,12 @@ paths: items: type: string pattern: '[A-Z0-9]' - 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 [].' + 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.' + 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 with delimiter + length of suffix with delimiter. The maximum total length of a coupon code is 50. example: 10 minimum: 6 maximum: 16