@paid-ai/paid-node 1.1.0 → 1.2.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 (205) hide show
  1. package/README.md +2 -0
  2. package/dist/cjs/Client.d.ts +12 -0
  3. package/dist/cjs/Client.js +34 -14
  4. package/dist/cjs/api/resources/checkouts/client/Client.d.ts +84 -0
  5. package/dist/cjs/api/resources/checkouts/client/Client.js +350 -0
  6. package/dist/cjs/api/resources/checkouts/client/index.d.ts +1 -0
  7. package/dist/cjs/api/resources/checkouts/client/index.js +17 -0
  8. package/dist/cjs/api/resources/checkouts/client/requests/ArchiveCheckoutRequest.d.ts +9 -0
  9. package/dist/cjs/api/resources/checkouts/client/requests/ArchiveCheckoutRequest.js +3 -0
  10. package/dist/cjs/api/resources/checkouts/client/requests/CreateCheckoutRequest.d.ts +25 -0
  11. package/dist/cjs/api/resources/checkouts/client/requests/CreateCheckoutRequest.js +3 -0
  12. package/dist/cjs/api/resources/checkouts/client/requests/GetCheckoutRequest.d.ts +9 -0
  13. package/dist/cjs/api/resources/checkouts/client/requests/GetCheckoutRequest.js +3 -0
  14. package/dist/cjs/api/resources/checkouts/client/requests/ListCheckoutsRequest.d.ts +10 -0
  15. package/dist/cjs/api/resources/checkouts/client/requests/ListCheckoutsRequest.js +3 -0
  16. package/dist/cjs/api/resources/checkouts/client/requests/index.d.ts +4 -0
  17. package/dist/cjs/api/resources/checkouts/client/requests/index.js +2 -0
  18. package/dist/cjs/api/resources/checkouts/index.d.ts +2 -0
  19. package/dist/cjs/api/resources/checkouts/index.js +18 -0
  20. package/dist/cjs/api/resources/checkouts/types/ListCheckoutsRequestStatus.d.ts +6 -0
  21. package/dist/cjs/api/resources/checkouts/types/ListCheckoutsRequestStatus.js +9 -0
  22. package/dist/cjs/api/resources/checkouts/types/index.d.ts +1 -0
  23. package/dist/cjs/api/resources/checkouts/types/index.js +17 -0
  24. package/dist/cjs/api/resources/credits/client/Client.d.ts +27 -0
  25. package/dist/cjs/api/resources/credits/client/Client.js +123 -0
  26. package/dist/cjs/api/resources/credits/client/index.d.ts +1 -0
  27. package/dist/cjs/api/resources/credits/client/index.js +2 -0
  28. package/dist/cjs/api/resources/credits/index.d.ts +1 -0
  29. package/dist/cjs/api/resources/credits/index.js +17 -0
  30. package/dist/cjs/api/resources/customerPortals/client/Client.d.ts +30 -0
  31. package/dist/cjs/api/resources/customerPortals/client/Client.js +133 -0
  32. package/dist/cjs/api/resources/customerPortals/client/index.d.ts +1 -0
  33. package/dist/cjs/api/resources/customerPortals/client/index.js +17 -0
  34. package/dist/cjs/api/resources/customerPortals/client/requests/CreateCustomerPortalRequest.d.ts +12 -0
  35. package/dist/cjs/api/resources/customerPortals/client/requests/CreateCustomerPortalRequest.js +3 -0
  36. package/dist/cjs/api/resources/customerPortals/client/requests/index.d.ts +1 -0
  37. package/dist/cjs/api/resources/customerPortals/client/requests/index.js +2 -0
  38. package/dist/cjs/api/resources/customerPortals/index.d.ts +1 -0
  39. package/dist/cjs/api/resources/customerPortals/index.js +17 -0
  40. package/dist/cjs/api/resources/customers/client/Client.d.ts +36 -0
  41. package/dist/cjs/api/resources/customers/client/Client.js +142 -0
  42. package/dist/cjs/api/resources/customers/client/requests/GetCustomerCreditBalancesByExternalIdRequest.d.ts +9 -0
  43. package/dist/cjs/api/resources/customers/client/requests/GetCustomerCreditBalancesByExternalIdRequest.js +3 -0
  44. package/dist/cjs/api/resources/customers/client/requests/GetCustomerCreditBalancesRequest.d.ts +9 -0
  45. package/dist/cjs/api/resources/customers/client/requests/GetCustomerCreditBalancesRequest.js +3 -0
  46. package/dist/cjs/api/resources/customers/client/requests/index.d.ts +2 -0
  47. package/dist/cjs/api/resources/index.d.ts +8 -0
  48. package/dist/cjs/api/resources/index.js +9 -1
  49. package/dist/cjs/api/resources/orders/client/requests/CreateOrderRequest.d.ts +11 -7
  50. package/dist/cjs/api/resources/orders/client/requests/UpdateOrderRequest.d.ts +10 -7
  51. package/dist/cjs/api/resources/valueReceipts/client/Client.d.ts +75 -0
  52. package/dist/cjs/api/resources/valueReceipts/client/Client.js +347 -0
  53. package/dist/cjs/api/resources/valueReceipts/client/index.d.ts +1 -0
  54. package/dist/cjs/api/resources/valueReceipts/client/index.js +17 -0
  55. package/dist/cjs/api/resources/valueReceipts/client/requests/GetValueReceiptByIdRequest.d.ts +9 -0
  56. package/dist/cjs/api/resources/valueReceipts/client/requests/GetValueReceiptByIdRequest.js +3 -0
  57. package/dist/cjs/api/resources/valueReceipts/client/requests/ListValueReceiptsRequest.d.ts +10 -0
  58. package/dist/cjs/api/resources/valueReceipts/client/requests/ListValueReceiptsRequest.js +3 -0
  59. package/dist/cjs/api/resources/valueReceipts/client/requests/PublishValueReceiptBody.d.ts +10 -0
  60. package/dist/cjs/api/resources/valueReceipts/client/requests/PublishValueReceiptBody.js +3 -0
  61. package/dist/cjs/api/resources/valueReceipts/client/requests/UnpublishValueReceiptRequest.d.ts +9 -0
  62. package/dist/cjs/api/resources/valueReceipts/client/requests/UnpublishValueReceiptRequest.js +3 -0
  63. package/dist/cjs/api/resources/valueReceipts/client/requests/index.d.ts +4 -0
  64. package/dist/cjs/api/resources/valueReceipts/client/requests/index.js +2 -0
  65. package/dist/cjs/api/resources/valueReceipts/index.d.ts +1 -0
  66. package/dist/cjs/api/resources/valueReceipts/index.js +17 -0
  67. package/dist/cjs/api/types/Checkout.d.ts +19 -0
  68. package/dist/cjs/api/types/Checkout.js +3 -0
  69. package/dist/cjs/api/types/CheckoutListResponse.d.ts +5 -0
  70. package/dist/cjs/api/types/CheckoutListResponse.js +3 -0
  71. package/dist/cjs/api/types/CheckoutProduct.d.ts +3 -0
  72. package/dist/cjs/api/types/CheckoutProduct.js +3 -0
  73. package/dist/cjs/api/types/CheckoutProductInput.d.ts +3 -0
  74. package/dist/cjs/api/types/CheckoutProductInput.js +3 -0
  75. package/dist/cjs/api/types/CheckoutStatus.d.ts +7 -0
  76. package/dist/cjs/api/types/CheckoutStatus.js +10 -0
  77. package/dist/cjs/api/types/CreateOrderLineAttributeRequest.d.ts +116 -1
  78. package/dist/cjs/api/types/CreateOrderLineAttributeRequest.js +70 -0
  79. package/dist/cjs/api/types/CreateOrderLineRequest.d.ts +3 -3
  80. package/dist/cjs/api/types/CreditBalance.d.ts +19 -0
  81. package/dist/cjs/api/types/CreditBalance.js +11 -0
  82. package/dist/cjs/api/types/CreditBalanceListResponse.d.ts +4 -0
  83. package/dist/cjs/api/types/CreditBalanceListResponse.js +3 -0
  84. package/dist/cjs/api/types/CreditCurrency.d.ts +9 -0
  85. package/dist/cjs/api/types/CreditCurrency.js +3 -0
  86. package/dist/cjs/api/types/CreditCurrencyListResponse.d.ts +4 -0
  87. package/dist/cjs/api/types/CreditCurrencyListResponse.js +3 -0
  88. package/dist/cjs/api/types/CustomerPortal.d.ts +10 -0
  89. package/dist/cjs/api/types/CustomerPortal.js +3 -0
  90. package/dist/cjs/api/types/CustomerPortalStatus.d.ts +5 -0
  91. package/dist/cjs/api/types/CustomerPortalStatus.js +8 -0
  92. package/dist/cjs/api/types/Order.d.ts +3 -0
  93. package/dist/cjs/api/types/ValueReceiptDetail.d.ts +19 -0
  94. package/dist/cjs/api/types/ValueReceiptDetail.js +3 -0
  95. package/dist/cjs/api/types/ValueReceiptListResponse.d.ts +5 -0
  96. package/dist/cjs/api/types/ValueReceiptListResponse.js +3 -0
  97. package/dist/cjs/api/types/ValueReceiptSummary.d.ts +16 -0
  98. package/dist/cjs/api/types/ValueReceiptSummary.js +3 -0
  99. package/dist/cjs/api/types/index.d.ts +14 -0
  100. package/dist/cjs/api/types/index.js +14 -0
  101. package/dist/cjs/version.d.ts +1 -1
  102. package/dist/cjs/version.js +1 -1
  103. package/dist/esm/Client.d.mts +12 -0
  104. package/dist/esm/Client.mjs +22 -2
  105. package/dist/esm/api/resources/checkouts/client/Client.d.mts +84 -0
  106. package/dist/esm/api/resources/checkouts/client/Client.mjs +313 -0
  107. package/dist/esm/api/resources/checkouts/client/index.d.mts +1 -0
  108. package/dist/esm/api/resources/checkouts/client/index.mjs +1 -0
  109. package/dist/esm/api/resources/checkouts/client/requests/ArchiveCheckoutRequest.d.mts +9 -0
  110. package/dist/esm/api/resources/checkouts/client/requests/ArchiveCheckoutRequest.mjs +2 -0
  111. package/dist/esm/api/resources/checkouts/client/requests/CreateCheckoutRequest.d.mts +25 -0
  112. package/dist/esm/api/resources/checkouts/client/requests/CreateCheckoutRequest.mjs +2 -0
  113. package/dist/esm/api/resources/checkouts/client/requests/GetCheckoutRequest.d.mts +9 -0
  114. package/dist/esm/api/resources/checkouts/client/requests/GetCheckoutRequest.mjs +2 -0
  115. package/dist/esm/api/resources/checkouts/client/requests/ListCheckoutsRequest.d.mts +10 -0
  116. package/dist/esm/api/resources/checkouts/client/requests/ListCheckoutsRequest.mjs +2 -0
  117. package/dist/esm/api/resources/checkouts/client/requests/index.d.mts +4 -0
  118. package/dist/esm/api/resources/checkouts/client/requests/index.mjs +1 -0
  119. package/dist/esm/api/resources/checkouts/index.d.mts +2 -0
  120. package/dist/esm/api/resources/checkouts/index.mjs +2 -0
  121. package/dist/esm/api/resources/checkouts/types/ListCheckoutsRequestStatus.d.mts +6 -0
  122. package/dist/esm/api/resources/checkouts/types/ListCheckoutsRequestStatus.mjs +6 -0
  123. package/dist/esm/api/resources/checkouts/types/index.d.mts +1 -0
  124. package/dist/esm/api/resources/checkouts/types/index.mjs +1 -0
  125. package/dist/esm/api/resources/credits/client/Client.d.mts +27 -0
  126. package/dist/esm/api/resources/credits/client/Client.mjs +86 -0
  127. package/dist/esm/api/resources/credits/client/index.d.mts +1 -0
  128. package/dist/esm/api/resources/credits/client/index.mjs +1 -0
  129. package/dist/esm/api/resources/credits/index.d.mts +1 -0
  130. package/dist/esm/api/resources/credits/index.mjs +1 -0
  131. package/dist/esm/api/resources/customerPortals/client/Client.d.mts +30 -0
  132. package/dist/esm/api/resources/customerPortals/client/Client.mjs +96 -0
  133. package/dist/esm/api/resources/customerPortals/client/index.d.mts +1 -0
  134. package/dist/esm/api/resources/customerPortals/client/index.mjs +1 -0
  135. package/dist/esm/api/resources/customerPortals/client/requests/CreateCustomerPortalRequest.d.mts +12 -0
  136. package/dist/esm/api/resources/customerPortals/client/requests/CreateCustomerPortalRequest.mjs +2 -0
  137. package/dist/esm/api/resources/customerPortals/client/requests/index.d.mts +1 -0
  138. package/dist/esm/api/resources/customerPortals/client/requests/index.mjs +1 -0
  139. package/dist/esm/api/resources/customerPortals/index.d.mts +1 -0
  140. package/dist/esm/api/resources/customerPortals/index.mjs +1 -0
  141. package/dist/esm/api/resources/customers/client/Client.d.mts +36 -0
  142. package/dist/esm/api/resources/customers/client/Client.mjs +142 -0
  143. package/dist/esm/api/resources/customers/client/requests/GetCustomerCreditBalancesByExternalIdRequest.d.mts +9 -0
  144. package/dist/esm/api/resources/customers/client/requests/GetCustomerCreditBalancesByExternalIdRequest.mjs +2 -0
  145. package/dist/esm/api/resources/customers/client/requests/GetCustomerCreditBalancesRequest.d.mts +9 -0
  146. package/dist/esm/api/resources/customers/client/requests/GetCustomerCreditBalancesRequest.mjs +2 -0
  147. package/dist/esm/api/resources/customers/client/requests/index.d.mts +2 -0
  148. package/dist/esm/api/resources/index.d.mts +8 -0
  149. package/dist/esm/api/resources/index.mjs +8 -0
  150. package/dist/esm/api/resources/orders/client/requests/CreateOrderRequest.d.mts +11 -7
  151. package/dist/esm/api/resources/orders/client/requests/UpdateOrderRequest.d.mts +10 -7
  152. package/dist/esm/api/resources/valueReceipts/client/Client.d.mts +75 -0
  153. package/dist/esm/api/resources/valueReceipts/client/Client.mjs +310 -0
  154. package/dist/esm/api/resources/valueReceipts/client/index.d.mts +1 -0
  155. package/dist/esm/api/resources/valueReceipts/client/index.mjs +1 -0
  156. package/dist/esm/api/resources/valueReceipts/client/requests/GetValueReceiptByIdRequest.d.mts +9 -0
  157. package/dist/esm/api/resources/valueReceipts/client/requests/GetValueReceiptByIdRequest.mjs +2 -0
  158. package/dist/esm/api/resources/valueReceipts/client/requests/ListValueReceiptsRequest.d.mts +10 -0
  159. package/dist/esm/api/resources/valueReceipts/client/requests/ListValueReceiptsRequest.mjs +2 -0
  160. package/dist/esm/api/resources/valueReceipts/client/requests/PublishValueReceiptBody.d.mts +10 -0
  161. package/dist/esm/api/resources/valueReceipts/client/requests/PublishValueReceiptBody.mjs +2 -0
  162. package/dist/esm/api/resources/valueReceipts/client/requests/UnpublishValueReceiptRequest.d.mts +9 -0
  163. package/dist/esm/api/resources/valueReceipts/client/requests/UnpublishValueReceiptRequest.mjs +2 -0
  164. package/dist/esm/api/resources/valueReceipts/client/requests/index.d.mts +4 -0
  165. package/dist/esm/api/resources/valueReceipts/client/requests/index.mjs +1 -0
  166. package/dist/esm/api/resources/valueReceipts/index.d.mts +1 -0
  167. package/dist/esm/api/resources/valueReceipts/index.mjs +1 -0
  168. package/dist/esm/api/types/Checkout.d.mts +19 -0
  169. package/dist/esm/api/types/Checkout.mjs +2 -0
  170. package/dist/esm/api/types/CheckoutListResponse.d.mts +5 -0
  171. package/dist/esm/api/types/CheckoutListResponse.mjs +2 -0
  172. package/dist/esm/api/types/CheckoutProduct.d.mts +3 -0
  173. package/dist/esm/api/types/CheckoutProduct.mjs +2 -0
  174. package/dist/esm/api/types/CheckoutProductInput.d.mts +3 -0
  175. package/dist/esm/api/types/CheckoutProductInput.mjs +2 -0
  176. package/dist/esm/api/types/CheckoutStatus.d.mts +7 -0
  177. package/dist/esm/api/types/CheckoutStatus.mjs +7 -0
  178. package/dist/esm/api/types/CreateOrderLineAttributeRequest.d.mts +116 -1
  179. package/dist/esm/api/types/CreateOrderLineAttributeRequest.mjs +69 -1
  180. package/dist/esm/api/types/CreateOrderLineRequest.d.mts +3 -3
  181. package/dist/esm/api/types/CreditBalance.d.mts +19 -0
  182. package/dist/esm/api/types/CreditBalance.mjs +8 -0
  183. package/dist/esm/api/types/CreditBalanceListResponse.d.mts +4 -0
  184. package/dist/esm/api/types/CreditBalanceListResponse.mjs +2 -0
  185. package/dist/esm/api/types/CreditCurrency.d.mts +9 -0
  186. package/dist/esm/api/types/CreditCurrency.mjs +2 -0
  187. package/dist/esm/api/types/CreditCurrencyListResponse.d.mts +4 -0
  188. package/dist/esm/api/types/CreditCurrencyListResponse.mjs +2 -0
  189. package/dist/esm/api/types/CustomerPortal.d.mts +10 -0
  190. package/dist/esm/api/types/CustomerPortal.mjs +2 -0
  191. package/dist/esm/api/types/CustomerPortalStatus.d.mts +5 -0
  192. package/dist/esm/api/types/CustomerPortalStatus.mjs +5 -0
  193. package/dist/esm/api/types/Order.d.mts +3 -0
  194. package/dist/esm/api/types/ValueReceiptDetail.d.mts +19 -0
  195. package/dist/esm/api/types/ValueReceiptDetail.mjs +2 -0
  196. package/dist/esm/api/types/ValueReceiptListResponse.d.mts +5 -0
  197. package/dist/esm/api/types/ValueReceiptListResponse.mjs +2 -0
  198. package/dist/esm/api/types/ValueReceiptSummary.d.mts +16 -0
  199. package/dist/esm/api/types/ValueReceiptSummary.mjs +2 -0
  200. package/dist/esm/api/types/index.d.mts +14 -0
  201. package/dist/esm/api/types/index.mjs +14 -0
  202. package/dist/esm/version.d.mts +1 -1
  203. package/dist/esm/version.mjs +1 -1
  204. package/package.json +3 -3
  205. package/reference.md +771 -0
