Skip to content

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:

  • applicationMethod in query ("AUTOMATIC", "COUPON", optional).
  • isActive in query (boolean, optional).
  • page in query (number, min 1, optional).
  • pageSize in query (number, min 1, max 100, optional).
  • type in query ("BUY_X_GET_Y", "FIXED_AMOUNT", "FREE_SHIPPING", "PERCENTAGE", "TIERED_PRICE", "VOLUME_DISCOUNT", 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 ("BUY_X_GET_Y", "FIXED_AMOUNT", "FREE_SHIPPING", "PERCENTAGE", "TIERED_PRICE", "VOLUME_DISCOUNT", required).
  • applicationMethod ("AUTOMATIC", "COUPON", 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).
  • fr (string, optional).
  • en (string, optional).
  • ar (string, optional).
  • default (string, required).
As seen on Open Source Alternatives The Merchant Engine badge