Skip to content
You are reading the unreleased documentation. No version is released yet, and these pages describe code that is not in a release.

Promotions (admin API)

Admin routes of the promotions module. Every route needs a staff session and the permission named on it; send X-Resolve-Locale: false to receive every locale of a translatable field for editing.

List promotions

Parameters:

  • isActive in query (boolean, optional).
  • page in query (number, min 1, optional).
  • pageSize in query (number, min 1, max 100, optional).

Responses:

  • 200: Promotions retrieved.
  • 401: Unauthorized.
  • 403: Insufficient permissions.

Create promotion

Request body: CreatePromotionAdminDto.

Responses:

  • 201: Promotion created.
  • 400: Invalid input.
  • 401: Unauthorized.
  • 403: Insufficient permissions.

Deactivate promotion

Parameters:

  • id in path (string, required).

Responses:

  • 204: Promotion deactivated.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Promotion not found.

Get promotion

Parameters:

  • id in path (string, required).

Responses:

  • 200: Promotion retrieved.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Promotion not found.

Update promotion

Parameters:

  • id in path (string, required).

Request body: UpdatePromotionAdminDto.

Responses:

  • 200: Promotion updated.
  • 400: Invalid input.
  • 401: Unauthorized.
  • 403: Insufficient permissions.
  • 404: Promotion not found.
  • name (TranslatableDto, required).
  • description (TranslatableDto, optional).
  • type (object, required).
  • applicationMethod (object, required).
  • couponCode (string, optional).
  • value (number, min 0, required).
  • minimumOrderAmount (number, min 0, optional).
  • maximumDiscount (number, min 0, optional).
  • usageLimit (number, min 1, optional).
  • usageLimitPerUser (number, min 1, optional).
  • isExclusive (boolean, optional).
  • priority (number, min 0, optional).
  • buyQuantity (number, min 1, optional).
  • getQuantity (number, min 1, optional).
  • tierConfig (object, optional).
  • startsAt (string, optional).
  • endsAt (string, optional).
  • isActive (boolean, optional).
  • eligibleProductIds (array of string, optional).
  • eligibleCategoryIds (array of string, optional).
  • default (string, required).
  • fr (string, optional).
  • en (string, optional).
  • ar (string, optional).