List Offers Groups
Pending
GET
https://api.mpc.dev.placewise.com/v3/{loyalty_club_slug}/offers/grouped
API Permit:Offers:Api:Offers:ListGroups
API Context:Loyalty Club
Authorizations:UserToken
Query Parameters
Parameter | Type | Default | Description |
---|---|---|---|
group_by | enum | null | (required) Specifies attribute by which the offers should be grouped. See: Grouping attributes |
scope | enum | standard | When present, only offers from given scope will be returned |
types | string[] | null | When present, only offers of given types will be returned |
per_page | integer | 100 | Number of results to be returned per request (100 is the maximum) |
page_no | integer | 1 | Number of results page |
sort_by | string | "name" | What attribute should results be sorted by? Supported attributes are: ["name", "usable_since", "usable_until", "visible_since", "visible_until", "created_at", "updated_at", "archived_at"] |
sort_direction | string | "asc" | Direction of sorting: "asc" or "desc" |
collection_ids | integer[] | null | When present, only offers belonging to at least one of given collections will be returned |
store_ids | integer[] | null | When present, only offers belonging to at at least one of given store_id will be returned |
status | enum | null | When present, only offers with this status will be returned. See: statuses |
campaign_id | integer | null | When present, only offers with this campaign_id will be returned |
audience_id | integer | null | When present, only offers with this audience_id will be returned |
search | string | null | When present, only offers that match the query string will be returned |
extras | object | null | When present, only offers that match given values will be returned. See: below |
ids | integer[] | null | When present, only offers having one of provided IDs will be returned |
without_collection | boolean | false | When present, only offers without collections will be returned |
without_audience_id | boolean | false | When present, only offers without audiences will be returned |
without_campaign_id | boolean | false | When present, only offers without campaigns will be returned |
without_store | boolean | false | When present, only offers without store will be returned |
with_archived | boolean | false | When present, also archived offers will be returned |
only_archived | boolean | false | When present, only archived offers will be returned |
visible_since_after | datetime | null | When present, only offers with greater visible_since will be returned |
visible_since_before | datetime | null | When present, only offers with lesser visible_since will be returned |
visible_until_after | datetime | null | When present, only offers with greater visible_until will be returned |
visible_until_before | datetime | null | When present, only offers with lesser visible_until will be returned |
usable_since_after | datetime | null | When present, only offers with greater usable_since will be returned |
usable_since_before | datetime | null | When present, only offers with lesser usable_since will be returned |
usable_until_before | datetime | null | When present, only offers with lesser usable_until will be returned |
Grouping attributes
Attribute | Description |
---|---|
collection | Groups by collection |
store_id | Groups by store |
audience_id | Groups by audience_id |
created_at | Groups by creation day |
usable_since | Groups by date when offer starts to be usable |
campaign_id | Groups by campaign_id |
Response Body
Key | Type | Description |
---|---|---|
groups | object | |
groups[].name | string | Name of group |
groups[].offers_count | integer | Number of offers within group |
groups[].collection_id | integer | ID of collection (present only for 'collection' as grouping attribute) |
Example
{
"groups": [
{
"name": "Birthday",
"offers_count": 2,
"collection_id": 1000396
},
{
"name": "Great deals",
"offers_count": 1,
"collection_id": 1000664
}
]
}
Request
Path Params
loyalty_club_slug
stringÂ
required
Example:
infinity-mall
Header Params
X-Loyalty-Club-Slug
stringÂ
required
Default:
{{LOYALTY_CLUB_SLUG}}
X-Client-Authorization
stringÂ
optional
Default:
{{API_TOKEN}}
Request samples
Responses
Modified at 2024-05-07 15:48:35