@zenglobal/api-client 5.1.13 → 5.1.15

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.
@@ -1,7 +1,7 @@
1
1
  export type ClientOptions = {
2
2
  baseUrl: 'https://api-dev.zenglobal.au' | 'https://api.zenglobal.au' | (string & {});
3
3
  };
4
- export type Webhooks = WebhookLoyaltyWebhookRequest | WebhookCustomerWebhookRequest | WebhookOfferWebhookRequest | WebhookRedeemWebhookRequest | WebhookDeleteWebhookRequest | WebhookItemWebhookRequest | WebhookPriceWebhookRequest | WebhookTransactionWebhookRequest;
4
+ export type Webhooks = WebhookLoyaltyCardWebhookRequest | WebhookLoyaltyPointsWebhookRequest | WebhookCustomerUpsertWebhookRequest | WebhookOfferCreateWebhookRequest | WebhookOfferUpdateWebhookRequest | WebhookOfferRedeemWebhookRequest | WebhookOfferDeleteWebhookRequest | WebhookItemSohWebhookRequest | WebhookItemPriceWebhookRequest | WebhookTransactionCompleteWebhookRequest | WebhookPingWebhookRequest;
5
5
  /**
6
6
  * Address structure used for billing and shipping addresses
7
7
  */
@@ -38,27 +38,27 @@ export type AddressData = {
38
38
  /**
39
39
  * Address line 1
40
40
  */
41
- address1?: string;
41
+ address1: string;
42
42
  /**
43
43
  * Address line 2
44
44
  */
45
- address2?: string;
45
+ address2: string;
46
46
  /**
47
47
  * Suburb
48
48
  */
49
- suburb?: string;
49
+ suburb: string;
50
50
  /**
51
51
  * State
52
52
  */
53
- state?: string;
53
+ state: string;
54
54
  /**
55
55
  * Postcode
56
56
  */
57
- postcode?: string;
57
+ postcode: string;
58
58
  /**
59
59
  * Country
60
60
  */
61
- country?: string;
61
+ country: string;
62
62
  };
63
63
  /**
64
64
  * Response for GET /lists.
@@ -808,7 +808,7 @@ export type CustomerData = {
808
808
  /**
809
809
  * Company/chain code
810
810
  */
811
- Company: string;
811
+ Company: number;
812
812
  /**
813
813
  * Customer number
814
814
  */
