@paynow-gg/typescript-sdk 1.0.61 → 2.0.1

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 (140) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +44 -5
  3. package/dist/cjs/generated/management/client.d.ts +895 -0
  4. package/dist/cjs/generated/management/client.d.ts.map +1 -0
  5. package/dist/cjs/generated/management/client.js +1568 -0
  6. package/dist/cjs/generated/management/client.js.map +1 -0
  7. package/dist/cjs/generated/management/types.d.ts +7566 -0
  8. package/dist/cjs/generated/management/types.d.ts.map +1 -0
  9. package/dist/cjs/generated/management/types.js +4 -0
  10. package/dist/cjs/generated/management/types.js.map +1 -0
  11. package/dist/cjs/generated/storefront/client.d.ts +229 -0
  12. package/dist/cjs/generated/storefront/client.d.ts.map +1 -0
  13. package/dist/cjs/generated/storefront/client.js +357 -0
  14. package/dist/cjs/generated/storefront/client.js.map +1 -0
  15. package/dist/cjs/generated/storefront/types.d.ts +3076 -0
  16. package/dist/cjs/generated/storefront/types.d.ts.map +1 -0
  17. package/dist/cjs/generated/storefront/types.js +4 -0
  18. package/dist/cjs/generated/storefront/types.js.map +1 -0
  19. package/dist/cjs/generated/webhooks/types.d.ts +3113 -0
  20. package/dist/cjs/generated/webhooks/types.d.ts.map +1 -0
  21. package/dist/cjs/generated/webhooks/types.js +4 -0
  22. package/dist/cjs/generated/webhooks/types.js.map +1 -0
  23. package/dist/cjs/index.d.ts +9 -0
  24. package/dist/cjs/index.d.ts.map +1 -0
  25. package/dist/cjs/index.js +16 -0
  26. package/dist/cjs/index.js.map +1 -0
  27. package/dist/cjs/management.d.ts +3 -0
  28. package/dist/cjs/management.d.ts.map +1 -0
  29. package/dist/cjs/management.js +22 -0
  30. package/dist/cjs/management.js.map +1 -0
  31. package/dist/cjs/package.json +3 -0
  32. package/dist/cjs/runtime/errors.d.ts +18 -0
  33. package/dist/cjs/runtime/errors.d.ts.map +1 -0
  34. package/dist/cjs/runtime/errors.js +41 -0
  35. package/dist/cjs/runtime/errors.js.map +1 -0
  36. package/dist/cjs/runtime/http.d.ts +20 -0
  37. package/dist/cjs/runtime/http.d.ts.map +1 -0
  38. package/dist/cjs/runtime/http.js +121 -0
  39. package/dist/cjs/runtime/http.js.map +1 -0
  40. package/dist/cjs/runtime/options.d.ts +12 -0
  41. package/dist/cjs/runtime/options.d.ts.map +1 -0
  42. package/dist/{types.js → cjs/runtime/options.js} +1 -1
  43. package/dist/cjs/runtime/options.js.map +1 -0
  44. package/dist/cjs/storefront.d.ts +3 -0
  45. package/dist/cjs/storefront.d.ts.map +1 -0
  46. package/dist/cjs/storefront.js +22 -0
  47. package/dist/cjs/storefront.js.map +1 -0
  48. package/dist/cjs/webhooks.d.ts +2 -0
  49. package/dist/cjs/webhooks.d.ts.map +1 -0
  50. package/dist/cjs/webhooks.js +18 -0
  51. package/dist/cjs/webhooks.js.map +1 -0
  52. package/dist/esm/generated/management/client.d.ts +895 -0
  53. package/dist/esm/generated/management/client.d.ts.map +1 -0
  54. package/dist/esm/generated/management/client.js +1531 -0
  55. package/dist/esm/generated/management/client.js.map +1 -0
  56. package/dist/esm/generated/management/types.d.ts +7566 -0
  57. package/dist/esm/generated/management/types.d.ts.map +1 -0
  58. package/dist/esm/generated/management/types.js +3 -0
  59. package/dist/esm/generated/management/types.js.map +1 -0
  60. package/dist/esm/generated/storefront/client.d.ts +229 -0
  61. package/dist/esm/generated/storefront/client.d.ts.map +1 -0
  62. package/dist/esm/generated/storefront/client.js +340 -0
  63. package/dist/esm/generated/storefront/client.js.map +1 -0
  64. package/dist/esm/generated/storefront/types.d.ts +3076 -0
  65. package/dist/esm/generated/storefront/types.d.ts.map +1 -0
  66. package/dist/esm/generated/storefront/types.js +3 -0
  67. package/dist/esm/generated/storefront/types.js.map +1 -0
  68. package/dist/esm/generated/webhooks/types.d.ts +3113 -0
  69. package/dist/esm/generated/webhooks/types.d.ts.map +1 -0
  70. package/dist/esm/generated/webhooks/types.js +3 -0
  71. package/dist/esm/generated/webhooks/types.js.map +1 -0
  72. package/dist/esm/index.d.ts +9 -0
  73. package/dist/esm/index.d.ts.map +1 -0
  74. package/dist/esm/index.js +5 -0
  75. package/dist/esm/index.js.map +1 -0
  76. package/dist/esm/management.d.ts +3 -0
  77. package/dist/esm/management.d.ts.map +1 -0
  78. package/dist/esm/management.js +3 -0
  79. package/dist/esm/management.js.map +1 -0
  80. package/dist/esm/package.json +3 -0
  81. package/dist/esm/runtime/errors.d.ts +18 -0
  82. package/dist/esm/runtime/errors.d.ts.map +1 -0
  83. package/dist/esm/runtime/errors.js +36 -0
  84. package/dist/esm/runtime/errors.js.map +1 -0
  85. package/dist/esm/runtime/http.d.ts +20 -0
  86. package/dist/esm/runtime/http.d.ts.map +1 -0
  87. package/dist/esm/runtime/http.js +117 -0
  88. package/dist/esm/runtime/http.js.map +1 -0
  89. package/dist/esm/runtime/options.d.ts +12 -0
  90. package/dist/esm/runtime/options.d.ts.map +1 -0
  91. package/dist/esm/runtime/options.js +2 -0
  92. package/dist/esm/runtime/options.js.map +1 -0
  93. package/dist/esm/storefront.d.ts +3 -0
  94. package/dist/esm/storefront.d.ts.map +1 -0
  95. package/dist/esm/storefront.js +3 -0
  96. package/dist/esm/storefront.js.map +1 -0
  97. package/dist/esm/webhooks.d.ts +2 -0
  98. package/dist/esm/webhooks.d.ts.map +1 -0
  99. package/dist/esm/webhooks.js +2 -0
  100. package/dist/esm/webhooks.js.map +1 -0
  101. package/package.json +74 -15
  102. package/dist/client.d.ts +0 -73
  103. package/dist/client.d.ts.map +0 -1
  104. package/dist/client.js +0 -55
  105. package/dist/client.js.map +0 -1
  106. package/dist/errors.d.ts +0 -7
  107. package/dist/errors.d.ts.map +0 -1
  108. package/dist/errors.js +0 -14
  109. package/dist/errors.js.map +0 -1
  110. package/dist/generate.d.ts +0 -2
  111. package/dist/generate.d.ts.map +0 -1
  112. package/dist/generate.js +0 -102
  113. package/dist/generate.js.map +0 -1
  114. package/dist/generated/management.d.ts +0 -12767
  115. package/dist/generated/management.d.ts.map +0 -1
  116. package/dist/generated/management.js +0 -638
  117. package/dist/generated/management.js.map +0 -1
  118. package/dist/generated/storefront.d.ts +0 -3464
  119. package/dist/generated/storefront.d.ts.map +0 -1
  120. package/dist/generated/storefront.js +0 -90
  121. package/dist/generated/storefront.js.map +0 -1
  122. package/dist/generated/webhooks.d.ts +0 -3659
  123. package/dist/generated/webhooks.d.ts.map +0 -1
  124. package/dist/generated/webhooks.js +0 -5
  125. package/dist/generated/webhooks.js.map +0 -1
  126. package/dist/index.d.ts +0 -12
  127. package/dist/index.d.ts.map +0 -1
  128. package/dist/index.js +0 -10
  129. package/dist/index.js.map +0 -1
  130. package/dist/management.d.ts +0 -7
  131. package/dist/management.d.ts.map +0 -1
  132. package/dist/management.js +0 -12
  133. package/dist/management.js.map +0 -1
  134. package/dist/storefront.d.ts +0 -7
  135. package/dist/storefront.d.ts.map +0 -1
  136. package/dist/storefront.js +0 -13
  137. package/dist/storefront.js.map +0 -1
  138. package/dist/types.d.ts +0 -12
  139. package/dist/types.d.ts.map +0 -1
  140. package/dist/types.js.map +0 -1
