@zenglobal/api-client 1.0.0

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.
Files changed (78) hide show
  1. package/README.md +134 -0
  2. package/dist/client/client/client.gen.d.ts +3 -0
  3. package/dist/client/client/client.gen.d.ts.map +1 -0
  4. package/dist/client/client/client.gen.js +257 -0
  5. package/dist/client/client/client.gen.js.map +1 -0
  6. package/dist/client/client/index.d.ts +9 -0
  7. package/dist/client/client/index.d.ts.map +1 -0
  8. package/dist/client/client/index.js +7 -0
  9. package/dist/client/client/index.js.map +1 -0
  10. package/dist/client/client/types.gen.d.ts +146 -0
  11. package/dist/client/client/types.gen.d.ts.map +1 -0
  12. package/dist/client/client/types.gen.js +3 -0
  13. package/dist/client/client/types.gen.js.map +1 -0
  14. package/dist/client/client/utils.gen.d.ts +34 -0
  15. package/dist/client/client/utils.gen.d.ts.map +1 -0
  16. package/dist/client/client/utils.gen.js +227 -0
  17. package/dist/client/client/utils.gen.js.map +1 -0
  18. package/dist/client/client.gen.d.ts +13 -0
  19. package/dist/client/client.gen.d.ts.map +1 -0
  20. package/dist/client/client.gen.js +4 -0
  21. package/dist/client/client.gen.js.map +1 -0
  22. package/dist/client/core/auth.gen.d.ts +19 -0
  23. package/dist/client/core/auth.gen.d.ts.map +1 -0
  24. package/dist/client/core/auth.gen.js +15 -0
  25. package/dist/client/core/auth.gen.js.map +1 -0
  26. package/dist/client/core/bodySerializer.gen.d.ts +26 -0
  27. package/dist/client/core/bodySerializer.gen.d.ts.map +1 -0
  28. package/dist/client/core/bodySerializer.gen.js +58 -0
  29. package/dist/client/core/bodySerializer.gen.js.map +1 -0
  30. package/dist/client/core/params.gen.d.ts +44 -0
  31. package/dist/client/core/params.gen.d.ts.map +1 -0
  32. package/dist/client/core/params.gen.js +101 -0
  33. package/dist/client/core/params.gen.js.map +1 -0
  34. package/dist/client/core/pathSerializer.gen.d.ts +34 -0
  35. package/dist/client/core/pathSerializer.gen.d.ts.map +1 -0
  36. package/dist/client/core/pathSerializer.gen.js +107 -0
  37. package/dist/client/core/pathSerializer.gen.js.map +1 -0
  38. package/dist/client/core/queryKeySerializer.gen.d.ts +19 -0
  39. package/dist/client/core/queryKeySerializer.gen.d.ts.map +1 -0
  40. package/dist/client/core/queryKeySerializer.gen.js +93 -0
  41. package/dist/client/core/queryKeySerializer.gen.js.map +1 -0
  42. package/dist/client/core/serverSentEvents.gen.d.ts +72 -0
  43. package/dist/client/core/serverSentEvents.gen.d.ts.map +1 -0
  44. package/dist/client/core/serverSentEvents.gen.js +134 -0
  45. package/dist/client/core/serverSentEvents.gen.js.map +1 -0
  46. package/dist/client/core/types.gen.d.ts +79 -0
  47. package/dist/client/core/types.gen.d.ts.map +1 -0
  48. package/dist/client/core/types.gen.js +3 -0
  49. package/dist/client/core/types.gen.js.map +1 -0
  50. package/dist/client/core/utils.gen.d.ts +20 -0
  51. package/dist/client/core/utils.gen.d.ts.map +1 -0
  52. package/dist/client/core/utils.gen.js +88 -0
  53. package/dist/client/core/utils.gen.js.map +1 -0
  54. package/dist/client/index.d.ts +3 -0
  55. package/dist/client/index.d.ts.map +1 -0
  56. package/dist/client/index.js +3 -0
  57. package/dist/client/index.js.map +1 -0
  58. package/dist/client/sdk.gen.d.ts +1544 -0
  59. package/dist/client/sdk.gen.d.ts.map +1 -0
  60. package/dist/client/sdk.gen.js +2111 -0
  61. package/dist/client/sdk.gen.js.map +1 -0
  62. package/dist/client/types.gen.d.ts +10180 -0
  63. package/dist/client/types.gen.d.ts.map +1 -0
  64. package/dist/client/types.gen.js +3 -0
  65. package/dist/client/types.gen.js.map +1 -0
  66. package/dist/configure.d.ts +30 -0
  67. package/dist/configure.d.ts.map +1 -0
  68. package/dist/configure.js +71 -0
  69. package/dist/configure.js.map +1 -0
  70. package/dist/errors.d.ts +23 -0
  71. package/dist/errors.d.ts.map +1 -0
  72. package/dist/errors.js +25 -0
  73. package/dist/errors.js.map +1 -0
  74. package/dist/index.d.ts +7 -0
  75. package/dist/index.d.ts.map +1 -0
  76. package/dist/index.js +10 -0
  77. package/dist/index.js.map +1 -0
  78. package/package.json +54 -0
@@ -0,0 +1,2111 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ import { client } from './client.gen.js';
3
+ /**
4
+ * Send SMS
5
+ *
6
+ * Send an SMS message.
7
+ *
8
+ * The request body must be wrapped in an `sms` key: `{"sms": {...}}`.
9
+ *
10
+ * **Required scope:** `SEND_SMS`
11
+ *
12
+ * **Error codes:**
13
+ * - `8` (Missing Data) - Body Missing
14
+ * - `45` (Invalid JSON) - Invalid JSON body
15
+ * - `51` (SMS Not Enabled) - SMS sending not enabled for this chain
16
+ * - `32` (Balance Zero) - No SMS units remaining
17
+ * - `33` (Length Exceeded) - Message exceeds maximum length
18
+ * - `7` (Invalid Mobile) - Mobile number invalid or wrong length
19
+ * - `23` (Missing Mobile) - Mobile number not provided
20
+ * - `50` (SMS Error) - SMS sending failed
21
+ */
22
+ export const smsSendSms = (options) => (options.client ?? client).post({
23
+ security: [{ scheme: 'basic', type: 'http' }],
24
+ url: '/SMS',
25
+ ...options,
26
+ headers: {
27
+ 'Content-Type': 'application/json',
28
+ ...options.headers
29
+ }
30
+ });
31
+ /**
32
+ * Get SMS Balance
33
+ *
34
+ * Get SMS balance and usage information for a site.
35
+ *
36
+ * Returns the remaining SMS balance, unit cost, and total units sent.
37
+ *
38
+ * **Required scope:** `READ_SMS`
39
+ *
40
+ * **Error codes:**
41
+ * - `8` (Missing Data) - Invalid Site
42
+ */
43
+ export const smsGetSmsBalance = (options) => (options.client ?? client).get({
44
+ security: [{ scheme: 'basic', type: 'http' }],
45
+ url: '/SMS/balance/{site}',
46
+ ...options
47
+ });
48
+ /**
49
+ * Get SMS Replies
50
+ *
51
+ * Get SMS replies for a site.
52
+ *
53
+ * **Note:** This endpoint is currently a stub and always returns an empty JSON object.
54
+ *
55
+ * **Required scope:** `READ_SMS`
56
+ *
57
+ * **Error codes:**
58
+ * - `4` (Not Found) - missing search string, missing from date
59
+ * - `8` (Missing Data) - Invalid Site
60
+ */
61
+ export const smsGetSmsReplies = (options) => (options.client ?? client).get({
62
+ security: [{ scheme: 'basic', type: 'http' }],
63
+ url: '/SMS/replies/{site}',
64
+ ...options
65
+ });
66
+ /**
67
+ * Get SMS Responses
68
+ *
69
+ * Get SMS response list for a site.
70
+ *
71
+ * **Note:** This endpoint is currently a stub and always returns an empty JSON object.
72
+ * Both URL paths `/SMS/response/{site}` and `/SMS/reponse/{site}` (legacy typo) are accepted.
73
+ *
74
+ * **Required scope:** `READ_SMS`
75
+ *
76
+ * **Error codes:**
77
+ * - `4` (Not Found) - missing search string, missing from date, missing to date, missing mobile
78
+ * - `8` (Missing Data) - Invalid Site
79
+ */
80
+ export const smsGetSmsResponses = (options) => (options.client ?? client).get({
81
+ security: [{ scheme: 'basic', type: 'http' }],
82
+ url: '/SMS/response/{site}',
83
+ ...options
84
+ });
85
+ /**
86
+ * Get Sent SMS List
87
+ *
88
+ * Get list of SMS messages sent to a mobile number within a date range.
89
+ *
90
+ * Both `from` and `to` query parameters are required. The mobile number
91
+ * is passed as a path parameter. Numbers starting with '04' are automatically
92
+ * converted to international format (614...).
93
+ *
94
+ * **Required scope:** `READ_SMS`
95
+ *
96
+ * **Error codes:**
97
+ * - `4` (Not Found) - missing search string, missing from date, missing to date, missing mobile
98
+ */
99
+ export const smsGetSentSmsList = (options) => (options.client ?? client).get({
100
+ security: [{ scheme: 'basic', type: 'http' }],
101
+ url: '/SMS/sent/{mobile}',
102
+ ...options
103
+ });
104
+ /**
105
+ * Process Event
106
+ *
107
+ * Receives and processes event webhooks. The request body must be valid JSON
108
+ * containing the required `name`, `id`, and `payload` fields.
109
+ *
110
+ * Currently supported event names:
111
+ * * `order/delivered` - Order delivery confirmation
112
+ * * `order/rejected` - Order rejection notification
113
+ *
114
+ * **Required scope:** `write:events`
115
+ *
116
+ * **Error codes:**
117
+ * * `1` (Invalid Access Key) - Missing or invalid API key, or missing `write:events` scope
118
+ * * `9` (Request Rejected) - Request payload does not contain required fields, unknown event type, or company is disabled
119
+ */
120
+ export const eventsProcessEvent = (options) => (options.client ?? client).post({
121
+ security: [{ scheme: 'basic', type: 'http' }],
122
+ url: '/events',
123
+ ...options,
124
+ headers: {
125
+ 'Content-Type': 'application/json',
126
+ ...options.headers
127
+ }
128
+ });
129
+ /**
130
+ * Get Gateway Configuration
131
+ *
132
+ * Get payment gateway configurations for all providers.
133
+ *
134
+ * Returns configuration for Stripe, eWay, and PayPal gateways
135
+ * including API keys, currency settings, and sandbox status.
136
+ *
137
+ * Required scope: `read:gateway`
138
+ */
139
+ export const gatewayGetGatewayConfig = (options) => (options?.client ?? client).get({
140
+ security: [{ scheme: 'basic', type: 'http' }],
141
+ url: '/gateway',
142
+ ...options
143
+ });
144
+ /**
145
+ * Get Department Items
146
+ *
147
+ * Get all items in a specific department.
148
+ *
149
+ * Returns inventory items grouped by department. The response is returned
150
+ * directly via `prepareJson()` without `result`/`errormessage` wrapper fields.
151
+ *
152
+ * **Required scope:** `read:inventory`
153
+ *
154
+ * **Error codes:**
155
+ * - `4` (Not Found) - No items found in the department
156
+ * - `8` (Missing Data) - Invalid site
157
+ */
158
+ export const inventoryGetDepartmentItems = (options) => (options.client ?? client).get({
159
+ security: [{ scheme: 'basic', type: 'http' }],
160
+ url: '/inventory/{siteCode}/department/{departmentId}',
161
+ ...options
162
+ });
163
+ /**
164
+ * Get Item Details
165
+ *
166
+ * Get specific item details by item number.
167
+ *
168
+ * Performs an exact item number lookup and returns results grouped by department,
169
+ * using the same response structure as the search endpoint. The response is returned
170
+ * directly via `prepareJson()` without `result`/`errormessage` wrapper fields.
171
+ *
172
+ * **Required scope:** `read:inventory`
173
+ *
174
+ * **Error codes:**
175
+ * - `4` (Not Found) - Item not found
176
+ * - `8` (Missing Data) - Invalid site
177
+ */
178
+ export const inventoryGetItem = (options) => (options.client ?? client).get({
179
+ security: [{ scheme: 'basic', type: 'http' }],
180
+ url: '/inventory/{siteCode}/item/{itemNumber}',
181
+ ...options
182
+ });
183
+ /**
184
+ * Search Inventory
185
+ *
186
+ * Search inventory items by various criteria.
187
+ *
188
+ * The search value is taken from the raw query string (everything after the `?`),
189
+ * not from a named query parameter. For example:
190
+ * `GET /inventory/{siteCode}/search/description?Bombay Gin`
191
+ *
192
+ * The response groups results by department. The response is returned
193
+ * directly via `prepareJson()` without `result`/`errormessage` wrapper fields.
194
+ *
195
+ * **Required scope:** `read:inventory`
196
+ *
197
+ * **Available search commands:**
198
+ * - `number` - Search by item number (partial match)
199
+ * - `description` - Search by item description (case-insensitive partial match)
200
+ * - `supplier` - Search by product owner/supplier (partial match)
201
+ * - `colour` - Search by colour attribute (partial match)
202
+ * - `style` - Search by style attribute (partial match)
203
+ * - `size` - Search by size attribute (partial match)
204
+ * - `barcode` - Search by barcode (partial match)
205
+ *
206
+ * **Error codes:**
207
+ * - `4` (Not Found) - No items match the search
208
+ * - `8` (Missing Data) - Invalid site
209
+ * - `9` (Request Rejected) - Unknown search command
210
+ */
211
+ export const inventorySearchInventory = (options) => (options.client ?? client).get({
212
+ security: [{ scheme: 'basic', type: 'http' }],
213
+ url: '/inventory/{siteCode}/search/{command}',
214
+ ...options
215
+ });
216
+ /**
217
+ * Bulk update Inventory
218
+ *
219
+ * This endpoint is designed to bulk process a series of inventory changes for a given location.
220
+ *
221
+ * > info
222
+ * > All process will happen asynchronously and updates are processed in the order they arrive.
223
+ *
224
+ * **Required scope:** `write:inventory`
225
+ *
226
+ * Supports `Content-Encoding: gzip` for compressed request bodies.
227
+ *
228
+ * **Error codes:**
229
+ * - `0` (OK) - Bulk update submitted successfully
230
+ * - `8` (Missing Data) - Request body is empty
231
+ * - `9` (Request Rejected) - Failed to parse JSON or validation errors
232
+ */
233
+ export const inventoryBulkInventory = (options) => (options.client ?? client).post({
234
+ security: [{ scheme: 'basic', type: 'http' }],
235
+ url: '/inventory/{siteId}/bulk_inventory',
236
+ ...options,
237
+ headers: {
238
+ 'Content-Type': 'application/json',
239
+ ...options.headers
240
+ }
241
+ });
242
+ /**
243
+ * List Jackpots
244
+ *
245
+ * Returns active jackpots with optional date range filtering and pagination.
246
+ *
247
+ * **Required scope:** `read:jackpots`
248
+ *
249
+ * **Error codes:**
250
+ * * `1` (Invalid Access Key) - Missing or invalid API key, or missing `read:jackpots` scope
251
+ * * `3` (Invalid Function) - Request method is not GET
252
+ * * `9` (Request Rejected) - Company is disabled
253
+ */
254
+ export const jackpotsList = (options) => (options?.client ?? client).get({
255
+ security: [{ scheme: 'basic', type: 'http' }],
256
+ url: '/jackpots',
257
+ ...options
258
+ });
259
+ /**
260
+ * List Jackpot Winners
261
+ *
262
+ * Returns jackpot winners with optional date range and site filtering, with pagination.
263
+ *
264
+ * **Required scope:** `read:jackpots`
265
+ *
266
+ * **Error codes:**
267
+ * * `1` (Invalid Access Key) - Missing or invalid API key, or missing `read:jackpots` scope
268
+ * * `3` (Invalid Function) - Request method is not GET
269
+ * * `9` (Request Rejected) - Company is disabled
270
+ */
271
+ export const jackpotsListWinners = (options) => (options?.client ?? client).get({
272
+ security: [{ scheme: 'basic', type: 'http' }],
273
+ url: '/jackpots/winners',
274
+ ...options
275
+ });
276
+ /**
277
+ * Delete List
278
+ *
279
+ * Delete an entire list definition.
280
+ *
281
+ * Deletes the list definition entirely. Requires the `allowdelete` flag to be set to true
282
+ * in the request body. The list must exist.
283
+ *
284
+ * **Required scope:** `delete:lists`
285
+ *
286
+ * **Error codes:**
287
+ * * `1` (Invalid Access Key) - Missing or invalid API key, or missing `delete:lists` scope
288
+ * * `8` (Missing Data) - Request body is empty
289
+ * * `9` (Request Rejected) - List does not exist, id not defined, id references a non-list profile, or allowdelete flag is missing
290
+ * * `11` (Database Error) - Failed to delete the list
291
+ * * `45` (Invalid JSON) - Request body is not valid JSON
292
+ */
293
+ export const listsDeleteList = (options) => (options.client ?? client).delete({
294
+ security: [{ scheme: 'basic', type: 'http' }],
295
+ url: '/lists',
296
+ ...options,
297
+ headers: {
298
+ 'Content-Type': 'application/json',
299
+ ...options.headers
300
+ }
301
+ });
302
+ /**
303
+ * Get All Lists
304
+ *
305
+ * Get all list definitions for the chain.
306
+ *
307
+ * Returns all communication profile list definitions (PROFILEHEADER rows where ISLIST='T').
308
+ * Each list includes its id, description, enabled status, comments, and card count.
309
+ * The response `lists` object contains list definitions keyed by id, plus a `card` field
310
+ * set to an empty string.
311
+ *
312
+ * **Required scope:** `read:lists`
313
+ *
314
+ * **Error codes:**
315
+ * * `1` (Invalid Access Key) - Missing or invalid API key, or missing `read:lists` scope
316
+ */
317
+ export const listsGetAllLists = (options) => (options?.client ?? client).get({
318
+ security: [{ scheme: 'basic', type: 'http' }],
319
+ url: '/lists',
320
+ ...options
321
+ });
322
+ /**
323
+ * Create List
324
+ *
325
+ * Create a new list definition.
326
+ *
327
+ * Creates a new communication profile list. The request body must be wrapped
328
+ * in a `lists` key. If an `id` is provided and a list with that id already exists,
329
+ * returns a request rejected error.
330
+ *
331
+ * **Required scope:** `write:lists`
332
+ *
333
+ * **Error codes:**
334
+ * * `1` (Invalid Access Key) - Missing or invalid API key, or missing `write:lists` scope
335
+ * * `8` (Missing Data) - Request body is empty
336
+ * * `9` (Request Rejected) - List id already exists, or id references a non-list profile
337
+ * * `11` (Database Error) - Failed to create the list
338
+ * * `45` (Invalid JSON) - Request body is not valid JSON
339
+ */
340
+ export const listsCreateList = (options) => (options.client ?? client).post({
341
+ security: [{ scheme: 'basic', type: 'http' }],
342
+ url: '/lists',
343
+ ...options,
344
+ headers: {
345
+ 'Content-Type': 'application/json',
346
+ ...options.headers
347
+ }
348
+ });
349
+ /**
350
+ * Update List
351
+ *
352
+ * Update an existing list definition.
353
+ *
354
+ * Updates the description, comments, and enabled status of an existing list.
355
+ * The list must already exist. The request body must be wrapped in a `lists` key.
356
+ *
357
+ * **Required scope:** `write:lists`
358
+ *
359
+ * **Error codes:**
360
+ * * `1` (Invalid Access Key) - Missing or invalid API key, or missing `write:lists` scope
361
+ * * `8` (Missing Data) - Request body is empty
362
+ * * `9` (Request Rejected) - List does not exist, id not defined, or id references a non-list profile
363
+ * * `11` (Database Error) - Failed to update the list
364
+ * * `45` (Invalid JSON) - Request body is not valid JSON
365
+ */
366
+ export const listsUpdateList = (options) => (options.client ?? client).put({
367
+ security: [{ scheme: 'basic', type: 'http' }],
368
+ url: '/lists',
369
+ ...options,
370
+ headers: {
371
+ 'Content-Type': 'application/json',
372
+ ...options.headers
373
+ }
374
+ });
375
+ /**
376
+ * Remove Card from List
377
+ *
378
+ * Remove a card from a list.
379
+ *
380
+ * Removes the specified card's membership from the list. The list must exist
381
+ * and the card must exist. Does not delete the list definition itself.
382
+ *
383
+ * **Required scope:** `delete:lists`
384
+ *
385
+ * **Error codes:**
386
+ * * `1` (Invalid Access Key) - Missing or invalid API key, or missing `delete:lists` scope
387
+ * * `4` (Not Found) - Card does not exist
388
+ * * `8` (Missing Data) - Request body is empty
389
+ * * `9` (Request Rejected) - List does not exist, id not defined, or id references a non-list profile
390
+ * * `11` (Database Error) - Failed to remove the card from the list
391
+ * * `45` (Invalid JSON) - Request body is not valid JSON
392
+ */
393
+ export const listsRemoveCardFromList = (options) => (options.client ?? client).delete({
394
+ security: [{ scheme: 'basic', type: 'http' }],
395
+ url: '/lists/{cardNumber}',
396
+ ...options,
397
+ headers: {
398
+ 'Content-Type': 'application/json',
399
+ ...options.headers
400
+ }
401
+ });
402
+ /**
403
+ * Get Lists for Card
404
+ *
405
+ * Get list definitions that a specific card belongs to.
406
+ *
407
+ * Returns only the list definitions that the specified card is a member of.
408
+ * If the card does not exist, returns a not found error.
409
+ * The response `lists` object contains list definitions keyed by id, plus a `card` field
410
+ * with the queried card number.
411
+ *
412
+ * **Required scope:** `read:lists`
413
+ *
414
+ * **Error codes:**
415
+ * * `1` (Invalid Access Key) - Missing or invalid API key, or missing `read:lists` scope
416
+ * * `4` (Not Found) - Card does not exist
417
+ */
418
+ export const listsGetCardLists = (options) => (options.client ?? client).get({
419
+ security: [{ scheme: 'basic', type: 'http' }],
420
+ url: '/lists/{cardNumber}',
421
+ ...options
422
+ });
423
+ /**
424
+ * Create List and Add Card
425
+ *
426
+ * Create a list definition and add a card to it.
427
+ *
428
+ * Creates or references a list and adds the specified card to it.
429
+ * If `id` is set and references an existing list, the card is added to that list.
430
+ * If the card does not exist, returns a not found error.
431
+ *
432
+ * **Required scope:** `write:lists`
433
+ *
434
+ * **Error codes:**
435
+ * * `1` (Invalid Access Key) - Missing or invalid API key, or missing `write:lists` scope
436
+ * * `4` (Not Found) - Card does not exist
437
+ * * `8` (Missing Data) - Request body is empty
438
+ * * `9` (Request Rejected) - Id references a non-list profile
439
+ * * `11` (Database Error) - Failed to create the list or add card
440
+ * * `45` (Invalid JSON) - Request body is not valid JSON
441
+ */
442
+ export const listsCreateListWithCard = (options) => (options.client ?? client).post({
443
+ security: [{ scheme: 'basic', type: 'http' }],
444
+ url: '/lists/{cardNumber}',
445
+ ...options,
446
+ headers: {
447
+ 'Content-Type': 'application/json',
448
+ ...options.headers
449
+ }
450
+ });
451
+ /**
452
+ * Update List with Card
453
+ *
454
+ * Update a list definition and update a card's association.
455
+ *
456
+ * Updates the list definition and associates the card with the list.
457
+ * If the card does not exist, returns a not found error.
458
+ *
459
+ * **Required scope:** `write:lists`
460
+ *
461
+ * **Error codes:**
462
+ * * `1` (Invalid Access Key) - Missing or invalid API key, or missing `write:lists` scope
463
+ * * `4` (Not Found) - Card does not exist
464
+ * * `8` (Missing Data) - Request body is empty
465
+ * * `9` (Request Rejected) - List does not exist, id not defined, or id references a non-list profile
466
+ * * `11` (Database Error) - Failed to update the list or card association
467
+ * * `45` (Invalid JSON) - Request body is not valid JSON
468
+ */
469
+ export const listsUpdateListWithCard = (options) => (options.client ?? client).put({
470
+ security: [{ scheme: 'basic', type: 'http' }],
471
+ url: '/lists/{cardNumber}',
472
+ ...options,
473
+ headers: {
474
+ 'Content-Type': 'application/json',
475
+ ...options.headers
476
+ }
477
+ });
478
+ /**
479
+ * Get Allowed Functions
480
+ *
481
+ * Get list of allowed loyalty functions for the current API key.
482
+ * Returns an object keyed by feature name, each mapping to an array of allowed HTTP methods.
483
+ *
484
+ * **Required scope:** `READ_LOYALTY`
485
+ */
486
+ export const loyaltyGetAllowedFunctions = (options) => (options?.client ?? client).get({
487
+ security: [{ scheme: 'basic', type: 'http' }],
488
+ url: '/loyalty/allowedFunctions',
489
+ ...options
490
+ });
491
+ /**
492
+ * Create Card
493
+ *
494
+ * Create a new loyalty card. If no card number is provided, one is auto-generated.
495
+ * At minimum, an email or mobile number must be provided (unless `ispos` is true).
496
+ * Additional fields may be required based on the company's compulsory field settings
497
+ * (retrievable via GET /v1/loyalty/compulsory).
498
+ */
499
+ export const loyaltyCreateCard = (options) => (options.client ?? client).post({
500
+ security: [{ scheme: 'basic', type: 'http' }],
501
+ url: '/loyalty/card',
502
+ ...options,
503
+ headers: {
504
+ 'Content-Type': 'application/json',
505
+ ...options.headers
506
+ }
507
+ });
508
+ /**
509
+ * Get Card Details
510
+ *
511
+ * Get comprehensive loyalty card information.
512
+ * Supports short codes (6-character alphanumeric codes) in place of card numbers.
513
+ * Response is returned as raw JSON without result/errormessage wrapper.
514
+ *
515
+ * Use `includeoffers` sub-path with a site code to include available offers and
516
+ * recently redeemed offers in the response.
517
+ *
518
+ * Use `format=compact` query parameter to return only essential fields.
519
+ *
520
+ * **Required scope:** `READ_LOYALTY`
521
+ *
522
+ * **Error codes:**
523
+ * - `4` (Not Found) - Card not found or invalid card length
524
+ */
525
+ export const loyaltyGetCard = (options) => (options.client ?? client).get({
526
+ security: [{ scheme: 'basic', type: 'http' }],
527
+ url: '/loyalty/card/{cardNumber}',
528
+ ...options
529
+ });
530
+ /**
531
+ * Update Card
532
+ *
533
+ * Update an existing loyalty card's details. The card number is provided in the URL path.
534
+ * Fields may be required based on the company's compulsory field settings
535
+ * (retrievable via GET /v1/loyalty/compulsory).
536
+ * Checks for duplicate email and mobile against other cards.
537
+ *
538
+ * **Required scope:** `WRITE_LOYALTY`
539
+ */
540
+ export const loyaltyUpdateCard = (options) => (options.client ?? client).put({
541
+ security: [{ scheme: 'basic', type: 'http' }],
542
+ url: '/loyalty/card/{cardNumber}',
543
+ ...options,
544
+ headers: {
545
+ 'Content-Type': 'application/json',
546
+ ...options.headers
547
+ }
548
+ });
549
+ /**
550
+ * Activate Card
551
+ *
552
+ * Activate a loyalty card. Sets PURGED to false and CARDACTIVE to true.
553
+ * No request body required.
554
+ *
555
+ * **Required scope:** `WRITE_LOYALTY`
556
+ */
557
+ export const loyaltyActivateCard = (options) => (options.client ?? client).put({
558
+ security: [{ scheme: 'basic', type: 'http' }],
559
+ url: '/loyalty/card/{cardNumber}/activate',
560
+ ...options
561
+ });
562
+ /**
563
+ * Update Address
564
+ *
565
+ * Update billing and/or shipping address for a loyalty card in a single call.
566
+ * At least one of billing, shipping, or deliveryinstruction must be provided.
567
+ *
568
+ * **Required scope:** `WRITE_LOYALTY`
569
+ */
570
+ export const loyaltyUpdateAddress = (options) => (options.client ?? client).put({
571
+ security: [{ scheme: 'basic', type: 'http' }],
572
+ url: '/loyalty/card/{cardNumber}/address',
573
+ ...options,
574
+ headers: {
575
+ 'Content-Type': 'application/json',
576
+ ...options.headers
577
+ }
578
+ });
579
+ /**
580
+ * Update Billing Address
581
+ *
582
+ * Update billing address for a loyalty card. Also updates the postcode on the loyalty record.
583
+ *
584
+ * **Required scope:** `WRITE_LOYALTY`
585
+ */
586
+ export const loyaltyUpdateBillingAddress = (options) => (options.client ?? client).put({
587
+ security: [{ scheme: 'basic', type: 'http' }],
588
+ url: '/loyalty/card/{cardNumber}/billingaddress',
589
+ ...options,
590
+ headers: {
591
+ 'Content-Type': 'application/json',
592
+ ...options.headers
593
+ }
594
+ });
595
+ /**
596
+ * Deactivate Card
597
+ *
598
+ * Deactivate a loyalty card. Sets PURGED to true and CARDACTIVE to false.
599
+ * No request body required.
600
+ *
601
+ * **Required scope:** `WRITE_LOYALTY`
602
+ */
603
+ export const loyaltyDeactivateCard = (options) => (options.client ?? client).put({
604
+ security: [{ scheme: 'basic', type: 'http' }],
605
+ url: '/loyalty/card/{cardNumber}/deactivate',
606
+ ...options
607
+ });
608
+ /**
609
+ * Update Groups
610
+ *
611
+ * Update loyalty groups assigned to a card. Groups are non-purchase loyalty groups.
612
+ * Use the optional `/delete` sub-path to remove groups instead of adding them.
613
+ *
614
+ * **Required scope:** `WRITE_LOYALTY`
615
+ */
616
+ export const loyaltyUpdateGroups = (options) => (options.client ?? client).put({
617
+ security: [{ scheme: 'basic', type: 'http' }],
618
+ url: '/loyalty/card/{cardNumber}/groups',
619
+ ...options,
620
+ headers: {
621
+ 'Content-Type': 'application/json',
622
+ ...options.headers
623
+ }
624
+ });
625
+ /**
626
+ * Update External User ID
627
+ *
628
+ * Update the external user ID and/or username for a loyalty card.
629
+ *
630
+ * **Required scope:** `WRITE_LOYALTY`
631
+ */
632
+ export const loyaltyUpdateExternalUserId = (options) => (options.client ?? client).put({
633
+ security: [{ scheme: 'basic', type: 'http' }],
634
+ url: '/loyalty/card/{cardNumber}/idchange',
635
+ ...options,
636
+ headers: {
637
+ 'Content-Type': 'application/json',
638
+ ...options.headers
639
+ }
640
+ });
641
+ /**
642
+ * Get Card Details with Offers
643
+ *
644
+ * Get comprehensive loyalty card information with available offers.
645
+ * The site code determines which offers are available. Includes both
646
+ * available offers and recently redeemed offers in the response.
647
+ *
648
+ * **Required scope:** `READ_LOYALTY`
649
+ *
650
+ * **Error codes:**
651
+ * - `4` (Not Found) - Card not found or invalid card length
652
+ */
653
+ export const loyaltyGetCardWithOffers = (options) => (options.client ?? client).get({
654
+ security: [{ scheme: 'basic', type: 'http' }],
655
+ url: '/loyalty/card/{cardNumber}/includeoffers/{siteCode}',
656
+ ...options
657
+ });
658
+ /**
659
+ * Update Member Groups
660
+ *
661
+ * Update member (purchase) groups assigned to a card.
662
+ * Use the optional `/delete` sub-path to remove groups instead of adding them.
663
+ *
664
+ * **Required scope:** `WRITE_LOYALTY`
665
+ */
666
+ export const loyaltyUpdateMemberGroups = (options) => (options.client ?? client).put({
667
+ security: [{ scheme: 'basic', type: 'http' }],
668
+ url: '/loyalty/card/{cardNumber}/membergroups',
669
+ ...options,
670
+ headers: {
671
+ 'Content-Type': 'application/json',
672
+ ...options.headers
673
+ }
674
+ });
675
+ /**
676
+ * Update Card PIN
677
+ *
678
+ * Update the PIN for a loyalty card.
679
+ *
680
+ * **Required scope:** `WRITE_LOYALTY`
681
+ */
682
+ export const loyaltyUpdateCardPin = (options) => (options.client ?? client).put({
683
+ security: [{ scheme: 'basic', type: 'http' }],
684
+ url: '/loyalty/card/{cardNumber}/pin',
685
+ ...options,
686
+ headers: {
687
+ 'Content-Type': 'application/json',
688
+ ...options.headers
689
+ }
690
+ });
691
+ /**
692
+ * Update Points
693
+ *
694
+ * Award or redeem points on a loyalty card. Use positive points to award, negative to redeem.
695
+ * When redeeming (negative points), the amount represents the redemption value.
696
+ *
697
+ * **Required scope:** `WRITE_LOYALTY`
698
+ */
699
+ export const loyaltyUpdatePoints = (options) => (options.client ?? client).put({
700
+ security: [{ scheme: 'basic', type: 'http' }],
701
+ url: '/loyalty/card/{cardNumber}/points',
702
+ ...options,
703
+ headers: {
704
+ 'Content-Type': 'application/json',
705
+ ...options.headers
706
+ }
707
+ });
708
+ /**
709
+ * Renew Card
710
+ *
711
+ * Process card renewal with payment via Stripe. Extends the card expiry date
712
+ * based on the card type's configured renewal period (in years).
713
+ *
714
+ * **Required scope:** `WRITE_LOYALTY`
715
+ */
716
+ export const loyaltyRenewCard = (options) => (options.client ?? client).put({
717
+ security: [{ scheme: 'basic', type: 'http' }],
718
+ url: '/loyalty/card/{cardNumber}/renewal',
719
+ ...options,
720
+ headers: {
721
+ 'Content-Type': 'application/json',
722
+ ...options.headers
723
+ }
724
+ });
725
+ /**
726
+ * Update Shipping Address
727
+ *
728
+ * Update shipping address for a loyalty card.
729
+ *
730
+ * **Required scope:** `WRITE_LOYALTY`
731
+ */
732
+ export const loyaltyUpdateShippingAddress = (options) => (options.client ?? client).put({
733
+ security: [{ scheme: 'basic', type: 'http' }],
734
+ url: '/loyalty/card/{cardNumber}/shippingaddress',
735
+ ...options,
736
+ headers: {
737
+ 'Content-Type': 'application/json',
738
+ ...options.headers
739
+ }
740
+ });
741
+ /**
742
+ * Generate Short Code
743
+ *
744
+ * Generate a new short code for a loyalty card. The short code is generated server-side
745
+ * and returned along with the card's public ID and wallet link.
746
+ *
747
+ * **Required scope:** `WRITE_LOYALTY`
748
+ */
749
+ export const loyaltyGenerateShortCode = (options) => (options.client ?? client).put({
750
+ security: [{ scheme: 'basic', type: 'http' }],
751
+ url: '/loyalty/card/{cardNumber}/shortcode',
752
+ ...options
753
+ });
754
+ /**
755
+ * Update Card Token
756
+ *
757
+ * Update the push notification token for a loyalty card. Can also optionally
758
+ * update card type, external user ID, and username.
759
+ *
760
+ * **Required scope:** `WRITE_LOYALTY`
761
+ */
762
+ export const loyaltyUpdateCardToken = (options) => (options.client ?? client).put({
763
+ security: [{ scheme: 'basic', type: 'http' }],
764
+ url: '/loyalty/card/{cardNumber}/token',
765
+ ...options,
766
+ headers: {
767
+ 'Content-Type': 'application/json',
768
+ ...options.headers
769
+ }
770
+ });
771
+ /**
772
+ * Get Card Types
773
+ *
774
+ * Get available loyalty card types.
775
+ * Response uses `cardTypes` key (camelCase). The `version` and `loyaltyVersion` fields
776
+ * are embedded as pseudo-elements inside the cardTypes array.
777
+ * Response is returned as raw JSON without result/errormessage wrapper.
778
+ *
779
+ * **Required scope:** `READ_LOYALTY`
780
+ */
781
+ export const loyaltyGetCardTypes = (options) => (options?.client ?? client).get({
782
+ security: [{ scheme: 'basic', type: 'http' }],
783
+ url: '/loyalty/cardtypes',
784
+ ...options
785
+ });
786
+ /**
787
+ * Get Coffee Card Stats
788
+ *
789
+ * Get coffee card statistics for offers.
790
+ * Returns progress towards coffee card offers (offers with a promotion group).
791
+ * Card number must be between 5 and 25 characters.
792
+ * Response is a raw JSON array (no wrapper object).
793
+ *
794
+ * **Required scope:** `READ_LOYALTY`
795
+ *
796
+ * **Error codes:**
797
+ * - `8` (Missing Data) - Invalid site or invalid card
798
+ * - `9` (Request Rejected) - Card number too short (< 5) or too long (> 25)
799
+ */
800
+ export const loyaltyGetCoffeeCardStats = (options) => (options.client ?? client).get({
801
+ security: [{ scheme: 'basic', type: 'http' }],
802
+ url: '/loyalty/coffeecard/{cardNumber}',
803
+ ...options
804
+ });
805
+ /**
806
+ * Get Compulsory Fields
807
+ *
808
+ * Get compulsory field configuration.
809
+ * Response is returned as raw JSON without result/errormessage wrapper.
810
+ *
811
+ * **Required scope:** `READ_LOYALTY`
812
+ */
813
+ export const loyaltyGetCompulsoryFields = (options) => (options?.client ?? client).get({
814
+ security: [{ scheme: 'basic', type: 'http' }],
815
+ url: '/loyalty/compulsory',
816
+ ...options
817
+ });
818
+ /**
819
+ * Get Loyalty Groups
820
+ *
821
+ * Get available loyalty groups (non-purchase groups).
822
+ * Response uses `cardGroups` key. The `version` and `loyaltyVersion` fields
823
+ * are embedded as pseudo-elements inside the cardGroups array.
824
+ * Response is returned as raw JSON without result/errormessage wrapper.
825
+ *
826
+ * **Required scope:** `READ_LOYALTY`
827
+ *
828
+ * **Error codes:**
829
+ * - `4` (Not Found) - No groups found
830
+ */
831
+ export const loyaltyGetGroups = (options) => (options?.client ?? client).get({
832
+ security: [{ scheme: 'basic', type: 'http' }],
833
+ url: '/loyalty/groups',
834
+ ...options
835
+ });
836
+ /**
837
+ * Get Card Image
838
+ *
839
+ * Get loyalty card barcode image URL.
840
+ * Card number must be between 5 and 13 characters.
841
+ * Response is returned as raw JSON without result/errormessage wrapper.
842
+ *
843
+ * **Required scope:** `READ_LOYALTY`
844
+ */
845
+ export const loyaltyGetCardImage = (options) => (options.client ?? client).get({
846
+ security: [{ scheme: 'basic', type: 'http' }],
847
+ url: '/loyalty/image/{cardNumber}',
848
+ ...options
849
+ });
850
+ /**
851
+ * Get Member Groups
852
+ *
853
+ * Get available member groups (purchase groups).
854
+ * Response uses `membergroups` key. The `version` and `loyaltyVersion` fields
855
+ * are embedded as pseudo-elements inside the membergroups array.
856
+ * Response is returned as raw JSON without result/errormessage wrapper.
857
+ *
858
+ * **Required scope:** `READ_LOYALTY`
859
+ *
860
+ * **Error codes:**
861
+ * - `4` (Not Found) - No groups found
862
+ */
863
+ export const loyaltyGetMemberGroups = (options) => (options?.client ?? client).get({
864
+ security: [{ scheme: 'basic', type: 'http' }],
865
+ url: '/loyalty/membergroups',
866
+ ...options
867
+ });
868
+ /**
869
+ * Calculate Points for Items
870
+ *
871
+ * Calculate points for a transaction with line items.
872
+ * Returns the calculated points for the given items and total.
873
+ * Body is wrapped in a `card` key.
874
+ *
875
+ * **Required scope:** `WRITE_LOYALTY`
876
+ */
877
+ export const loyaltyCreatePointsTransaction = (options) => (options.client ?? client).post({
878
+ security: [{ scheme: 'basic', type: 'http' }],
879
+ url: '/loyalty/points',
880
+ ...options,
881
+ headers: {
882
+ 'Content-Type': 'application/json',
883
+ ...options.headers
884
+ }
885
+ });
886
+ /**
887
+ * Recover Card PIN
888
+ *
889
+ * Trigger password/PIN recovery for a loyalty card. Sends a recovery email
890
+ * to the card's registered email address. If the card has no PIN set,
891
+ * a random one is generated first.
892
+ *
893
+ * **Required scope:** `READ_LOYALTY`
894
+ *
895
+ * **Error codes:**
896
+ * - `0` (OK) - Recovery email sent successfully
897
+ * - `4` (Not Found) - Card not found, invalid card length, no email on file, or email marked as bad
898
+ */
899
+ export const loyaltyGetCardRecovery = (options) => (options.client ?? client).get({
900
+ security: [{ scheme: 'basic', type: 'http' }],
901
+ url: '/loyalty/recover/{cardNumber}',
902
+ ...options
903
+ });
904
+ /**
905
+ * Search Cards
906
+ *
907
+ * Search for loyalty cards by various criteria.
908
+ * The search term can be passed either as a query string parameter or
909
+ * as the 4th path segment (e.g., `/search/mobile/0412345678`).
910
+ * Also supports short codes (6-character alphanumeric codes) as the search term,
911
+ * which are automatically detected regardless of command.
912
+ * Response is returned as raw JSON without result/errormessage wrapper.
913
+ *
914
+ * **Required scope:** `READ_LOYALTY`
915
+ *
916
+ * **Supported search commands:**
917
+ * - `card` - Search by card number (partial match)
918
+ * - `cardmatch` - Exact card number match
919
+ * - `customernumber` - Search by customer number (partial match)
920
+ * - `first` - Search by first name (partial match)
921
+ * - `last` - Search by last name (partial match)
922
+ * - `name` - Search by full name (supports "surname, firstname" or single term)
923
+ * - `email` - Search by email (partial match)
924
+ * - `emailmatch` - Exact email match
925
+ * - `username` - Exact username match
926
+ * - `mobile` - Search by mobile (partial match, leading 0 stripped)
927
+ * - `mobilematch` - Exact mobile match (converted to E.164 format)
928
+ * - `homephone` / `phone` - Search by home phone (partial match)
929
+ * - `workphone` / `work` - Search by work phone (partial match)
930
+ * - `gender` - Filter by gender (exact match)
931
+ * - `postcode` - Search by postcode (partial match)
932
+ * - `changed` - Cards changed since date (max 3 months back)
933
+ * - `home` / `homesite` - Filter by home site code (exact match)
934
+ * - `birthmonth` - Filter by birth month (1-12)
935
+ * - `age` - Filter by age
936
+ * - `occupation` - Search by occupation (partial match)
937
+ * - `soft1` through `soft10` - Search by custom soft fields (partial match)
938
+ * - `emailopt` - Filter by email opt-in flag (T/F)
939
+ * - `smsopt` - Filter by SMS opt-in flag (T/F)
940
+ * - `cardtype` - Filter by card type
941
+ * - `pointsgreater` - Cards with points balance >= value
942
+ * - `pointsless` - Cards with points balance <= value
943
+ * - `loyaltygroup` - Cards belonging to a loyalty group ID
944
+ *
945
+ * **Error codes:**
946
+ * - `4` (Not Found) - No results found, missing search term, or invalid command
947
+ */
948
+ export const loyaltySearchCards = (options) => (options.client ?? client).get({
949
+ security: [{ scheme: 'basic', type: 'http' }],
950
+ url: '/loyalty/search/{command}',
951
+ ...options
952
+ });
953
+ /**
954
+ * Get Loyalty Settings
955
+ *
956
+ * Get loyalty system settings including card types and groups.
957
+ * Response is returned as raw JSON without result/errormessage wrapper.
958
+ *
959
+ * **Required scope:** `READ_LOYALTY`
960
+ */
961
+ export const loyaltyGetSettings = (options) => (options?.client ?? client).get({
962
+ security: [{ scheme: 'basic', type: 'http' }],
963
+ url: '/loyalty/settings',
964
+ ...options
965
+ });
966
+ /**
967
+ * Get Sync List
968
+ *
969
+ * Get loyalty sync list — returns email and card number pairs for active cards.
970
+ * Optionally filter by card type using the path parameter.
971
+ * Response uses `cards` key. The `version` and `loyaltyVersion` fields
972
+ * are embedded as pseudo-elements inside the cards array.
973
+ * Response is returned as raw JSON without result/errormessage wrapper.
974
+ *
975
+ * **Required scope:** `READ_LOYALTY`
976
+ *
977
+ * **Error codes:**
978
+ * - `4` (Not Found) - No cards found
979
+ */
980
+ export const loyaltyGetSyncList = (options) => (options?.client ?? client).get({
981
+ security: [{ scheme: 'basic', type: 'http' }],
982
+ url: '/loyalty/syncList',
983
+ ...options
984
+ });
985
+ /**
986
+ * Update Sync List
987
+ *
988
+ * Update sync list information.
989
+ *
990
+ * **Required scope:** `WRITE_LOYALTY`
991
+ */
992
+ export const loyaltyUpdateSyncList = (options) => (options.client ?? client).put({
993
+ security: [{ scheme: 'basic', type: 'http' }],
994
+ url: '/loyalty/syncList',
995
+ ...options,
996
+ headers: {
997
+ 'Content-Type': 'application/json',
998
+ ...options.headers
999
+ }
1000
+ });
1001
+ /**
1002
+ * Get Sync List by Card Type
1003
+ *
1004
+ * Get loyalty sync list filtered by card type.
1005
+ *
1006
+ * **Required scope:** `READ_LOYALTY`
1007
+ */
1008
+ export const loyaltyGetSyncListByCommand = (options) => (options.client ?? client).get({
1009
+ security: [{ scheme: 'basic', type: 'http' }],
1010
+ url: '/loyalty/syncList/{command}',
1011
+ ...options
1012
+ });
1013
+ /**
1014
+ * Verify Card
1015
+ *
1016
+ * Verify a loyalty card against a PIN and retrieve full card details if verification succeeds.
1017
+ * The card field can be a card number or an email address (if it contains `@`, lookup is by email).
1018
+ * PIN is checked against the stored PIN first, then falls back to card number, mobile, or email
1019
+ * based on company settings.
1020
+ * Response is returned as raw JSON without result/errormessage wrapper.
1021
+ *
1022
+ * **Required scope:** `WRITE_LOYALTY`
1023
+ */
1024
+ export const loyaltyVerifyCard = (options) => (options.client ?? client).post({
1025
+ security: [{ scheme: 'basic', type: 'http' }],
1026
+ url: '/loyalty/verify',
1027
+ ...options,
1028
+ headers: {
1029
+ 'Content-Type': 'application/json',
1030
+ ...options.headers
1031
+ }
1032
+ });
1033
+ /**
1034
+ * Get Wallet Link
1035
+ *
1036
+ * Get digital wallet link for a loyalty card
1037
+ */
1038
+ export const loyaltyGetWalletLink = (options) => (options.client ?? client).get({
1039
+ security: [{ scheme: 'basic', type: 'http' }],
1040
+ url: '/loyalty/wallet/{cardNumber}',
1041
+ ...options
1042
+ });
1043
+ /**
1044
+ * Create Member
1045
+ *
1046
+ * Create a new member.
1047
+ * The request body must be wrapped in a `member` key: `{"member": {...}}`.
1048
+ * Either email or mobile must be provided. If neither the member number nor
1049
+ * email/mobile is provided, returns MISSING_DATA.
1050
+ *
1051
+ * Phone numbers can be provided either as flat fields (mobile, phone, phone1)
1052
+ * or nested in a phones object ({phones: {mobile, home, work}}).
1053
+ * If phones object is provided, phones.home -> phone, phones.work -> phone1.
1054
+ *
1055
+ * If `createcard` is true, a virtual loyalty card is created.
1056
+ * If `billingtoken` or `billingcustomerid` is provided, auto-charge signup is triggered.
1057
+ *
1058
+ * **Required scope:** `WRITE_MEMBERSHIP`
1059
+ *
1060
+ * **Error codes:**
1061
+ * - `0` (OK) - Member created successfully
1062
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1063
+ * - `6` (Invalid Email) - Email format validation failed
1064
+ * - `7` (Invalid Mobile) - Mobile number too short or invalid format
1065
+ * - `8` (Missing Data) - Body missing or both email and mobile missing
1066
+ * - `11` (Database Error) - Failed to insert/update customer record
1067
+ * - `18` (Card Exists) - Member number already exists
1068
+ * - `45` (Invalid JSON) - Request body is not valid JSON
1069
+ * - `47` (Member Exists Same Email) - A member with this email already exists
1070
+ * - `48` (Member Exists Same Mobile) - A member with this mobile already exists
1071
+ */
1072
+ export const membershipCreateMember = (options) => (options.client ?? client).post({
1073
+ security: [{ scheme: 'basic', type: 'http' }],
1074
+ url: '/membership',
1075
+ ...options,
1076
+ headers: {
1077
+ 'Content-Type': 'application/json',
1078
+ ...options.headers
1079
+ }
1080
+ });
1081
+ /**
1082
+ * Get Allowed Functions
1083
+ *
1084
+ * Get list of allowed membership functions for the current API key.
1085
+ * Returns an object keyed by feature name, each mapping to an array of allowed HTTP methods.
1086
+ *
1087
+ * **Required scope:** `READ_MEMBERSHIP`
1088
+ *
1089
+ * **Error codes:**
1090
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1091
+ * - `3` (Invalid Function) - Invalid sub-function
1092
+ */
1093
+ export const membershipGetAllowedFunctions = (options) => (options?.client ?? client).get({
1094
+ security: [{ scheme: 'basic', type: 'http' }],
1095
+ url: '/membership/allowedFunctions',
1096
+ ...options
1097
+ });
1098
+ /**
1099
+ * Get Member by Card
1100
+ *
1101
+ * Get comprehensive member information by loyalty card number.
1102
+ * Looks up the customernumber from CUSTLOY by card number, then returns the
1103
+ * same full member detail as GET /membership/member/{memberNumber}.
1104
+ *
1105
+ * **Required scope:** `READ_MEMBERSHIP`
1106
+ *
1107
+ * **Error codes:**
1108
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1109
+ * - `4` (Not Found) - Card not found or member not found
1110
+ */
1111
+ export const membershipGetMemberByCard = (options) => (options.client ?? client).get({
1112
+ security: [{ scheme: 'basic', type: 'http' }],
1113
+ url: '/membership/card/{cardNumber}',
1114
+ ...options
1115
+ });
1116
+ /**
1117
+ * Update Member by Card
1118
+ *
1119
+ * Update member information via card number.
1120
+ * Route: PUT /membership/card/{cardNumber}
1121
+ *
1122
+ * Same as PUT /membership/member/{memberNumber} but looks up the member
1123
+ * by loyalty card number first. When using the card path, CUSTLOY fields
1124
+ * are also updated and group assignments can be managed.
1125
+ *
1126
+ * **Required scope:** `WRITE_MEMBERSHIP`
1127
+ */
1128
+ export const membershipUpdateMemberByCard = (options) => (options.client ?? client).put({
1129
+ security: [{ scheme: 'basic', type: 'http' }],
1130
+ url: '/membership/card/{cardNumber}',
1131
+ ...options,
1132
+ headers: {
1133
+ 'Content-Type': 'application/json',
1134
+ ...options.headers
1135
+ }
1136
+ });
1137
+ /**
1138
+ * Get Member Groups
1139
+ *
1140
+ * Get available membership groups (purchase groups).
1141
+ * Returns groups from LOYALTYGROUP where PURCHASEGROUP = 'T'.
1142
+ * Columns LINKEDCARD, LINKED_CUSTOMER_LOYALTY_ID, SHAREPER, VENUETOPAY, PURCHASEGROUP
1143
+ * are removed. IMAGEURL is renamed to `url`. All keys are lowercased.
1144
+ * The `version` and `loyaltyVersion` fields are embedded as pseudo-elements inside the groups array.
1145
+ * Both `groups` and `membergroups` sub-function paths are supported and return the same data.
1146
+ *
1147
+ * **Required scope:** `READ_MEMBERSHIP`
1148
+ *
1149
+ * **Error codes:**
1150
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1151
+ * - `4` (Not Found) - No groups found
1152
+ */
1153
+ export const membershipGetMemberGroups = (options) => (options?.client ?? client).get({
1154
+ security: [{ scheme: 'basic', type: 'http' }],
1155
+ url: '/membership/groups',
1156
+ ...options
1157
+ });
1158
+ /**
1159
+ * Get Member Details
1160
+ *
1161
+ * Get comprehensive member information by member number (customernumber).
1162
+ * Returns full member details from the CUSTOMER table, plus associated loyalty cards
1163
+ * from CUSTLOY, member groups from LOYCARDGROUP/LOYALTYGROUP, and customer orders
1164
+ * from CUSTORDER. The response does NOT include result/errormessage wrapper fields.
1165
+ *
1166
+ * The `version` and `loyaltyVersion` fields are embedded inside the member object.
1167
+ *
1168
+ * The member/{id}/search/{type}/{from}/{to} sub-path allows filtering orders by
1169
+ * date range or amount range.
1170
+ *
1171
+ * **Required scope:** `READ_MEMBERSHIP`
1172
+ *
1173
+ * **Error codes:**
1174
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1175
+ * - `4` (Not Found) - Member not found, or card number invalid (length must be 1-25)
1176
+ */
1177
+ export const membershipGetMember = (options) => (options.client ?? client).get({
1178
+ security: [{ scheme: 'basic', type: 'http' }],
1179
+ url: '/membership/member/{memberNumber}',
1180
+ ...options
1181
+ });
1182
+ /**
1183
+ * Update Member
1184
+ *
1185
+ * Update member information (general update).
1186
+ * Route: PUT /membership/member/{memberNumber}
1187
+ *
1188
+ * The request body must be wrapped in a `member` key: `{"member": {...}}`.
1189
+ * Updates the CUSTOMER record and optionally the CUSTLOY record (when using card sub-function).
1190
+ *
1191
+ * When using the `card` sub-function path, additional CUSTLOY fields are updated
1192
+ * (email, dateofbirth, firstname, lastname, mobile, phone, postcode, gender)
1193
+ * and group assignments can be managed.
1194
+ *
1195
+ * If `createcard` is true and no card exists, a virtual loyalty card is created.
1196
+ * If `billingtoken` or `billingcustomerid` is provided, auto-charge signup is triggered.
1197
+ *
1198
+ * **Required scope:** `WRITE_MEMBERSHIP`
1199
+ *
1200
+ * **Error codes:**
1201
+ * - `0` (OK) - Member updated successfully
1202
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1203
+ * - `4` (Not Found) - Member not found
1204
+ * - `8` (Missing Data) - Body missing
1205
+ * - `11` (Database Error) - Failed to update customer record
1206
+ * - `45` (Invalid JSON) - Request body is not valid JSON
1207
+ */
1208
+ export const membershipUpdateMember = (options) => (options.client ?? client).put({
1209
+ security: [{ scheme: 'basic', type: 'http' }],
1210
+ url: '/membership/member/{memberNumber}',
1211
+ ...options,
1212
+ headers: {
1213
+ 'Content-Type': 'application/json',
1214
+ ...options.headers
1215
+ }
1216
+ });
1217
+ /**
1218
+ * Activate Member
1219
+ *
1220
+ * Activate a member.
1221
+ * Route: PUT /membership/member/{memberNumber}/activate
1222
+ * Sets MEMBERSTATUS to 'A' (Active).
1223
+ * No request body is required.
1224
+ *
1225
+ * **Required scope:** `WRITE_MEMBERSHIP`
1226
+ *
1227
+ * **Error codes:**
1228
+ * - `0` (OK) - Member activated successfully
1229
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1230
+ * - `4` (Not Found) - Member not found
1231
+ * - `11` (Database Error) - Failed to update status
1232
+ */
1233
+ export const membershipActivateMember = (options) => (options.client ?? client).put({
1234
+ security: [{ scheme: 'basic', type: 'http' }],
1235
+ url: '/membership/member/{memberNumber}/activate',
1236
+ ...options
1237
+ });
1238
+ /**
1239
+ * Update Member Address
1240
+ *
1241
+ * Update member billing and/or shipping address.
1242
+ * Route: PUT /membership/member/{memberNumber}/address
1243
+ * Updates billing address, shipping address, and/or delivery instructions.
1244
+ * At least one of billing, shipping, or deliveryinstruction must be provided.
1245
+ *
1246
+ * **Required scope:** `WRITE_MEMBERSHIP`
1247
+ *
1248
+ * **Error codes:**
1249
+ * - `0` (OK) - Address updated successfully
1250
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1251
+ * - `4` (Not Found) - Member not found
1252
+ * - `8` (Missing Data) - Body missing or no address data provided
1253
+ * - `11` (Database Error) - Failed to update address
1254
+ * - `45` (Invalid JSON) - Request body is not valid JSON
1255
+ */
1256
+ export const membershipUpdateMemberAddress = (options) => (options.client ?? client).put({
1257
+ security: [{ scheme: 'basic', type: 'http' }],
1258
+ url: '/membership/member/{memberNumber}/address',
1259
+ ...options,
1260
+ headers: {
1261
+ 'Content-Type': 'application/json',
1262
+ ...options.headers
1263
+ }
1264
+ });
1265
+ /**
1266
+ * Update Billing Address
1267
+ *
1268
+ * Update member billing address only.
1269
+ * Route: PUT /membership/member/{memberNumber}/billingaddress
1270
+ *
1271
+ * **Required scope:** `WRITE_MEMBERSHIP`
1272
+ *
1273
+ * **Error codes:**
1274
+ * - `0` (OK) - Billing address updated successfully
1275
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1276
+ * - `4` (Not Found) - Member not found
1277
+ * - `8` (Missing Data) - Body missing or billing data not provided
1278
+ * - `11` (Database Error) - Failed to update billing address
1279
+ * - `45` (Invalid JSON) - Request body is not valid JSON
1280
+ */
1281
+ export const membershipUpdateBillingAddress = (options) => (options.client ?? client).put({
1282
+ security: [{ scheme: 'basic', type: 'http' }],
1283
+ url: '/membership/member/{memberNumber}/billingaddress',
1284
+ ...options,
1285
+ headers: {
1286
+ 'Content-Type': 'application/json',
1287
+ ...options.headers
1288
+ }
1289
+ });
1290
+ /**
1291
+ * Cancel Member
1292
+ *
1293
+ * Cancel a member.
1294
+ * Route: PUT /membership/member/{memberNumber}/cancel
1295
+ * Sets MEMBERSTATUS to 'C' (Cancelled).
1296
+ * No request body is required.
1297
+ *
1298
+ * **Required scope:** `WRITE_MEMBERSHIP`
1299
+ *
1300
+ * **Error codes:**
1301
+ * - `0` (OK) - Member cancelled successfully
1302
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1303
+ * - `4` (Not Found) - Member not found
1304
+ * - `11` (Database Error) - Failed to update status
1305
+ */
1306
+ export const membershipCancelMember = (options) => (options.client ?? client).put({
1307
+ security: [{ scheme: 'basic', type: 'http' }],
1308
+ url: '/membership/member/{memberNumber}/cancel',
1309
+ ...options
1310
+ });
1311
+ /**
1312
+ * Replace Credit Card
1313
+ *
1314
+ * Replace member credit card token.
1315
+ * Route: PUT /membership/member/{memberNumber}/replacecreditcard
1316
+ * Updates the TOKEN field in the CUSTOMER table with the new card token.
1317
+ *
1318
+ * **Required scope:** `WRITE_MEMBERSHIP`
1319
+ *
1320
+ * **Error codes:**
1321
+ * - `0` (OK) - Card token replaced successfully
1322
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1323
+ * - `4` (Not Found) - Member not found
1324
+ * - `8` (Missing Data) - Body missing or cardtoken field empty
1325
+ * - `11` (Database Error) - Failed to update token
1326
+ * - `45` (Invalid JSON) - Request body is not valid JSON
1327
+ */
1328
+ export const membershipReplaceCreditCard = (options) => (options.client ?? client).put({
1329
+ security: [{ scheme: 'basic', type: 'http' }],
1330
+ url: '/membership/member/{memberNumber}/replacecreditcard',
1331
+ ...options,
1332
+ headers: {
1333
+ 'Content-Type': 'application/json',
1334
+ ...options.headers
1335
+ }
1336
+ });
1337
+ /**
1338
+ * Update Shipping Address
1339
+ *
1340
+ * Update member shipping address only.
1341
+ * Route: PUT /membership/member/{memberNumber}/shippingaddress
1342
+ *
1343
+ * **Required scope:** `WRITE_MEMBERSHIP`
1344
+ *
1345
+ * **Error codes:**
1346
+ * - `0` (OK) - Shipping address updated successfully
1347
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1348
+ * - `4` (Not Found) - Member not found
1349
+ * - `8` (Missing Data) - Body missing or shipping data not provided
1350
+ * - `11` (Database Error) - Failed to update shipping address
1351
+ * - `45` (Invalid JSON) - Request body is not valid JSON
1352
+ */
1353
+ export const membershipUpdateShippingAddress = (options) => (options.client ?? client).put({
1354
+ security: [{ scheme: 'basic', type: 'http' }],
1355
+ url: '/membership/member/{memberNumber}/shippingaddress',
1356
+ ...options,
1357
+ headers: {
1358
+ 'Content-Type': 'application/json',
1359
+ ...options.headers
1360
+ }
1361
+ });
1362
+ /**
1363
+ * Suspend Member
1364
+ *
1365
+ * Suspend a member.
1366
+ * Route: PUT /membership/member/{memberNumber}/suspend
1367
+ * Sets MEMBERSTATUS to 'S' (Suspended).
1368
+ * No request body is required.
1369
+ *
1370
+ * **Required scope:** `WRITE_MEMBERSHIP`
1371
+ *
1372
+ * **Error codes:**
1373
+ * - `0` (OK) - Member suspended successfully
1374
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1375
+ * - `4` (Not Found) - Member not found
1376
+ * - `11` (Database Error) - Failed to update status
1377
+ */
1378
+ export const membershipSuspendMember = (options) => (options.client ?? client).put({
1379
+ security: [{ scheme: 'basic', type: 'http' }],
1380
+ url: '/membership/member/{memberNumber}/suspend',
1381
+ ...options
1382
+ });
1383
+ /**
1384
+ * Update Member Token
1385
+ *
1386
+ * Update member authentication token.
1387
+ * Route: PUT /membership/member/{memberNumber}/token
1388
+ * Updates the TOKEN field in the CUSTOMER table.
1389
+ *
1390
+ * **Required scope:** `WRITE_MEMBERSHIP`
1391
+ *
1392
+ * **Error codes:**
1393
+ * - `0` (OK) - Token updated successfully
1394
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1395
+ * - `4` (Not Found) - Member not found
1396
+ * - `8` (Missing Data) - Body missing
1397
+ * - `11` (Database Error) - Failed to update token
1398
+ * - `45` (Invalid JSON) - Request body is not valid JSON
1399
+ */
1400
+ export const membershipUpdateMemberToken = (options) => (options.client ?? client).put({
1401
+ security: [{ scheme: 'basic', type: 'http' }],
1402
+ url: '/membership/member/{memberNumber}/token',
1403
+ ...options,
1404
+ headers: {
1405
+ 'Content-Type': 'application/json',
1406
+ ...options.headers
1407
+ }
1408
+ });
1409
+ /**
1410
+ * Get Member Groups (alternate)
1411
+ *
1412
+ * Get available membership groups (alternate route).
1413
+ * Same as GET /membership/groups.
1414
+ *
1415
+ * **Required scope:** `READ_MEMBERSHIP`
1416
+ */
1417
+ export const membershipGetMemberGroupsAlt = (options) => (options?.client ?? client).get({
1418
+ security: [{ scheme: 'basic', type: 'http' }],
1419
+ url: '/membership/membergroups',
1420
+ ...options
1421
+ });
1422
+ /**
1423
+ * Search Members
1424
+ *
1425
+ * Search for members by various criteria.
1426
+ * Returns a simplified member record for each match (max 500 results).
1427
+ * The response does NOT include result/errormessage wrapper fields.
1428
+ * The `version` and `loyaltyVersion` fields are embedded as pseudo-elements inside the members array.
1429
+ *
1430
+ * Supported search commands:
1431
+ * - `number` or `customer` - Search by card number (LIKE match)
1432
+ * - `name` - Search by name (case-insensitive LIKE match)
1433
+ * - `email` - Search by email (case-insensitive LIKE match)
1434
+ * - `mobile` - Search by mobile number (LIKE match)
1435
+ * - `phone` - Search by home or work phone (PHONE or PHONE1, LIKE match)
1436
+ * - `gender` - Search by exact gender code
1437
+ * - `postcode` - Search by billing or shipping postcode (case-insensitive LIKE match)
1438
+ * - `changed` - Search by date changed (members changed since the given date, max 3 months back)
1439
+ * - `birthmonth` - Search by birth month (1-12)
1440
+ * - `age` - Search by age
1441
+ *
1442
+ * **Required scope:** `READ_MEMBERSHIP`
1443
+ *
1444
+ * **Error codes:**
1445
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1446
+ * - `4` (Not Found) - Missing search command, missing query string, invalid command, or no results found
1447
+ */
1448
+ export const membershipSearchMembers = (options) => (options.client ?? client).get({
1449
+ security: [{ scheme: 'basic', type: 'http' }],
1450
+ url: '/membership/search/{command}',
1451
+ ...options
1452
+ });
1453
+ /**
1454
+ * Create an Offer
1455
+ *
1456
+ * Create a new offer in the system.
1457
+ *
1458
+ * Requires scope: `write:offers`
1459
+ */
1460
+ export const offerCreate = (options) => (options.client ?? client).post({
1461
+ security: [{ scheme: 'basic', type: 'http' }],
1462
+ url: '/offer',
1463
+ ...options,
1464
+ headers: {
1465
+ 'Content-Type': 'application/json',
1466
+ ...options.headers
1467
+ }
1468
+ });
1469
+ /**
1470
+ * List Offer Redemptions
1471
+ *
1472
+ * Get a list of offer redemptions with optional date range and limit filtering.
1473
+ * Only the GET method is supported.
1474
+ *
1475
+ * Requires scope: `read:offers`
1476
+ */
1477
+ export const offerRedemptionsList = (options) => (options?.client ?? client).get({
1478
+ security: [{ scheme: 'basic', type: 'http' }],
1479
+ url: '/offer-redemptions',
1480
+ ...options
1481
+ });
1482
+ /**
1483
+ * Get Offer Coffee Card Stats
1484
+ *
1485
+ * Returns coffee card statistics for a specific offer and loyalty card, showing progress towards offer completion
1486
+ */
1487
+ export const offerGetCoffeeCardStats = (options) => (options.client ?? client).get({
1488
+ security: [{ scheme: 'basic', type: 'http' }],
1489
+ url: '/offer/coffeecard/{cardNumber}',
1490
+ ...options
1491
+ });
1492
+ /**
1493
+ * List all Offers
1494
+ *
1495
+ * List all offers or filter by a loyalty card.
1496
+ *
1497
+ * Requires scope: `read:offers`
1498
+ */
1499
+ export const offerList = (options) => (options.client ?? client).get({
1500
+ security: [{ scheme: 'basic', type: 'http' }],
1501
+ url: '/offer/list/{cardNumber}',
1502
+ ...options
1503
+ });
1504
+ /**
1505
+ * Delete an Offer
1506
+ *
1507
+ * Delete an offer from the system.
1508
+ *
1509
+ * Requires scope: `delete:offers`
1510
+ */
1511
+ export const offerDelete = (options) => (options.client ?? client).delete({
1512
+ security: [{ scheme: 'basic', type: 'http' }],
1513
+ url: '/offer/{offerId}',
1514
+ ...options
1515
+ });
1516
+ /**
1517
+ * Update an Offer
1518
+ *
1519
+ * Update an existing offer in the system.
1520
+ * You can send partial updates to this endpoint, provide only the data you wish to change.
1521
+ *
1522
+ * Requires scope: `write:offers`
1523
+ */
1524
+ export const offerUpdate = (options) => (options.client ?? client).put({
1525
+ security: [{ scheme: 'basic', type: 'http' }],
1526
+ url: '/offer/{offerId}',
1527
+ ...options,
1528
+ headers: {
1529
+ 'Content-Type': 'application/json',
1530
+ ...options.headers
1531
+ }
1532
+ });
1533
+ /**
1534
+ * Delete Order
1535
+ *
1536
+ * Delete an order (soft delete - sets status to 'D').
1537
+ *
1538
+ * Marks the order as deleted by setting ORDERSTATUS to 'D'.
1539
+ * The order record is not physically removed from the database.
1540
+ *
1541
+ * **Required scope:** `DELETE_ORDER`
1542
+ *
1543
+ * **Error codes:**
1544
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1545
+ * - `8` (Missing Data) - Body missing
1546
+ * - `9` (Request Rejected) - Order does not exist
1547
+ * - `11` (Database Error) - Database error during deletion
1548
+ * - `12` (Invalid Site) - Site not part of company
1549
+ * - `45` (Invalid JSON) - Request body is not valid JSON
1550
+ */
1551
+ export const orderDeleteOrder = (options) => (options.client ?? client).delete({
1552
+ security: [{ scheme: 'basic', type: 'http' }],
1553
+ url: '/order',
1554
+ ...options,
1555
+ headers: {
1556
+ 'Content-Type': 'application/json',
1557
+ ...options.headers
1558
+ }
1559
+ });
1560
+ /**
1561
+ * Create Order
1562
+ *
1563
+ * Create a new order.
1564
+ *
1565
+ * Creates a new customer order with line items. Either `card` or `customer`
1566
+ * (or both) must be provided. If both are provided, they must be linked to
1567
+ * the same customer.
1568
+ *
1569
+ * If the order number is omitted, one will be auto-generated. If a delivery
1570
+ * address is provided and shipping is enabled, the order may be automatically
1571
+ * shipped to distribution.
1572
+ *
1573
+ * **Required scope:** `WRITE_ORDER`
1574
+ *
1575
+ * **Error codes:**
1576
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1577
+ * - `8` (Missing Data) - Body missing, missing card/customer, no delivery address, no items
1578
+ * - `9` (Request Rejected) - Order exists, card/customer not linked, item not found, customer not found
1579
+ * - `11` (Database Error) - Database error during creation
1580
+ * - `12` (Invalid Site) - Site not part of company
1581
+ * - `45` (Invalid JSON) - Request body is not valid JSON
1582
+ */
1583
+ export const orderCreateOrder = (options) => (options.client ?? client).post({
1584
+ security: [{ scheme: 'basic', type: 'http' }],
1585
+ url: '/order',
1586
+ ...options,
1587
+ headers: {
1588
+ 'Content-Type': 'application/json',
1589
+ ...options.headers
1590
+ }
1591
+ });
1592
+ /**
1593
+ * Get Allowed Functions
1594
+ *
1595
+ * Get list of allowed order functions for the current API key.
1596
+ *
1597
+ * Returns a nested object with the API version and allowed HTTP methods
1598
+ * for each feature (allowedFunctions, settings, search).
1599
+ *
1600
+ * **Required scope:** `READ_ORDER`
1601
+ *
1602
+ * **Error codes:**
1603
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1604
+ */
1605
+ export const orderGetAllowedFunctions = (options) => (options?.client ?? client).get({
1606
+ security: [{ scheme: 'basic', type: 'http' }],
1607
+ url: '/order/allowedFunctions',
1608
+ ...options
1609
+ });
1610
+ /**
1611
+ * Search Orders
1612
+ *
1613
+ * Search for orders by various criteria.
1614
+ *
1615
+ * Returns up to 500 matching orders. The search is case-insensitive
1616
+ * for text fields. Pass site as -1 to search across all sites.
1617
+ *
1618
+ * **Required scope:** `READ_ORDER`
1619
+ *
1620
+ * **Search commands (case-insensitive):**
1621
+ * - `card` - Search by loyalty card number (partial match)
1622
+ * - `customer` - Search by customer number (partial match)
1623
+ * - `name` - Search by customer name (partial match)
1624
+ * - `email` - Search by email address (partial match)
1625
+ * - `emailmatch` - Search by exact email address
1626
+ * - `status` - Search by order status code
1627
+ * - `order` - Search by order number (partial match)
1628
+ * - `mobile` - Search by mobile number (partial match)
1629
+ * - `phone` / `homephone` - Search by home phone number (partial match)
1630
+ * - `deposit` - Search by minimum deposit amount
1631
+ * - `total` - Search by minimum order total
1632
+ * - `work` / `workphone` - Search by work phone number (partial match)
1633
+ * - `postcode` - Search by shipping postcode (partial match)
1634
+ * - `changed` - Search by modified date (max 3 months back)
1635
+ *
1636
+ * **Error codes:**
1637
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1638
+ * - `4` (Not Found) - Missing search criteria or no orders match
1639
+ */
1640
+ export const orderSearchOrders = (options) => (options.client ?? client).get({
1641
+ security: [{ scheme: 'basic', type: 'http' }],
1642
+ url: '/order/search/{command}/{query}/{site}',
1643
+ ...options
1644
+ });
1645
+ /**
1646
+ * Get Order Details
1647
+ *
1648
+ * Get order details by order number and site.
1649
+ *
1650
+ * Returns full order details including customer information, delivery
1651
+ * address, and all line items. Customer data is sourced from the
1652
+ * CUSTOMER table and includes billing/shipping addresses.
1653
+ *
1654
+ * **Required scope:** `READ_ORDER`
1655
+ *
1656
+ * **Error codes:**
1657
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1658
+ * - `4` (Not Found) - Order not found
1659
+ */
1660
+ export const orderGetOrder = (options) => (options.client ?? client).get({
1661
+ security: [{ scheme: 'basic', type: 'http' }],
1662
+ url: '/order/{orderNumber}/{site}',
1663
+ ...options
1664
+ });
1665
+ /**
1666
+ * Ping
1667
+ *
1668
+ * Use this endpoint to verify your connection and credentials to the
1669
+ * Zen server.
1670
+ */
1671
+ export const pingPing = (options) => (options?.client ?? client).get({
1672
+ security: [{ scheme: 'basic', type: 'http' }],
1673
+ url: '/ping',
1674
+ ...options
1675
+ });
1676
+ /**
1677
+ * Get Sites Information
1678
+ *
1679
+ * Get complete company and site information.
1680
+ *
1681
+ * Returns company details (from CHAIN, CHAININFO, CHAINDEFAULT, CHAINLOCALE tables)
1682
+ * along with all sites and their locations. Only the GET method is supported.
1683
+ *
1684
+ * **Required scope:** `READ_SITES`
1685
+ *
1686
+ * **Error codes:**
1687
+ * - `3` (Invalid Function) - Non-GET method used
1688
+ * - `4` (Not Found) - Company or sites not found
1689
+ */
1690
+ export const sitesGetSites = (options) => (options?.client ?? client).get({
1691
+ security: [{ scheme: 'basic', type: 'http' }],
1692
+ url: '/sites',
1693
+ ...options
1694
+ });
1695
+ /**
1696
+ * Get Stripe Configuration
1697
+ *
1698
+ * Get Stripe public key configuration.
1699
+ *
1700
+ * Returns the Stripe public key configured for the company.
1701
+ *
1702
+ * Required scope: `read:stripe`
1703
+ */
1704
+ export const stripeGetStripeConfig = (options) => (options?.client ?? client).get({
1705
+ security: [{ scheme: 'basic', type: 'http' }],
1706
+ url: '/stripe',
1707
+ ...options
1708
+ });
1709
+ /**
1710
+ * Get Transaction Details
1711
+ *
1712
+ * Get transaction details by site, location, terminal, journal and date.
1713
+ *
1714
+ * The response is returned directly via `prepareJson()` without `result`/`errormessage`
1715
+ * wrapper fields. All integer values are converted to strings.
1716
+ *
1717
+ * When `format=event` is specified, returns a JournalCreatedEvent serialization
1718
+ * instead of the standard transaction structure.
1719
+ *
1720
+ * The response conditionally includes:
1721
+ * - `customer` - when a loyalty card was used or customer data is available from POS
1722
+ * - `salesdiscount` - when a sales discount was applied
1723
+ * - `offers` - when offers were redeemed
1724
+ *
1725
+ * **Required scope:** `read:transaction`
1726
+ *
1727
+ * **Error codes:**
1728
+ * - `4` (Not Found) - Transaction basket not found
1729
+ * - `8` (Missing Data) - Required query parameters missing, or invalid site, or journal not found (event format)
1730
+ * - `12` (Invalid Site) - Site not part of company
1731
+ */
1732
+ export const transactionGetTransaction = (options) => (options.client ?? client).get({
1733
+ security: [{ scheme: 'basic', type: 'http' }],
1734
+ url: '/transaction',
1735
+ ...options
1736
+ });
1737
+ /**
1738
+ * Create Transaction
1739
+ *
1740
+ * Create a new transaction record.
1741
+ *
1742
+ * Submit a transaction from the POS terminal. The request body must be wrapped
1743
+ * in a `transaction` key. The payload shape varies depending on the scenario -
1744
+ * see the examples for common use cases including basic sales, loyalty, vouchers,
1745
+ * debtor charges, and refunds.
1746
+ *
1747
+ * **Required scope:** `write:transaction`
1748
+ *
1749
+ * **Error codes:**
1750
+ * - `0` (OK) - Transaction submitted for processing
1751
+ * - `8` (Missing Data) - Body missing, missing site/terminal/journal/date/time/operator/operatorname/operatorlogin, invalid serial number, date older than 180 days
1752
+ * - `9` (Request Rejected) - Journal already exists, same transaction pending, voucher number missing, unable to save transaction
1753
+ * - `12` (Invalid Site) - Site not part of company
1754
+ * - `45` (Invalid JSON) - Request body is not valid JSON
1755
+ */
1756
+ export const transactionCreateTransaction = (options) => (options.client ?? client).post({
1757
+ security: [{ scheme: 'basic', type: 'http' }],
1758
+ url: '/transaction',
1759
+ ...options,
1760
+ headers: {
1761
+ 'Content-Type': 'application/json',
1762
+ ...options.headers
1763
+ }
1764
+ });
1765
+ /**
1766
+ * Validate Email Address
1767
+ *
1768
+ * Validates an email address by checking:
1769
+ * 1. Email format validity
1770
+ * 2. Domain has valid MX records
1771
+ *
1772
+ * Returns detailed validation results including overall validity status.
1773
+ *
1774
+ * **Error codes:**
1775
+ * * `8` (Missing Data) - Request body is empty or `email` field is missing
1776
+ * * `3` (Invalid Function) - Request method is not POST
1777
+ */
1778
+ export const emailValidationValidateEmail = (options) => (options.client ?? client).post({
1779
+ security: [{ scheme: 'basic', type: 'http' }],
1780
+ url: '/validate-email',
1781
+ ...options,
1782
+ headers: {
1783
+ 'Content-Type': 'application/json',
1784
+ ...options.headers
1785
+ }
1786
+ });
1787
+ /**
1788
+ * Get Version Information
1789
+ *
1790
+ * Get API version information and available function sections
1791
+ */
1792
+ export const versionGetVersion = (options) => (options?.client ?? client).get({
1793
+ security: [{ scheme: 'basic', type: 'http' }],
1794
+ url: '/version',
1795
+ ...options
1796
+ });
1797
+ /**
1798
+ * Delete Voucher
1799
+ *
1800
+ * Delete (cancel) a voucher. Sets the voucher status to 'C' (Cancelled).
1801
+ *
1802
+ * Requires the voucher serial number, PIN (for verification when enabled),
1803
+ * and site code. The voucher record is not physically removed.
1804
+ *
1805
+ * Request body must be wrapped in a `voucher` key: `{"voucher": {...}}`.
1806
+ *
1807
+ * **Required scope:** `DELETE_VOUCHER`
1808
+ *
1809
+ * **Error codes:**
1810
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1811
+ * - `4` (Not Found) - Voucher not found
1812
+ * - `8` (Missing Data) - Body missing, missing serial number, missing PIN, missing site, invalid site
1813
+ * - `9` (Request Rejected) - Invalid PIN
1814
+ * - `11` (Database Error) - Database error during deletion
1815
+ * - `45` (Invalid JSON) - Request body is not valid JSON
1816
+ */
1817
+ export const voucherDeleteVoucher = (options) => (options.client ?? client).delete({
1818
+ security: [{ scheme: 'basic', type: 'http' }],
1819
+ url: '/voucher/{voucherType}',
1820
+ ...options,
1821
+ headers: {
1822
+ 'Content-Type': 'application/json',
1823
+ ...options.headers
1824
+ }
1825
+ });
1826
+ /**
1827
+ * Get Voucher Type
1828
+ *
1829
+ * Get voucher type information.
1830
+ *
1831
+ * Returns all settings for the specified voucher type from the VOUCHERTYPE table.
1832
+ * If the voucher type path segment is omitted, defaults to 'Gift'.
1833
+ *
1834
+ * **Required scope:** `READ_VOUCHER`
1835
+ *
1836
+ * **Error codes:**
1837
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1838
+ * - `4` (Not Found) - Voucher type not found
1839
+ */
1840
+ export const voucherGetVoucherType = (options) => (options.client ?? client).get({
1841
+ security: [{ scheme: 'basic', type: 'http' }],
1842
+ url: '/voucher/{voucherType}',
1843
+ ...options
1844
+ });
1845
+ /**
1846
+ * Create Voucher
1847
+ *
1848
+ * Create a new voucher. If the serial number is omitted and the company has
1849
+ * lead characters configured, a serial number will be auto-generated.
1850
+ *
1851
+ * For web vouchers (`isWebVoucher: true`), payment charge information including
1852
+ * a `processId` from the payment gateway is required. Duplicate processIds
1853
+ * will be rejected.
1854
+ *
1855
+ * Request body must be wrapped in a `voucher` key: `{"voucher": {...}}`.
1856
+ *
1857
+ * **Required scope:** `WRITE_VOUCHER`
1858
+ *
1859
+ * **Error codes:**
1860
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1861
+ * - `8` (Missing Data) - Body missing, missing amount, missing site, missing voucher number
1862
+ * - `9` (Request Rejected) - Voucher exists, invalid amount, invalid terminal, duplicate payment, missing payment info
1863
+ * - `11` (Database Error) - Database error during creation
1864
+ * - `45` (Invalid JSON) - Request body is not valid JSON
1865
+ */
1866
+ export const voucherCreateVoucher = (options) => (options.client ?? client).post({
1867
+ security: [{ scheme: 'basic', type: 'http' }],
1868
+ url: '/voucher/{voucherType}/create',
1869
+ ...options,
1870
+ headers: {
1871
+ 'Content-Type': 'application/json',
1872
+ ...options.headers
1873
+ }
1874
+ });
1875
+ /**
1876
+ * Enquire Voucher
1877
+ *
1878
+ * Enquire about a voucher's current status, balance, and transaction history.
1879
+ * Returns detailed voucher information including up to 50 most recent transactions.
1880
+ *
1881
+ * PIN verification may be required depending on company settings. POS requests
1882
+ * (`ispos: true`) bypass PIN checking. The `READ_VOUCHER_PINLESS` scope also
1883
+ * bypasses PIN checking.
1884
+ *
1885
+ * Vouchers in Cancelled (C), Locked (L), or Written Off (W) status will be rejected
1886
+ * (though for enquire, expiry is NOT checked unlike other operations).
1887
+ *
1888
+ * Request body must be wrapped in a `voucher` key: `{"voucher": {...}}`.
1889
+ *
1890
+ * **Required scope:** `WRITE_VOUCHER`
1891
+ *
1892
+ * **Voucher Status Codes:**
1893
+ *
1894
+ * | Code | Status |
1895
+ * |------|--------|
1896
+ * | A | Available |
1897
+ * | S | Sold |
1898
+ * | Z | Recharged |
1899
+ * | R | Redeemed |
1900
+ * | P | Part Redeemed |
1901
+ * | G | Given Away |
1902
+ * | C | Cancelled |
1903
+ * | L | Locked |
1904
+ * | H | Pending Sale |
1905
+ * | r | Pending Full Redeem |
1906
+ * | p | Pending Part Redeem |
1907
+ * | I | Import |
1908
+ * | W | Written Off |
1909
+ * | E | Portal Edit |
1910
+ */
1911
+ export const voucherEnquireVoucher = (options) => (options.client ?? client).post({
1912
+ security: [{ scheme: 'basic', type: 'http' }],
1913
+ url: '/voucher/{voucherType}/enquire',
1914
+ ...options,
1915
+ headers: {
1916
+ 'Content-Type': 'application/json',
1917
+ ...options.headers
1918
+ }
1919
+ });
1920
+ /**
1921
+ * Get Voucher Image
1922
+ *
1923
+ * Get voucher barcode image URL.
1924
+ *
1925
+ * Returns a URL to the barcode image for the specified voucher serial number.
1926
+ * If the image does not exist, it will be generated on demand.
1927
+ * Serial number must be between 4 and 13 characters.
1928
+ *
1929
+ * **Required scope:** `READ_VOUCHER`
1930
+ *
1931
+ * **Error codes:**
1932
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1933
+ * - `9` (Request Rejected) - Serial number length out of range (4-13 chars)
1934
+ */
1935
+ export const voucherGetVoucherImage = (options) => (options.client ?? client).get({
1936
+ security: [{ scheme: 'basic', type: 'http' }],
1937
+ url: '/voucher/{voucherType}/image/{serialNumber}',
1938
+ ...options
1939
+ });
1940
+ /**
1941
+ * Recharge Voucher
1942
+ *
1943
+ * Recharge (top up) an existing voucher with additional funds.
1944
+ *
1945
+ * For web vouchers (`isWebVoucher: true`), payment charge information including
1946
+ * a `processId` from the payment gateway is required. Duplicate payments
1947
+ * (same `processId`) will be rejected.
1948
+ *
1949
+ * Auto-recharge settings, payment option, and token are preserved from the
1950
+ * existing voucher record and cannot be changed via this endpoint.
1951
+ *
1952
+ * Supports gift recharges (`isgift: true`) where the recharge notification
1953
+ * is sent to a different recipient. Optional message fields can be included.
1954
+ *
1955
+ * PIN is not validated for recharge operations.
1956
+ *
1957
+ * Request body must be wrapped in a `voucher` key: `{"voucher": {...}}`.
1958
+ *
1959
+ * **Required scope:** `WRITE_VOUCHER`
1960
+ *
1961
+ * **Error codes:**
1962
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1963
+ * - `4` (Not Found) - Voucher not found
1964
+ * - `8` (Missing Data) - Missing amount, missing site, body missing
1965
+ * - `9` (Request Rejected) - Invalid amount, voucher expired, invalid state, invalid terminal, duplicate payment, missing payment info
1966
+ * - `11` (Database Error) - Database error during recharge
1967
+ * - `45` (Invalid JSON) - Request body is not valid JSON
1968
+ */
1969
+ export const voucherRechargeVoucher = (options) => (options.client ?? client).post({
1970
+ security: [{ scheme: 'basic', type: 'http' }],
1971
+ url: '/voucher/{voucherType}/recharge',
1972
+ ...options,
1973
+ headers: {
1974
+ 'Content-Type': 'application/json',
1975
+ ...options.headers
1976
+ }
1977
+ });
1978
+ /**
1979
+ * Redeem Voucher
1980
+ *
1981
+ * Redeem an amount from a voucher. The redemption amount must not exceed the
1982
+ * available balance. Expired, cancelled, locked, or written-off vouchers
1983
+ * cannot be redeemed.
1984
+ *
1985
+ * For POS requests (`ispos: true`), `location` and `terminal` are required
1986
+ * and a `reference` (site:terminal:journal) is included in the response.
1987
+ *
1988
+ * Request body must be wrapped in a `voucher` key: `{"voucher": {...}}`.
1989
+ *
1990
+ * **Required scope:** `WRITE_VOUCHER`
1991
+ *
1992
+ * **Error codes:**
1993
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
1994
+ * - `4` (Not Found) - Voucher not found
1995
+ * - `8` (Missing Data) - Missing amount, missing site, invalid site, body missing
1996
+ * - `9` (Request Rejected) - Invalid amount, insufficient balance, voucher expired, invalid state, invalid PIN, invalid terminal
1997
+ * - `11` (Database Error) - Database error during redemption
1998
+ * - `45` (Invalid JSON) - Request body is not valid JSON
1999
+ */
2000
+ export const voucherRedeemVoucher = (options) => (options.client ?? client).post({
2001
+ security: [{ scheme: 'basic', type: 'http' }],
2002
+ url: '/voucher/{voucherType}/redeem',
2003
+ ...options,
2004
+ headers: {
2005
+ 'Content-Type': 'application/json',
2006
+ ...options.headers
2007
+ }
2008
+ });
2009
+ /**
2010
+ * Release Voucher Reserve
2011
+ *
2012
+ * Release a previously reserved amount on a voucher, making the funds
2013
+ * available again. The release amount must not exceed the currently
2014
+ * reserved amount.
2015
+ *
2016
+ * Request body must be wrapped in a `voucher` key: `{"voucher": {...}}`.
2017
+ *
2018
+ * **Required scope:** `WRITE_VOUCHER`
2019
+ *
2020
+ * **Error codes:**
2021
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
2022
+ * - `4` (Not Found) - Voucher not found
2023
+ * - `8` (Missing Data) - Missing amount, body missing
2024
+ * - `9` (Request Rejected) - Invalid amount, release exceeds reserved, no current reserve, voucher expired, invalid state
2025
+ * - `11` (Database Error) - Database error during release
2026
+ * - `45` (Invalid JSON) - Request body is not valid JSON
2027
+ */
2028
+ export const voucherReleaseVoucher = (options) => (options.client ?? client).post({
2029
+ security: [{ scheme: 'basic', type: 'http' }],
2030
+ url: '/voucher/{voucherType}/release',
2031
+ ...options,
2032
+ headers: {
2033
+ 'Content-Type': 'application/json',
2034
+ ...options.headers
2035
+ }
2036
+ });
2037
+ /**
2038
+ * Reserve Voucher Amount
2039
+ *
2040
+ * Reserve an amount on a voucher, reducing its available balance without
2041
+ * actually redeeming it. The reserved amount can later be redeemed or released.
2042
+ *
2043
+ * The reserve amount must not exceed the current available balance
2044
+ * (value - used - pending).
2045
+ *
2046
+ * Request body must be wrapped in a `voucher` key: `{"voucher": {...}}`.
2047
+ *
2048
+ * **Required scope:** `WRITE_VOUCHER`
2049
+ *
2050
+ * **Error codes:**
2051
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
2052
+ * - `4` (Not Found) - Voucher not found
2053
+ * - `8` (Missing Data) - Missing amount, body missing
2054
+ * - `9` (Request Rejected) - Invalid amount, insufficient balance, voucher expired, invalid state, invalid PIN
2055
+ * - `11` (Database Error) - Database error during reserve
2056
+ * - `45` (Invalid JSON) - Request body is not valid JSON
2057
+ */
2058
+ export const voucherReserveVoucher = (options) => (options.client ?? client).post({
2059
+ security: [{ scheme: 'basic', type: 'http' }],
2060
+ url: '/voucher/{voucherType}/reserve',
2061
+ ...options,
2062
+ headers: {
2063
+ 'Content-Type': 'application/json',
2064
+ ...options.headers
2065
+ }
2066
+ });
2067
+ /**
2068
+ * Search Vouchers
2069
+ *
2070
+ * Search for vouchers by various criteria.
2071
+ *
2072
+ * Returns up to 150 matching vouchers. The search value is passed as the
2073
+ * raw query string (e.g., `/voucher/Gift/search/number?V12345`).
2074
+ *
2075
+ * For the non-flat endpoint, the response includes a `version` key inside
2076
+ * the `vouchers` object alongside the numeric-indexed items.
2077
+ *
2078
+ * When searching for 'Gift' type, both 'Gift' and 'GiveAway' vouchers
2079
+ * are included in results.
2080
+ *
2081
+ * **Required scope:** `READ_VOUCHER`
2082
+ *
2083
+ * **Error codes:**
2084
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
2085
+ * - `4` (Not Found) - Missing search criteria or no vouchers found
2086
+ */
2087
+ export const voucherSearchVouchers = (options) => (options.client ?? client).get({
2088
+ security: [{ scheme: 'basic', type: 'http' }],
2089
+ url: '/voucher/{voucherType}/search/{searchBy}',
2090
+ ...options
2091
+ });
2092
+ /**
2093
+ * Search Vouchers (Flat Format)
2094
+ *
2095
+ * Search for vouchers (flattened response format).
2096
+ *
2097
+ * Same as the regular search but without the `version` key in the response.
2098
+ * Returns up to 150 matching vouchers.
2099
+ *
2100
+ * **Required scope:** `READ_VOUCHER`
2101
+ *
2102
+ * **Error codes:**
2103
+ * - `1` (Invalid Access Key) - Invalid or missing API key/scope
2104
+ * - `4` (Not Found) - Missing search criteria or no vouchers found
2105
+ */
2106
+ export const voucherSearchVouchersFlat = (options) => (options.client ?? client).get({
2107
+ security: [{ scheme: 'basic', type: 'http' }],
2108
+ url: '/voucher/{voucherType}/search2/{searchBy}',
2109
+ ...options
2110
+ });
2111
+ //# sourceMappingURL=sdk.gen.js.map