package/README.md CHANGED
@@ -349,6 +349,7 @@ const signal: Paid.Signal = {
349
349
  "gen_ai.usage.input_tokens": 100,
350
350
  "gen_ai.usage.output_tokens": 300,
351
351
  "gen_ai.usage.cached_input_tokens": 600,
352
+ "gen_ai.usage.cache_creation_input_tokens": 250,
352
353
  },
353
354
  }
354
355
  }
@@ -379,6 +380,7 @@ async function main() {
379
380
  "gen_ai.usage.input_tokens": 100,
380
381
  "gen_ai.usage.output_tokens": 300,
381
382
  "gen_ai.usage.cached_input_tokens": 600,
383
+ "gen_ai.usage.cache_creation_input_tokens": 250,
382
384
  },
383
385
  }
384
386
  });
@@ -1,9 +1,13 @@
1
+ import { Checkouts } from "./api/resources/checkouts/client/Client.js";
1
2
  import { Contacts } from "./api/resources/contacts/client/Client.js";
3
+ import { Credits } from "./api/resources/credits/client/Client.js";
4
+ import { CustomerPortals } from "./api/resources/customerPortals/client/Client.js";
2
5
  import { Customers } from "./api/resources/customers/client/Client.js";
3
6
  import { Invoices } from "./api/resources/invoices/client/Client.js";
