Download OpenAPI specification:
This is the API documentation for novowatt app.
| keyword | string Search by keyword - code, name, ... |
| code | string Filter by code |
| promo_type | string Enum: "Subscription" "FeePayment" Filter by promo type |
| status | string Enum: "active" "inactive" "deleted" Filter by status |
| is_used | boolean Filter by is used |
| merchant_id | string Filter by merchant id |
| page | integer The page number. |
| per_page | integer The numbers of items to return. |
{- "ok": true,
- "total": 25,
- "page": 1,
- "data": [
- {
- "_id": "665e8f15ebf7d56c133612ab",
- "code": "M1234",
- "program_id": "665e8f15ebf7d56c133612ab",
- "name": "Free 1 month",
- "merchant_id": "665e8f15ebf7d56c133612ab",
- "merchant_name": "Merchant ABC Ltd.",
- "description": "This is a description",
- "promo_type": "Subscription",
- "discount_value": 100,
- "discount_type": "percent",
- "max_discount": 50,
- "max_discount_type": "fixed",
- "expiry_date": "2021-07-31",
- "status": "active",
- "created_at": "2021-07-01T00:00:00.000Z",
- "updated_at": "2021-07-01T00:00:00.000Z",
- "activated_at": "2021-07-01T00:00:00.000Z",
- "activated_by": "665e8f15ebf7d56c133612ab",
- "activated_by_name": "User ABC"
}
]
}{- "ok": true,
- "data": [
- {
- "_id": "665e8f15ebf7d56c133612ab",
- "code": "M1234",
- "program_id": "665e8f15ebf7d56c133612ab",
- "name": "Free 1 month",
- "merchant_id": "665e8f15ebf7d56c133612ab",
- "merchant_name": "Merchant ABC Ltd.",
- "description": "This is a description",
- "promo_type": "Subscription",
- "discount_value": 100,
- "discount_type": "percent",
- "max_discount": 50,
- "max_discount_type": "fixed",
- "expiry_date": "2021-07-31",
- "status": "active",
- "created_at": "2021-07-01T00:00:00.000Z",
- "updated_at": "2021-07-01T00:00:00.000Z",
- "activated_at": "2021-07-01T00:00:00.000Z",
- "activated_by": "665e8f15ebf7d56c133612ab",
- "activated_by_name": "User ABC"
}
]
}| program_id | string |
| number_of_codes | integer |
| start_date | string |
| end_date | string |
| status | string |
| discount_value | number |
| discount_type | string Enum: "percent" "fixed" |
| max_discount | number Maximum discount amount |
| max_discount_type | string Enum: "percent" "fixed" |
{- "program_id": "665e8f15ebf7d56c133612ab",
- "number_of_codes": 10,
- "start_date": "2021-07-01",
- "end_date": "2021-07-31",
- "status": "active",
- "discount_value": 100,
- "discount_type": "percent",
- "max_discount": 50,
- "max_discount_type": "fixed"
}{- "ok": true
}| ids | Array of strings |
| promo_program_id | string |
{- "ids": [
- "667fced180a245c95d401f4d",
- "667fced180a245c95d401f4e"
], - "promo_program_id": "667fced180a245c95d401f4c"
}{- "ok": true,
- "message": "Invalidated {number} promo codes"
}{- "code": "PROMO52E"
}{- "ok": true,
- "data": [
- {
- "_id": "665e8f15ebf7d56c133612ab",
- "code": "M1234",
- "program_id": "665e8f15ebf7d56c133612ab",
- "name": "Free 1 month",
- "merchant_id": "665e8f15ebf7d56c133612ab",
- "merchant_name": "Merchant ABC Ltd.",
- "description": "This is a description",
- "promo_type": "Subscription",
- "discount_value": 100,
- "discount_type": "percent",
- "max_discount": 50,
- "max_discount_type": "fixed",
- "expiry_date": "2021-07-31",
- "status": "active",
- "created_at": "2021-07-01T00:00:00.000Z",
- "updated_at": "2021-07-01T00:00:00.000Z",
- "activated_at": "2021-07-01T00:00:00.000Z",
- "activated_by": "665e8f15ebf7d56c133612ab",
- "activated_by_name": "User ABC"
}
]
}| ids | Array of strings |
| promo_program_id | string |
| extend_to_date | string date with format YYYY-MM-DD |
{- "ids": [
- "667fced180a245c95d401f4d",
- "667fced180a245c95d401f4e"
], - "promo_program_id": "667fced180a245c95d401f4c",
- "extend_to_date": "2028-07-31"
}{- "ok": true,
- "message": "Expiration dates updated successfully"
}| id required | string Promo code ID |
Calculate discount request body
| invoice_type | string Type of invoice |
| amount | number Amount for which discount is to be calculated |
{- "invoice_type": "Subscription",
- "amount": 100
}{- "ok": true,
- "data": {
- "original_price": 100,
- "discounted_price": 10,
- "discounted_type": "percent",
- "discounted_value": 10,
- "final_price": 90
}
}| id required | string Promo code ID |
Mark used request body
| transaction_id | string Transaction id |
| user_id | string User id |
{- "transaction_id": "666b176eac77dae25d567ec2",
- "user_id": "663a687cdd21174060cf185a"
}{- "ok": true,
- "msg": "Used ${number} promo codes"
}| keyword | string Keyword for searching promo programs |
| code | string Code of the promo program |
| merchant_id | string Merchant ID associated with the promo program |
| promo_type | string Type of promo program |
| status | string Status of the promo program |
| used_codes | integer Number of used codes |
| start_date | string <date-time> Start date of the promo program |
| end_date | string <date-time> End date of the promo program |
| per_page | integer >= 1 Number of results per page |
| page | integer >= 1 Page number |
{- "ok": true,
- "data": [
- {
- "_id": "665e8f15ebf7d56c133612ab",
- "code": "PROMO52E",
- "merchant_id": "665e8f15ebf7d56c133612ab",
- "name": "Free 1 month",
- "description": "This program is for new user only",
- "promo_type": "Subscription",
- "discount_value": 100,
- "discount_type": "percent",
- "max_discount": 50,
- "max_discount_type": "fixed",
- "start_date": "2021-07-01",
- "end_date": "2021-07-31",
- "status": "active",
- "created_at": "2021-07-01T00:00:00.000Z",
- "updated_at": "2021-07-01T00:00:00.000Z",
- "number_of_codes": 10,
- "used_codes": 0
}
], - "total": 0,
- "page": 0,
- "per_page": 0
}| _id | string |
| code | string |
| merchant_id | string |
| name | string |
| description | string |
| promo_type | string Enum: "Subscription" "FeePayment" |
| discount_value | number |
| discount_type | string Enum: "percent" "fixed" |
| max_discount | number Maximum discount amount |
| max_discount_type | string Enum: "percent" "fixed" |
| start_date | string |
| end_date | string |
| status | string |
| created_at | string |
| updated_at | string |
| number_of_codes | integer |
| used_codes | integer |
{- "_id": "665e8f15ebf7d56c133612ab",
- "code": "PROMO52E",
- "merchant_id": "665e8f15ebf7d56c133612ab",
- "name": "Free 1 month",
- "description": "This program is for new user only",
- "promo_type": "Subscription",
- "discount_value": 100,
- "discount_type": "percent",
- "max_discount": 50,
- "max_discount_type": "fixed",
- "start_date": "2021-07-01",
- "end_date": "2021-07-31",
- "status": "active",
- "created_at": "2021-07-01T00:00:00.000Z",
- "updated_at": "2021-07-01T00:00:00.000Z",
- "number_of_codes": 10,
- "used_codes": 0
}{- "ok": true,
- "promoprograms": {
- "_id": "665e8f15ebf7d56c133612ab",
- "code": "PROMO52E",
- "merchant_id": "665e8f15ebf7d56c133612ab",
- "name": "Free 1 month",
- "description": "This program is for new user only",
- "promo_type": "Subscription",
- "discount_value": 100,
- "discount_type": "percent",
- "max_discount": 50,
- "max_discount_type": "fixed",
- "start_date": "2021-07-01",
- "end_date": "2021-07-31",
- "status": "active",
- "created_at": "2021-07-01T00:00:00.000Z",
- "updated_at": "2021-07-01T00:00:00.000Z",
- "number_of_codes": 10,
- "used_codes": 0
}
}| promo_program_id required | string The ID of the promo program to retrieve |
{- "ok": true,
- "msg": "string",
- "data": {
- "_id": "665e8f15ebf7d56c133612ab",
- "code": "PROMO52E",
- "merchant_id": "665e8f15ebf7d56c133612ab",
- "name": "Free 1 month",
- "description": "This program is for new user only",
- "promo_type": "Subscription",
- "discount_value": 100,
- "discount_type": "percent",
- "max_discount": 50,
- "max_discount_type": "fixed",
- "start_date": "2021-07-01",
- "end_date": "2021-07-31",
- "status": "active",
- "created_at": "2021-07-01T00:00:00.000Z",
- "updated_at": "2021-07-01T00:00:00.000Z",
- "number_of_codes": 10,
- "used_codes": 0
}
}| promo_program_id required | string The ID of the promo program to update |
| _id | string |
| code | string |
| merchant_id | string |
| name | string |
| description | string |
| promo_type | string Enum: "Subscription" "FeePayment" |
| discount_value | number |
| discount_type | string Enum: "percent" "fixed" |
| max_discount | number Maximum discount amount |
| max_discount_type | string Enum: "percent" "fixed" |
| start_date | string |
| end_date | string |
| status | string |
| created_at | string |
| updated_at | string |
| number_of_codes | integer |
| used_codes | integer |
{- "_id": "665e8f15ebf7d56c133612ab",
- "code": "PROMO52E",
- "merchant_id": "665e8f15ebf7d56c133612ab",
- "name": "Free 1 month",
- "description": "This program is for new user only",
- "promo_type": "Subscription",
- "discount_value": 100,
- "discount_type": "percent",
- "max_discount": 50,
- "max_discount_type": "fixed",
- "start_date": "2021-07-01",
- "end_date": "2021-07-31",
- "status": "active",
- "created_at": "2021-07-01T00:00:00.000Z",
- "updated_at": "2021-07-01T00:00:00.000Z",
- "number_of_codes": 10,
- "used_codes": 0
}{- "ok": true,
- "msg": "string"
}