@delopay/sdk 0.400.0 → 0.407.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.
package/dist/internal.cjs CHANGED
@@ -195,6 +195,7 @@ __export(internal_exports, {
195
195
  Subscriptions: () => Subscriptions,
196
196
  Support: () => Support,
197
197
  UNKNOWN_SECTION_ORDER: () => UNKNOWN_SECTION_ORDER,
198
+ VatRates: () => VatRates,
198
199
  WCAG_AA_TEXT: () => WCAG_AA_TEXT,
199
200
  WCAG_AA_UI: () => WCAG_AA_UI,
200
201
  WHOP_ACCENT_COLORS: () => WHOP_ACCENT_COLORS,
@@ -564,6 +565,23 @@ var ApiKeys = class {
564
565
  async list(merchantId) {
565
566
  return this.request("GET", `/api-keys/${encodeURIComponent(merchantId)}/list`);
566
567
  }
568
+ /**
569
+ * The key templates the caller may use, with the values each prefills.
570
+ * Create the key with `create`; the template itself is not sent.
571
+ * `GET /api-keys/{merchantId}/templates`
572
+ *
573
+ * @param merchantId - The merchant account ID.
574
+ * @returns The templates, each limited to what the caller may grant.
575
+ *
576
+ * @example
577
+ * ```typescript
578
+ * const { templates } = await delopay.apiKeys.listTemplates('merch_123');
579
+ * const readOnly = templates.find((t) => t.id === 'ai_agent_read_only');
580
+ * ```
581
+ */
582
+ async listTemplates(merchantId) {
583
+ return this.request("GET", `/api-keys/${encodeURIComponent(merchantId)}/templates`);
584
+ }
567
585
  // --- Profile-scoped (shop-level) API keys ---------------------------------
568
586
  //
569
587
  // JWT-authenticated routes under `/account/{merchantId}/profile/api-keys`.
@@ -7137,6 +7155,12 @@ var Export = class {
7137
7155
  options
7138
7156
  );
7139
7157
  }
7158
+ async vatReport(params, options) {
7159
+ return runExport(this.request, "GET", "/export/vat-report", queried(params), options);
7160
+ }
7161
+ async vatReportForProfile(params, options) {
7162
+ return runExport(this.request, "GET", "/export/profile/vat-report", queried(params), options);
7163
+ }
7140
7164
  async auditLog(params, options) {
7141
7165
  return runExport(
7142
7166
  this.request,
@@ -7435,6 +7459,24 @@ var SellToRestrictions = class {
7435
7459
  }
7436
7460
  };
7437
7461
 
7462
+ // src/resources/vatRates.ts
7463
+ var VatRates = class {
7464
+ constructor(request) {
7465
+ this.request = request;
7466
+ }
7467
+ /**
7468
+ * List the rates, by country, category and `valid_from`. With `on`, only
7469
+ * the row in force on that date for each country and category.
7470
+ *
7471
+ * `GET /vat-rates`
7472
+ */
7473
+ async list(params) {
7474
+ return this.request("GET", "/vat-rates", {
7475
+ query: { country: params?.country, on: params?.on }
7476
+ });
7477
+ }
7478
+ };
7479
+
7438
7480
  // src/resources/buyerBlocklist.ts
7439
7481
  var BuyerBlocklist = class {
7440
7482
  constructor(request) {
@@ -7901,6 +7943,17 @@ var PayoutDestinations = class {
7901
7943
  body: { user_id: userId }
7902
7944
  });
7903
7945
  }
7946
+ /**
7947
+ * The merchant's revenue-share holders, each with the team member it is
7948
+ * linked to, if any.
7949
+ *
7950
+ * `GET /revenue-shares/holders?merchant_id={merchantId}`
7951
+ */
7952
+ async listRevenueShareHolders(merchantId) {
7953
+ return this.request("GET", "/revenue-shares/holders", {
7954
+ query: { merchant_id: merchantId }
7955
+ });
7956
+ }
7904
7957
  /**
7905
7958
  * The share terms of the holders linked to the caller. Read-only.
7906
7959
  *
@@ -8525,6 +8578,54 @@ var Products = class {
8525
8578
  ...this.scoped(profileId, options)
8526
8579
  });
8527
8580
  }
8581
+ /**
8582
+ * Copy a test product to live: its names, active prices under new ids,
8583
+ * image, tax category, category, selection groups and bundle composition.
8584
+ * A test product it contains or offers is replaced by its live copy; one
8585
+ * without a live copy refuses the copy. Nothing at a payment provider is
8586
+ * copied. A repeated copy returns the existing live copy unless `another`
8587
+ * is set (`created` says which).
8588
+ * `POST /products/{product_id}/copy-to-live`
8589
+ */
8590
+ async copyToLive(productId, params, profileId, options) {
8591
+ return this.request("POST", `/products/${encodeURIComponent(productId)}/copy-to-live`, {
8592
+ body: params,
8593
+ ...this.scoped(profileId, options)
8594
+ });
8595
+ }
8596
+ /**
8597
+ * What `copyToLive` would do, with nothing written. A copy that would be
8598
+ * refused answers with the copy's error.
8599
+ * `GET /products/{product_id}/copy-to-live/preview`
8600
+ */
8601
+ async previewCopyToLive(productId, query, profileId, options) {
8602
+ return this.request("GET", `/products/${encodeURIComponent(productId)}/copy-to-live/preview`, {
8603
+ query: query === void 0 ? void 0 : { ...query },
8604
+ ...this.scoped(profileId, options)
8605
+ });
8606
+ }
8607
+ /**
8608
+ * The shop's products from before modes, newest first, each with where it
8609
+ * is in use per mode.
8610
+ * `GET /products/legacy-usage`
8611
+ */
8612
+ async legacyUsage(params, profileId, options) {
8613
+ return this.request("GET", "/products/legacy-usage", {
8614
+ query: params === void 0 ? void 0 : { ...params },
8615
+ ...this.scoped(profileId, options)
8616
+ });
8617
+ }
8618
+ /**
8619
+ * Give a product from before modes the mode it belongs to, once. Refused
8620
+ * while the other mode still uses it, or when it already has a mode.
8621
+ * `POST /products/{product_id}/assign-mode`
8622
+ */
8623
+ async assignMode(productId, params, profileId, options) {
8624
+ return this.request("POST", `/products/${encodeURIComponent(productId)}/assign-mode`, {
8625
+ body: params,
8626
+ ...this.scoped(profileId, options)
8627
+ });
8628
+ }
8528
8629
  /**
8529
8630
  * Put an archived product back on sale.
8530
8631
  * `POST /products/{product_id}/restore`
@@ -12004,6 +12105,7 @@ var Delopay = class {
12004
12105
  this.regions = new Regions(request);
12005
12106
  this.availabilityOverrides = new AvailabilityOverrides(request);
12006
12107
  this.sellToRestrictions = new SellToRestrictions(request);
12108
+ this.vatRates = new VatRates(request);
12007
12109
  this.buyerBlocklist = new BuyerBlocklist(request);
12008
12110
  this.persons = new Persons(request);
12009
12111
  this.shopLabels = new ShopLabels(request);
@@ -17103,6 +17205,29 @@ var CheckoutSession = class {
17103
17205
  headers: this.bearerHeaders(options?.headers)
17104
17206
  });
17105
17207
  }
17208
+ /**
17209
+ * Send the buyer's tax country, region and VAT ID while the checkout data's
17210
+ * `tax.step` is `open`, and get the VAT the payment carries for them.
17211
+ *
17212
+ * `close: false` recalculates and keeps the step open, for a live total
17213
+ * while the buyer types; it also opens a confirmed step again while nothing
17214
+ * was prepared at a provider. `close: true` recalculates and confirms: the
17215
+ * payment is charged what the answer says, and the checkout data, fetched
17216
+ * again, answers the payment methods with `tax.step` `closed`. A confirmed
17217
+ * step answers the same closing request again. A change once something was
17218
+ * prepared at a provider is refused with `DE_28` (409), as is one while the
17219
+ * add-on choice is open or after the checkout expired. A malformed country
17220
+ * or region is refused with `IR_06` (400).
17221
+ *
17222
+ * `POST /payment-link/{merchantId}/{paymentId}/tax`
17223
+ */
17224
+ async submitTax(params, options) {
17225
+ return this.client.request("POST", `${this.linkBase}/tax`, {
17226
+ body: params,
17227
+ ...options,
17228
+ headers: this.bearerHeaders(options?.headers)
17229
+ });
17230
+ }
17106
17231
  /**
17107
17232
  * The payment's identity verification step: whether the payment asked for
17108
17233
  * one, its outcome, and the provider's page while it is pending. A pending
@@ -18881,13 +19006,32 @@ var AdminPortal = class {
18881
19006
  });
18882
19007
  }
18883
19008
  /**
18884
- * Every shop's device intelligence account, with its assessments per environment and
18885
- * its error rate over the last `window_days` days. The error rate counts finished
18886
- * assessments: one still running and a payment naming no buyer are not errors.
19009
+ * Every shop's device intelligence account, with its merchant's and its own
19010
+ * name and its assessments per environment over the last `days` days: counts
19011
+ * and error rate, failures by reason, finished assessments per day and
19012
+ * provider, the last recorded assessment, browser payments against assessed
19013
+ * ones, and the payments held for a missing assessment. The error rate counts
19014
+ * finished assessments: one still running and a payment naming no buyer are
19015
+ * not errors.
18887
19016
  * `GET /admin-portal/device-intelligence`
18888
19017
  */
18889
- async deviceIntelligenceUsage() {
18890
- return this.request("GET", "/admin-portal/device-intelligence");
19018
+ async deviceIntelligenceUsage(params = {}) {
19019
+ return this.request("GET", "/admin-portal/device-intelligence", {
19020
+ query: params
19021
+ });
19022
+ }
19023
+ /**
19024
+ * The payments behind one number of the device intelligence overview, one
19025
+ * page at a time: the assessments it counts, the payments held for a missing
19026
+ * assessment, or the browser payments without a device signal. With the same
19027
+ * `days` a list's `total` is the count it was opened from. A row carries
19028
+ * nothing about the buyer.
19029
+ * `GET /admin-portal/device-intelligence/payments`
19030
+ */
19031
+ async deviceIntelligencePayments(params = {}) {
19032
+ return this.request("GET", "/admin-portal/device-intelligence/payments", {
19033
+ query: params
19034
+ });
18891
19035
  }
18892
19036
  /**
18893
19037
  * PSP analytics across merchants: the merchant surface's
@@ -19416,6 +19560,50 @@ var AdminPortal = class {
19416
19560
  `/admin-portal/processor-costs/${encodeURIComponent(scheduleId)}`
19417
19561
  );
19418
19562
  }
19563
+ /**
19564
+ * The platform VAT rate table, every row past and future. With `on`, only
19565
+ * the row in force on that date for each country and category.
19566
+ *
19567
+ * `GET /admin-portal/vat-rates`
19568
+ */
19569
+ async listVatRates(params) {
19570
+ return this.request("GET", "/admin-portal/vat-rates", {
19571
+ query: { country: params?.country, on: params?.on }
19572
+ });
19573
+ }
19574
+ /**
19575
+ * Add a rate for a country and category from `valid_from` on. A rate change
19576
+ * is a new row with a later `valid_from`; the earlier row keeps pricing the
19577
+ * days before it. A second row for the same country, category and date is
19578
+ * refused with `IR_38`.
19579
+ *
19580
+ * `POST /admin-portal/vat-rates`
19581
+ */
19582
+ async createVatRate(params) {
19583
+ return this.request("POST", "/admin-portal/vat-rates", { body: params });
19584
+ }
19585
+ /**
19586
+ * Change a rate's label, or the rate of a row that has not started yet. A
19587
+ * row in force (`valid_from` on or before today, UTC) keeps its rate:
19588
+ * payments were determined on it, and a new `rate_bp` is refused with
19589
+ * `DE_29` (409).
19590
+ *
19591
+ * `PUT /admin-portal/vat-rates/{rateId}`
19592
+ */
19593
+ async updateVatRate(rateId, params) {
19594
+ return this.request("PUT", `/admin-portal/vat-rates/${encodeURIComponent(rateId)}`, {
19595
+ body: params
19596
+ });
19597
+ }
19598
+ /**
19599
+ * Delete a rate that has not started yet. A row in force is refused with
19600
+ * `DE_29` (409); add a row with a later `valid_from` instead.
19601
+ *
19602
+ * `DELETE /admin-portal/vat-rates/{rateId}`
19603
+ */
19604
+ async deleteVatRate(rateId) {
19605
+ return this.request("DELETE", `/admin-portal/vat-rates/${encodeURIComponent(rateId)}`);
19606
+ }
19419
19607
  /**
19420
19608
  * One shop's statement periods, newest first. Same shape as the
19421
19609
  * merchant-facing `settlement.listPeriods`, admin-authenticated.
@@ -20874,6 +21062,7 @@ var DelopayInternal = class extends Delopay {
20874
21062
  Subscriptions,
20875
21063
  Support,
20876
21064
  UNKNOWN_SECTION_ORDER,
21065
+ VatRates,
20877
21066
  WCAG_AA_TEXT,
20878
21067
  WCAG_AA_UI,
20879
21068
  WHOP_ACCENT_COLORS,