Skip to content

Flash Sale Subscription API Documentation

This API allows users to subscribe to flash sales, manage their subscriptions, and update their subscription status. Only authenticated users can access this API.


1. Get All Subscriptions

Note

Flash sale will be created by super admin from the django admin.

Endpoint

  • URL: api/v1/flash_sale/subscription/
  • Method: GET
  • Permission Required: IsAuthenticated

Description

Retrieves a list of flash sale subscriptions for the authenticated user.

Request Payload

This endpoint does not require any request payload.

Response Examples

Success

{
    "id": 1,
    "flash_sale": 10,
    "is_subscribed": true
}


2. Subscribe to a Flash Sale

Endpoint

  • URL: api/v1/flash_sale/subscription/
  • Method: POST
  • Permission Required: IsAuthenticated

Description

Retrieves a list of flash sale subscriptions for the authenticated user.

Request Payload

{
    "flash_sale": 10,
    "is_subscribed": true
}

Response Examples

Success

{
    "id": 3,
    "flash_sale": 10,
    "is_subscribed": true
}


If user is already subscribed

{
    "non_field_errors": ["You are already subscribed to this flash sale."]
}