-
Notifications
You must be signed in to change notification settings - Fork 44
PROMO-933 add bulk coupon code generation #970
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
b2368fc
to
281881b
Compare
- batch_size | ||
type: object | ||
properties: | ||
prefix: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets add a minLength
, maxLength
and pattern
to this property.
type: string | ||
description: A prefix to add to the generated codes. | ||
example: 'PROMO' | ||
suffix: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. A minLength
, maxLength
and pattern
could be helpful here
reference/promotions.v3.yml
Outdated
batch_size: | ||
type: integer | ||
description: The number of coupon codes to generate in each batch. The maximum value is 250. | ||
example: 5 | ||
max_uses: | ||
type: integer | ||
description: The maximum number of times each coupon code can be used. The default value is 0, which represents unlimited uses. | ||
example: 10 | ||
max_uses_per_customer: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can define a minimum
and maximum
for these values
reference/promotions.v3.yml
Outdated
example: 5 | ||
max_uses: | ||
type: integer | ||
description: The maximum number of times each coupon code can be used. The default value is 0, which represents unlimited uses. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering the use case for batch creation of codes would a default of 1
make more sense?
add bulk coupon code generation
Generate a batch of coupon codes for a particular bulk coupon promotion. | ||
|
||
**Note:** | ||
* batch_size is limited to 250 codes per request for first version. If batch_size is not an integer or larger than 250, it will return a 400 error code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we prefer 422 over 400: https://stackoverflow.com/a/20215807
* batch_size is limited to 250 codes per request for first version. If batch_size is not an integer or larger than 250, it will return a 400 error code. | |
* batch_size is limited to 250 codes per request for first version. If batch_size is not an integer or larger than 250, it will return a 422 error code. |
|
||
**Note:** | ||
* batch_size is limited to 250 codes per request for first version. If batch_size is not an integer or larger than 250, it will return a 400 error code. | ||
* The default rate limit for this endpoint is 40 concurrent requests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we start with small number first ?
* The default rate limit for this endpoint is 40 concurrent requests. | |
* The default rate limit for this endpoint is 10 concurrent requests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe lets just not expose what our concurrent limits are? Since these are dynamic, probably not very useful to add a hard number in the docs
maximum: 250 | ||
max_uses: | ||
type: integer | ||
description: The maximum number of times each coupon code can be used. The default value is 1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we default it to "0" which is unlimited usage, similar to
docs/reference/promotions.v3.yml
Line 248 in 9132b92
description: The maximum number of times you can use this coupon code. The default value is 0, which represents unlimited uses. The parent promotion's `max_uses` field overrides the coupon code's `max_uses` field. |
'200': | ||
$ref: '#/components/responses/BulkCouponCodesResponse' | ||
'400': | ||
description: The request payload was invalid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description: The request payload was invalid. | |
description: invalid request |
code: | ||
type: string | ||
pattern: '[a-zA-Z0-9_\ -]' | ||
description: A unique code that can be used to manually apply a discount. Only letters, numbers, white spaces, underscores and hyphens are allowed. | ||
example: TEST-COUPON-CODE | ||
maxLength: 50 | ||
minLength: 12 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not in scope of this PR: probably we can define a type for this and reuse it in many places
prefix: | ||
type: string | ||
description: A prefix to add to the generated codes. | ||
example: 'PROMO' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe better communicate that we will not add anything to the prefix
example: 'PROMO' | |
example: 'PROMO_' |
add bulk coupon code generation
PROMO-933
What changed?
Release notes draft
in progress
Anything else?
in progress
ping {names}