4
7
  import { Orders } from "./api/resources/orders/client/Client.js";
5
8
  import { Products } from "./api/resources/products/client/Client.js";
6
9
  import { Signals } from "./api/resources/signals/client/Client.js";
10
+ import { ValueReceipts } from "./api/resources/valueReceipts/client/Client.js";
7
11
  import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
8
12
  export declare namespace PaidClient {
9
13
  interface Options extends BaseClientOptions {
@@ -19,6 +23,10 @@ export declare class PaidClient {
19
23
  protected _orders: Orders | undefined;
20
24
  protected _invoices: Invoices | undefined;
21
25
  protected _signals: Signals | undefined;
26
+ protected _credits: Credits | undefined;
27
+ protected _checkouts: Checkouts | undefined;
28
+ protected _customerPortals: CustomerPortals | undefined;
29
+ protected _valueReceipts: ValueReceipts | undefined;
22
30
  constructor(_options: PaidClient.Options);
23
31
  get products(): Products;
24
32
  get customers(): Customers;
@@ -26,4 +34,8 @@ export declare class PaidClient {
26
34
  get orders(): Orders;
27
35
  get invoices(): Invoices;
28
36
  get signals(): Signals;
37
+ get credits(): Credits;
38
+ get checkouts(): Checkouts;
39
+ get customerPortals(): CustomerPortals;
40
+ get valueReceipts(): ValueReceipts;
29
41
  }
@@ -35,12 +35,16 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  })();
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.PaidClient = void 0;
38
- const Client_js_1 = require("./api/resources/contacts/client/Client.js");
39
- const Client_js_2 = require("./api/resources/customers/client/Client.js");
40
- const Client_js_3 = require("./api/resources/invoices/client/Client.js");
41
- const Client_js_4 = require("./api/resources/orders/client/Client.js");
42
- const Client_js_5 = require("./api/resources/products/client/Client.js");
43
- const Client_js_6 = require("./api/resources/signals/client/Client.js");
38
+ const Client_js_1 = require("./api/resources/checkouts/client/Client.js");
39
+ const Client_js_2 = require("./api/resources/contacts/client/Client.js");
40
+ const Client_js_3 = require("./api/resources/credits/client/Client.js");
41
+ const Client_js_4 = require("./api/resources/customerPortals/client/Client.js");
42
+ const Client_js_5 = require("./api/resources/customers/client/Client.js");
43
+ const Client_js_6 = require("./api/resources/invoices/client/Client.js");
44
+ const Client_js_7 = require("./api/resources/orders/client/Client.js");
45
+ const Client_js_8 = require("./api/resources/products/client/Client.js");
46
+ const Client_js_9 = require("./api/resources/signals/client/Client.js");
47
+ const Client_js_10 = require("./api/resources/valueReceipts/client/Client.js");
44
48
  const headers_js_1 = require("./core/headers.js");
45
49
  const core = __importStar(require("./core/index.js"));
46
50
  class PaidClient {
@@ -48,35 +52,51 @@ class PaidClient {
48
52
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
49
53
  "X-Fern-Language": "JavaScript",
50
54
  "X-Fern-SDK-Name": "@paid-ai/paid-node",
51
- "X-Fern-SDK-Version": "1.1.0",
52
- "User-Agent": "@paid-ai/paid-node/1.1.0",
55
+ "X-Fern-SDK-Version": "1.2.1",
56
+ "User-Agent": "@paid-ai/paid-node/1.2.1",
53
57
  "X-Fern-Runtime": core.RUNTIME.type,
54
58
  "X-Fern-Runtime-Version": core.RUNTIME.version,
55
59
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
56
60
  }
57
61
  get products() {
58
62
  var _a;
59
- return ((_a = this._products) !== null && _a !== void 0 ? _a : (this._products = new Client_js_5.Products(this._options)));
63
+ return ((_a = this._products) !== null && _a !== void 0 ? _a : (this._products = new Client_js_8.Products(this._options)));
60
64
  }
61
65
  get customers() {
62
66
  var _a;
63
- return ((_a = this._customers) !== null && _a !== void 0 ? _a : (this._customers = new Client_js_2.Customers(this._options)));
67
+ return ((_a = this._customers) !== null && _a !== void 0 ? _a : (this._customers = new Client_js_5.Customers(this._options)));
64
68
  }
65
69
  get contacts() {
66
70
  var _a;
67
- return ((_a = this._contacts) !== null && _a !== void 0 ? _a : (this._contacts = new Client_js_1.Contacts(this._options)));
71
+ return ((_a = this._contacts) !== null && _a !== void 0 ? _a : (this._contacts = new Client_js_2.Contacts(this._options)));
68
72
  }
69
73
  get orders() {
70
74
  var _a;
71
- return ((_a = this._orders) !== null && _a !== void 0 ? _a : (this._orders = new Client_js_4.Orders(this._options)));
75
+ return ((_a = this._orders) !== null && _a !== void 0 ? _a : (this._orders = new Client_js_7.Orders(this._options)));
72
76
  }
73
77
  get invoices() {
74
78
  var _a;
75
- return ((_a = this._invoices) !== null && _a !== void 0 ? _a : (this._invoices = new Client_js_3.Invoices(this._options)));
79
+ return ((_a = this._invoices) !== null && _a !== void 0 ? _a : (this._invoices = new Client_js_6.Invoices(this._options)));
76
80
  }
77
81
  get signals() {
78
82
  var _a;
79
- return ((_a = this._signals) !== null && _a !== void 0 ? _a : (this._signals = new Client_js_6.Signals(this._options)));
83
+ return ((_a = this._signals) !== null && _a !== void 0 ? _a : (this._signals = new Client_js_9.Signals(this._options)));
84
+ }
85
+ get credits() {
86
+ var _a;
87
+ return ((_a = this._credits) !== null && _a !== void 0 ? _a : (this._credits = new Client_js_3.Credits(this._options)));
88
+ }
89
+ get checkouts() {
90
+ var _a;
91
+ return ((_a = this._checkouts) !== null && _a !== void 0 ? _a : (this._checkouts = new Client_js_1.Checkouts(this._options)));
92
+ }
93
+ get customerPortals() {
94
+ var _a;
95
+ return ((_a = this._customerPortals) !== null && _a !== void 0 ? _a : (this._customerPortals = new Client_js_4.CustomerPortals(this._options)));
96
+ }
97
+ get valueReceipts() {
98
+ var _a;
99
+ return ((_a = this._valueReceipts) !== null && _a !== void 0 ? _a : (this._valueReceipts = new Client_js_10.ValueReceipts(this._options)));
80
100
  }
81
101
  }
82
102
  exports.PaidClient = PaidClient;
@@ -0,0 +1,84 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
+ import * as core from "../../../../core/index.js";
3
+ import * as Paid from "../../../index.js";
4
+ export declare namespace Checkouts {
5
+ interface Options extends BaseClientOptions {
6
+ }
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class Checkouts {
11
+ protected readonly _options: Checkouts.Options;
12
+ constructor(_options: Checkouts.Options);
13
+ /**
14
+ * Get a list of checkouts for the organization
15
+ *
16
+ * @param {Paid.ListCheckoutsRequest} request
17
+ * @param {Checkouts.RequestOptions} requestOptions - Request-specific configuration.
18
+ *
19
+ * @throws {@link Paid.BadRequestError}
20
+ * @throws {@link Paid.ForbiddenError}
21
+ * @throws {@link Paid.InternalServerError}
22
+ *
23
+ * @example
24
+ * await client.checkouts.listCheckouts()
25
+ */
26
+ listCheckouts(request?: Paid.ListCheckoutsRequest, requestOptions?: Checkouts.RequestOptions): core.HttpResponsePromise<Paid.CheckoutListResponse>;
27
+ private __listCheckouts;
28
+ /**
29
+ * Creates a checkout link that generates a URL for a customer to complete a purchase
30
+ *
31
+ * @param {Paid.CreateCheckoutRequest} request
32
+ * @param {Checkouts.RequestOptions} requestOptions - Request-specific configuration.
33
+ *
34
+ * @throws {@link Paid.BadRequestError}
35
+ * @throws {@link Paid.ForbiddenError}
36
+ * @throws {@link Paid.NotFoundError}
37
+ * @throws {@link Paid.InternalServerError}
38
+ *
39
+ * @example
40
+ * await client.checkouts.createCheckout({
41
+ * products: [{
42
+ * id: "id"
43
+ * }],
44
+ * successUrl: "successUrl"
45
+ * })
46
+ */
47
+ createCheckout(request: Paid.CreateCheckoutRequest, requestOptions?: Checkouts.RequestOptions): core.HttpResponsePromise<Paid.Checkout>;
48
+ private __createCheckout;
49
+ /**
50
+ * Get a checkout by ID
51
+ *
52
+ * @param {Paid.GetCheckoutRequest} request
53
+ * @param {Checkouts.RequestOptions} requestOptions - Request-specific configuration.
54
+ *
55
+ * @throws {@link Paid.ForbiddenError}
56
+ * @throws {@link Paid.NotFoundError}
57
+ * @throws {@link Paid.InternalServerError}
58
+ *
59
+ * @example
60
+ * await client.checkouts.getCheckout({
61
+ * id: "id"
62
+ * })
63
+ */
64
+ getCheckout(request: Paid.GetCheckoutRequest, requestOptions?: Checkouts.RequestOptions): core.HttpResponsePromise<Paid.Checkout>;
65
+ private __getCheckout;
66
+ /**
67
+ * Archive a checkout by ID
68
+ *
69
+ * @param {Paid.ArchiveCheckoutRequest} request
70
+ * @param {Checkouts.RequestOptions} requestOptions - Request-specific configuration.
71
+ *
72
+ * @throws {@link Paid.ForbiddenError}
73
+ * @throws {@link Paid.NotFoundError}
74
+ * @throws {@link Paid.InternalServerError}
75
+ *
76
+ * @example
77
+ * await client.checkouts.archiveCheckout({
78
+ * id: "id"
79
+ * })
80
+ */
81
+ archiveCheckout(request: Paid.ArchiveCheckoutRequest, requestOptions?: Checkouts.RequestOptions): core.HttpResponsePromise<Paid.EmptyResponse>;
82
+ private __archiveCheckout;
83
+ protected _getAuthorizationHeader(): Promise<string>;
84
+ }
@@ -0,0 +1,350 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.Checkouts = void 0;
47
+ const headers_js_1 = require("../../../../core/headers.js");
48
+ const core = __importStar(require("../../../../core/index.js"));
49
+ const environments = __importStar(require("../../../../environments.js"));
50
+ const errors = __importStar(require("../../../../errors/index.js"));
51
+ const Paid = __importStar(require("../../../index.js"));
52
+ class Checkouts {
53
+ constructor(_options) {
54
+ this._options = _options;
55
+ }
56
+ /**
57
+ * Get a list of checkouts for the organization
58
+ *
59
+ * @param {Paid.ListCheckoutsRequest} request
60
+ * @param {Checkouts.RequestOptions} requestOptions - Request-specific configuration.
61
+ *
62
+ * @throws {@link Paid.BadRequestError}
63
+ * @throws {@link Paid.ForbiddenError}
64
+ * @throws {@link Paid.InternalServerError}
65
+ *
66
+ * @example
67
+ * await client.checkouts.listCheckouts()
68
+ */
69
+ listCheckouts(request = {}, requestOptions) {
70
+ return core.HttpResponsePromise.fromPromise(this.__listCheckouts(request, requestOptions));
71
+ }
72
+ __listCheckouts() {
73
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
74
+ var _a, _b, _c, _d, _e, _f, _g, _h;
75
+ const { limit, offset, status } = request;
76
+ const _queryParams = {};
77
+ if (limit != null) {
78
+ _queryParams.limit = limit.toString();
79
+ }
80
+ if (offset != null) {
81
+ _queryParams.offset = offset.toString();
82
+ }
83
+ if (status != null) {
84
+ _queryParams.status = status;
85
+ }
86
+ const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
87
+ const _response = yield core.fetcher({
88
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, "checkouts/"),
89
+ method: "GET",
90
+ headers: _headers,
91
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
92
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
93
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
94
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
95
+ });
96
+ if (_response.ok) {
97
+ return { data: _response.body, rawResponse: _response.rawResponse };
98
+ }
99
+ if (_response.error.reason === "status-code") {
100
+ switch (_response.error.statusCode) {
101
+ case 400:
102
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
103
+ case 403:
104
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
105
+ case 500:
106
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
107
+ default:
108
+ throw new errors.PaidError({
109
+ statusCode: _response.error.statusCode,
110
+ body: _response.error.body,
111
+ rawResponse: _response.rawResponse,
112
+ });
113
+ }
114
+ }
115
+ switch (_response.error.reason) {
116
+ case "non-json":
117
+ throw new errors.PaidError({
118
+ statusCode: _response.error.statusCode,
119
+ body: _response.error.rawBody,
120
+ rawResponse: _response.rawResponse,
121
+ });
122
+ case "timeout":
123
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /checkouts/.");
124
+ case "unknown":
125
+ throw new errors.PaidError({
126
+ message: _response.error.errorMessage,
127
+ rawResponse: _response.rawResponse,
128
+ });
129
+ }
130
+ });
131
+ }
132
+ /**
133
+ * Creates a checkout link that generates a URL for a customer to complete a purchase
134
+ *
135
+ * @param {Paid.CreateCheckoutRequest} request
136
+ * @param {Checkouts.RequestOptions} requestOptions - Request-specific configuration.
137
+ *
138
+ * @throws {@link Paid.BadRequestError}
139
+ * @throws {@link Paid.ForbiddenError}
140
+ * @throws {@link Paid.NotFoundError}
141
+ * @throws {@link Paid.InternalServerError}
142
+ *
143
+ * @example
144
+ * await client.checkouts.createCheckout({
145
+ * products: [{
146
+ * id: "id"
147
+ * }],
148
+ * successUrl: "successUrl"
149
+ * })
150
+ */
151
+ createCheckout(request, requestOptions) {
152
+ return core.HttpResponsePromise.fromPromise(this.__createCheckout(request, requestOptions));
153
+ }
154
+ __createCheckout(request, requestOptions) {
155
+ return __awaiter(this, void 0, void 0, function* () {
156
+ var _a, _b, _c, _d, _e, _f, _g, _h;
157
+ const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
158
+ const _response = yield core.fetcher({
159
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, "checkouts/"),
160
+ method: "POST",
161
+ headers: _headers,
162
+ contentType: "application/json",
163
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
164
+ requestType: "json",
165
+ body: request,
166
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
167
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
168
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
169
+ });
170
+ if (_response.ok) {
171
+ return { data: _response.body, rawResponse: _response.rawResponse };
172
+ }
173
+ if (_response.error.reason === "status-code") {
174
+ switch (_response.error.statusCode) {
175
+ case 400:
176
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
177
+ case 403:
178
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
179
+ case 404:
180
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
181
+ case 500:
182
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
183
+ default:
184
+ throw new errors.PaidError({
185
+ statusCode: _response.error.statusCode,
186
+ body: _response.error.body,
187
+ rawResponse: _response.rawResponse,
188
+ });
189
+ }
190
+ }
191
+ switch (_response.error.reason) {
192
+ case "non-json":
193
+ throw new errors.PaidError({
194
+ statusCode: _response.error.statusCode,
195
+ body: _response.error.rawBody,
196
+ rawResponse: _response.rawResponse,
197
+ });
198
+ case "timeout":
199
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /checkouts/.");
200
+ case "unknown":
201
+ throw new errors.PaidError({
202
+ message: _response.error.errorMessage,
203
+ rawResponse: _response.rawResponse,
204
+ });
205
+ }
206
+ });
207
+ }
208
+ /**
209
+ * Get a checkout by ID
210
+ *
211
+ * @param {Paid.GetCheckoutRequest} request
212
+ * @param {Checkouts.RequestOptions} requestOptions - Request-specific configuration.
213
+ *
214
+ * @throws {@link Paid.ForbiddenError}
215
+ * @throws {@link Paid.NotFoundError}
216
+ * @throws {@link Paid.InternalServerError}
217
+ *
218
+ * @example
219
+ * await client.checkouts.getCheckout({
220
+ * id: "id"
221
+ * })
222
+ */
223
+ getCheckout(request, requestOptions) {
224
+ return core.HttpResponsePromise.fromPromise(this.__getCheckout(request, requestOptions));
225
+ }
226
+ __getCheckout(request, requestOptions) {
227
+ return __awaiter(this, void 0, void 0, function* () {
228
+ var _a, _b, _c, _d, _e, _f, _g, _h;
229
+ const { id } = request;
230
+ const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
231
+ const _response = yield core.fetcher({
232
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `checkouts/${core.url.encodePathParam(id)}`),
233
+ method: "GET",
234
+ headers: _headers,
235
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
236
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
237
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
238
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
239
+ });
240
+ if (_response.ok) {
241
+ return { data: _response.body, rawResponse: _response.rawResponse };
242
+ }
243
+ if (_response.error.reason === "status-code") {
244
+ switch (_response.error.statusCode) {
245
+ case 403:
246
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
247
+ case 404:
248
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
249
+ case 500:
250
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
251
+ default:
252
+ throw new errors.PaidError({
253
+ statusCode: _response.error.statusCode,
254
+ body: _response.error.body,
255
+ rawResponse: _response.rawResponse,
256
+ });
257
+ }
258
+ }
259
+ switch (_response.error.reason) {
260
+ case "non-json":
261
+ throw new errors.PaidError({
262
+ statusCode: _response.error.statusCode,
263
+ body: _response.error.rawBody,
264
+ rawResponse: _response.rawResponse,
265
+ });
266
+ case "timeout":
267
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /checkouts/{id}.");
268
+ case "unknown":
269
+ throw new errors.PaidError({
270
+ message: _response.error.errorMessage,
271
+ rawResponse: _response.rawResponse,
272
+ });
273
+ }
274
+ });
275
+ }
276
+ /**
277
+ * Archive a checkout by ID
278
+ *
279
+ * @param {Paid.ArchiveCheckoutRequest} request
280
+ * @param {Checkouts.RequestOptions} requestOptions - Request-specific configuration.
281
+ *
282
+ * @throws {@link Paid.ForbiddenError}
283
+ * @throws {@link Paid.NotFoundError}
284
+ * @throws {@link Paid.InternalServerError}
285
+ *
286
+ * @example
287
+ * await client.checkouts.archiveCheckout({
288
+ * id: "id"
289
+ * })
290
+ */
291
+ archiveCheckout(request, requestOptions) {
292
+ return core.HttpResponsePromise.fromPromise(this.__archiveCheckout(request, requestOptions));
293
+ }
294
+ __archiveCheckout(request, requestOptions) {
295
+ return __awaiter(this, void 0, void 0, function* () {
296
+ var _a, _b, _c, _d, _e, _f, _g, _h;
297
+ const { id } = request;
298
+ const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
299
+ const _response = yield core.fetcher({
300
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `checkouts/${core.url.encodePathParam(id)}`),
301
+ method: "DELETE",
302
+ headers: _headers,
303
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
304
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
305
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
306
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
307
+ });
308
+ if (_response.ok) {
309
+ return { data: _response.body, rawResponse: _response.rawResponse };
310
+ }
311
+ if (_response.error.reason === "status-code") {
312
+ switch (_response.error.statusCode) {
313
+ case 403:
314
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
315
+ case 404:
316
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
317
+ case 500:
318
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
319
+ default:
320
+ throw new errors.PaidError({
321
+ statusCode: _response.error.statusCode,
322
+ body: _response.error.body,
323
+ rawResponse: _response.rawResponse,
324
+ });
325
+ }
326
+ }
327
+ switch (_response.error.reason) {
328
+ case "non-json":
329
+ throw new errors.PaidError({
330
+ statusCode: _response.error.statusCode,
331
+ body: _response.error.rawBody,
332
+ rawResponse: _response.rawResponse,
333
+ });
334
+ case "timeout":
335
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /checkouts/{id}.");
336
+ case "unknown":
337
+ throw new errors.PaidError({
338
+ message: _response.error.errorMessage,
339
+ rawResponse: _response.rawResponse,
340
+ });
341
+ }
342
+ });
343
+ }
344
+ _getAuthorizationHeader() {
345
+ return __awaiter(this, void 0, void 0, function* () {
346
+ return `Bearer ${yield core.Supplier.get(this._options.token)}`;
347
+ });
348
+ }
349
+ }
350
+ exports.Checkouts = Checkouts;
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests/index.js"), exports);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id"
5
+ * }
6
+ */
7
+ export interface ArchiveCheckoutRequest {
8
+ id: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,25 @@
1
+ import type * as Paid from "../../../../index.js";
2
+ /**
3
+ * @example
4
+ * {
5
+ * products: [{
6
+ * id: "id"
7
+ * }],
8
+ * successUrl: "successUrl"
9
+ * }
10
+ */
11
+ export interface CreateCheckoutRequest {
12
+ products: Paid.CheckoutProductInput[];
13
+ customerId?: string;
14
+ /** External customer identifier. Creates the customer on first use, resolves to the existing customer on subsequent uses. */
15
+ externalCustomerId?: string;
16
+ successUrl: string;
17
+ cancelUrl?: string;
18
+ expiresAt?: string;
19
+ metadata?: Record<string, unknown>;
20
+ collectAddress?: boolean;
21
+ collectPhone?: boolean;
22
+ singleUse?: boolean;
23
+ /** Lock checkout to a specific currency. Omit to allow all currencies supported by the selected plans. */
24
+ currency?: string;
25
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id"
5
+ * }
6
+ */
7
+ export interface GetCheckoutRequest {
8
+ id: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });