@zenglobal/api-client 5.0.4 → 5.0.5

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.
@@ -7153,6 +7153,136 @@ export type VoucherBalanceResponse = {
7153
7153
  [key: string]: unknown;
7154
7154
  };
7155
7155
  };
7156
+ /**
7157
+ * Individual cart item for multi-voucher operations.
7158
+ * Each item represents one voucher to be created.
7159
+ */
7160
+ export type VoucherCartItem = {
7161
+ /**
7162
+ * Cart item identifier
7163
+ */
7164
+ id: string;
7165
+ /**
7166
+ * Buyer's first name (from billing details)
7167
+ */
7168
+ firstname: string;
7169
+ /**
7170
+ * Buyer's surname (from billing details)
7171
+ */
7172
+ surname: string;
7173
+ /**
7174
+ * Buyer's surname only — legacy API concatenates as 'name, firstName'
7175
+ */
7176
+ name: string;
7177
+ /**
7178
+ * Buyer's first name (from billing details)
7179
+ */
7180
+ firstName: string;
7181
+ /**
7182
+ * Unit price per voucher after discount
7183
+ */
7184
+ unitPrice: number;
7185
+ /**
7186
+ * Number of vouchers for this line item
7187
+ */
7188
+ quantity: number;
7189
+ /**
7190
+ * Voucher face value per unit (includes bonus)
7191
+ */
7192
+ value: number;
7193
+ /**
7194
+ * Delivery method: 'email' or 'post'
7195
+ */
7196
+ sendBy: string;
7197
+ /**
7198
+ * Optional message to include with the voucher
7199
+ */
7200
+ message: string;
7201
+ /**
7202
+ * Sender name for the message
7203
+ */
7204
+ messageFrom: string;
7205
+ /**
7206
+ * Recipient name for the message
7207
+ */
7208
+ messageTo: string;
7209
+ /**
7210
+ * Delivery address
7211
+ */
7212
+ address: string;
7213
+ /**
7214
+ * Scheduled delivery date (YYYY-MM-DD format)
7215
+ */
7216
+ scheduledDate: string;
7217
+ /**
7218
+ * Buyer's email address
7219
+ */
7220
+ email: string;
7221
+ /**
7222
+ * Buyer's phone number
7223
+ */
7224
+ phone: string;
7225
+ /**
7226
+ * Buyer's mobile number
7227
+ */
7228
+ mobile: string;
7229
+ /**
7230
+ * Delivery postcode
7231
+ */
7232
+ postcode: string;
7233
+ /**
7234
+ * Recipient's first name
7235
+ */
7236
+ recipientFirstname: string;
7237
+ /**
7238
+ * Recipient's surname
7239
+ */
7240
+ recipientSurname: string;
7241
+ /**
7242
+ * Recipient's email address
7243
+ */
7244
+ recipientEmail: string;
7245
+ /**
7246
+ * Postage type: '1' for express, '0' for standard
7247
+ */
7248
+ postage: string;
7249
+ /**
7250
+ * Whether this item requires physical delivery
7251
+ */
7252
+ sendPhysical: boolean;
7253
+ /**
7254
+ * Postage charge amount for this item
7255
+ */
7256
+ postageCharge: number;
7257
+ /**
7258
+ * Whether this is a gift voucher
7259
+ */
7260
+ sendGift: boolean;
7261
+ /**
7262
+ * Secondary email address (recipient's email)
7263
+ */
7264
+ secondary_email: string;
7265
+ /**
7266
+ * Gift recipient's first name
7267
+ */
7268
+ giftfirst: string;
7269
+ /**
7270
+ * Gift recipient's last name
7271
+ */
7272
+ giftlast: string;
7273
+ /**
7274
+ * Gift recipient's address
7275
+ */
7276
+ giftaddress: string;
7277
+ /**
7278
+ * Scheduled email delivery date
7279
+ */
7280
+ emailDate: string;
7281
+ /**
7282
+ * Line number (1-based index)
7283
+ */
7284
+ line: number;
7285
+ };
7156
7286
  /**
7157
7287
  * Payment charge information for web voucher operations
7158
7288
  */