@@ -0,0 +1,1531 @@
1
+ // Generated from OpenAPI spec. Do not edit by hand.
2
+ import { HttpClient } from "../../runtime/http.js";
3
+ export class AffiliateLinksResource {
4
+ http;
5
+ constructor(http) {
6
+ this.http = http;
7
+ }
8
+ createAffiliateLink(body, opts) {
9
+ return this.http.request("POST", "/v1/stores/{storeId}/affiliate-links", {
10
+ body,
11
+ opts,
12
+ });
13
+ }
14
+ deleteAffiliateLink(affiliateLinkId, opts) {
15
+ return this.http.request("DELETE", "/v1/stores/{storeId}/affiliate-links/{affiliateLinkId}", { path: { affiliateLinkId }, opts });
16
+ }
17
+ getAffiliateLink(affiliateLinkId, opts) {
18
+ return this.http.request("GET", "/v1/stores/{storeId}/affiliate-links/{affiliateLinkId}", { path: { affiliateLinkId }, opts });
19
+ }
20
+ getAffiliateLinks(opts) {
21
+ return this.http.request("GET", "/v1/stores/{storeId}/affiliate-links", { opts });
22
+ }
23
+ updateAffiliateLink(affiliateLinkId, body, opts) {
24
+ return this.http.request("PATCH", "/v1/stores/{storeId}/affiliate-links/{affiliateLinkId}", { path: { affiliateLinkId }, body, opts });
25
+ }
26
+ }
27
+ export class BansResource {
28
+ http;
29
+ constructor(http) {
30
+ this.http = http;
31
+ }
32
+ checkForBanByIdentities(body, opts) {
33
+ return this.http.request("POST", "/v1/stores/{storeId}/bans/check", { body, opts });
34
+ }
35
+ createBan(body, opts) {
36
+ return this.http.request("POST", "/v1/stores/{storeId}/bans", { body, opts });
37
+ }
38
+ deleteBan(banId, opts) {
39
+ return this.http.request("DELETE", "/v1/stores/{storeId}/bans/{banId}", {
40
+ path: { banId },
41
+ opts,
42
+ });
43
+ }
44
+ getBan(banId, opts) {
45
+ return this.http.request("GET", "/v1/stores/{storeId}/bans/{banId}", {
46
+ path: { banId },
47
+ opts,
48
+ });
49
+ }
50
+ getBans(query, opts) {
51
+ return this.http.request("GET", "/v1/stores/{storeId}/bans", { query, opts });
52
+ }
53
+ updateBan(banId, body, opts) {
54
+ return this.http.request("PATCH", "/v1/stores/{storeId}/bans/{banId}", {
55
+ path: { banId },
56
+ body,
57
+ opts,
58
+ });
59
+ }
60
+ }
61
+ export class CheckoutResource {
62
+ http;
63
+ constructor(http) {
64
+ this.http = http;
65
+ }
66
+ /**
67
+ * Create a checkout session
68
+ *
69
+ * Creates a checkout session from a secure server using an API Key.
70
+ * If you have a Customer token, see the Storefront API Create Checkout endpoint.
71
+ */
72
+ createCheckoutSession(body, opts) {
73
+ return this.http.request("POST", "/v1/stores/{storeId}/checkouts", { body, opts });
74
+ }
75
+ }
76
+ export class CouponsResource {
77
+ http;
78
+ constructor(http) {
79
+ this.http = http;
80
+ }
81
+ createCouponForStore(body, opts) {
82
+ return this.http.request("POST", "/v1/stores/{storeId}/coupons", { body, opts });
83
+ }
84
+ /**
85
+ * Deletes a coupon
86
+ */
87
+ deleteCouponForStore(couponId, opts) {
88
+ return this.http.request("DELETE", "/v1/stores/{storeId}/coupons/{couponId}", {
89
+ path: { couponId },
90
+ opts,
91
+ });
92
+ }
93
+ /**
94
+ * Retrieves a coupon by ID
95
+ */
96
+ getCouponByIdForStore(couponId, opts) {
97
+ return this.http.request("GET", "/v1/stores/{storeId}/coupons/{couponId}", {
98
+ path: { couponId },
99
+ opts,
100
+ });
101
+ }
102
+ /**
103
+ * Fetches all coupons for a store id
104
+ */
105
+ getCouponsForStore(query, opts) {
106
+ return this.http.request("GET", "/v1/stores/{storeId}/coupons", {
107
+ query,
108
+ opts,
109
+ });
110
+ }
111
+ /**
112
+ * Performs a Delta Update of a Coupon
113
+ */
114
+ updateCouponForStore(couponId, body, opts) {
115
+ return this.http.request("PATCH", "/v1/stores/{storeId}/coupons/{couponId}", {
116
+ path: { couponId },
117
+ body,
118
+ opts,
119
+ });
120
+ }
121
+ }
122
+ export class CustomerPortalSessionsResource {
123
+ http;
124
+ constructor(http) {
125
+ this.http = http;
126
+ }
127
+ /**
128
+ * Create a customer portal session
129
+ *
130
+ * Creates a customer portal session from a secure server using an API Key.
131
+ * The returned session contains the token and URL to hand to the customer.
132
+ * @param customerId The ID of the customer to create the portal session for.
133
+ */
134
+ createCustomerPortalSession(customerId, body, opts) {
135
+ return this.http.request("POST", "/v1/stores/{storeId}/customers/{customerId}/portal-sessions", { path: { customerId }, body, opts });
136
+ }
137
+ }
138
+ export class CustomersResource {
139
+ http;
140
+ constructor(http) {
141
+ this.http = http;
142
+ }
143
+ /**
144
+ * Bulk create customers
145
+ *
146
+ * Creates up to 200 customers at once.
147
+ */
148
+ bulkCreateCustomers(body, opts) {
149
+ return this.http.request("POST", "/v1/stores/{storeId}/customers/bulk", {
150
+ body,
151
+ opts,
152
+ });
153
+ }
154
+ /**
155
+ * Create customer
156
+ *
157
+ * Creates a new customer based on the fields passed.
158
+ */
159
+ createCustomer(body, opts) {
160
+ return this.http.request("POST", "/v1/stores/{storeId}/customers", { body, opts });
161
+ }
162
+ /**
163
+ * Create customer token
164
+ *
165
+ * Generates a customer token that can be used by the Storefront (Headless) API.
166
+ * @param customerId The ID of the customer to generate the customer token for.
167
+ */
168
+ createCustomerToken(customerId, opts) {
169
+ return this.http.request("POST", "/v1/stores/{storeId}/customers/{customerId}/tokens", { path: { customerId }, opts });
170
+ }
171
+ /**
172
+ * Get customer by ID
173
+ *
174
+ * Retrieves a customer by the ID for the specified store.
175
+ * @param customerId The ID of the customer.
176
+ */
177
+ getCustomerById(customerId, opts) {
178
+ return this.http.request("GET", "/v1/stores/{storeId}/customers/{customerId}", {
179
+ path: { customerId },
180
+ opts,
181
+ });
182
+ }
183
+ /**
184
+ * Get customers
185
+ *
186
+ * Retrieves all customers for the specified store.
187
+ */
188
+ getCustomers(query, opts) {
189
+ return this.http.request("GET", "/v1/stores/{storeId}/customers", {
190
+ query,
191
+ opts,
192
+ });
193
+ }
194
+ /**
195
+ * Invalidate customer tokens
196
+ *
197
+ * Invalidates all generated customer tokens.
198
+ * @param customerId The ID of the customer to invalidate the customer tokens for.
199
+ */
200
+ invalidateCustomerTokens(customerId, opts) {
201
+ return this.http.request("DELETE", "/v1/stores/{storeId}/customers/{customerId}/tokens", {
202
+ path: { customerId },
203
+ opts,
204
+ });
205
+ }
206
+ /**
207
+ * Lookup customer
208
+ *
209
+ * Looks up a customer by an external platform ID.
210
+ */
211
+ lookupCustomer(query, opts) {
212
+ return this.http.request("GET", "/v1/stores/{storeId}/customers/lookup", {
213
+ query,
214
+ opts,
215
+ });
216
+ }
217
+ /**
218
+ * Update customer
219
+ *
220
+ * Updates an existing customer based on the fields passed.
221
+ */
222
+ updateCustomer(customerId, body, opts) {
223
+ return this.http.request("PATCH", "/v1/stores/{storeId}/customers/{customerId}", {
224
+ path: { customerId },
225
+ body,
226
+ opts,
227
+ });
228
+ }
229
+ }
230
+ export class CustomVariablesResource {
231
+ http;
232
+ constructor(http) {
233
+ this.http = http;
234
+ }
235
+ /**
236
+ * Create custom variable
237
+ *
238
+ * Creates a new custom variable for the specified store.
239
+ * Custom variables allow customers to provide additional input when purchasing products.
240
+ */
241
+ createCustomVariableForStore(body, opts) {
242
+ return this.http.request("POST", "/v1/stores/{storeId}/custom-variables", {
243
+ body,
244
+ opts,
245
+ });
246
+ }
247
+ /**
248
+ * Delete custom variable
249
+ *
250
+ * Deletes a custom variable from the specified store.
251
+ * This will also delete all associated options and cannot be undone.
252
+ * @param customVariableId The ID of the custom variable to delete.
253
+ */
254
+ deleteCustomVariableForStore(customVariableId, opts) {
255
+ return this.http.request("DELETE", "/v1/stores/{storeId}/custom-variables/{customVariableId}", { path: { customVariableId }, opts });
256
+ }
257
+ /**
258
+ * Get custom variable
259
+ *
260
+ * Retrieves a specific custom variable by ID from the specified store.
261
+ * @param customVariableId The ID of the custom variable to retrieve.
262
+ */
263
+ getCustomVariableByIdForStore(customVariableId, opts) {
264
+ return this.http.request("GET", "/v1/stores/{storeId}/custom-variables/{customVariableId}", { path: { customVariableId }, opts });
265
+ }
266
+ /**
267
+ * Get custom variables
268
+ *
269
+ * Retrieves all custom variables for the specified store.
270
+ */
271
+ getCustomVariablesForStore(opts) {
272
+ return this.http.request("GET", "/v1/stores/{storeId}/custom-variables", { opts });
273
+ }
274
+ /**
275
+ * Update custom variable
276
+ *
277
+ * Performs a partial update of a custom variable using field mask.
278
+ * Only the fields specified in the request will be updated.
279
+ * @param customVariableId The ID of the custom variable to update.
280
+ */
281
+ updateCustomVariableForStore(customVariableId, body, opts) {
282
+ return this.http.request("PATCH", "/v1/stores/{storeId}/custom-variables/{customVariableId}", { path: { customVariableId }, body, opts });
283
+ }
284
+ }
285
+ export class DataMigrationsResource {
286
+ http;
287
+ constructor(http) {
288
+ this.http = http;
289
+ }
290
+ getDataMigrations(query, opts) {
291
+ return this.http.request("GET", "/v1/stores/{storeId}/data-migrations", { query, opts });
292
+ }
293
+ startDataMigrationFromTebex(body, opts) {
294
+ return this.http.request("POST", "/v1/stores/{storeId}/data-migrations/tebex", { body, opts });
295
+ }
296
+ }
297
+ export class DeliveryResource {
298
+ http;
299
+ constructor(http) {
300
+ this.http = http;
301
+ }
302
+ /**
303
+ * Assign a delivery item to a customer
304
+ *
305
+ * Allows you to assign a delivery item to a customer
306
+ */
307
+ assignDeliveryItem(customerId, body, opts) {
308
+ return this.http.request("POST", "/v1/stores/{storeId}/customers/{customerId}/delivery/items", { path: { customerId }, body, opts });
309
+ }
310
+ /**
311
+ * Assign delivery items in bulk
312
+ *
313
+ * Allows you to assign multiple delivery items for multiple customers in bulk
314
+ */
315
+ assignDeliveryItemsBulk(body, opts) {
316
+ return this.http.request("POST", "/v1/stores/{storeId}/delivery/items", { body, opts });
317
+ }
318
+ /**
319
+ * Get command attempts associated with a customer
320
+ *
321
+ * Retrieves command attempts associated with a customer
322
+ */
323
+ getCommandAttemptsForCustomer(customerId, query, opts) {
324
+ return this.http.request("GET", "/v1/stores/{storeId}/customers/{customerId}/delivery/commands", { path: { customerId }, query, opts });
325
+ }
326
+ /**
327
+ * Get delivery items associated with a customer
328
+ *
329
+ * Retrieves delivery items associated with a customer
330
+ */
331
+ getCustomerDeliveryItems(customerId, query, opts) {
332
+ return this.http.request("GET", "/v1/stores/{storeId}/customers/{customerId}/delivery/items", { path: { customerId }, query, opts });
333
+ }
334
+ /**
335
+ * Returns delivery items in which an associated command attempt is for the gameserver
336
+ */
337
+ getGameServerDeliveryItems(gameServerId, query, opts) {
338
+ return this.http.request("GET", "/v1/stores/{storeId}/gameservers/{gameServerId}/delivery/items", { path: { gameServerId }, query, opts });
339
+ }
340
+ /**
341
+ * Get delivery items associated with an order
342
+ *
343
+ * Retrieves all delivery items associated with a specific order.
344
+ * @param orderId The ID of the order to retrieve delivery items from.
345
+ */
346
+ getOrderDeliveryItems(orderId, query, opts) {
347
+ return this.http.request("GET", "/v1/stores/{storeId}/orders/{orderId}/delivery/items", { path: { orderId }, query, opts });
348
+ }
349
+ /**
350
+ * Get all delivery items
351
+ *
352
+ * Retrieves all delivery items associated with this store (paginated)
353
+ */
354
+ getStoreDeliveryItems(query, opts) {
355
+ return this.http.request("GET", "/v1/stores/{storeId}/delivery/items", {
356
+ query,
357
+ opts,
358
+ });
359
+ }
360
+ /**
361
+ * Resend commands for a given Gameserver
362
+ */
363
+ resendDeliveryCommandsForGameServer(gameServerId, body, opts) {
364
+ return this.http.request("POST", "/v1/stores/{storeId}/gameservers/{gameServerId}/delivery/commands/resend", { path: { gameServerId }, body, opts });
365
+ }
366
+ /**
367
+ * Revoke a delivery item from a customer
368
+ *
369
+ * Allows you to revoke a delivery item associated with a customer
370
+ */
371
+ revokeDeliveryItem(customerId, deliveryItemId, opts) {
372
+ return this.http.request("DELETE", "/v1/stores/{storeId}/customers/{customerId}/delivery/items/{deliveryItemId}", { path: { customerId, deliveryItemId }, opts });
373
+ }
374
+ /**
375
+ * Unqueue commands by Attempt IDs
376
+ */
377
+ unqueueDeliveryCommandAttemptByAttemptIDs(body, opts) {
378
+ return this.http.request("POST", "/v1/stores/{storeId}/delivery/commands/unqueue", { body, opts });
379
+ }
380
+ }
381
+ export class DiscordResource {
382
+ http;
383
+ constructor(http) {
384
+ this.http = http;
385
+ }
386
+ createAction(productVersionId, body, opts) {
387
+ return this.http.request("PUT", "/v1/stores/{storeId}/product_versions/{productVersionId}/discord_actions", { path: { productVersionId }, body, opts });
388
+ }
389
+ createDiscordServerLink(opts) {
390
+ return this.http.request("POST", "/v1/stores/{storeId}/discord/links", {
391
+ opts,
392
+ });
393
+ }
394
+ deleteDiscordServerLinks(token, opts) {
395
+ return this.http.request("DELETE", "/v1/stores/{storeId}/discord/links/{token}", { path: { token }, opts });
396
+ }
397
+ deleteUserToDeliveryItemLink(inventoryItemId, opts) {
398
+ return this.http.request("DELETE", "/v1/stores/{storeId}/inventory/{inventoryItemId}/discord/link", { path: { inventoryItemId }, opts });
399
+ }
400
+ getActions(productVersionId, opts) {
401
+ return this.http.request("GET", "/v1/stores/{storeId}/product_versions/{productVersionId}/discord_actions", { path: { productVersionId }, opts });
402
+ }
403
+ getDiscordActionExecutionHistory(orderId, opts) {
404
+ return this.http.request("GET", "/v1/stores/{storeId}/orders/{orderId}/discord/queued", { path: { orderId }, opts });
405
+ }
406
+ getDiscordServerLinks(opts) {
407
+ return this.http.request("GET", "/v1/stores/{storeId}/discord/links", { opts });
408
+ }
409
+ getDiscordServerRoles(discordServerId, opts) {
410
+ return this.http.request("GET", "/v1/stores/{storeId}/discord/{discordServerId}/roles", { path: { discordServerId }, opts });
411
+ }
412
+ getDiscordServerTextChannels(discordServerId, opts) {
413
+ return this.http.request("GET", "/v1/stores/{storeId}/discord/{discordServerId}/discord/text_channels", { path: { discordServerId }, opts });
414
+ }
415
+ getLinkedDiscordAccounts(orderId, opts) {
416
+ return this.http.request("GET", "/v1/stores/{storeId}/orders/{orderId}/discord", { path: { orderId }, opts });
417
+ }
418
+ getQueuedDiscordActionForDeliveryItem(inventoryItemId, opts) {
419
+ return this.http.request("GET", "/v1/stores/{storeId}/inventory/{inventoryItemId}/discord/queued", { path: { inventoryItemId }, opts });
420
+ }
421
+ getUserToDeliveryItemLinks(inventoryItemId, opts) {
422
+ return this.http.request("GET", "/v1/stores/{storeId}/inventory/{inventoryItemId}/discord/link", { path: { inventoryItemId }, opts });
423
+ }
424
+ setUserToDeliveryItemLink(inventoryItemId, query, opts) {
425
+ return this.http.request("PUT", "/v1/stores/{storeId}/inventory/{inventoryItemId}/discord/link", { path: { inventoryItemId }, query, opts });
426
+ }
427
+ }
428
+ export class DownloadableFilesResource {
429
+ http;
430
+ constructor(http) {
431
+ this.http = http;
432
+ }
433
+ createDownloadUrl(productId, downloadableFileId, opts) {
434
+ return this.http.request("GET", "/v1/stores/{storeId}/products/{productId}/downloadable-files/{downloadableFileId}/download-url", { path: { productId, downloadableFileId }, opts });
435
+ }
436
+ deleteDownloadableFile(productId, downloadableFileId, opts) {
437
+ return this.http.request("DELETE", "/v1/stores/{storeId}/products/{productId}/downloadable-files/{downloadableFileId}", { path: { productId, downloadableFileId }, opts });
438
+ }
439
+ finishDownloadableFileUpload(productId, downloadableFileId, opts) {
440
+ return this.http.request("POST", "/v1/stores/{storeId}/products/{productId}/downloadable-files/{downloadableFileId}/finish", { path: { productId, downloadableFileId }, opts });
441
+ }
442
+ getDownloadableFiles(productId, opts) {
443
+ return this.http.request("GET", "/v1/stores/{storeId}/products/{productId}/downloadable-files", { path: { productId }, opts });
444
+ }
445
+ startDownloadableFileUpload(productId, body, opts) {
446
+ return this.http.request("POST", "/v1/stores/{storeId}/products/{productId}/downloadable-files", { path: { productId }, body, opts });
447
+ }
448
+ }
449
+ export class GameServersResource {
450
+ http;
451
+ constructor(http) {
452
+ this.http = http;
453
+ }
454
+ /**
455
+ * Create a new Game Server for a store
456
+ */
457
+ createGameServer(body, opts) {
458
+ return this.http.request("POST", "/v1/stores/{storeId}/gameservers", {
459
+ body,
460
+ opts,
461
+ });
462
+ }
463
+ /**
464
+ * Create a console for a game server.
465
+ */
466
+ createGameServerConsole(gameServerId, body, opts) {
467
+ return this.http.request("POST", "/v1/stores/{storeId}/gameservers/{gameServerId}/console", { path: { gameServerId }, body, opts });
468
+ }
469
+ /**
470
+ * Delete a Game Server by ID for a store
471
+ */
472
+ deleteGameServer(gameServerId, opts) {
473
+ return this.http.request("DELETE", "/v1/stores/{storeId}/gameservers/{gameServerId}", {
474
+ path: { gameServerId },
475
+ opts,
476
+ });
477
+ }
478
+ /**
479
+ * Delete an associated game server console.
480
+ */
481
+ deleteGameServerConsole(gameServerId, opts) {
482
+ return this.http.request("DELETE", "/v1/stores/{storeId}/gameservers/{gameServerId}/console", { path: { gameServerId }, opts });
483
+ }
484
+ /**
485
+ * Get a Game Server by ID for a store
486
+ */
487
+ getGameServer(gameServerId, opts) {
488
+ return this.http.request("GET", "/v1/stores/{storeId}/gameservers/{gameServerId}", { path: { gameServerId }, opts });
489
+ }
490
+ /**
491
+ * Get the associated console for a game server.
492
+ */
493
+ getGameServerConsole(gameServerId, opts) {
494
+ return this.http.request("GET", "/v1/stores/{storeId}/gameservers/{gameServerId}/console", { path: { gameServerId }, opts });
495
+ }
496
+ /**
497
+ * Get console messages for a game server.
498
+ */
499
+ getGameServerConsoleMessages(gameServerId, opts) {
500
+ return this.http.request("GET", "/v1/stores/{storeId}/gameservers/{gameServerId}/console/messages", { path: { gameServerId }, opts });
501
+ }
502
+ /**
503
+ * Get Game Servers for a store
504
+ */
505
+ getGameServers(opts) {
506
+ return this.http.request("GET", "/v1/stores/{storeId}/gameservers", {
507
+ opts,
508
+ });
509
+ }
510
+ /**
511
+ * Reset the API Key Token for a Game Server for a store
512
+ */
513
+ resetGameServerToken(gameServerId, opts) {
514
+ return this.http.request("POST", "/v1/stores/{storeId}/gameservers/{gameServerId}/reset-token", { path: { gameServerId }, opts });
515
+ }
516
+ /**
517
+ * Update a Game Server By ID for a store
518
+ */
519
+ updateGameServer(gameServerId, body, opts) {
520
+ return this.http.request("PATCH", "/v1/stores/{storeId}/gameservers/{gameServerId}", { path: { gameServerId }, body, opts });
521
+ }
522
+ /**
523
+ * Update a console for a game server.
524
+ */
525
+ updateGameServerConsole(gameServerId, body, opts) {
526
+ return this.http.request("PATCH", "/v1/stores/{storeId}/gameservers/{gameServerId}/console", { path: { gameServerId }, body, opts });
527
+ }
528
+ }
529
+ export class GiftcardsResource {
530
+ http;
531
+ constructor(http) {
532
+ this.http = http;
533
+ }
534
+ /**
535
+ * Create a Gift Card for a store
536
+ */
537
+ createGiftCard(body, opts) {
538
+ return this.http.request("POST", "/v1/stores/{storeId}/giftcards", { body, opts });
539
+ }
540
+ /**
541
+ * Delete a Gift Card By ID for a store
542
+ */
543
+ deleteGiftCard(giftCardId, opts) {
544
+ return this.http.request("DELETE", "/v1/stores/{storeId}/giftcards/{giftCardId}", {
545
+ path: { giftCardId },
546
+ opts,
547
+ });
548
+ }
549
+ /**
550
+ * Get a Gift Card By ID for a store
551
+ */
552
+ getGiftCard(giftCardId, opts) {
553
+ return this.http.request("GET", "/v1/stores/{storeId}/giftcards/{giftCardId}", {
554
+ path: { giftCardId },
555
+ opts,
556
+ });
557
+ }
558
+ /**
559
+ * Get Gift Cards for a store
560
+ */
561
+ getGiftCards(query, opts) {
562
+ return this.http.request("GET", "/v1/stores/{storeId}/giftcards", {
563
+ query,
564
+ opts,
565
+ });
566
+ }
567
+ /**
568
+ * Update a Gift Card By ID for a store
569
+ */
570
+ updateGiftCard(giftCardId, body, opts) {
571
+ return this.http.request("PATCH", "/v1/stores/{storeId}/giftcards/{giftCardId}", {
572
+ path: { giftCardId },
573
+ body,
574
+ opts,
575
+ });
576
+ }
577
+ }
578
+ export class GlobalCommandsResource {
579
+ http;
580
+ constructor(http) {
581
+ this.http = http;
582
+ }
583
+ /**
584
+ * Create global command
585
+ *
586
+ * Creates a global command for a store.
587
+ */
588
+ createGlobalCommand(body, opts) {
589
+ return this.http.request("POST", "/v1/stores/{storeId}/global-commands", {
590
+ body,
591
+ opts,
592
+ });
593
+ }
594
+ /**
595
+ * Delete global command
596
+ *
597
+ * Deletes a global command for a store.
598
+ * @param globalCommandId The ID of the command to delete.
599
+ */
600
+ deleteGlobalCommand(globalCommandId, opts) {
601
+ return this.http.request("DELETE", "/v1/stores/{storeId}/global-commands/{globalCommandId}", { path: { globalCommandId }, opts });
602
+ }
603
+ /**
604
+ * Get global commands
605
+ *
606
+ * Retrieves all global commands for the specified store.
607
+ */
608
+ getGlobalCommands(opts) {
609
+ return this.http.request("GET", "/v1/stores/{storeId}/global-commands", { opts });
610
+ }
611
+ /**
612
+ * Update global command
613
+ *
614
+ * Updates a global command for a store.
615
+ */
616
+ updateGlobalCommand(globalCommandId, body, opts) {
617
+ return this.http.request("PATCH", "/v1/stores/{storeId}/global-commands/{globalCommandId}", { path: { globalCommandId }, body, opts });
618
+ }
619
+ }
620
+ export class InvoicesResource {
621
+ http;
622
+ constructor(http) {
623
+ this.http = http;
624
+ }
625
+ /**
626
+ * Download invoice
627
+ *
628
+ * Retrieves a temporary download URL for the invoice PDF.
629
+ * @param invoiceId The ID of the invoice to download.
630
+ */
631
+ downloadInvoice(invoiceId, opts) {
632
+ return this.http.request("GET", "/v1/stores/{storeId}/invoices/{invoiceId}/download", { path: { invoiceId }, opts });
633
+ }
634
+ /**
635
+ * Get invoices
636
+ *
637
+ * Retrieves all invoices for the specified store.
638
+ */
639
+ listInvoices(query, opts) {
640
+ return this.http.request("GET", "/v1/stores/{storeId}/invoices", {
641
+ query,
642
+ opts,
643
+ });
644
+ }
645
+ }
646
+ export class MarketingResource {
647
+ http;
648
+ constructor(http) {
649
+ this.http = http;
650
+ }
651
+ activateEmailTemplate(templateId, opts) {
652
+ return this.http.request("POST", "/v1/stores/{storeId}/marketing/email/templates/{templateId}/activate", { path: { templateId }, opts });
653
+ }
654
+ createEmailTemplate(body, opts) {
655
+ return this.http.request("POST", "/v1/stores/{storeId}/marketing/email/templates", { body, opts });
656
+ }
657
+ deactivateEmailTemplate(templateId, opts) {
658
+ return this.http.request("POST", "/v1/stores/{storeId}/marketing/email/templates/{templateId}/deactivate", { path: { templateId }, opts });
659
+ }
660
+ deactivateEmailTemplateByType(body, opts) {
661
+ return this.http.request("POST", "/v1/stores/{storeId}/marketing/email/templates/deactivate", { body, opts });
662
+ }
663
+ deleteEmailTemplate(templateId, opts) {
664
+ return this.http.request("DELETE", "/v1/stores/{storeId}/marketing/email/templates/{templateId}", { path: { templateId }, opts });
665
+ }
666
+ finishEmailBrandingImageUpload(body, opts) {
667
+ return this.http.request("POST", "/v1/stores/{storeId}/marketing/email/branding/image-upload-finish", { body, opts });
668
+ }
669
+ getEmailBranding(opts) {
670
+ return this.http.request("GET", "/v1/stores/{storeId}/marketing/email/branding", { opts });
671
+ }
672
+ getEmailBrandingImageUploadUrl(query, opts) {
673
+ return this.http.request("GET", "/v1/stores/{storeId}/marketing/email/branding/image-upload-url", { query, opts });
674
+ }
675
+ getEmailDeliveries(query, opts) {
676
+ return this.http.request("GET", "/v1/stores/{storeId}/marketing/email/deliveries", { query, opts });
677
+ }
678
+ getEmailDelivery(emailDeliveryId, opts) {
679
+ return this.http.request("GET", "/v1/stores/{storeId}/marketing/email/deliveries/{emailDeliveryId}", { path: { emailDeliveryId }, opts });
680
+ }
681
+ getEmailTemplate(templateId, opts) {
682
+ return this.http.request("GET", "/v1/stores/{storeId}/marketing/email/templates/{templateId}", { path: { templateId }, opts });
683
+ }
684
+ getEmailTemplateDefinitions(opts) {
685
+ return this.http.request("GET", "/v1/stores/{storeId}/marketing/email/template-definitions", { opts });
686
+ }
687
+ getEmailTemplates(query, opts) {
688
+ return this.http.request("GET", "/v1/stores/{storeId}/marketing/email/templates", { query, opts });
689
+ }
690
+ /**
691
+ * Gets the abandoned checkout behaviour for a store
692
+ */
693
+ getStoreAbandonedCheckoutConfigurationOptions(opts) {
694
+ return this.http.request("GET", "/v1/stores/{storeId}/marketing/abandoned-checkouts/configuration", { opts });
695
+ }
696
+ /**
697
+ * Gets the purchase follow up behaviour for a store
698
+ */
699
+ getStorePurchaseFollowUpConfigurationOptions(opts) {
700
+ return this.http.request("GET", "/v1/stores/{storeId}/marketing/purchase-follow-ups/configuration", { opts });
701
+ }
702
+ /**
703
+ * Sets the abandoned checkout behaviour for a store
704
+ */
705
+ setStoreAbandonedCheckoutConfigurationOptions(body, opts) {
706
+ return this.http.request("PUT", "/v1/stores/{storeId}/marketing/abandoned-checkouts/configuration", { body, opts });
707
+ }
708
+ /**
709
+ * Sets the purchase follow up behaviour for a store
710
+ */
711
+ setStorePurchaseFollowUpConfigurationOptions(body, opts) {
712
+ return this.http.request("PUT", "/v1/stores/{storeId}/marketing/purchase-follow-ups/configuration", { body, opts });
713
+ }
714
+ updateEmailBranding(body, opts) {
715
+ return this.http.request("PATCH", "/v1/stores/{storeId}/marketing/email/branding", { body, opts });
716
+ }
717
+ updateEmailTemplate(templateId, body, opts) {
718
+ return this.http.request("PATCH", "/v1/stores/{storeId}/marketing/email/templates/{templateId}", { path: { templateId }, body, opts });
719
+ }
720
+ }
721
+ export class NavlinksResource {
722
+ http;
723
+ constructor(http) {
724
+ this.http = http;
725
+ }
726
+ /**
727
+ * Create a new NavLink for a store
728
+ */
729
+ createNavLink(body, opts) {
730
+ return this.http.request("POST", "/v1/stores/{storeId}/navlinks", { body, opts });
731
+ }
732
+ /**
733
+ * Delete a NavLink for a store
734
+ */
735
+ deleteNavLink(navLinkId, opts) {
736
+ return this.http.request("DELETE", "/v1/stores/{storeId}/navlinks/{navLinkId}", {
737
+ path: { navLinkId },
738
+ opts,
739
+ });
740
+ }
741
+ /**
742
+ * Get a NavLink by ID for a store
743
+ */
744
+ getNavLink(navLinkId, opts) {
745
+ return this.http.request("GET", "/v1/stores/{storeId}/navlinks/{navLinkId}", {
746
+ path: { navLinkId },
747
+ opts,
748
+ });
749
+ }
750
+ /**
751
+ * Get all NavLinks for a store
752
+ */
753
+ getNavLinks(opts) {
754
+ return this.http.request("GET", "/v1/stores/{storeId}/navlinks", { opts });
755
+ }
756
+ /**
757
+ * Update a NavLink By ID for a store
758
+ */
759
+ updateNavLink(navLinkId, body, opts) {
760
+ return this.http.request("PATCH", "/v1/stores/{storeId}/navlinks/{navLinkId}", {
761
+ path: { navLinkId },
762
+ body,
763
+ opts,
764
+ });
765
+ }
766
+ /**
767
+ * Update the sort orders of NavLinks for a Store
768
+ */
769
+ updateNavLinkOrder(body, opts) {
770
+ return this.http.request("PATCH", "/v1/stores/{storeId}/navlinks/sort-orders", {
771
+ body,
772
+ opts,
773
+ });
774
+ }
775
+ }
776
+ export class OrdersResource {
777
+ http;
778
+ constructor(http) {
779
+ this.http = http;
780
+ }
781
+ /**
782
+ * Get order by ID
783
+ *
784
+ * Retrieves an order by the ID for the specified store.
785
+ * @param orderId The ID of the order.
786
+ */
787
+ getOrderById(orderId, opts) {
788
+ return this.http.request("GET", "/v1/stores/{storeId}/orders/{orderId}", {
789
+ path: { orderId },
790
+ opts,
791
+ });
792
+ }
793
+ /**
794
+ * Get orders
795
+ *
796
+ * Retrieves all orders for the specified store.
797
+ */
798
+ getOrders(query, opts) {
799
+ return this.http.request("GET", "/v1/stores/{storeId}/orders", {
800
+ query,
801
+ opts,
802
+ });
803
+ }
804
+ /**
805
+ * Refund order by ID
806
+ *
807
+ * Creates a refund for an order by the ID for the specified store.
808
+ * @param orderId The ID of the order.
809
+ */
810
+ refundOrder(orderId, body, opts) {
811
+ return this.http.request("POST", "/v1/stores/{storeId}/orders/{orderId}/refund", {
812
+ path: { orderId },
813
+ body,
814
+ opts,
815
+ });
816
+ }
817
+ }
818
+ export class PaymentMethodTypesResource {
819
+ http;
820
+ constructor(http) {
821
+ this.http = http;
822
+ }
823
+ /**
824
+ * Get store payment method types
825
+ *
826
+ * Retrieves all payment method types associated with a store
827
+ */
828
+ getStorePaymentMethodTypes(opts) {
829
+ return this.http.request("GET", "/v1/stores/{storeId}/payment-method-types", { opts });
830
+ }
831
+ /**
832
+ * Request approval for a store payment method type
833
+ *
834
+ * Requests approval to use a payment method type that requires manual review
835
+ */
836
+ requestStorePaymentMethodTypeApproval(paymentMethodTypeId, opts) {
837
+ return this.http.request("POST", "/v1/stores/{storeId}/payment-method-types/{paymentMethodTypeId}/request-approval", { path: { paymentMethodTypeId }, opts });
838
+ }
839
+ /**
840
+ * Toggle a store payment method type
841
+ *
842
+ * Enables or disabled a payment method type for a store
843
+ */
844
+ toggleStorePaymentMethodType(paymentMethodTypeId, body, opts) {
845
+ return this.http.request("PATCH", "/v1/stores/{storeId}/payment-method-types/{paymentMethodTypeId}/toggle", { path: { paymentMethodTypeId }, body, opts });
846
+ }
847
+ }
848
+ export class PaymentsResource {
849
+ http;
850
+ constructor(http) {
851
+ this.http = http;
852
+ }
853
+ /**
854
+ * Get payment by ID
855
+ *
856
+ * Retrieves a payment by an ID.
857
+ */
858
+ getPaymentById(paymentId, opts) {
859
+ return this.http.request("GET", "/v1/stores/{storeId}/payments/{paymentId}", {
860
+ path: { paymentId },
861
+ opts,
862
+ });
863
+ }
864
+ /**
865
+ * Get payments
866
+ *
867
+ * Retrieves all payments for the specified store using the filter specified.
868
+ */
869
+ getPayments(query, opts) {
870
+ return this.http.request("GET", "/v1/stores/{storeId}/payments", {
871
+ query,
872
+ opts,
873
+ });
874
+ }
875
+ }
876
+ export class PaymentSettingsResource {
877
+ http;
878
+ constructor(http) {
879
+ this.http = http;
880
+ }
881
+ /**
882
+ * Get store payment settings
883
+ *
884
+ * Retrieves payment settings for a store.
885
+ */
886
+ getStorePaymentSettings(opts) {
887
+ return this.http.request("GET", "/v1/stores/{storeId}/payment-settings", { opts });
888
+ }
889
+ /**
890
+ * Updates store payment settings
891
+ *
892
+ * Updates payment settings for a store.
893
+ */
894
+ updateStorePaymentSettings(body, opts) {
895
+ return this.http.request("PATCH", "/v1/stores/{storeId}/payment-settings", {
896
+ body,
897
+ opts,
898
+ });
899
+ }
900
+ }
901
+ export class ProductDependentMigrationsResource {
902
+ http;
903
+ constructor(http) {
904
+ this.http = http;
905
+ }
906
+ createProductDependentMigration(productId, body, opts) {
907
+ return this.http.request("POST", "/v1/stores/{storeId}/products/{productId}/dependent-migrations", { path: { productId }, body, opts });
908
+ }
909
+ getProductDependentMigrationById(productDependentMigrationId, opts) {
910
+ return this.http.request("GET", "/v1/stores/{storeId}/product-dependent-migrations/{productDependentMigrationId}", { path: { productDependentMigrationId }, opts });
911
+ }
912
+ getProductDependentMigrationEstimate(productId, opts) {
913
+ return this.http.request("GET", "/v1/stores/{storeId}/products/{productId}/dependent-migrations/estimate", { path: { productId }, opts });
914
+ }
915
+ getProductDependentMigrations(productId, query, opts) {
916
+ return this.http.request("GET", "/v1/stores/{storeId}/products/{productId}/dependent-migrations", { path: { productId }, query, opts });
917
+ }
918
+ }
919
+ export class ProductsResource {
920
+ http;
921
+ constructor(http) {
922
+ this.http = http;
923
+ }
924
+ /**
925
+ * Create product
926
+ *
927
+ * Creates a new product in the specified store.
928
+ * Creating dynamic products while creating a checkout session via this endpoint without prior approval is prohibited and will result in store deactivation per our User Agreement.
929
+ */
930
+ createProduct(body, opts) {
931
+ return this.http.request("POST", "/v1/stores/{storeId}/products", { body, opts });
932
+ }
933
+ /**
934
+ * Delete product
935
+ *
936
+ * Deletes a product from the specified store.
937
+ * @param productId The ID of the product to delete.
938
+ */
939
+ deleteProduct(productId, opts) {
940
+ return this.http.request("DELETE", "/v1/stores/{storeId}/products/{productId}", {
941
+ path: { productId },
942
+ opts,
943
+ });
944
+ }
945
+ /**
946
+ * Get product
947
+ *
948
+ * Retrieves a specific product by ID from the specified store.
949
+ * DO NOT USE THIS ROUTE FOR DISPLAYING PRODUCTS ON YOUR STOREFRONT, use the storefront API instead.
950
+ * @param productId The ID of the product to retrieve.
951
+ */
952
+ getProduct(productId, opts) {
953
+ return this.http.request("GET", "/v1/stores/{storeId}/products/{productId}", {
954
+ path: { productId },
955
+ opts,
956
+ });
957
+ }
958
+ /**
959
+ * Get products
960
+ *
961
+ * Retrieves all products for the specified store.
962
+ * DO NOT USE THIS ROUTE FOR DISPLAYING PRODUCTS ON YOUR STOREFRONT, use the storefront API instead!
963
+ */
964
+ getProducts(query, opts) {
965
+ return this.http.request("GET", "/v1/stores/{storeId}/products", {
966
+ query,
967
+ opts,
968
+ });
969
+ }
970
+ /**
971
+ * Update product
972
+ *
973
+ * Updates an existing product in the specified store.
974
+ * @param productId The ID of the product to update.
975
+ */
976
+ updateProduct(productId, body, opts) {
977
+ return this.http.request("PATCH", "/v1/stores/{storeId}/products/{productId}", {
978
+ path: { productId },
979
+ body,
980
+ opts,
981
+ });
982
+ }
983
+ /**
984
+ * Update product sort order
985
+ *
986
+ * Updates the sort order of products in the specified store.
987
+ */
988
+ updateProductSortOrder(body, opts) {
989
+ return this.http.request("POST", "/v1/stores/{storeId}/products/sort-order", { body, opts });
990
+ }
991
+ }
992
+ export class RegionalPricingResource {
993
+ http;
994
+ constructor(http) {
995
+ this.http = http;
996
+ }
997
+ getProductPricingRegions(productId, opts) {
998
+ return this.http.request("GET", "/v1/stores/{storeId}/products/{productId}/pricing/regions", { path: { productId }, opts });
999
+ }
1000
+ getStorePricingRegionGroups(opts) {
1001
+ return this.http.request("GET", "/v1/stores/{storeId}/products/pricing/region-groups", { opts });
1002
+ }
1003
+ getStorePricingRegions(opts) {
1004
+ return this.http.request("GET", "/v1/stores/{storeId}/products/pricing/regions", { opts });
1005
+ }
1006
+ setProductPricingRegionOverride(productId, regionId, body, opts) {
1007
+ return this.http.request("PATCH", "/v1/stores/{storeId}/products/{productId}/pricing/regions/{regionId}", { path: { productId, regionId }, body, opts });
1008
+ }
1009
+ setStorePricingRegionOverride(regionId, body, opts) {
1010
+ return this.http.request("PATCH", "/v1/stores/{storeId}/products/pricing/regions/{regionId}", { path: { regionId }, body, opts });
1011
+ }
1012
+ }
1013
+ export class SalesResource {
1014
+ http;
1015
+ constructor(http) {
1016
+ this.http = http;
1017
+ }
1018
+ /**
1019
+ * Create a sale by ID for a store
1020
+ */
1021
+ createSale(body, opts) {
1022
+ return this.http.request("POST", "/v1/stores/{storeId}/sales", { body, opts });
1023
+ }
1024
+ /**
1025
+ * Delete a sale by ID for a store
1026
+ */
1027
+ deleteSaleById(saleId, opts) {
1028
+ return this.http.request("DELETE", "/v1/stores/{storeId}/sales/{saleId}", {
1029
+ path: { saleId },
1030
+ opts,
1031
+ });
1032
+ }
1033
+ /**
1034
+ * Get a sale by ID for a store
1035
+ */
1036
+ getSale(saleId, opts) {
1037
+ return this.http.request("GET", "/v1/stores/{storeId}/sales/{saleId}", {
1038
+ path: { saleId },
1039
+ opts,
1040
+ });
1041
+ }
1042
+ /**
1043
+ * Get sales associated with a store.
1044
+ */
1045
+ getSales(opts) {
1046
+ return this.http.request("GET", "/v1/stores/{storeId}/sales", { opts });
1047
+ }
1048
+ /**
1049
+ * Update a sale by ID for a store
1050
+ */
1051
+ updateSale(saleId, body, opts) {
1052
+ return this.http.request("PATCH", "/v1/stores/{storeId}/sales/{saleId}", {
1053
+ path: { saleId },
1054
+ body,
1055
+ opts,
1056
+ });
1057
+ }
1058
+ }
1059
+ export class StoreResource {
1060
+ http;
1061
+ constructor(http) {
1062
+ this.http = http;
1063
+ }
1064
+ /**
1065
+ * Get a store
1066
+ *
1067
+ * Retrieves a single store by its ID.
1068
+ */
1069
+ getStore(opts) {
1070
+ return this.http.request("GET", "/v1/stores/{storeId}", { opts });
1071
+ }
1072
+ /**
1073
+ * Get store member permissions
1074
+ *
1075
+ * Retrieves the resolved permissions map for a specific member of a store.
1076
+ */
1077
+ getStoreMemberPermissions(memberId, opts) {
1078
+ return this.http.request("GET", "/v1/stores/{storeId}/members/{memberId}/permissions", { path: { memberId }, opts });
1079
+ }
1080
+ /**
1081
+ * List store members
1082
+ *
1083
+ * Retrieves all members who have access to the specified store.
1084
+ */
1085
+ getStoreMembers(opts) {
1086
+ return this.http.request("GET", "/v1/stores/{storeId}/members", {
1087
+ opts,
1088
+ });
1089
+ }
1090
+ /**
1091
+ * Get stores
1092
+ *
1093
+ * Retrieves all stores accessible to the authenticated user or API key.
1094
+ */
1095
+ getStores(opts) {
1096
+ return this.http.request("GET", "/v1/stores", { opts });
1097
+ }
1098
+ /**
1099
+ * Remove a store member
1100
+ *
1101
+ * Removes the specified member from the store, revoking their access.
1102
+ */
1103
+ kickStoreMember(memberId, opts) {
1104
+ return this.http.request("DELETE", "/v1/stores/{storeId}/members/{memberId}", {
1105
+ path: { memberId },
1106
+ opts,
1107
+ });
1108
+ }
1109
+ /**
1110
+ * Update a store
1111
+ *
1112
+ * Partially updates a store's configuration using the provided fields.
1113
+ */
1114
+ updateStore(body, opts) {
1115
+ return this.http.request("PATCH", "/v1/stores/{storeId}", { body, opts });
1116
+ }
1117
+ /**
1118
+ * Update a store member
1119
+ *
1120
+ * Updates the role assigned to a specific member of the store.
1121
+ */
1122
+ updateStoreMember(memberId, body, opts) {
1123
+ return this.http.request("PATCH", "/v1/stores/{storeId}/members/{memberId}", {
1124
+ path: { memberId },
1125
+ body,
1126
+ opts,
1127
+ });
1128
+ }
1129
+ }
1130
+ export class SubscriptionsResource {
1131
+ http;
1132
+ constructor(http) {
1133
+ this.http = http;
1134
+ }
1135
+ /**
1136
+ * Cancel subscription by ID
1137
+ *
1138
+ * Cancels a subscription for the specified store by the supplied ID.
1139
+ * @param subscriptionId The ID of the subscription.
1140
+ */
1141
+ cancelSubscription(subscriptionId, body, opts) {
1142
+ return this.http.request("POST", "/v1/stores/{storeId}/subscriptions/{subscriptionId}/cancel", { path: { subscriptionId }, body, opts });
1143
+ }
1144
+ /**
1145
+ * Get subscription by ID
1146
+ *
1147
+ * Retrieves a subscription for the specified store by the supplied ID.
1148
+ * @param subscriptionId The ID of the subscription.
1149
+ */
1150
+ getSubscriptionById(subscriptionId, opts) {
1151
+ return this.http.request("GET", "/v1/stores/{storeId}/subscriptions/{subscriptionId}", { path: { subscriptionId }, opts });
1152
+ }
1153
+ /**
1154
+ * Get subscriptions
1155
+ *
1156
+ * Retrieves all subscriptions for the specified store.
1157
+ */
1158
+ getSubscriptions(query, opts) {
1159
+ return this.http.request("GET", "/v1/stores/{storeId}/subscriptions", {
1160
+ query,
1161
+ opts,
1162
+ });
1163
+ }
1164
+ /**
1165
+ * Preview a subscription change
1166
+ *
1167
+ * Simulates a subscription change and returns the pricing breakdown without creating any records or
1168
+ * initiating a payment. Accepts the same request body as `POST change` — see that endpoint for
1169
+ * full parameter documentation. Does not return the `pending_payment` field.
1170
+ */
1171
+ previewSubscriptionChange(subscriptionId, body, opts) {
1172
+ return this.http.request("POST", "/v1/stores/{storeId}/subscriptions/{subscriptionId}/change/preview", { path: { subscriptionId }, body, opts });
1173
+ }
1174
+ /**
1175
+ * Stop pending subscription cancellation
1176
+ *
1177
+ * Stops a pending subscription cancellation for the specified store by the supplied ID.
1178
+ * @param subscriptionId The ID of the subscription.
1179
+ */
1180
+ stopPendingSubscriptionCancellation(subscriptionId, opts) {
1181
+ return this.http.request("POST", "/v1/stores/{storeId}/subscriptions/{subscriptionId}/stop-pending-cancellation", { path: { subscriptionId }, opts });
1182
+ }
1183
+ /**
1184
+ * Update items on a subscription
1185
+ *
1186
+ * Updates the subscription lines, including the pricing, on an active subscription. The subscription must not be within 1 hour of its
1187
+ * next renewal, and only one change can be pending at a time.
1188
+ *
1189
+ * **Access**
1190
+ *
1191
+ * This endpoint requires the Subscription Updates API feature flag to be enabled on your store. Contact
1192
+ * PayNow to request access.
1193
+ *
1194
+ * **Proration behavior**
1195
+ *
1196
+ * Controlled by the `proration_behavior` field on the request:
1197
+ *
1198
+ * - `immediate` - the change is applied as soon as possible.
1199
+ * Proration is calculated for the remaining period. If the prorated amount is ≥ $0.50 (or equivalent in other currencies), an order is
1200
+ * initiated against the subscription's payment method; the change is applied once the payment succeeds.
1201
+ * If the prorated amount is below $0.50, no order is created and the change is
1202
+ * applied instantly.
1203
+ * Only one proration order is allowed per billing cycle - a second immediate change in the same
1204
+ * period will be rejected if a proration was already charged.
1205
+ * When a payment is triggered, the response will include a `pending_payment` object. The payment result
1206
+ * is synchronous - check `pending_payment.declined` to determine whether the charge succeeded. If
1207
+ * declined, `pending_payment.decline_code` contains the reason.
1208
+ *
1209
+ * - `next_billing_period` - no payment is created. The change is queued and will be applied automatically
1210
+ * at the start of the next renewal cycle. Ideal for downgrades.
1211
+ *
1212
+ * - `none` - the change is applied instantly with no proration calculated or charged.
1213
+ *
1214
+ * **Reverting a pending change**
1215
+ *
1216
+ * If a `next_billing_period` change is pending and the new request specifies the same product versions
1217
+ * that are already on the subscription (i.e. reverting back to the current state), the pending change
1218
+ * is canceled rather than rejected. The canceled change record is returned in the response.
1219
+ */
1220
+ updateSubscription(subscriptionId, body, opts) {
1221
+ return this.http.request("POST", "/v1/stores/{storeId}/subscriptions/{subscriptionId}/change", { path: { subscriptionId }, body, opts });
1222
+ }
1223
+ }
1224
+ export class TagsResource {
1225
+ http;
1226
+ constructor(http) {
1227
+ this.http = http;
1228
+ }
1229
+ /**
1230
+ * Create a new tag
1231
+ */
1232
+ createTag(body, opts) {
1233
+ return this.http.request("POST", "/v1/stores/{storeId}/tags", { body, opts });
1234
+ }
1235
+ /**
1236
+ * Delete a tag by ID
1237
+ */
1238
+ deleteTag(tagId, opts) {
1239
+ return this.http.request("DELETE", "/v1/stores/{storeId}/tags/{tagId}", {
1240
+ path: { tagId },
1241
+ opts,
1242
+ });
1243
+ }
1244
+ /**
1245
+ * Delete tag image
1246
+ *
1247
+ * Deletes an image for a tag
1248
+ */
1249
+ deleteTagImage(tagId, opts) {
1250
+ return this.http.request("DELETE", "/v1/stores/{storeId}/tags/{tagId}/image", {
1251
+ path: { tagId },
1252
+ opts,
1253
+ });
1254
+ }
1255
+ /**
1256
+ * Finish tag image upload
1257
+ *
1258
+ * Finishes an image upload for a tag
1259
+ */
1260
+ finishTagImageUpload(tagId, body, opts) {
1261
+ return this.http.request("POST", "/v1/stores/{storeId}/tags/{tagId}/image-upload-finish", { path: { tagId }, body, opts });
1262
+ }
1263
+ /**
1264
+ * Get a tag by an ID
1265
+ */
1266
+ getTag(tagId, opts) {
1267
+ return this.http.request("GET", "/v1/stores/{storeId}/tags/{tagId}", {
1268
+ path: { tagId },
1269
+ opts,
1270
+ });
1271
+ }
1272
+ /**
1273
+ * Get upload URL for tag image
1274
+ *
1275
+ * Gets a pre-signed upload URL for uploading an image to a tag
1276
+ */
1277
+ getTagImageUploadUrl(tagId, opts) {
1278
+ return this.http.request("GET", "/v1/stores/{storeId}/tags/{tagId}/image-upload-url", { path: { tagId }, opts });
1279
+ }
1280
+ /**
1281
+ * Get all tags for a store
1282
+ */
1283
+ getTags(opts) {
1284
+ return this.http.request("GET", "/v1/stores/{storeId}/tags", { opts });
1285
+ }
1286
+ /**
1287
+ * Update a tag by ID
1288
+ */
1289
+ updateTag(tagId, body, opts) {
1290
+ return this.http.request("PATCH", "/v1/stores/{storeId}/tags/{tagId}", {
1291
+ path: { tagId },
1292
+ body,
1293
+ opts,
1294
+ });
1295
+ }
1296
+ }
1297
+ export class TierGroupsResource {
1298
+ http;
1299
+ constructor(http) {
1300
+ this.http = http;
1301
+ }
1302
+ /**
1303
+ * Create a new tier group
1304
+ */
1305
+ createTierGroup(body, opts) {
1306
+ return this.http.request("POST", "/v1/stores/{storeId}/tier-groups", {
1307
+ body,
1308
+ opts,
1309
+ });
1310
+ }
1311
+ /**
1312
+ * Delete a tier group by ID
1313
+ */
1314
+ deleteTierGroup(tierGroupId, opts) {
1315
+ return this.http.request("DELETE", "/v1/stores/{storeId}/tier-groups/{tierGroupId}", {
1316
+ path: { tierGroupId },
1317
+ opts,
1318
+ });
1319
+ }
1320
+ /**
1321
+ * Get a tier group by ID
1322
+ */
1323
+ getTierGroup(tierGroupId, opts) {
1324
+ return this.http.request("GET", "/v1/stores/{storeId}/tier-groups/{tierGroupId}", { path: { tierGroupId }, opts });
1325
+ }
1326
+ /**
1327
+ * List all tier groups for a store
1328
+ */
1329
+ listTierGroups(opts) {
1330
+ return this.http.request("GET", "/v1/stores/{storeId}/tier-groups", {
1331
+ opts,
1332
+ });
1333
+ }
1334
+ /**
1335
+ * Update a tier group by ID
1336
+ */
1337
+ updateTierGroup(tierGroupId, body, opts) {
1338
+ return this.http.request("PATCH", "/v1/stores/{storeId}/tier-groups/{tierGroupId}", { path: { tierGroupId }, body, opts });
1339
+ }
1340
+ }
1341
+ export class TrialsResource {
1342
+ http;
1343
+ constructor(http) {
1344
+ this.http = http;
1345
+ }
1346
+ /**
1347
+ * Create trial eligibility override for a customer
1348
+ *
1349
+ * Creates a new trial eligibility override for the specified customer.
1350
+ * @param customerId The ID of the customer to create the trial eligibility override for.
1351
+ */
1352
+ createEligibilityOverrideForCustomer(customerId, body, opts) {
1353
+ return this.http.request("POST", "/v1/stores/{storeId}/customers/{customerId}/trials/eligibility/overrides", { path: { customerId }, body, opts });
1354
+ }
1355
+ /**
1356
+ * Delete trial eligibility override for a customer
1357
+ *
1358
+ * Deletes an existing trial eligibility override.
1359
+ * @param trialEligibilityOverrideId The ID of the trial eligibility override to delete.
1360
+ */
1361
+ deleteEligibilityOverrideForCustomer(customerId, trialEligibilityOverrideId, opts) {
1362
+ return this.http.request("DELETE", "/v1/stores/{storeId}/customers/{customerId}/trials/eligibility/overrides/{trialEligibilityOverrideId}", { path: { customerId, trialEligibilityOverrideId }, opts });
1363
+ }
1364
+ /**
1365
+ * Get trial eligibility overrides for a specific customer
1366
+ *
1367
+ * Retrieves all trial eligibility overrides for the specified customer.
1368
+ * @param customerId The ID of the customer to retrieve trial eligibility overrides for.
1369
+ */
1370
+ getEligibilityOverridesForCustomer(customerId, query, opts) {
1371
+ return this.http.request("GET", "/v1/stores/{storeId}/customers/{customerId}/trials/eligibility/overrides", { path: { customerId }, query, opts });
1372
+ }
1373
+ /**
1374
+ * Get a trial by ID for a store
1375
+ */
1376
+ getTrial(trialId, opts) {
1377
+ return this.http.request("GET", "/v1/stores/{storeId}/trials/{trialId}", {
1378
+ path: { trialId },
1379
+ opts,
1380
+ });
1381
+ }
1382
+ /**
1383
+ * Get trials for a store
1384
+ */
1385
+ getTrials(query, opts) {
1386
+ return this.http.request("GET", "/v1/stores/{storeId}/trials", {
1387
+ query,
1388
+ opts,
1389
+ });
1390
+ }
1391
+ }
1392
+ export class UpsellSettingsResource {
1393
+ http;
1394
+ constructor(http) {
1395
+ this.http = http;
1396
+ }
1397
+ /**
1398
+ * Get store upselling settings
1399
+ *
1400
+ * Retrieves upselling settings for the store.
1401
+ */
1402
+ getStoreUpsellSettings(opts) {
1403
+ return this.http.request("GET", "/v1/stores/{storeId}/upsell-settings", { opts });
1404
+ }
1405
+ /**
1406
+ * Updates store upselling settings
1407
+ *
1408
+ * Updates upselling settings for a store.
1409
+ */
1410
+ updateStoreUpsellSettings(body, opts) {
1411
+ return this.http.request("PATCH", "/v1/stores/{storeId}/upsell-settings", { body, opts });
1412
+ }
1413
+ }
1414
+ export class WebhooksResource {
1415
+ http;
1416
+ constructor(http) {
1417
+ this.http = http;
1418
+ }
1419
+ createSubscription(body, opts) {
1420
+ return this.http.request("POST", "/v1/stores/{storeId}/webhooks", {
1421
+ body,
1422
+ opts,
1423
+ });
1424
+ }
1425
+ deleteSubscription(webhookId, opts) {
1426
+ return this.http.request("DELETE", "/v1/stores/{storeId}/webhooks/{webhookId}", {
1427
+ path: { webhookId },
1428
+ opts,
1429
+ });
1430
+ }
1431
+ getHistory(webhookId, query, opts) {
1432
+ return this.http.request("GET", "/v1/stores/{storeId}/webhooks/{webhookId}/history", { path: { webhookId }, query, opts });
1433
+ }
1434
+ getSubscriptions(opts) {
1435
+ return this.http.request("GET", "/v1/stores/{storeId}/webhooks", { opts });
1436
+ }
1437
+ getVariables(opts) {
1438
+ return this.http.request("GET", "/v1/stores/{storeId}/webhooks/variables", { opts });
1439
+ }
1440
+ resend(body, opts) {
1441
+ return this.http.request("POST", "/v1/stores/{storeId}/webhooks/resend", { body, opts });
1442
+ }
1443
+ updateSubscription(webhookId, body, opts) {
1444
+ return this.http.request("PATCH", "/v1/stores/{storeId}/webhooks/{webhookId}", { path: { webhookId }, body, opts });
1445
+ }
1446
+ }
1447
+ /** Typed client for the PayNow management API. */
1448
+ export class ManagementClient {
1449
+ /** Escape hatch for endpoints this SDK does not model. */
1450
+ $http;
1451
+ affiliateLinks;
1452
+ bans;
1453
+ checkout;
1454
+ coupons;
1455
+ customer_portal_sessions;
1456
+ customers;
1457
+ customVariables;
1458
+ dataMigrations;
1459
+ delivery;
1460
+ discord;
1461
+ downloadableFiles;
1462
+ gameServers;
1463
+ giftcards;
1464
+ globalCommands;
1465
+ invoices;
1466
+ marketing;
1467
+ navlinks;
1468
+ orders;
1469
+ paymentMethodTypes;
1470
+ payments;
1471
+ paymentSettings;
1472
+ productDependentMigrations;
1473
+ products;
1474
+ regionalPricing;
1475
+ sales;
1476
+ store;
1477
+ subscriptions;
1478
+ tags;
1479
+ tierGroups;
1480
+ trials;
1481
+ upsellSettings;
1482
+ webhooks;
1483
+ constructor(http) {
1484
+ this.$http = http;
1485
+ this.affiliateLinks = new AffiliateLinksResource(http);
1486
+ this.bans = new BansResource(http);
1487
+ this.checkout = new CheckoutResource(http);
1488
+ this.coupons = new CouponsResource(http);
1489
+ this.customer_portal_sessions = new CustomerPortalSessionsResource(http);
1490
+ this.customers = new CustomersResource(http);
1491
+ this.customVariables = new CustomVariablesResource(http);
1492
+ this.dataMigrations = new DataMigrationsResource(http);
1493
+ this.delivery = new DeliveryResource(http);
1494
+ this.discord = new DiscordResource(http);
1495
+ this.downloadableFiles = new DownloadableFilesResource(http);
1496
+ this.gameServers = new GameServersResource(http);
1497
+ this.giftcards = new GiftcardsResource(http);
1498
+ this.globalCommands = new GlobalCommandsResource(http);
1499
+ this.invoices = new InvoicesResource(http);
1500
+ this.marketing = new MarketingResource(http);
1501
+ this.navlinks = new NavlinksResource(http);
1502
+ this.orders = new OrdersResource(http);
1503
+ this.paymentMethodTypes = new PaymentMethodTypesResource(http);
1504
+ this.payments = new PaymentsResource(http);
1505
+ this.paymentSettings = new PaymentSettingsResource(http);
1506
+ this.productDependentMigrations = new ProductDependentMigrationsResource(http);
1507
+ this.products = new ProductsResource(http);
1508
+ this.regionalPricing = new RegionalPricingResource(http);
1509
+ this.sales = new SalesResource(http);
1510
+ this.store = new StoreResource(http);
1511
+ this.subscriptions = new SubscriptionsResource(http);
1512
+ this.tags = new TagsResource(http);
1513
+ this.tierGroups = new TierGroupsResource(http);
1514
+ this.trials = new TrialsResource(http);
1515
+ this.upsellSettings = new UpsellSettingsResource(http);
1516
+ this.webhooks = new WebhooksResource(http);
1517
+ }
1518
+ }
1519
+ /** Creates a ManagementClient that authenticates and scopes every request. */
1520
+ export function createManagementClient(options) {
1521
+ const headers = { ...options.headers };
1522
+ headers.Authorization = `APIKey ${options.apiKey}`;
1523
+ return new ManagementClient(new HttpClient({
1524
+ baseUrl: options.baseUrl,
1525
+ timeoutMs: options.timeoutMs,
1526
+ fetch: options.fetch,
1527
+ headers,
1528
+ pathDefaults: { storeId: options.storeId, store_id: options.storeId },
1529
+ }));
1530
+ }
1531
+ //# sourceMappingURL=client.js.map