Flavours API Documentation
  1. Discounts
Flavours API Documentation
  • Readme
  • Developer Guide
  • Authorization
  • Includables
  • Pagination
  • Sorting
  • Retrieve Market Information
  • Retrieve Branch Information
  • Me
    • Overview
    • Detail
      GET
  • Branches
    • Overview
    • List
      GET
    • Detail
      GET
    • Create
      POST
    • Update
      POST
    • Delete
      DELETE
  • Orders
    • Overview
    • List
      GET
    • Detail
      GET
    • Create
      POST
    • Calculate
      POST
    • Checkout
      POST
    • Update
      POST
    • Sync
      POST
  • Customers
    • Overview
    • List
    • Detail
    • Create
    • Update
  • Products
    • Overview
    • List
    • Detail
    • Create
    • Update
    • Delete
  • Product Categories
    • Overview
    • List
    • Detail
  • Discounts
    • Overview
    • List
      GET
    • Detail
      GET
    • Verify
      POST
  • Payment Methods
    • Overview
    • List
    • Detail
  • Table
    • Overview
    • List
    • Detail
    • Create
    • Update
    • Delete
  • Printer
  • Webhook
    • Orders Webhooks
      • Webhook Events
      • Payload
    • Product Webhooks
      • Webhook Events
      • Payload
    • Loyalty Webhooks
      • Promotional Coupon
    • Customers Webhooks
      • Webhook Events
      • Payload
    • Error Webhook
      • Stay Alert to Connectivity Issues
    • Third-Party
      • Ballurh
        • Install Ballurh
      • Loyapro
        • Loyalty
          • Check Reward
          • Redeem Reward
      • Bonat
        • Check Reward
        • Redeem Reward
      • Fai
        • Register Entity
  1. Discounts

List

Developing
DEVELOPMENT
https://api.flavours.sa/dev/api/v2
DEVELOPMENT
https://api.flavours.sa/dev/api/v2
GET
https://api.flavours.sa/dev/api/v2
/discounts

Request Body#

Constant#

Use the constants below according to the field names and rules for each request
ConstantValue
typeCOUPON OFFER PROMOTION FAST_OFFER
Info
PROMOTION and FAST_OFFER are under development

Coupon Flow#

image
Sample Case :
Restaurant create a coupon for product A (10% off)
Customers get a coupon code provided by the restaurant
Customers buys product A according to the coupon
Customers get discount

Offers Flow#

image
Sample Case :
Restaurant create an offer for product A for a week (10% off)
Customers buys product A according to the offer
CUstomers get discount

Validation#

FieldTypeRuleDescription
pageintegernullable min:1Read more on the Pagination page
per_pageintegernullable min:1Read more on the Pagination page
searchstringnullable
sortstringnullableRead more on the Sorting page
includesarraynullableRead more on the Includables page
filter.market_idstringnullableId from Market model
filter.branch_idstringnullableId from Branch model
filter.typesarraynullableArray of type
filter.expired_atintegernullableMilliseconds time
The rules on the fields will change depending on conditions, including the following
FieldRuleCondition
filter.market_idrequiredUser authentication role SUBSCRIBER
filter.branch_idrequiredUser authentication role SUBSCRIBER & has branch_id

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Query Params
page
integer 
optional
Example:
1
per_page
integer 
optional
Example:
20
search
string 
optional
sort
string 
optional
includes
array[string]
optional
Example:
[""]
filter[market_id]
string 
optional
Example:
b5d70a92-5d2e-4f89-8e52-1827cfbd01f4
filter[branch_id]
string 
optional
filter[types]
array[string]
optional
filter[expired_at]
integer 
optional

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request GET 'https://api.flavours.sa/dev/api/v2/discounts?page=1&per_page=20&search=&sort=&includes=&filter[market_id]=b5d70a92-5d2e-4f89-8e52-1827cfbd01f4&filter[branch_id]=&filter[types]=&filter[expired_at]='

Responses

🟢200OK
application/json
Body
meta
object 
required
code
integer 
required
status
string 
required
message
string 
required
data
object 
required
current_page
integer 
required
data
array [object {15}] 
required
first_page_url
string 
required
from
integer 
required
last_page
integer 
required
last_page_url
string 
required
links
array [object {3}] 
required
next_page_url
string  | null 
optional
path
string 
required
per_page
integer 
required
prev_page_url
string  | null 
optional
to
integer 
required
total
integer 
required
Example
{
  "meta": {
    "code": 200,
    "status": "success",
    "message": "Data Loaded Successfully"
  },
  "data": {
    "current_page": 1,
    "data": [
      {
        "id": "3e50cfeb-3c45-484a-8174-dcb010f092e1",
        "market_id": "b5d70a92-5d2e-4f89-8e52-1827cfbd01f4",
        "branch_id": null,
        "type": "OFFER",
        "max": null,
        "code": null,
        "value": 20,
        "value_type": "PERCENT",
        "expired_at": 1720713600000,
        "created_at": 1720692585796,
        "updated_at": 1720692585796,
        "deleted_at": null,
        "target": "ORDER",
        "max_amount": null,
        "is_fast_offer": false
      },
      {
        "id": "df750d37-9925-4e00-9934-a7ca5fcb76a3",
        "market_id": "b5d70a92-5d2e-4f89-8e52-1827cfbd01f4",
        "branch_id": null,
        "type": "COUPON",
        "max": null,
        "code": "m8",
        "value": 15,
        "value_type": "PERCENT",
        "expired_at": null,
        "created_at": 1713400666562,
        "updated_at": 1713400666562,
        "deleted_at": null,
        "target": "ORDER",
        "max_amount": null,
        "is_fast_offer": false
      },
      {
        "id": "42d1fe04-2e45-42f5-83d2-acb7087be9dd",
        "market_id": "b5d70a92-5d2e-4f89-8e52-1827cfbd01f4",
        "branch_id": null,
        "type": "COUPON",
        "max": null,
        "code": "S24",
        "value": 10,
        "value_type": "PERCENT",
        "expired_at": 1713560400000,
        "created_at": 1713384568645,
        "updated_at": 1713384568645,
        "deleted_at": null,
        "target": "ORDER",
        "max_amount": null,
        "is_fast_offer": false
      }
    ],
    "first_page_url": "https://app.flavours.sa/api/v2/discounts?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://app.flavours.sa/api/v2/discounts?page=1",
    "links": [
      {
        "url": null,
        "label": "« Previous",
        "active": false
      },
      {
        "url": "https://app.flavours.sa/api/v2/discounts?page=1",
        "label": "1",
        "active": true
      },
      {
        "url": null,
        "label": "Next »",
        "active": false
      }
    ],
    "next_page_url": null,
    "path": "https://app.flavours.sa/api/v2/discounts",
    "per_page": 20,
    "prev_page_url": null,
    "to": 3,
    "total": 3
  }
}
Modified at 2025-03-28 03:52:47
Previous
Overview
Next
Detail
Built with