Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions reference/promotions.v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,14 @@ components:
- BULK
description: The type of the coupon promotion, whether it will have single or multiple codes.
example: BULK
number_of_codes:
type: integer
description: The total number of coupon codes for this promotion.
example: 1
number_of_used_codes:
type: integer
description: The number of coupon codes that have been used at least once.
example: 0
required:
- id
- name
Expand All @@ -623,6 +631,8 @@ components:
- can_be_used_with_other_promotions
- coupon_overrides_automatic_when_offering_higher_discounts
- coupon_type
- number_of_codes
- number_of_used_codes
Comment on lines +634 to +635
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the intention is to have those fields as optional, and we can query them in adhoc with "include" parameter, somethingg like "GET /promotions?include=number_of_codes,number_of_used_codes"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably we can do the same for those number_of_codes and number_of_used_codes, make it available for internal usage for now ?

Copy link
Contributor

@donald-nguyen-bc donald-nguyen-bc Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if so, probably we don't need to update this swagger doc.

Copy link
Contributor Author

@YevenLourance YevenLourance Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i will implement as GET /promotions?include=number_of_codes,number_of_used_codes then
do we want to hide if promotion is automatic or maybe number of codes are 0 for automatic promotions?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably we can return 0 for automatic promotions, similar to how we are handling the codes and multiple_codes ?

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks ! @donald-nguyen-bc ill try with that in my implementation 👍

PatchAutomaticPromotion:
title: Patch Automatic Promotion
description: 'A Partial **Automatic Promotion** that contains properties to patch.'
Expand Down