@zenglobal/api-client 4.0.0 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2084,6 +2084,23 @@ export type LoyaltyGroup = {
2084
2084
  */
2085
2085
  sitelist: Array<string>;
2086
2086
  };
2087
+ /**
2088
+ * Loyalty group (v2 format) with clean field names.
2089
+ */
2090
+ export type LoyaltyGroupV2 = {
2091
+ /**
2092
+ * Unique group identifier (database primary key)
2093
+ */
2094
+ id: number;
2095
+ /**
2096
+ * Legacy group reference number (GROUPID) — consistent across chains for the same business concept
2097
+ */
2098
+ reference: string;
2099
+ /**
2100
+ * Group description
2101
+ */
2102
+ description: string;
2103
+ };
2087
2104
  /**
2088
2105
  * Simplified loyalty card information returned by search endpoints
2089
2106
  */
@@ -3626,6 +3643,90 @@ export type OfferDeleteResult = {
3626
3643
  result: number;
3627
3644
  errormessage: string;
3628
3645
  };
3646
+ export type OfferDetailAmount = {
3647
+ type: string;
3648
+ value: number;
3649
+ };
3650
+ export type OfferDetailBirthday = {
3651
+ enabled: boolean;
3652
+ delta_days?: number;
3653
+ direction?: string;
3654
+ };
3655
+ export type OfferDetailConditions = {
3656
+ active_on?: string;
3657
+ expires_on?: string;
3658
+ minimum_trigger_amount: number;
3659
+ maximum_trigger_amount: number;
3660
+ limits: OfferDetailLimits;
3661
+ time_of_day?: OfferDetailTimeOfDay;
3662
+ birthday: OfferDetailBirthday;
3663
+ new_member_window: OfferDetailNewMemberWindow;
3664
+ trigger_days_valid_after?: number;
3665
+ filters: OfferDetailFilters;
3666
+ };
3667
+ export type OfferDetailDiscountItem = {
3668
+ number?: string;
3669
+ type?: string;
3670
+ };
3671
+ export type OfferDetailEffect = {
3672
+ type: string;
3673
+ amount: OfferDetailAmount;
3674
+ apply_to: string;
3675
+ apply_upto_quantity: number;
3676
+ apply_to_items: Array<string>;
3677
+ per_item: boolean;
3678
+ points_multiplier: number;
3679
+ discount_item: OfferDetailDiscountItem;
3680
+ department: number;
3681
+ };
3682
+ export type OfferDetailFilters = {
3683
+ site?: OfferFilterValue;
3684
+ location?: OfferFilterValue;
3685
+ location_type?: OfferFilterValue;
3686
+ region?: OfferFilterValue;
3687
+ state?: OfferFilterValue;
3688
+ day_of_week?: OfferFilterValue;
3689
+ };
3690
+ export type OfferDetailLimits = {
3691
+ number_allowed_per_card?: number;
3692
+ number_allowed_per_site?: number;
3693
+ every?: string;
3694
+ };
3695
+ export type OfferDetailNewMemberWindow = {
3696
+ start?: string;
3697
+ end?: string;
3698
+ };
3699
+ /**
3700
+ * Full offer detail returned by GET /v1/offers/{id}
3701
+ */
3702
+ export type OfferDetailResponse = {
3703
+ id: number;
3704
+ description?: string;
3705
+ enabled: boolean;
3706
+ reference?: string;
3707
+ comment?: string;
3708
+ loyalty_only: boolean;
3709
+ auto_applied: boolean;
3710
+ image_url?: string;
3711
+ updated_at?: string;
3712
+ conditions: OfferDetailConditions;
3713
+ effect: OfferDetailEffect;
3714
+ targeting: OfferDetailTargeting;
3715
+ linked_to: boolean;
3716
+ card_active: boolean;
3717
+ card_complete: boolean;
3718
+ event_id?: number;
3719
+ };
3720
+ export type OfferDetailTargeting = {
3721
+ card_type_flag?: string;
3722
+ loyalty_card_types: Array<number | null>;
3723
+ group_flag?: string;
3724
+ groups: Array<number | null>;
3725
+ };
3726
+ export type OfferDetailTimeOfDay = {
3727
+ start_hour: string;
3728
+ end_hour: string;
3729
+ };
3629
3730
  export type OfferEffect = {
3630
3731
  /**
3631
3732
  * The type and amount of discount offered with the offer
@@ -3642,6 +3743,10 @@ export type OfferEffect = {
3642
3743
  */
3643
3744
  apply_to_items?: Array<string>;
3644
3745
  };
3746
+ export type OfferFilterValue = {
3747
+ operator: string;
3748
+ values: Array<number>;
3749
+ };
3645
3750
  /**
3646
3751
  * The limits imposed upon the offer
3647
3752
  */
@@ -3755,6 +3860,19 @@ export type OfferResult = {
3755
3860
  */
3756
3861
  id: string;
3757
3862
  };
