2222 description : Promotion Progress Controller
2323 - name : Transactions
2424 description : Transactions Controller
25+ - name : Audiences
26+ description : Provides clients with the ability to get the promotion details of a specific cardholder or enroll to a specific promotions for a specific time periods.
2527paths :
2628 /accounts/searches :
2729 post :
@@ -157,6 +159,69 @@ paths:
157159 $ref : ' #/components/responses/ResponseForbidden'
158160 ' 404 ' :
159161 $ref : ' #/components/responses/ResponseNotFound'
162+ /audiences :
163+ post :
164+ tags :
165+ - Audiences
166+ description : Add an eligibility period (begin and end datetime) for the cardholder either account or household.
167+ operationId : createAudience
168+ summary : This API endpoint is used to create an audience entity
169+ requestBody :
170+ $ref : ' #/components/requestBodies/Audience'
171+ responses :
172+ ' 201 ' :
173+ $ref : ' #/components/responses/ResponseAudienceCreated'
174+ ' 400 ' :
175+ $ref : ' #/components/responses/ResponseBadRequest'
176+ ' 401 ' :
177+ $ref : ' #/components/responses/ResponseUnauthorizedError'
178+ ' 404 ' :
179+ $ref : ' #/components/responses/ResponseNotFound'
180+ get :
181+ tags :
182+ - Audiences
183+ description : Retrieve audiences by passing the entityType (A or H) and entityId (account id or household id) to get the history of eligibility periods for all the audiences (represented by the code). Only audiences that the entityId has been added to will be returned.
184+ operationId : getAudiences
185+ summary : This API endpoint is used to fetch the audiences
186+ parameters :
187+ - $ref : ' #/components/parameters/entity_id'
188+ - $ref : ' #/components/parameters/entity_type'
189+ - $ref : ' #/components/parameters/code'
190+ - $ref : ' #/components/parameters/from_date_time'
191+ - $ref : ' #/components/parameters/to_date_time'
192+ - $ref : ' #/components/parameters/Offset'
193+ - $ref : ' #/components/parameters/Limit'
194+ responses :
195+ ' 200 ' :
196+ $ref : ' #/components/responses/ResponsePagedResponseAudience'
197+ ' 401 ' :
198+ $ref : ' #/components/responses/ResponseUnauthorizedError'
199+ ' 403 ' :
200+ $ref : ' #/components/responses/ResponseForbiddenError'
201+ ' 404 ' :
202+ $ref : ' #/components/responses/ResponseNotFound'
203+ /audiences/{id} :
204+ put :
205+ tags :
206+ - Audiences
207+ description : End the eligibility period for a given id.
208+ operationId : updateAudience
209+ summary : This API endpoint is used to update the audience entity
210+ parameters :
211+ - $ref : ' #/components/parameters/ref_id'
212+ requestBody :
213+ $ref : ' #/components/requestBodies/AudienceUpdate'
214+ responses :
215+ ' 200 ' :
216+ $ref : ' #/components/responses/ResponseAudience'
217+ ' 400 ' :
218+ $ref : ' #/components/responses/ResponseBadRequest'
219+ ' 401 ' :
220+ $ref : ' #/components/responses/ResponseUnauthorizedError'
221+ ' 403 ' :
222+ $ref : ' #/components/responses/ResponseForbiddenError'
223+ ' 404 ' :
224+ $ref : ' #/components/responses/ResponseNotFound'
160225
161226components :
162227 requestBodies :
@@ -174,6 +239,19 @@ components:
174239 type : array
175240 items :
176241 $ref : " #/components/schemas/OptIn"
242+ Audience :
243+ required : true
244+ content :
245+ application/json :
246+ schema :
247+ $ref : ' #/components/schemas/Audience'
248+
249+ AudienceUpdate :
250+ required : true
251+ content :
252+ application/json :
253+ schema :
254+ $ref : ' #/components/schemas/AudienceUpdate'
177255 parameters :
178256 FromDateParam :
179257 name : from_date
@@ -302,6 +380,60 @@ components:
302380 type : integer
303381 format : int32
304382 default : 25
383+ ref_id :
384+ description : Unique identifier for an audience
385+ example : 1127d5a6-ed44-4148-aa08-da168016cd56
386+ in : path
387+ name : id
388+ required : true
389+ schema :
390+ type : string
391+ style : simple
392+ entity_id :
393+ description : Entity ID is the reference id for account and household
394+ example : 12f5930a-ab8b-4a25-9774-6ba49a9bfd8c
395+ in : query
396+ name : entity_id
397+ required : true
398+ schema :
399+ type : string
400+ style : form
401+ entity_type :
402+ description : Entity Type is the type either Account or Household
403+ example : A
404+ in : query
405+ name : entity_type
406+ required : true
407+ schema :
408+ type : string
409+ style : form
410+ code :
411+ description : It is the audience code
412+ example : CODE_NY
413+ in : query
414+ name : code
415+ required : false
416+ schema :
417+ type : string
418+ style : form
419+ from_date_time :
420+ description : Begin date time of audience records
421+ example : 2025-01-11T02:00:00Z
422+ in : query
423+ name : from_date_time
424+ required : false
425+ schema :
426+ type : string
427+ style : form
428+ to_date_time :
429+ description : End date time of audience records
430+ example : 2025-01-18T02:00:00Z
431+ in : query
432+ name : to_date_time
433+ required : false
434+ schema :
435+ type : string
436+ style : form
305437 responses :
306438 ResponseOkSearchAccount :
307439 description : Successfully Retrieved Account(s)
@@ -380,6 +512,30 @@ components:
380512 $ref : " #/components/schemas/PromotionDetail"
381513 ResponseActivated :
382514 description : Successfully updated Opt-In choice
515+ ResponseForbiddenError :
516+ description : Forbidden
517+ content :
518+ application/json :
519+ schema :
520+ $ref : ' #/components/schemas/ErrorsList'
521+ ResponsePagedResponseAudience :
522+ description : OK
523+ content :
524+ application/json :
525+ schema :
526+ $ref : ' #/components/schemas/PagedResponseAudience'
527+ ResponseAudience :
528+ description : OK
529+ content :
530+ application/json :
531+ schema :
532+ $ref : ' #/components/schemas/Audience'
533+ ResponseAudienceCreated :
534+ description : Created
535+ content :
536+ application/json :
537+ schema :
538+ $ref : ' #/components/schemas/Audience'
383539 schemas :
384540 AccountSearch :
385541 type : object
@@ -1337,6 +1493,73 @@ components:
13371493 description : The list of Accounts that are in the entire collection
13381494 items :
13391495 $ref : ' #/components/schemas/AccountSearchItem'
1496+ AudienceUpdate :
1497+ type : object
1498+ properties :
1499+ beginDateTime :
1500+ description : Begin Date Time
1501+ example : 2025-01-11T02:00:00Z
1502+ type : string
1503+ endDateTime :
1504+ description : End Date Time
1505+ example : 2025-01-18T02:00:00Z
1506+ type : string
1507+ Audience :
1508+ type : object
1509+ properties :
1510+ id :
1511+ type : string
1512+ example : 1127d5a6-ed44-4148-aa08-da168016cd56
1513+ description : It is the unique reference id for audience records
1514+ code :
1515+ type : string
1516+ example : CODE_NY
1517+ description : It is the audience code
1518+ beginDateTime :
1519+ type : string
1520+ example : 2025-01-11T02:00:00Z
1521+ description : Begin date time of audience records
1522+ endDateTime :
1523+ type : string
1524+ example : 2025-01-18T02:00:00Z
1525+ description : End date time of audience records
1526+ entityType :
1527+ type : string
1528+ example : A
1529+ description : Indicates at which level the audience record is associated - either 'A' for Account or 'H' for Household
1530+ entityId :
1531+ type : string
1532+ example : 12f5930a-ab8b-4a25-9774-6ba49a9bfd8c
1533+ description : Code for the associated audience record
1534+ PagedResponseAudience :
1535+ type : object
1536+ properties :
1537+ count :
1538+ description : The number of items that are in this offset batch
1539+ example : 1
1540+ format : int32
1541+ type : integer
1542+ offset :
1543+ description : The number of items to offset the start of the list from
1544+ example : 0
1545+ format : int32
1546+ type : integer
1547+ limit :
1548+ description : The number of items in the list to be limited to
1549+ example : 25
1550+ format : int32
1551+ type : integer
1552+ total :
1553+ description : The total number of items that are in the entire collection
1554+ example : 1
1555+ format : int64
1556+ type : integer
1557+ items :
1558+ type : array
1559+ description : List of Audience Data
1560+ items :
1561+ $ref : ' #/components/schemas/Audience'
1562+
13401563 examples :
13411564 SearchAccountBadRequest :
13421565 value :
@@ -1355,4 +1578,13 @@ components:
13551578 ReasonCode : AUTHORIZATION_ERROR
13561579 Description : Client could not be authorized.
13571580 Recoverable : true
1581+ Details : null
1582+ Forbidden :
1583+ value :
1584+ Errors :
1585+ Error :
1586+ - Source : Loyalty-Enrollment
1587+ ReasonCode : FORBIDDEN
1588+ Description : Client does not have permission.
1589+ Recoverable : true
13581590 Details : null
0 commit comments