@@ -7161,6 +7291,28 @@ export type VoucherCharge = {
7161
7291
  * Payment process ID from payment gateway
7162
7292
  */
7163
7293
  processId: string;
7294
+ /**
7295
+ * Card identifier from payment method
7296
+ */
7297
+ cardID?: string;
7298
+ /**
7299
+ * Cardholder name from payment method billing details
7300
+ */
7301
+ cardName?: string;
7302
+ /**
7303
+ * Payment reference
7304
+ */
7305
+ reference?: string;
7306
+ /**
7307
+ * Payment token (e.g., charge ID from Stripe)
7308
+ */
7309
+ token?: string;
7310
+ /**
7311
+ * Raw charge payload from payment gateway
7312
+ */
7313
+ raw?: {
7314
+ [key: string]: unknown;
7315
+ };
7164
7316
  };
7165
7317
  /**
7166
7318
  * Voucher create body fields (inside the `voucher` wrapper).
@@ -7228,6 +7380,10 @@ export type VoucherCreateBody = {
7228
7380
  * Surcharge amount
7229
7381
  */
7230
7382
  surcharge?: number;
7383
+ /**
7384
+ * Currency code (e.g., 'aud')
7385
+ */
7386
+ currency?: string;
7231
7387
  /**
7232
7388
  * Whether this is a web voucher (requires charge.processId)
7233
7389
  */