3863
+ export type OfferSearchResponse = {
3864
+ total_records: number;
3865
+ limit: number;
3866
+ results: Array<OfferSearchResult>;
3867
+ };
3868
+ export type OfferSearchResult = {
3869
+ id: number;
3870
+ description?: string;
3871
+ reference?: string;
3872
+ enabled: boolean;
3873
+ active_on?: string;
3874
+ expires_on?: string;
3875
+ };
3758
3876
  /**
3759
3877
  * The type of offer discount
3760
3878
  * * `fixed_per_item` - Each item in the apply to list should be set to this dollar amount
@@ -8476,7 +8594,7 @@ export type LoyaltyGetGroupsResponses = {
8476
8594
  */
8477
8595
  200: {
8478
8596
  /**
8479
- * Non-purchase loyalty groups. Also contains version and loyaltyVersion as pseudo-elements.
8597
+ * Non-purchase loyalty groups. Response is a JSON object with numeric string keys (not an array). Also contains version and loyaltyVersion as pseudo-elements.
8480
8598
  */
8481
8599
  cardGroups: Array<LoyaltyGroup>;
8482
8600
  };
@@ -9515,6 +9633,72 @@ export type OfferUpdateResponses = {
9515
9633
  200: OfferResult;
9516
9634
  };
9517
9635
  export type OfferUpdateResponse = OfferUpdateResponses[keyof OfferUpdateResponses];
9636
+ export type OffersSearchData = {
9637
+ body?: never;
9638
+ path?: never;
9639
+ query: {
9640
+ /**
9641
+ * Search term to match against reference and/or description
9642
+ */
9643
+ q: string;
9644
+ /**
9645
+ * Constrain search to a specific field
9646
+ */
9647
+ field?: 'reference' | 'description';
9648
+ /**
9649
+ * Maximum number of results to return (default: 50)
9650
+ */
9651
+ limit?: number;
9652
+ };
9653
+ url: '/v1/offers/search';
9654
+ };
9655
+ export type OffersSearchErrors = {
9656
+ /**
9657
+ * The server could not understand the request due to invalid syntax.
9658
+ */
9659
+ 400: ValidationError;
9660
+ /**
9661
+ * Access is unauthorized.
9662
+ */
9663
+ 401: InvalidAccessKeyError;
9664
+ };
9665
+ export type OffersSearchError = OffersSearchErrors[keyof OffersSearchErrors];
9666
+ export type OffersSearchResponses = {
9667
+ /**
9668
+ * The request has succeeded.
9669
+ */
9670
+ 200: OfferSearchResponse;
9671
+ };
9672
+ export type OffersSearchResponse = OffersSearchResponses[keyof OffersSearchResponses];
9673
+ export type OffersGetByIdData = {
9674
+ body?: never;
9675
+ path: {
9676
+ /**
9677
+ * Unique identifier of the offer
9678
+ */
9679
+ id: number;
9680
+ };
9681
+ query?: never;
9682
+ url: '/v1/offers/{id}';
9683
+ };
9684
+ export type OffersGetByIdErrors = {
9685
+ /**
9686
+ * The server could not understand the request due to invalid syntax.
9687
+ */
9688
+ 400: ValidationError;
9689
+ /**
9690
+ * Access is unauthorized.
9691
+ */
9692
+ 401: InvalidAccessKeyError;
9693
+ };
9694
+ export type OffersGetByIdError = OffersGetByIdErrors[keyof OffersGetByIdErrors];
9695
+ export type OffersGetByIdResponses = {
9696
+ /**
9697
+ * The request has succeeded.
9698
+ */
9699
+ 200: OfferDetailResponse;
9700
+ };
9701
+ export type OffersGetByIdResponse = OffersGetByIdResponses[keyof OffersGetByIdResponses];
9518
9702
  export type OrderDeleteOrderData = {
9519
9703
  body: OrderDeleteRequest;
9520
9704
  path?: never;
@@ -10289,6 +10473,35 @@ export type CustomerDeleteResponses = {
10289
10473
  204: void;
10290
10474
  };
10291
10475
  export type CustomerDeleteResponse = CustomerDeleteResponses[keyof CustomerDeleteResponses];
10476
+ export type LoyaltyV2GetGroupsData = {
10477
+ body?: never;
10478
+ path?: never;
10479
+ query?: never;
10480
+ url: '/v2/loyalty/groups';
10481
+ };
10482
+ export type LoyaltyV2GetGroupsErrors = {
10483
+ /**
10484
+ * Access is unauthorized.
10485
+ */
10486
+ 401: InvalidAccessKeyError;
10487
+ /**
10488
+ * The server cannot find the requested resource.
10489
+ */
10490
+ 404: ZenNotFoundError;
10491
+ };
10492
+ export type LoyaltyV2GetGroupsError = LoyaltyV2GetGroupsErrors[keyof LoyaltyV2GetGroupsErrors];
10493
+ export type LoyaltyV2GetGroupsResponses = {
10494
+ /**
10495
+ * The request has succeeded.
10496
+ */
10497
+ 200: {
10498
+ /**
10499
+ * Non-purchase loyalty groups
10500
+ */
10501
+ card_groups: Array<LoyaltyGroupV2>;
10502
+ };
10503
+ };
10504
+ export type LoyaltyV2GetGroupsResponse = LoyaltyV2GetGroupsResponses[keyof LoyaltyV2GetGroupsResponses];
10292
10505
  export type PingV2ShowData = {
10293
10506
  body?: never;
10294
10507
  path?: never;