Rupa Rawi - Revou Group Project
  1. promotions
Rupa Rawi - Revou Group Project
  • auth
    • register user
      POST
    • login
      POST
    • refresh token
      POST
  • user
    • address
      • create address
      • get all address
      • update address
      • delete address
    • payment method
      • get all payment methods
      • delete payment method
      • update payment method
      • create payment method
    • update own profile
      PUT
    • get own profile
      GET
    • get public profile
      GET
  • product
    • category
      • get categories tree
      • get categories detail
    • wishlist
      • add item to wishlist
      • remove item to wishlist
      • get wishlist
    • promotions
      • get promotion detail (public)
      • get active promotions (public)
    • get product details (public)
      GET
    • get product list (public)
      GET
    • get public vendor products
      GET
  • admin
    • category
      • create category
      • update category
      • soft delete category
      • create subcategory
    • vendor management
      • get all vendors
      • vendor application review
    • promotions
      • get all promotions
        GET
      • create promotion
        POST
      • update promotion
        PUT
    • get admin logs
      GET
  • vendor
    • product
      • soft delete product
      • create product
      • update product
      • get vendor products
    • vendor apply
      POST
    • get vendor profile
      GET
    • update vendor profile
      PUT
    • vendor stats
      GET
    • Vendor recent orders
      GET
  • order
    • cart
      • add item to cart
      • update item in cart
      • delete item in cart
      • get cart
    • update order status
    • get order
    • get all orders
    • pre-checkout calculation
    • order checkout
  • article
    • delete article
    • create article
    • get article
    • get article detail
    • update article
  • product review
    • create review product
    • get product reviews by product id
    • get product review detail
    • update product review detail
    • delete product review
  • testimony
    • create testimonial
    • update testimonial
    • get testimonial
    • delete testimonial
  1. promotions

create promotion

Developing
POST
admin/promotions
class PromotionType(Enum):
PERCENTAGE_DISCOUNT = "percentage_discount"
FIXED_DISCOUNT = "fixed_discount"
max discount for percentage discount
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'admin/promotions' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6ZmFsc2UsImlhdCI6MTc0NTU3MDkyMywianRpIjoiN2JmNWYzYWEtNjBiYS00MDcyLWIyY2MtYjcyMTdiOTEyNTExIiwidHlwZSI6ImFjY2VzcyIsInN1YiI6IjMiLCJuYmYiOjE3NDU1NzA5MjMsImNzcmYiOiJlNjliZTVmNC03ODRmLTRmN2YtOWUzZC02NWZmYzE3YWM1YWMiLCJ1c2VybmFtZSI6InNlbGYiLCJlbWFpbCI6InNlbGZAZXhhbXBsZS5jb20iLCJpc192ZW5kb3IiOmZhbHNlfQ.OWOHjdvS-Epyv6Dimp_n53eiO1r2h3RoY8tDTa7yS9c' \
--header 'Content-Type: application/json' \
--data-raw '{
    "title": "Summer Sale",
    "description": "20% off all eco-friendly products",
    "promo_code": "HELPMEPLS3",
    "discount_value": 20,
    "promotion_type": "percentage_discount",
    "start_date": "2023-06-01T00:00:00",
    "end_date": "2043-06-30T23:59:59",
    "image_url" : "https://example.com/image.jpg",
    "min_order_amount": 100,
    "max_discount": 500000,
    "usage_limit": 2,
    "product_ids": [1, 2, 3],
    "category_names": ["Food", "Clothes"]
}'
Response Response Example
{
  "message": "Promotion created successfully",
  "promotion": {
    "categories": "['Food', 'Clothes']",
    "created_at": "Sun, 04 May 2025 17:21:39 GMT",
    "description": "20% off all eco-friendly products",
    "discount_value": 20.0,
    "end_date": "Tue, 30 Jun 2043 23:59:59 GMT",
    "id": 21,
    "image_url": "https://example.com/image.jpg",
    "is_active": true,
    "max_discount": 500000.0,
    "products": "[1, 2, 3]",
    "promo_code": "HELPMEPLS3",
    "promotion_type": "percentage_discount",
    "start_date": "Thu, 01 Jun 2023 00:00:00 GMT",
    "title": "Summer Sale",
    "updated_at": "Sun, 04 May 2025 17:21:39 GMT",
    "usage_limit": 2
  },
  "success": true
}

Request

Header Params
Authorization
string 
required
Example:
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6ZmFsc2UsImlhdCI6MTc0NTU3MDkyMywianRpIjoiN2JmNWYzYWEtNjBiYS00MDcyLWIyY2MtYjcyMTdiOTEyNTExIiwidHlwZSI6ImFjY2VzcyIsInN1YiI6IjMiLCJuYmYiOjE3NDU1NzA5MjMsImNzcmYiOiJlNjliZTVmNC03ODRmLTRmN2YtOWUzZC02NWZmYzE3YWM1YWMiLCJ1c2VybmFtZSI6InNlbGYiLCJlbWFpbCI6InNlbGZAZXhhbXBsZS5jb20iLCJpc192ZW5kb3IiOmZhbHNlfQ.OWOHjdvS-Epyv6Dimp_n53eiO1r2h3RoY8tDTa7yS9c
Body Params application/json
title
string 
required
description
string 
optional
promo_code
string 
required
discount_value
integer 
required
promotion_type
string 
required
start_date
string 
required
end_date
string 
required
image_url
string 
optional
min_order_amount
integer 
required
max_discount
integer 
optional
usage_limit
integer 
optional
product_ids
array[integer]
optional
category_names
array[string]
optional
Examples

Responses

🟢201Success
application/json
Body
message
string 
required
promotion
object 
required
categories
string 
required
created_at
string 
required
description
string 
required
discount_value
integer 
required
end_date
string 
required
id
integer 
required
image_url
string 
required
is_active
boolean 
required
max_discount
integer 
required
products
string 
required
promo_code
string 
required
promotion_type
string 
required
start_date
string 
required
title
string 
required
updated_at
string 
required
usage_limit
integer 
required
success
boolean 
required
Modified at 2025-05-04 17:44:12
Previous
get all promotions
Next
update promotion
Built with