@@ -7276,6 +7432,10 @@ export type VoucherCreateBody = {
7276
7432
  * Gift recipient's last name (when isgift is true)
7277
7433
  */
7278
7434
  giftlast?: string;
7435
+ /**
7436
+ * Scheduled date for gift email delivery (YYYY-MM-DD format)
7437
+ */
7438
+ giftEmailDate?: string;
7279
7439
  /**
7280
7440
  * Optional message to include with the voucher notification
7281
7441
  */
@@ -7288,10 +7448,26 @@ export type VoucherCreateBody = {
7288
7448
  * Recipient name for the voucher message
7289
7449
  */
7290
7450
  messageTo?: string;
7451
+ /**
7452
+ * Whether the customer opted in to marketing communications
7453
+ */
7454
+ marketingOptIn?: boolean;
7291
7455
  /**
7292
7456
  * When true, sets the voucher to Locked status instead of Sold (for sandbox/testing)
7293
7457
  */
7294
7458
  sandbox?: boolean;
7459
+ /**
7460
+ * Whether terms and conditions were accepted. Note: field name preserves legacy API typo.
7461
+ */
7462
+ condtionAccept?: boolean;
7463
+ /**
7464
+ * Client IP address for web voucher transactions
7465
+ */
7466
+ webVoucherIP?: string;
7467
+ /**
7468
+ * Client user agent string for web voucher transactions
7469
+ */
7470
+ webVoucherAgent?: string;
7295
7471
  /**
7296
7472
  * Voucher PIN
7297
7473
  */
@@ -7307,9 +7483,7 @@ export type VoucherCreateBody = {
7307
7483
  /**
7308
7484
  * Cart items for multi-voucher operations
7309
7485
  */
7310
- cart?: Array<{
7311
- [key: string]: unknown;
7312
- }>;
7486
+ cart?: Array<VoucherCartItem>;
7313
7487
  /**
7314
7488
  * Reason text for the voucher operation
7315
7489
  */
@@ -7317,9 +7491,7 @@ export type VoucherCreateBody = {
7317
7491
  /**
7318
7492
  * Voucher number tracking for multi-voucher operations
7319
7493
  */
7320
- voucherNumbers?: {
7321
- [key: string]: unknown;
7322
- };
7494
+ voucherNumbers?: VoucherNumbers;
7323
7495
  /**
7324
7496
  * Location number (used when ispos is true)
7325
7497
  */
@@ -7328,6 +7500,38 @@ export type VoucherCreateBody = {
7328
7500
  * Terminal number (used when ispos is true)
7329
7501
  */
7330
7502
  terminal?: number;
7503
+ /**
7504
+ * Chain/company code
7505
+ */
7506
+ company?: number;
7507
+ /**
7508
+ * Total amount paid by customer (after discounts and surcharges)
7509
+ */
7510
+ amountpaid?: number;
7511
+ /**
7512
+ * Discount amount applied
7513
+ */
7514
+ discount?: number;
7515
+ /**
7516
+ * Voucher type identifier (e.g., 'Gift', 'Loyalty')
7517
+ */
7518
+ vouchertype?: string;
7519
+ /**
7520
+ * Timestamp of web voucher creation (Y-m-d H:i:s format)
7521
+ */
7522
+ webVoucherDateTime?: string;
7523
+ /**
7524
+ * Unix timestamp of web voucher creation
7525
+ */
7526
+ webVoucherDateTimeRaw?: number;
7527
+ /**
7528
+ * Total postage charge amount
7529
+ */
7530
+ postageCharge?: number;
7531
+ /**
7532
+ * Cart workflow reference ID
7533
+ */
7534
+ reference?: string;
7331
7535
  };
7332
7536
  /**
7333
7537
  * Request body for creating a new voucher via POST /voucher/{voucherType}/create.
@@ -7377,43 +7581,14 @@ export type VoucherCreateResponse = {
7377
7581
  * Transaction reference in format site:terminal:journal (POS operations only)
7378
7582
  */
7379
7583
  reference?: string;
7380
- };
7381
- /**
7382
- * Voucher deletion request.
7383
- * Body must be wrapped in a `voucher` key: `{"voucher": {...}}`.
7384
- */
7385
- export type VoucherDeleteRequest = {
7386
- /**
7387
- * Voucher wrapper
7388
- */
7389
- voucher: {
7390
- /**
7391
- * Voucher serial number
7392
- */
7393
- serialnumber: string;
7394
- /**
7395
- * Voucher PIN for verification (required when PIN checking is enabled)
7396
- */
7397
- pin: string;
7398
- /**
7399
- * Site code where deletion occurs
7400
- */
7401
- site: number;
7402
- };
7403
- };
7404
- /**
7405
- * Voucher deletion response.
7406
- * Uses setError() so includes result/errormessage.
7407
- */
7408
- export type VoucherDeleteResponse = {
7409
7584
  /**
7410
- * Result code (0 = success)
7585
+ * Reason for failure or additional context
7411
7586
  */
7412
- result: number;
7587
+ reason?: string;
7413
7588
  /**
7414
- * Result message
7589
+ * Whether to show the view voucher link in the response
7415
7590
  */
7416
- errormessage: string;
7591
+ showViewLink?: boolean;
7417
7592
  };
7418
7593
  /**
7419
7594
  * Voucher enquire body fields (inside the `voucher` wrapper).
@@ -7602,6 +7777,23 @@ export type VoucherImageResponse = {
7602
7777
  voucherimage: string;
7603
7778
  };
7604
7779
  };
7780
+ /**
7781
+ * Voucher count tracking for multi-voucher operations
7782
+ */
7783
+ export type VoucherNumbers = {
7784
+ /**
7785
+ * Total number of vouchers in the cart
7786
+ */
7787
+ total: number;
7788
+ /**
7789
+ * Number of email (electronic) vouchers
7790
+ */
7791
+ totalE: number;
7792
+ /**
7793
+ * Number of physical (postal) vouchers
7794
+ */
7795
+ totalP: number;
7796
+ };
7605
7797
  /**
7606
7798
  * Voucher recharge body fields (inside the `voucher` wrapper).
7607
7799
  */
@@ -11178,32 +11370,6 @@ export type VersionGetVersionResponses = {
11178
11370
  200: VersionResponse;
11179
11371
  };
11180
11372
  export type VersionGetVersionResponse = VersionGetVersionResponses[keyof VersionGetVersionResponses];
11181
- export type VoucherDeleteVoucherData = {
11182
- body: VoucherDeleteRequest;
11183
- path: {
11184
- voucherType: string;
11185
- };
11186
- query?: never;
11187
- url: '/v1/voucher/{voucherType}';
11188
- };
11189
- export type VoucherDeleteVoucherErrors = {
11190
- /**
11191
- * The server could not understand the request due to invalid syntax.
11192
- */
11193
- 400: ValidationError;
11194
- /**
11195
- * Access is unauthorized.
11196
- */
11197
- 401: InvalidAccessKeyError;
11198
- };
11199
- export type VoucherDeleteVoucherError = VoucherDeleteVoucherErrors[keyof VoucherDeleteVoucherErrors];
11200
- export type VoucherDeleteVoucherResponses = {
11201
- /**
11202
- * The request has succeeded.
11203
- */
11204
- 200: VoucherDeleteResponse;
11205
- };
11206
- export type VoucherDeleteVoucherResponse = VoucherDeleteVoucherResponses[keyof VoucherDeleteVoucherResponses];
11207
11373
  export type VoucherGetVoucherTypeData = {
11208
11374
  body?: never;
11209
11375
  path: {