@@ -820,35 +820,36 @@ export type CustomerData = {
820
820
  /**
821
821
  * Email address
822
822
  */
823
- email?: string;
823
+ email: string;
824
824
  /**
825
825
  * Mobile number
826
826
  */
827
- mobile?: string;
827
+ mobile: string;
828
828
  /**
829
829
  * Phone number
830
830
  */
831
- phone?: string;
831
+ phone: string;
832
832
  /**
833
833
  * Secondary phone number
834
834
  */
835
- phone1?: string;
835
+ phone1: string;
836
836
  /**
837
837
  * Gender
838
838
  */
839
- gender?: string;
839
+ gender: string;
840
840
  /**
841
- * Date of birth
841
+ * Date of birth (YYYY-MM-DD)
842
842
  */
843
- dateofbirth?: string;
843
+ dateofbirth: string;
844
844
  /**
845
845
  * WooCommerce customer ID
846
846
  */
847
- woocommerce?: string;
847
+ woocommerce: string;
848
848
  /**
849
- * Shopify customer ID
849
+ * Shopify customer ID. The key really is spelled `shopfiy`; it has always
850
+ * been sent that way and is kept for compatibility.
850
851
  */
851
- shopify?: string;
852
+ shopfiy: string;
852
853
  /**
853
854
  * Billing address
854
855
  */
@@ -858,9 +859,9 @@ export type CustomerData = {
858
859
  */
859
860
  shipping: AddressData;
860
861
  /**
861
- * Associated loyalty cards
862
+ * Loyalty cards linked to the customer. An empty array when there are none.
862
863
  */
863
- cards?: Array<LoyaltyCardSummary>;
864
+ cards: Array<LoyaltyCardSummary>;
864
865
  };
865
866
  /**
866
867
  * The error body these operations return.
@@ -1362,53 +1363,108 @@ export type InventoryLoyaltyGroup = {
1362
1363
  description: string;
1363
1364
  };
1364
1365
  /**
1365
- * Inventory webhook data payload
1366
+ * Price change, sent on `item.price`. The fields are at the top level of
1367
+ * `data`, not in a wrapper object.
1366
1368
  */
1367
- export type InventoryWebhookData = {
1369
+ export type InventoryPriceWebhookData = {
1370
+ /**
1371
+ * Company/chain code
1372
+ */
1373
+ chain: number;
1374
+ /**
1375
+ * Company/chain code (same value as `chain`)
1376
+ */
1377
+ Company: number;
1378
+ /**
1379
+ * Site ID
1380
+ */
1381
+ Site: number;
1382
+ /**
1383
+ * Location ID
1384
+ */
1385
+ Location: number;
1368
1386
  /**
1369
1387
  * Item code
1370
1388
  */
1371
1389
  Item: string;
1390
+ /**
1391
+ * New price
1392
+ */
1393
+ Price: number;
1394
+ /**
1395
+ * Always `false`
1396
+ */
1397
+ sohFlag: false;
1398
+ /**
1399
+ * Always `true`
1400
+ */
1401
+ priceFlag: true;
1402
+ };
1403
+ /**
1404
+ * Stock-on-hand change, sent on `item.soh`. The fields are at the top level
1405
+ * of `data`, not in a wrapper object.
1406
+ *
1407
+ * Exactly one of `StockOnHand` and `DeltaQuantity` is present, chosen by
1408
+ * `delta`. `PreviousSOH`, `CurrentSOH`, `ReferralItem` and `ReferralRatio`
1409
+ * are each left out when they have no value.
1410
+ */
1411
+ export type InventorySohWebhookData = {
1372
1412
  /**
1373
1413
  * Company/chain code
1374
1414
  */
1375
- chain: string;
1415
+ chain: number;
1376
1416
  /**
1377
- * Company/chain code (duplicate)
1417
+ * Company/chain code (same value as `chain`)
1378
1418
  */
1379
- Company: string;
1419
+ Company: number;
1380
1420
  /**
1381
- * Whether stock on hand has changed
1421
+ * Site ID
1382
1422
  */
1383
- sohFlag: boolean;
1423
+ Site: number;
1384
1424
  /**
1385
- * Whether price has changed
1425
+ * Location ID
1386
1426
  */
1387
- priceFlag: boolean;
1427
+ Location: number;
1388
1428
  /**
1389
- * Current stock on hand
1429
+ * Item code
1390
1430
  */
1391
- stockOnHand?: number;
1431
+ Item: string;
1392
1432
  /**
1393
- * Item price
1433
+ * Always `true`
1394
1434
  */
1395
- price?: number;
1435
+ sohFlag: true;
1396
1436
  /**
1397
- * Item cost
1437
+ * Always `false`
1398
1438
  */
1399
- cost?: number;
1439
+ priceFlag: false;
1400
1440
  /**
1401
- * Item description
1441
+ * `true` when the change is sent as a quantity change (`DeltaQuantity`), `false` when it is the new level (`StockOnHand`)
1402
1442
  */
1403
- description?: string;
1443
+ delta: boolean;
1404
1444
  /**
1405
- * Department code
1445
+ * Stock on hand. Present when `delta` is `false`.
1406
1446
  */
1407
- department?: number;
1447
+ StockOnHand?: number;
1408
1448
  /**
1409
- * Site code
1449
+ * Change in stock on hand. Present when `delta` is `true`.
1450
+ */
1451
+ DeltaQuantity?: number;
1452
+ /**
1453
+ * Stock on hand before the change
1454
+ */
1455
+ PreviousSOH?: number;
1456
+ /**
1457
+ * Stock on hand after the change
1458
+ */
1459
+ CurrentSOH?: number;
1460
+ /**
1461
+ * Referral item code
1410
1462
  */
1411
- sitecode?: string;
1463
+ ReferralItem?: string;
1464
+ /**
1465
+ * Ratio between this item and `ReferralItem`
1466
+ */
1467
+ ReferralRatio?: number;
1412
1468
  };
1413
1469
  /**
1414
1470
  * Active jackpot information
@@ -2399,7 +2455,7 @@ export type LoyaltyCardData = {
2399
2455
  /**
2400
2456
  * Company/chain code
2401
2457
  */
2402
- Company: string;
2458
+ Company: number;
2403
2459
  /**
2404
2460
  * Loyalty card number
2405
2461
  */
@@ -2409,21 +2465,21 @@ export type LoyaltyCardData = {
2409
2465
  */
2410
2466
  Customer: string;
2411
2467
  /**
2412
- * Family card number (if linked)
2468
+ * Family card number, or an empty string if the card is not linked
2413
2469
  */
2414
2470
  FamilyCard: string;
2415
2471
  /**
2416
- * Original card number before conversion
2472
+ * Same value as `Card`
2417
2473
  */
2418
2474
  OriginalCard: string;
2419
2475
  /**
2420
- * Card status
2476
+ * Always `Present`
2421
2477
  */
2422
- Status: string;
2478
+ Status: 'Present';
2423
2479
  /**
2424
2480
  * Customer salutation
2425
2481
  */
2426
- Salutation?: string;
2482
+ Salutation: string;
2427
2483
  /**
2428
2484
  * First name
2429
2485
  */
@@ -2435,77 +2491,77 @@ export type LoyaltyCardData = {
2435
2491
  /**
2436
2492
  * Card PIN
2437
2493
  */
2438
- pin?: string;
2494
+ pin: string;
2439
2495
  /**
2440
2496
  * Gender
2441
2497
  */
2442
- Gender?: string;
2498
+ Gender: string;
2443
2499
  /**
2444
2500
  * Address line 1
2445
2501
  */
2446
- Address1?: string;
2502
+ Address1: string;
2447
2503
  /**
2448
2504
  * Address line 2
2449
2505
  */
2450
- Address2?: string;
2506
+ Address2: string;
2451
2507
  /**
2452
2508
  * Suburb
2453
2509
  */
2454
- Suburb?: string;
2510
+ Suburb: string;
2455
2511
  /**
2456
2512
  * State
2457
2513
  */
2458
- State?: string;
2514
+ State: string;
2459
2515
  /**
2460
2516
  * Postcode
2461
2517
  */
2462
- Postcode?: string;
2518
+ Postcode: string;
2463
2519
  /**
2464
2520
  * Security token
2465
2521
  */
2466
- Token?: string;
2522
+ Token: string;
2467
2523
  /**
2468
- * App token
2524
+ * Always an empty string
2469
2525
  */
2470
- AppToken?: string;
2526
+ AppToken: '';
2471
2527
  /**
2472
- * App operating system
2528
+ * Always an empty string
2473
2529
  */
2474
- AppSystem?: string;
2530
+ AppSystem: '';
2475
2531
  /**
2476
2532
  * Email address
2477
2533
  */
2478
- Email?: string;
2534
+ Email: string;
2479
2535
  /**
2480
2536
  * Phone number
2481
2537
  */
2482
- Phone?: string;
2538
+ Phone: string;
2483
2539
  /**
2484
2540
  * Secondary phone number
2485
2541
  */
2486
- Phone2?: string;
2542
+ Phone2: string;
2487
2543
  /**
2488
2544
  * Mobile number
2489
2545
  */
2490
- Mobile?: string;
2546
+ Mobile: string;
2491
2547
  /**
2492
2548
  * Fax number
2493
2549
  */
2494
- Fax?: string;
2550
+ Fax: string;
2495
2551
  /**
2496
2552
  * Occupation
2497
2553
  */
2498
- Occupation?: string;
2554
+ Occupation: string;
2499
2555
  /**
2500
- * Date of birth
2556
+ * Date of birth (YYYY-MM-DD)
2501
2557
  */
2502
- dateOfBirth?: string;
2558
+ dateOfBirth: string;
2503
2559
  /**
2504
2560
  * Card type ID
2505
2561
  */
2506
- CARDTYPE: string;
2562
+ CARDTYPE: number;
2507
2563
  /**
2508
- * Whether card follows default settings
2564
+ * Whether the card follows its card type's default settings
2509
2565
  */
2510
2566
  FOLLOWCARD: 'T' | 'F';
2511
2567
  /**
@@ -2521,29 +2577,29 @@ export type LoyaltyCardData = {
2521
2577
  */
2522
2578
  Discount: string;
2523
2579
  /**
2524
- * Mail opt-in preference
2580
+ * Mail opt-in
2525
2581
  */
2526
- mailOpt?: string;
2582
+ mailOpt: 'T' | 'F';
2527
2583
  /**
2528
- * Email opt-in preference
2584
+ * Email opt-in
2529
2585
  */
2530
- emailOpt?: string;
2586
+ emailOpt: 'T' | 'F';
2531
2587
  /**
2532
- * SMS opt-in preference
2588
+ * SMS opt-in
2533
2589
  */
2534
- smsOpt?: string;
2590
+ smsOpt: 'T' | 'F';
2535
2591
  /**
2536
2592
  * Whether card details are complete
2537
2593
  */
2538
- CardComplete: string;
2594
+ CardComplete: 'T' | 'F';
2539
2595
  /**
2540
2596
  * Whether card is active
2541
2597
  */
2542
- CardActive: string;
2598
+ CardActive: 'T' | 'F';
2543
2599
  /**
2544
2600
  * Whether card is purged
2545
2601
  */
2546
- Purged: string;
2602
+ Purged: 'T' | 'F';
2547
2603
  /**
2548
2604
  * Current points balance
2549
2605
  */
@@ -2551,7 +2607,7 @@ export type LoyaltyCardData = {
2551
2607
  /**
2552
2608
  * Home site ID
2553
2609
  */
2554
- HomeSite: string;
2610
+ HomeSite: number;
2555
2611
  /**
2556
2612
  * Home site name
2557
2613
  */
@@ -2559,7 +2615,7 @@ export type LoyaltyCardData = {
2559
2615
  /**
2560
2616
  * Profile picture URL
2561
2617
  */
2562
- Picture?: string;
2618
+ Picture: string;
2563
2619
  };
2564
2620
  /**
2565
2621
  * Card movement/tier progression information
@@ -2617,33 +2673,29 @@ export type LoyaltyCardSummary = {
2617
2673
  */
2618
2674
  name: string;
2619
2675
  /**
2620
- * Join date
2676
+ * Join date (YYYY-MM-DD)
2621
2677
  */
2622
2678
  joindate: string;
2623
2679
  /**
2624
2680
  * Points earned to date
2625
2681
  */
2626
- pointsearned: string;
2682
+ pointsearned: number;
2627
2683
  /**
2628
2684
  * Points redeemed to date
2629
2685
  */
2630
- pointsredeemed: string;
2686
+ pointsredeemed: number;
2631
2687
  /**
2632
2688
  * Points expired to date
2633
2689
  */
2634
- pointsexpired: string;
2690
+ pointsexpired: number;
2635
2691
  /**
2636
- * Current points balance
2692
+ * Current points balance. Sent as a string, unlike the other points fields.
2637
2693
  */
2638
2694
  pointsbalance: string;
2639
2695
  /**
2640
- * Total sales to date
2641
- */
2642
- salestodate: string;
2643
- /**
2644
- * Card type
2696
+ * Card type ID
2645
2697
  */
2646
- cardtype: string;
2698
+ cardtype: number;
2647
2699
  };
2648
2700
  /**
2649
2701
  * Loyalty card type information
@@ -4474,57 +4526,306 @@ export type OfferCreateRequest = {
4474
4526
  effect?: OfferEffect;
4475
4527
  };
4476
4528
  /**
4477
- * Offer data structure
4529
+ * The offer record, sent on `offer.create` and `offer.update`.
4530
+ *
4531
+ * Most fields can be `null` when the offer does not set them. Decimal
4532
+ * columns are sent as strings (`"19.990"`). Flag columns are sent as `"T"`
4533
+ * or `"F"`, except the six listed as booleans.
4534
+ *
4535
+ * The boolean flags `linkedto`, `peritem`, `birthdayoffer`, `linkscheduler`,
4536
+ * `cardactive` and `cardcomplete` are always `false`, and `loyaltyonly` is
4537
+ * always `true`, whatever the offer is set to. This is a long-standing bug
4538
+ * in how these flags are converted; it is kept so existing consumers do not
4539
+ * break. Do not rely on these seven fields.
4478
4540
  */
4479
4541
  export type OfferData = {
4480
4542
  /**
4481
4543
  * Offer ID
4482
4544
  */
4483
- offerid: string;
4545
+ offerid: number;
4484
4546
  /**
4485
- * Company/chain code
4547
+ * Company/chain code that owns the offer
4486
4548
  */
4487
- chaincode: string;
4549
+ chaincode: number | null;
4488
4550
  /**
4489
- * Offer title
4551
+ * Offer description
4490
4552
  */
4491
- title?: string;
4553
+ description: string | null;
4492
4554
  /**
4493
- * Offer description
4555
+ * Date the offer becomes active (YYYY-MM-DD)
4494
4556
  */
4495
- description?: string;
4557
+ dateactive: string | null;
4558
+ /**
4559
+ * Date the offer expires (YYYY-MM-DD)
4560
+ */
4561
+ dateexpire: string | null;
4496
4562
  /**
4497
- * Whether offer is loyalty-only
4563
+ * Number of times a customer may use the offer
4564
+ */
4565
+ numberallowed: number | null;
4566
+ /**
4567
+ * Number of times the offer may be used per site
4568
+ */
4569
+ numberallowedsite: number | null;
4570
+ /**
4571
+ * Start hour of day, as a decimal string
4572
+ */
4573
+ starthour: string | null;
4574
+ /**
4575
+ * End hour of day, as a decimal string
4576
+ */
4577
+ endhour: string | null;
4578
+ /**
4579
+ * Largest basket total the offer triggers on
4580
+ */
4581
+ maxamount: string | null;
4582
+ /**
4583
+ * Smallest basket total the offer triggers on
4584
+ */
4585
+ minamount: string | null;
4586
+ /**
4587
+ * Offer amount
4588
+ */
4589
+ amount: string | null;
4590
+ /**
4591
+ * Points value configured on the offer
4592
+ */
4593
+ points: string | null;
4594
+ /**
4595
+ * Discount
4596
+ */
4597
+ discount: string | null;
4598
+ /**
4599
+ * Department code
4600
+ */
4601
+ department: number | null;
4602
+ /**
4603
+ * Points multiplier
4604
+ */
4605
+ multpoints: string | null;
4606
+ /**
4607
+ * Whether the offer is enabled
4608
+ */
4609
+ enabled: 'T' | 'F' | null;
4610
+ /**
4611
+ * Always `true`. See the model description.
4498
4612
  */
4499
4613
  loyaltyonly: boolean;
4500
4614
  /**
4501
- * Whether offer is linked to another offer
4615
+ * Whether the offer is limited to the card types below
4616
+ */
4617
+ cardtypeflag: 'T' | 'F' | null;
4618
+ /**
4619
+ * Card type the offer is limited to
4620
+ */
4621
+ loyaltycardtype: number | null;
4622
+ /**
4623
+ * Additional card type
4624
+ */
4625
+ loyaltycardtype1: number | null;
4626
+ /**
4627
+ * Additional card type
4628
+ */
4629
+ loyaltycardtype2: number | null;
4630
+ /**
4631
+ * Additional card type
4632
+ */
4633
+ loyaltycardtype3: number | null;
4634
+ /**
4635
+ * Additional card type
4636
+ */
4637
+ loyaltycardtype4: number | null;
4638
+ /**
4639
+ * Additional card type
4640
+ */
4641
+ loyaltycardtype5: number | null;
4642
+ /**
4643
+ * Customer group the offer is limited to
4644
+ */
4645
+ group1: number | null;
4646
+ /**
4647
+ * Additional customer group
4648
+ */
4649
+ group2: number | null;
4650
+ /**
4651
+ * Additional customer group
4652
+ */
4653
+ group3: number | null;
4654
+ /**
4655
+ * Additional customer group
4656
+ */
4657
+ group4: number | null;
4658
+ /**
4659
+ * Additional customer group
4660
+ */
4661
+ group5: number | null;
4662
+ /**
4663
+ * Additional customer group
4664
+ */
4665
+ group6: number | null;
4666
+ /**
4667
+ * Whether the offer is limited to the groups above
4668
+ */
4669
+ groupflag: 'T' | 'F' | null;
4670
+ /**
4671
+ * Always `false`. See the model description.
4502
4672
  */
4503
4673
  linkedto: boolean;
4504
4674
  /**
4505
- * Whether this is a birthday offer
4675
+ * Always `false`. See the model description.
4676
+ */
4677
+ peritem: boolean;
4678
+ /**
4679
+ * Offer reference
4680
+ */
4681
+ offerref: string | null;
4682
+ /**
4683
+ * Free-text comments
4684
+ */
4685
+ comments: string | null;
4686
+ /**
4687
+ * Offer period in days
4688
+ */
4689
+ offerperiod: number | null;
4690
+ /**
4691
+ * Always `false`. See the model description.
4506
4692
  */
4507
4693
  birthdayoffer: boolean;
4508
4694
  /**
4509
- * Whether card must be active
4695
+ * Delta days
4696
+ */
4697
+ deltadays: number | null;
4698
+ /**
4699
+ * Whether the offer is linked to an external system
4700
+ */
4701
+ externallink: 'T' | 'F' | null;
4702
+ /**
4703
+ * External system user
4704
+ */
4705
+ externaluser: string | null;
4706
+ /**
4707
+ * External system password
4708
+ */
4709
+ externalpassword: string | null;
4710
+ /**
4711
+ * External system reference
4712
+ */
4713
+ externalref: string | null;
4714
+ /**
4715
+ * Always `false`. See the model description.
4716
+ */
4717
+ linkscheduler: boolean;
4718
+ /**
4719
+ * Offer image URL
4720
+ */
4721
+ image: string | null;
4722
+ /**
4723
+ * Delta direction
4724
+ */
4725
+ deltadir: string | null;
4726
+ /**
4727
+ * Boost type
4728
+ */
4729
+ boosttype: string | null;
4730
+ /**
4731
+ * Boost days
4732
+ */
4733
+ boostdays: number | null;
4734
+ /**
4735
+ * Always `false`. See the model description.
4510
4736
  */
4511
4737
  cardactive: boolean;
4512
4738
  /**
4513
- * Whether card details must be complete
4739
+ * Always `false`. See the model description.
4514
4740
  */
4515
4741
  cardcomplete: boolean;
4516
4742
  /**
4517
- * Date offer was last changed
4743
+ * Coffee card ID
4744
+ */
4745
+ coffeecard: number | null;
4746
+ /**
4747
+ * Portal user who last changed the offer
4748
+ */
4749
+ portaluser: string | null;
4750
+ /**
4751
+ * Date the offer was last changed (YYYY-MM-DD)
4752
+ */
4753
+ changedate: string | null;
4754
+ /**
4755
+ * Event ID
4756
+ */
4757
+ eventid: number | null;
4758
+ /**
4759
+ * What the offer applies to
4760
+ */
4761
+ apply_to: number;
4762
+ /**
4763
+ * Maximum quantity the offer applies to
4764
+ */
4765
+ apply_upto_quantity: number;
4766
+ /**
4767
+ * Fixed amount
4768
+ */
4769
+ fixed_amount: string;
4770
+ /**
4771
+ * Location type filter, as a JSON-encoded array in a string
4772
+ */
4773
+ location_type_id_filter: string | null;
4774
+ /**
4775
+ * Location filter, as a JSON-encoded array in a string
4776
+ */
4777
+ location_filter: string | null;
4778
+ /**
4779
+ * Site filter, as a JSON-encoded array in a string
4780
+ */
4781
+ site_filter: string | null;
4782
+ /**
4783
+ * Day-of-week filter, as a JSON-encoded array in a string
4518
4784
  */
4519
- changedate: string;
4785
+ day_of_week_filter: string | null;
4520
4786
  /**
4521
- * Date offer becomes active
4787
+ * Region filter, as a JSON-encoded array in a string
4522
4788
  */
4523
- dateactive: string;
4789
+ region_filter: string | null;
4524
4790
  /**
4525
- * Date offer expires
4791
+ * State filter, as a JSON-encoded array in a string
4526
4792
  */
4527
- dateexpire: string;
4793
+ state_filter: string | null;
4794
+ /**
4795
+ * Promotion group ID
4796
+ */
4797
+ promo_group_id: number | null;
4798
+ /**
4799
+ * Item the offer applies to, or `null`
4800
+ */
4801
+ apply_to_items: {
4802
+ sku: string;
4803
+ quantity: number;
4804
+ } | null;
4805
+ /**
4806
+ * Start of the new-member window (YYYY-MM-DD)
4807
+ */
4808
+ new_member_window_start: string | null;
4809
+ /**
4810
+ * End of the new-member window (YYYY-MM-DD)
4811
+ */
4812
+ new_member_window_end: string | null;
4813
+ /**
4814
+ * Days after the trigger that the offer becomes valid
4815
+ */
4816
+ trigger_days_valid_after: number | null;
4817
+ /**
4818
+ * Discount item number
4819
+ */
4820
+ discount_item_number: string | null;
4821
+ /**
4822
+ * Whether the offer is applied automatically (`1` or `0`)
4823
+ */
4824
+ auto_applied: number;
4825
+ /**
4826
+ * Discount item type
4827
+ */
4828
+ discount_item_type: string | null;
4528
4829
  /**
4529
4830
  * Maximum total discount this offer may give in a single transaction,
4530
4831
  * summed across all lines. `null` means no cap.
@@ -4533,24 +4834,42 @@ export type OfferData = {
4533
4834
  * amount. Not to be confused with `maxamount`, the largest basket total the
4534
4835
  * offer triggers on.
4535
4836
  */
4536
- max_discount_amount?: string | null;
4837
+ max_discount_amount: string | null;
4537
4838
  /**
4538
- * Whether this is a redemption event
4839
+ * Always `false`. Redemptions are sent as `offer.redeem`.
4539
4840
  */
4540
- redeem: boolean;
4841
+ redeem: false;
4541
4842
  /**
4542
- * Whether this is a deletion event
4843
+ * Always `false`. Deletions are sent as `offer.delete`.
4543
4844
  */
4544
- delete: boolean;
4845
+ delete: false;
4545
4846
  /**
4546
- * Card data for redemption events
4847
+ * Always `null`.
4547
4848
  */
4548
- card?: LoyaltyCardData;
4849
+ card: null;
4549
4850
  };
4550
4851
  export type OfferDeleteResult = {
4551
4852
  result: number;
4552
4853
  errormessage: string;
4553
4854
  };
4855
+ /**
4856
+ * Offer delete webhook data payload
4857
+ */
4858
+ export type OfferDeleteWebhookData = {
4859
+ /**
4860
+ * The deleted offer
4861
+ */
4862
+ Offer: {
4863
+ /**
4864
+ * Offer ID
4865
+ */
4866
+ offer_id: number;
4867
+ /**
4868
+ * Company loyalty chain the offer belonged to
4869
+ */
4870
+ chain_code: number;
4871
+ };
4872
+ };
4554
4873
  export type OfferDetailAmount = {
4555
4874
  type: string;
4556
4875
  value: number;
@@ -4772,6 +5091,102 @@ export type OfferRedemption = {
4772
5091
  */
4773
5092
  redeemed_tax?: ApiNumeric;
4774
5093
  };
5094
+ /**
5095
+ * One redemption of an offer at the POS. This is the redemption itself,
5096
+ * not the offer record: subscribe to `offer.create`/`offer.update` for the
5097
+ * offer's settings, and `loyalty.card` for cardholder details.
5098
+ */
5099
+ export type OfferRedemptionData = {
5100
+ /**
5101
+ * Offer ID
5102
+ */
5103
+ offer_id: number;
5104
+ /**
5105
+ * Offer reference
5106
+ */
5107
+ offer_ref: string;
5108
+ /**
5109
+ * Offer description
5110
+ */
5111
+ description: string;
5112
+ /**
5113
+ * Loyalty card used, or `null` when no card was presented
5114
+ */
5115
+ card: string | null;
5116
+ /**
5117
+ * Whether this was a loyalty redemption
5118
+ */
5119
+ is_loyalty: boolean;
5120
+ /**
5121
+ * Company loyalty chain the offer belongs to. This is the chain the
5122
+ * webhook destination is configured on, and the same value as the
5123
+ * envelope's `chain`.
5124
+ */
5125
+ chain_code: number;
5126
+ /**
5127
+ * Company (chain) code where the redemption took place
5128
+ */
5129
+ trading_chain_code: number;
5130
+ /**
5131
+ * Site ID
5132
+ */
5133
+ site: number;
5134
+ /**
5135
+ * Location ID
5136
+ */
5137
+ location: number;
5138
+ /**
5139
+ * Terminal number
5140
+ */
5141
+ terminal: number;
5142
+ /**
5143
+ * Journal number of the transaction
5144
+ */
5145
+ journal: number;
5146
+ /**
5147
+ * Sequence number of the redemption line
5148
+ */
5149
+ sequence: number;
5150
+ /**
5151
+ * Transaction date (YYYY-MM-DD)
5152
+ */
5153
+ transaction_date: string;
5154
+ /**
5155
+ * Transaction time of day (HH:MM:SS)
5156
+ */
5157
+ transaction_time: string;
5158
+ /**
5159
+ * Operator number
5160
+ */
5161
+ operator: number;
5162
+ /**
5163
+ * Operator name
5164
+ */
5165
+ operator_name: string;
5166
+ /**
5167
+ * Value of the redemption line. Negative for a discount.
5168
+ */
5169
+ amount: number;
5170
+ /**
5171
+ * Tax on the redemption line
5172
+ */
5173
+ tax: number;
5174
+ /**
5175
+ * The offer's configured points value, NOT the points awarded on this
5176
+ * redemption. A non-loyalty redemption (`is_loyalty: false`) awards no
5177
+ * points even when this is non-zero.
5178
+ */
5179
+ points: number;
5180
+ };
5181
+ /**
5182
+ * Offer redemption webhook data payload
5183
+ */
5184
+ export type OfferRedemptionWebhookData = {
5185
+ /**
5186
+ * The redemption
5187
+ */
5188
+ Redemption: OfferRedemptionData;
5189
+ };
4775
5190
  /**
4776
5191
  * Response for offer redemptions list endpoint
4777
5192
  */
@@ -4855,7 +5270,7 @@ export type OfferUpdateRequest = {
4855
5270
  effect?: OfferEffect;
4856
5271
  };
4857
5272
  /**
4858
- * Offer webhook data payload
5273
+ * Offer create/update webhook data payload
4859
5274
  */
4860
5275
  export type OfferWebhookData = {
4861
5276
  /**
@@ -5581,6 +5996,23 @@ export type PingV2PingResult = {
5581
5996
  */
5582
5997
  chaincode: number;
5583
5998
  };
5999
+ /**
6000
+ * Test delivery sent when a destination is tested from Zen.
6001
+ */
6002
+ export type PingWebhookData = {
6003
+ /**
6004
+ * Always `zen.ping`
6005
+ */
6006
+ event: 'zen.ping';
6007
+ /**
6008
+ * Name of the destination being tested
6009
+ */
6010
+ destination: string;
6011
+ /**
6012
+ * When the test was sent (RFC 3339)
6013
+ */
6014
+ sent_at: string;
6015
+ };
5584
6016
  export type PluGroup = {
5585
6017
  /**
5586
6018
  * PLU Group Id (match with PLUGroupNo)
@@ -6624,6 +7056,10 @@ export type TransactionCreateTender = {
6624
7056
  * Tips tax
6625
7057
  */
6626
7058
  tipstax?: ApiNumeric;
7059
+ /**
7060
+ * Retrieval reference number of the card payment, 1-32 alphanumeric characters. Stored trimmed and upper-cased; an invalid value is dropped without rejecting the transaction. The XML transaction API takes the same value as <Rrn> on <Tender>.
7061
+ */
7062
+ rrn?: string;
6627
7063
  };
6628
7064
  /**
6629
7065
  * Transaction customer information for creation requests
@@ -6679,29 +7115,30 @@ export type TransactionCustomer = {
6679
7115
  purchaseorder?: string;
6680
7116
  };
6681
7117
  /**
6682
- * Transaction data structure
7118
+ * Transaction data structure. Optional fields are left out of the body
7119
+ * entirely when they have no value; they are never sent as `null`.
6683
7120
  */
6684
7121
  export type TransactionData = {
6685
7122
  /**
6686
7123
  * Company/chain code
6687
7124
  */
6688
- Company: string;
7125
+ Company: number;
6689
7126
  /**
6690
- * Site code
7127
+ * Site ID
6691
7128
  */
6692
- Site: string;
7129
+ Site: number;
6693
7130
  /**
6694
- * Location code
7131
+ * Location ID
6695
7132
  */
6696
- Location: string;
7133
+ Location: number;
6697
7134
  /**
6698
7135
  * Terminal number
6699
7136
  */
6700
- Terminal: string;
7137
+ Terminal: number;
6701
7138
  /**
6702
7139
  * Journal number
6703
7140
  */
6704
- Journal: string;
7141
+ Journal: number;
6705
7142
  /**
6706
7143
  * Invoice journal number
6707
7144
  */
@@ -6711,21 +7148,21 @@ export type TransactionData = {
6711
7148
  */
6712
7149
  CreditJournal?: string;
6713
7150
  /**
6714
- * Transaction date and time
7151
+ * Transaction date and time (YYYY-MM-DD HH:MM:SS)
6715
7152
  */
6716
7153
  DateTime: string;
6717
7154
  /**
6718
- * Trading date
7155
+ * Trading date (YYYY-MM-DD)
6719
7156
  */
6720
7157
  TradingDate: string;
6721
7158
  /**
6722
- * Whether this is a training transaction
7159
+ * Always `false`
6723
7160
  */
6724
- isTraining: boolean;
7161
+ isTraining: false;
6725
7162
  /**
6726
7163
  * Operator number
6727
7164
  */
6728
- OperatorNumber: string;
7165
+ OperatorNumber: number;
6729
7166
  /**
6730
7167
  * Operator name
6731
7168
  */
@@ -6737,19 +7174,19 @@ export type TransactionData = {
6737
7174
  /**
6738
7175
  * Cash drawer number
6739
7176
  */
6740
- Cashdrawer: string;
7177
+ Cashdrawer: number;
6741
7178
  /**
6742
- * Email receipt address
7179
+ * Always an empty string
6743
7180
  */
6744
- EmailReceipt?: string;
7181
+ EmailReceipt: '';
6745
7182
  /**
6746
7183
  * Customer email
6747
7184
  */
6748
- CustomerEmail?: string;
7185
+ CustomerEmail: string;
6749
7186
  /**
6750
7187
  * Customer postcode
6751
7188
  */
6752
- Postcode?: string;
7189
+ Postcode: string;
6753
7190
  /**
6754
7191
  * Customer name
6755
7192
  */
@@ -6763,23 +7200,23 @@ export type TransactionData = {
6763
7200
  */
6764
7201
  CustomerPhone?: string;
6765
7202
  /**
6766
- * Loyalty information
7203
+ * Loyalty information, when a card was used
6767
7204
  */
6768
7205
  Loyalty?: WebhookTransactionLoyalty;
6769
7206
  /**
6770
- * Sales items
7207
+ * Sales lines
6771
7208
  */
6772
7209
  Sales?: Array<TransactionItem>;
6773
7210
  /**
6774
- * Tender information
7211
+ * Tenders. Change given is a separate line with a negative amount.
6775
7212
  */
6776
7213
  Tender?: Array<TransactionTender>;
6777
7214
  /**
6778
- * Sales discount
7215
+ * Whole-of-sale discount
6779
7216
  */
6780
7217
  SalesDiscount?: TransactionDiscount;
6781
7218
  /**
6782
- * Rounding amount
7219
+ * Rounding
6783
7220
  */
6784
7221
  Rounding?: TransactionRounding;
6785
7222
  };
@@ -6809,11 +7246,16 @@ export type TransactionEventResponse = {
6809
7246
  [key: string]: unknown;
6810
7247
  };
6811
7248
  /**
6812
- * Transaction item
7249
+ * Transaction sales line.
7250
+ *
7251
+ * At most one of the pairs `SubDepartment`/`SubDepartmentName`,
7252
+ * `Category`/`CategoryName`, `SubCategory`/`SubCategoryName` and
7253
+ * `Range`/`RangeName` is present, depending on how many department levels
7254
+ * the company uses.
6813
7255
  */
6814
7256
  export type TransactionItem = {
6815
7257
  /**
6816
- * Item transaction date and time
7258
+ * Line date and time (YYYY-MM-DD HH:MM:SS)
6817
7259
  */
6818
7260
  DateTime: string;
6819
7261
  /**
@@ -6833,15 +7275,15 @@ export type TransactionItem = {
6833
7275
  */
6834
7276
  PriceLevel: number;
6835
7277
  /**
6836
- * Item price
7278
+ * Unit price
6837
7279
  */
6838
7280
  Price: number;
6839
7281
  /**
6840
- * Original price before discounts
7282
+ * Original price before discounts. `0` when not discounted.
6841
7283
  */
6842
- OriginalPrice?: number;
7284
+ OriginalPrice: number;
6843
7285
  /**
6844
- * Item cost
7286
+ * Unit cost
6845
7287
  */
6846
7288
  Cost: number;
6847
7289
  /**
@@ -6849,11 +7291,11 @@ export type TransactionItem = {
6849
7291
  */
6850
7292
  Quantity: number;
6851
7293
  /**
6852
- * Line total amount
7294
+ * Line total
6853
7295
  */
6854
7296
  LineTotal: number;
6855
7297
  /**
6856
- * Line tax amount
7298
+ * Line tax
6857
7299
  */
6858
7300
  LineTAX: number;
6859
7301
  /**
@@ -6867,9 +7309,9 @@ export type TransactionItem = {
6867
7309
  /**
6868
7310
  * Department name
6869
7311
  */
6870
- DepartmentName?: string;
7312
+ DepartmentName: string;
6871
7313
  /**
6872
- * Whether item is on special
7314
+ * Whether the item is on special
6873
7315
  */
6874
7316
  Special: boolean;
6875
7317
  /**
@@ -6881,21 +7323,21 @@ export type TransactionItem = {
6881
7323
  */
6882
7324
  Bonus?: number;
6883
7325
  /**
6884
- * Whether item was scanned
7326
+ * Whether the item was scanned
6885
7327
  */
6886
7328
  Scanned: boolean;
6887
7329
  /**
6888
- * Scan terminal number
7330
+ * Scan terminal number. `0` when not scanned.
6889
7331
  */
6890
- ScanTerminal?: number;
7332
+ ScanTerminal: number;
6891
7333
  /**
6892
- * Brand code
7334
+ * Brand code. Empty string when the item has no brand.
6893
7335
  */
6894
- Brand?: string;
7336
+ Brand: string;
6895
7337
  /**
6896
- * Brand name
7338
+ * Brand name. Empty string when the item has no brand.
6897
7339
  */
6898
- BrandName?: string;
7340
+ BrandName: string;
6899
7341
  /**
6900
7342
  * Sub-department code
6901
7343
  */
@@ -7155,7 +7597,7 @@ export type TransactionTender = {
7155
7597
  /**
7156
7598
  * Tender type number
7157
7599
  */
7158
- Number: string;
7600
+ Number: number;
7159
7601
  /**
7160
7602
  * Tender name
7161
7603
  */
@@ -8803,37 +9245,40 @@ export type WebhookEventType = 'loyalty.card' | 'loyalty.points' | 'customer.ups
8803
9245
  * Outbound Webhook Models
8804
9246
  *
8805
9247
  * Zen sends webhooks to external systems when various events occur.
8806
- * All webhooks are sent as HTTP POST requests with JSON payloads.Base webhook payload structure
9248
+ * All webhooks are sent as HTTP POST requests with JSON payloads.
9249
+ *
9250
+ * These models describe the bodies exactly as Zen renders them. Each one is
9251
+ * checked against a golden fixture in
9252
+ * `apps/zen/db/dbtend/comms/fixtures/webhook-parity/` (the
9253
+ * `*.expected.json` files). When a template changes, update the matching
9254
+ * model here.
9255
+ *
9256
+ * Several payloads keep legacy quirks (mixed key casing, numbers sent as
9257
+ * strings, the `shopfiy` key). They are part of the wire contract and are
9258
+ * documented as sent, not as they should be.The envelope every webhook body is wrapped in. The event's own fields are
9259
+ * in `data`.
8807
9260
  */
8808
9261
  export type WebhookPayload = {
8809
9262
  /**
8810
- * Webhook function/event type
8811
- */
8812
- function: string;
8813
- /**
8814
- * Authentication key for webhook verification
9263
+ * Shared key. Only filled in when the destination is configured to send
9264
+ * its credential in the body; otherwise an empty string. Verify deliveries
9265
+ * with the `X-Zen-Signature` header instead.
8815
9266
  */
8816
9267
  key: string;
8817
9268
  /**
8818
- * Company/chain code
8819
- */
8820
- chain: string;
8821
- /**
8822
- * Whether HTML trace is enabled
9269
+ * The legacy function name for this event. Several events share a value
9270
+ * (for example `create` is sent for customer, loyalty and offer events),
9271
+ * so use the `X-Zen-Topic` header to tell events apart.
8823
9272
  */
8824
- traceHtml: boolean;
8825
- /**
8826
- * Whether trace logging is enabled
8827
- */
8828
- trace: boolean;
9273
+ function: string;
8829
9274
  /**
8830
- * Target webhook URL
9275
+ * Company (chain) code the destination is configured on.
8831
9276
  */
8832
- url: string;
9277
+ chain: number;
8833
9278
  /**
8834
- * Whether data is sent via POST body
9279
+ * Always `true`.
8835
9280
  */
8836
- viaBody: boolean;
9281
+ viaBody: true;
8837
9282
  };
8838
9283
  /**
8839
9284
  * 200 — a newly generated signing key.
@@ -8856,29 +9301,29 @@ export type WebhookTransactionLoyalty = {
8856
9301
  */
8857
9302
  Card: string;
8858
9303
  /**
8859
- * Opening points balance
9304
+ * Always an empty string
8860
9305
  */
8861
- OpeningPoints?: string;
9306
+ OpeningPoints: '';
8862
9307
  /**
8863
- * Card holder name
9308
+ * Card holder name, as `Last,First`
8864
9309
  */
8865
9310
  Name: string;
8866
9311
  /**
8867
9312
  * First name
8868
9313
  */
8869
- FirstName?: string;
9314
+ FirstName: string;
8870
9315
  /**
8871
9316
  * Last name
8872
9317
  */
8873
- LastName?: string;
9318
+ LastName: string;
8874
9319
  /**
8875
- * Points from rounding
9320
+ * Round points flag
8876
9321
  */
8877
- RoundPoints?: string;
9322
+ RoundPoints: boolean;
8878
9323
  /**
8879
- * Card type
9324
+ * Card type ID
8880
9325
  */
8881
- CardType: string;
9326
+ CardType: number;
8882
9327
  };
8883
9328
  /**
8884
9329
  * A field-level validation failure.
@@ -8901,6 +9346,37 @@ export type ZenNotFoundError = {
8901
9346
  errormessage: 'Not Found';
8902
9347
  issue?: string;
8903
9348
  };
9349
+ /**
9350
+ * HMAC-SHA256 signature of the raw body, keyed with the destination's
9351
+ * signing key: `t=<unix seconds>,v1=<hex hmac_sha256(key, "<t>.<raw body>")>`.
9352
+ * See *Verifying a delivery* under Webhook Destinations.
9353
+ *
9354
+ */
9355
+ export type XZenSignature = string;
9356
+ /**
9357
+ * The event type, for example `offer.redeem`. Use this, not the body's `function`, to tell events apart.
9358
+ */
9359
+ export type XZenTopic = string;
9360
+ /**
9361
+ * Identifies the event. The same on every retry, so deduplicate on it.
9362
+ */
9363
+ export type XZenEventId = string;
9364
+ /**
9365
+ * Identifies this delivery attempt, as `<event id>.<attempt>`. Different on every retry.
9366
+ */
9367
+ export type XZenDeliveryId = string;
9368
+ /**
9369
+ * Name of the webhook destination this was delivered to.
9370
+ */
9371
+ export type XZenDestination = string;
9372
+ /**
9373
+ * RFC 3339 time the event occurred. Does not change between retries.
9374
+ */
9375
+ export type XZenTriggeredAt = string;
9376
+ /**
9377
+ * Revision of that template the body was rendered from.
9378
+ */
9379
+ export type XZenTemplateVersion = string;
8904
9380
  export type SmsSendSmsData = {
8905
9381
  body: SmsSendRequestBody;
8906
9382
  path?: never;
@@ -10453,58 +10929,6 @@ export type LoyaltyGetMemberGroupsResponses = {
10453
10929
  };
10454
10930
  };
10455
10931
  export type LoyaltyGetMemberGroupsResponse = LoyaltyGetMemberGroupsResponses[keyof LoyaltyGetMemberGroupsResponses];
10456
- export type LoyaltyCreatePointsTransactionData = {
10457
- body: {
10458
- card: {
10459
- /**
10460
- * Loyalty card number
10461
- */
10462
- card: string;
10463
- /**
10464
- * Site code
10465
- */
10466
- site: number;
10467
- /**
10468
- * Transaction total amount
10469
- */
10470
- total: number;
10471
- /**
10472
- * Line items for point calculation
10473
- */
10474
- items: Array<{
10475
- [key: string]: unknown;
10476
- }>;
10477
- };
10478
- };
10479
- path?: never;
10480
- query?: never;
10481
- url: '/v1/loyalty/points';
10482
- };
10483
- export type LoyaltyCreatePointsTransactionErrors = {
10484
- /**
10485
- * The server could not understand the request due to invalid syntax.
10486
- */
10487
- 400: ValidationError;
10488
- /**
10489
- * Access is unauthorized.
10490
- */
10491
- 401: InvalidAccessKeyError;
10492
- };
10493
- export type LoyaltyCreatePointsTransactionError = LoyaltyCreatePointsTransactionErrors[keyof LoyaltyCreatePointsTransactionErrors];
10494
- export type LoyaltyCreatePointsTransactionResponses = {
10495
- /**
10496
- * The request has succeeded.
10497
- */
10498
- 200: {
10499
- /**
10500
- * Calculated points result
10501
- */
10502
- points: {
10503
- [key: string]: unknown;
10504
- };
10505
- };
10506
- };
10507
- export type LoyaltyCreatePointsTransactionResponse = LoyaltyCreatePointsTransactionResponses[keyof LoyaltyCreatePointsTransactionResponses];
10508
10932
  export type LoyaltyGetCardRecoveryData = {
10509
10933
  body?: never;
10510
10934
  path: {
@@ -12741,75 +13165,113 @@ export type PingV2ShowResponses = {
12741
13165
  200: PingV2PingResult;
12742
13166
  };
12743
13167
  export type PingV2ShowResponse = PingV2ShowResponses[keyof PingV2ShowResponses];
12744
- export type WebhookLoyaltyWebhookPayload = WebhookPayload & {
13168
+ export type WebhookLoyaltyCardWebhookPayload = WebhookPayload & {
13169
+ function?: 'card' | 'create' | 'update';
13170
+ data: LoyaltyWebhookData;
13171
+ };
13172
+ export type WebhookLoyaltyCardWebhookRequest = {
13173
+ body: WebhookLoyaltyCardWebhookPayload;
13174
+ key: 'loyalty.card';
13175
+ path?: never;
13176
+ query?: never;
13177
+ };
13178
+ export type WebhookLoyaltyPointsWebhookPayload = WebhookPayload & {
13179
+ function?: 'points';
12745
13180
  data: LoyaltyWebhookData;
12746
13181
  };
12747
- export type WebhookLoyaltyWebhookRequest = {
12748
- body: WebhookLoyaltyWebhookPayload;
12749
- key: 'loyalty';
13182
+ export type WebhookLoyaltyPointsWebhookRequest = {
13183
+ body: WebhookLoyaltyPointsWebhookPayload;
13184
+ key: 'loyalty.points';
12750
13185
  path?: never;
12751
13186
  query?: never;
12752
13187
  };
12753
- export type WebhookCustomerWebhookPayload = WebhookPayload & {
13188
+ export type WebhookCustomerUpsertWebhookPayload = WebhookPayload & {
13189
+ function?: 'customer' | 'create' | 'update';
12754
13190
  data: CustomerWebhookData;
12755
13191
  };
12756
- export type WebhookCustomerWebhookRequest = {
12757
- body: WebhookCustomerWebhookPayload;
12758
- key: 'customer';
13192
+ export type WebhookCustomerUpsertWebhookRequest = {
13193
+ body: WebhookCustomerUpsertWebhookPayload;
13194
+ key: 'customer.upsert';
12759
13195
  path?: never;
12760
13196
  query?: never;
12761
13197
  };
12762
- export type WebhookOfferWebhookPayload = WebhookPayload & {
13198
+ export type WebhookOfferCreateWebhookPayload = WebhookPayload & {
13199
+ function?: 'create';
12763
13200
  data: OfferWebhookData;
12764
13201
  };
12765
- export type WebhookOfferWebhookRequest = {
12766
- body: WebhookOfferWebhookPayload;
12767
- key: 'offer';
13202
+ export type WebhookOfferCreateWebhookRequest = {
13203
+ body: WebhookOfferCreateWebhookPayload;
13204
+ key: 'offer.create';
12768
13205
  path?: never;
12769
13206
  query?: never;
12770
13207
  };
12771
- export type WebhookRedeemWebhookPayload = WebhookPayload & {
13208
+ export type WebhookOfferUpdateWebhookPayload = WebhookPayload & {
13209
+ function?: 'update';
12772
13210
  data: OfferWebhookData;
12773
13211
  };
12774
- export type WebhookRedeemWebhookRequest = {
12775
- body: WebhookRedeemWebhookPayload;
12776
- key: 'redeem';
13212
+ export type WebhookOfferUpdateWebhookRequest = {
13213
+ body: WebhookOfferUpdateWebhookPayload;
13214
+ key: 'offer.update';
12777
13215
  path?: never;
12778
13216
  query?: never;
12779
13217
  };
12780
- export type WebhookDeleteWebhookPayload = WebhookPayload & {
12781
- data: OfferWebhookData;
13218
+ export type WebhookOfferRedeemWebhookPayload = WebhookPayload & {
13219
+ function?: 'redeem';
13220
+ data: OfferRedemptionWebhookData;
12782
13221
  };
12783
- export type WebhookDeleteWebhookRequest = {
12784
- body: WebhookDeleteWebhookPayload;
12785
- key: 'delete';
13222
+ export type WebhookOfferRedeemWebhookRequest = {
13223
+ body: WebhookOfferRedeemWebhookPayload;
13224
+ key: 'offer.redeem';
12786
13225
  path?: never;
12787
13226
  query?: never;
12788
13227
  };
12789
- export type WebhookItemWebhookPayload = WebhookPayload & {
12790
- data: InventoryWebhookData;
13228
+ export type WebhookOfferDeleteWebhookPayload = WebhookPayload & {
13229
+ function?: 'delete';
13230
+ data: OfferDeleteWebhookData;
12791
13231
  };
12792
- export type WebhookItemWebhookRequest = {
12793
- body: WebhookItemWebhookPayload;
12794
- key: 'item';
13232
+ export type WebhookOfferDeleteWebhookRequest = {
13233
+ body: WebhookOfferDeleteWebhookPayload;
13234
+ key: 'offer.delete';
12795
13235
  path?: never;
12796
13236
  query?: never;
12797
13237
  };
12798
- export type WebhookPriceWebhookPayload = WebhookPayload & {
12799
- data: InventoryWebhookData;
13238
+ export type WebhookItemSohWebhookPayload = WebhookPayload & {
13239
+ function?: 'item';
13240
+ data: InventorySohWebhookData;
12800
13241
  };
12801
- export type WebhookPriceWebhookRequest = {
12802
- body: WebhookPriceWebhookPayload;
12803
- key: 'price';
13242
+ export type WebhookItemSohWebhookRequest = {
13243
+ body: WebhookItemSohWebhookPayload;
13244
+ key: 'item.soh';
12804
13245
  path?: never;
12805
13246
  query?: never;
12806
13247
  };
12807
- export type WebhookTransactionWebhookPayload = WebhookPayload & {
13248
+ export type WebhookItemPriceWebhookPayload = WebhookPayload & {
13249
+ function?: 'price';
13250
+ data: InventoryPriceWebhookData;
13251
+ };
13252
+ export type WebhookItemPriceWebhookRequest = {
13253
+ body: WebhookItemPriceWebhookPayload;
13254
+ key: 'item.price';
13255
+ path?: never;
13256
+ query?: never;
13257
+ };
13258
+ export type WebhookTransactionCompleteWebhookPayload = WebhookPayload & {
13259
+ function?: 'transaction';
12808
13260
  data: TransactionWebhookData;
12809
13261
  };
12810
- export type WebhookTransactionWebhookRequest = {
12811
- body: WebhookTransactionWebhookPayload;
12812
- key: 'transaction';
13262
+ export type WebhookTransactionCompleteWebhookRequest = {
13263
+ body: WebhookTransactionCompleteWebhookPayload;
13264
+ key: 'transaction.complete';
13265
+ path?: never;
13266
+ query?: never;
13267
+ };
13268
+ export type WebhookPingWebhookPayload = WebhookPayload & {
13269
+ function?: 'ping';
13270
+ data: PingWebhookData;
13271
+ };
13272
+ export type WebhookPingWebhookRequest = {
13273
+ body: WebhookPingWebhookPayload;
13274
+ key: 'ping';
12813
13275
  path?: never;
12814
13276
  query?: never;
12815
13277
  };