@polar-sh/sdk 0.32.1 → 0.32.2

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 (160) hide show
  1. package/README.md +5 -2
  2. package/bin/mcp-server.js +13 -9
  3. package/bin/mcp-server.js.map +8 -8
  4. package/dist/commonjs/lib/config.d.ts +2 -2
  5. package/dist/commonjs/lib/config.js +2 -2
  6. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  7. package/dist/commonjs/mcp-server/server.js +1 -1
  8. package/dist/commonjs/models/components/checkout.d.ts +19 -9
  9. package/dist/commonjs/models/components/checkout.d.ts.map +1 -1
  10. package/dist/commonjs/models/components/checkout.js +14 -6
  11. package/dist/commonjs/models/components/checkout.js.map +1 -1
  12. package/dist/commonjs/models/components/checkoutlinkupdate.d.ts +16 -2
  13. package/dist/commonjs/models/components/checkoutlinkupdate.d.ts.map +1 -1
  14. package/dist/commonjs/models/components/checkoutlinkupdate.js +4 -2
  15. package/dist/commonjs/models/components/checkoutlinkupdate.js.map +1 -1
  16. package/dist/commonjs/models/components/checkoutpublic.d.ts +19 -9
  17. package/dist/commonjs/models/components/checkoutpublic.d.ts.map +1 -1
  18. package/dist/commonjs/models/components/checkoutpublic.js +14 -6
  19. package/dist/commonjs/models/components/checkoutpublic.js.map +1 -1
  20. package/dist/commonjs/models/components/checkoutpublicconfirmed.d.ts +19 -9
  21. package/dist/commonjs/models/components/checkoutpublicconfirmed.d.ts.map +1 -1
  22. package/dist/commonjs/models/components/checkoutpublicconfirmed.js +14 -6
  23. package/dist/commonjs/models/components/checkoutpublicconfirmed.js.map +1 -1
  24. package/dist/commonjs/models/components/checkoutupdate.d.ts +18 -4
  25. package/dist/commonjs/models/components/checkoutupdate.d.ts.map +1 -1
  26. package/dist/commonjs/models/components/checkoutupdate.js +8 -6
  27. package/dist/commonjs/models/components/checkoutupdate.js.map +1 -1
  28. package/dist/commonjs/models/components/checkoutupdatepublic.d.ts +2 -2
  29. package/dist/commonjs/models/components/checkoutupdatepublic.d.ts.map +1 -1
  30. package/dist/commonjs/models/components/checkoutupdatepublic.js +4 -4
  31. package/dist/commonjs/models/components/checkoutupdatepublic.js.map +1 -1
  32. package/dist/commonjs/models/components/customerupdate.d.ts +16 -2
  33. package/dist/commonjs/models/components/customerupdate.d.ts.map +1 -1
  34. package/dist/commonjs/models/components/customerupdate.js +4 -2
  35. package/dist/commonjs/models/components/customerupdate.js.map +1 -1
  36. package/dist/commonjs/models/components/customfieldupdatecheckbox.d.ts +16 -2
  37. package/dist/commonjs/models/components/customfieldupdatecheckbox.d.ts.map +1 -1
  38. package/dist/commonjs/models/components/customfieldupdatecheckbox.js +4 -2
  39. package/dist/commonjs/models/components/customfieldupdatecheckbox.js.map +1 -1
  40. package/dist/commonjs/models/components/customfieldupdatedate.d.ts +16 -2
  41. package/dist/commonjs/models/components/customfieldupdatedate.d.ts.map +1 -1
  42. package/dist/commonjs/models/components/customfieldupdatedate.js +4 -2
  43. package/dist/commonjs/models/components/customfieldupdatedate.js.map +1 -1
  44. package/dist/commonjs/models/components/customfieldupdatenumber.d.ts +16 -2
  45. package/dist/commonjs/models/components/customfieldupdatenumber.d.ts.map +1 -1
  46. package/dist/commonjs/models/components/customfieldupdatenumber.js +4 -2
  47. package/dist/commonjs/models/components/customfieldupdatenumber.js.map +1 -1
  48. package/dist/commonjs/models/components/customfieldupdateselect.d.ts +16 -2
  49. package/dist/commonjs/models/components/customfieldupdateselect.d.ts.map +1 -1
  50. package/dist/commonjs/models/components/customfieldupdateselect.js +4 -2
  51. package/dist/commonjs/models/components/customfieldupdateselect.js.map +1 -1
  52. package/dist/commonjs/models/components/customfieldupdatetext.d.ts +16 -2
  53. package/dist/commonjs/models/components/customfieldupdatetext.d.ts.map +1 -1
  54. package/dist/commonjs/models/components/customfieldupdatetext.js +4 -2
  55. package/dist/commonjs/models/components/customfieldupdatetext.js.map +1 -1
  56. package/dist/commonjs/models/components/discountupdate.d.ts +16 -2
  57. package/dist/commonjs/models/components/discountupdate.d.ts.map +1 -1
  58. package/dist/commonjs/models/components/discountupdate.js +4 -2
  59. package/dist/commonjs/models/components/discountupdate.js.map +1 -1
  60. package/dist/commonjs/models/components/meterupdate.d.ts +16 -2
  61. package/dist/commonjs/models/components/meterupdate.d.ts.map +1 -1
  62. package/dist/commonjs/models/components/meterupdate.js +4 -2
  63. package/dist/commonjs/models/components/meterupdate.js.map +1 -1
  64. package/dist/commonjs/models/components/productpricemeteredunit.d.ts +5 -0
  65. package/dist/commonjs/models/components/productpricemeteredunit.d.ts.map +1 -1
  66. package/dist/commonjs/models/components/productpricemeteredunit.js +4 -0
  67. package/dist/commonjs/models/components/productpricemeteredunit.js.map +1 -1
  68. package/dist/commonjs/models/components/productupdate.d.ts +16 -2
  69. package/dist/commonjs/models/components/productupdate.d.ts.map +1 -1
  70. package/dist/commonjs/models/components/productupdate.js +4 -2
  71. package/dist/commonjs/models/components/productupdate.js.map +1 -1
  72. package/dist/esm/lib/config.d.ts +2 -2
  73. package/dist/esm/lib/config.js +2 -2
  74. package/dist/esm/mcp-server/mcp-server.js +1 -1
  75. package/dist/esm/mcp-server/server.js +1 -1
  76. package/dist/esm/models/components/checkout.d.ts +19 -9
  77. package/dist/esm/models/components/checkout.d.ts.map +1 -1
  78. package/dist/esm/models/components/checkout.js +14 -6
  79. package/dist/esm/models/components/checkout.js.map +1 -1
  80. package/dist/esm/models/components/checkoutlinkupdate.d.ts +16 -2
  81. package/dist/esm/models/components/checkoutlinkupdate.d.ts.map +1 -1
  82. package/dist/esm/models/components/checkoutlinkupdate.js +4 -2
  83. package/dist/esm/models/components/checkoutlinkupdate.js.map +1 -1
  84. package/dist/esm/models/components/checkoutpublic.d.ts +19 -9
  85. package/dist/esm/models/components/checkoutpublic.d.ts.map +1 -1
  86. package/dist/esm/models/components/checkoutpublic.js +14 -6
  87. package/dist/esm/models/components/checkoutpublic.js.map +1 -1
  88. package/dist/esm/models/components/checkoutpublicconfirmed.d.ts +19 -9
  89. package/dist/esm/models/components/checkoutpublicconfirmed.d.ts.map +1 -1
  90. package/dist/esm/models/components/checkoutpublicconfirmed.js +14 -6
  91. package/dist/esm/models/components/checkoutpublicconfirmed.js.map +1 -1
  92. package/dist/esm/models/components/checkoutupdate.d.ts +18 -4
  93. package/dist/esm/models/components/checkoutupdate.d.ts.map +1 -1
  94. package/dist/esm/models/components/checkoutupdate.js +8 -6
  95. package/dist/esm/models/components/checkoutupdate.js.map +1 -1
  96. package/dist/esm/models/components/checkoutupdatepublic.d.ts +2 -2
  97. package/dist/esm/models/components/checkoutupdatepublic.d.ts.map +1 -1
  98. package/dist/esm/models/components/checkoutupdatepublic.js +4 -4
  99. package/dist/esm/models/components/checkoutupdatepublic.js.map +1 -1
  100. package/dist/esm/models/components/customerupdate.d.ts +16 -2
  101. package/dist/esm/models/components/customerupdate.d.ts.map +1 -1
  102. package/dist/esm/models/components/customerupdate.js +4 -2
  103. package/dist/esm/models/components/customerupdate.js.map +1 -1
  104. package/dist/esm/models/components/customfieldupdatecheckbox.d.ts +16 -2
  105. package/dist/esm/models/components/customfieldupdatecheckbox.d.ts.map +1 -1
  106. package/dist/esm/models/components/customfieldupdatecheckbox.js +4 -2
  107. package/dist/esm/models/components/customfieldupdatecheckbox.js.map +1 -1
  108. package/dist/esm/models/components/customfieldupdatedate.d.ts +16 -2
  109. package/dist/esm/models/components/customfieldupdatedate.d.ts.map +1 -1
  110. package/dist/esm/models/components/customfieldupdatedate.js +4 -2
  111. package/dist/esm/models/components/customfieldupdatedate.js.map +1 -1
  112. package/dist/esm/models/components/customfieldupdatenumber.d.ts +16 -2
  113. package/dist/esm/models/components/customfieldupdatenumber.d.ts.map +1 -1
  114. package/dist/esm/models/components/customfieldupdatenumber.js +4 -2
  115. package/dist/esm/models/components/customfieldupdatenumber.js.map +1 -1
  116. package/dist/esm/models/components/customfieldupdateselect.d.ts +16 -2
  117. package/dist/esm/models/components/customfieldupdateselect.d.ts.map +1 -1
  118. package/dist/esm/models/components/customfieldupdateselect.js +4 -2
  119. package/dist/esm/models/components/customfieldupdateselect.js.map +1 -1
  120. package/dist/esm/models/components/customfieldupdatetext.d.ts +16 -2
  121. package/dist/esm/models/components/customfieldupdatetext.d.ts.map +1 -1
  122. package/dist/esm/models/components/customfieldupdatetext.js +4 -2
  123. package/dist/esm/models/components/customfieldupdatetext.js.map +1 -1
  124. package/dist/esm/models/components/discountupdate.d.ts +16 -2
  125. package/dist/esm/models/components/discountupdate.d.ts.map +1 -1
  126. package/dist/esm/models/components/discountupdate.js +4 -2
  127. package/dist/esm/models/components/discountupdate.js.map +1 -1
  128. package/dist/esm/models/components/meterupdate.d.ts +16 -2
  129. package/dist/esm/models/components/meterupdate.d.ts.map +1 -1
  130. package/dist/esm/models/components/meterupdate.js +4 -2
  131. package/dist/esm/models/components/meterupdate.js.map +1 -1
  132. package/dist/esm/models/components/productpricemeteredunit.d.ts +5 -0
  133. package/dist/esm/models/components/productpricemeteredunit.d.ts.map +1 -1
  134. package/dist/esm/models/components/productpricemeteredunit.js +4 -0
  135. package/dist/esm/models/components/productpricemeteredunit.js.map +1 -1
  136. package/dist/esm/models/components/productupdate.d.ts +16 -2
  137. package/dist/esm/models/components/productupdate.d.ts.map +1 -1
  138. package/dist/esm/models/components/productupdate.js +4 -2
  139. package/dist/esm/models/components/productupdate.js.map +1 -1
  140. package/jsr.json +1 -1
  141. package/package.json +1 -1
  142. package/src/lib/config.ts +2 -2
  143. package/src/mcp-server/mcp-server.ts +1 -1
  144. package/src/mcp-server/server.ts +1 -1
  145. package/src/models/components/checkout.ts +33 -15
  146. package/src/models/components/checkoutlinkupdate.ts +20 -8
  147. package/src/models/components/checkoutpublic.ts +33 -15
  148. package/src/models/components/checkoutpublicconfirmed.ts +33 -15
  149. package/src/models/components/checkoutupdate.ts +36 -30
  150. package/src/models/components/checkoutupdatepublic.ts +16 -22
  151. package/src/models/components/customerupdate.ts +20 -8
  152. package/src/models/components/customfieldupdatecheckbox.ts +20 -8
  153. package/src/models/components/customfieldupdatedate.ts +20 -8
  154. package/src/models/components/customfieldupdatenumber.ts +20 -8
  155. package/src/models/components/customfieldupdateselect.ts +20 -8
  156. package/src/models/components/customfieldupdatetext.ts +20 -8
  157. package/src/models/components/discountupdate.ts +20 -8
  158. package/src/models/components/meterupdate.ts +20 -8
  159. package/src/models/components/productpricemeteredunit.ts +9 -0
  160. package/src/models/components/productupdate.ts +20 -8
@@ -135,21 +135,25 @@ export type Checkout = {
135
135
  embedOrigin: string | null;
136
136
  amount: number | null;
137
137
  /**
138
- * Computed tax amount to pay in cents.
138
+ * Discount amount in cents.
139
139
  */
140
- taxAmount: number | null;
140
+ discountAmount: number | null;
141
141
  /**
142
- * Currency code of the checkout session.
142
+ * Amount in cents, after discounts but before taxes.
143
143
  */
144
- currency: string | null;
144
+ netAmount: number | null;
145
145
  /**
146
- * Subtotal amount in cents, including discounts and before tax.
146
+ * Sales tax amount in cents.
147
147
  */
148
- subtotalAmount: number | null;
148
+ taxAmount: number | null;
149
149
  /**
150
- * Total amount to pay in cents, including discounts and after tax.
150
+ * Amount in cents, after discounts and taxes.
151
151
  */
152
152
  totalAmount: number | null;
153
+ /**
154
+ * Currency code of the checkout session.
155
+ */
156
+ currency: string | null;
153
157
  /**
154
158
  * ID of the product to checkout.
155
159
  */
@@ -199,6 +203,10 @@ export type Checkout = {
199
203
  customerBillingAddress: Address | null;
200
204
  customerTaxId: string | null;
201
205
  paymentProcessorMetadata: { [k: string]: string };
206
+ /**
207
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
208
+ */
209
+ subtotalAmount: number | null;
202
210
  metadata: { [k: string]: string | number | boolean };
203
211
  /**
204
212
  * ID of the customer in your system. If a matching customer exists on Polar, the resulting order will be linked to this customer. Otherwise, a new customer will be created with this external ID set.
@@ -532,10 +540,11 @@ export const Checkout$inboundSchema: z.ZodType<
532
540
  success_url: z.string(),
533
541
  embed_origin: z.nullable(z.string()),
534
542
  amount: z.nullable(z.number().int()),
543
+ discount_amount: z.nullable(z.number().int()),
544
+ net_amount: z.nullable(z.number().int()),
535
545
  tax_amount: z.nullable(z.number().int()),
536
- currency: z.nullable(z.string()),
537
- subtotal_amount: z.nullable(z.number().int()),
538
546
  total_amount: z.nullable(z.number().int()),
547
+ currency: z.nullable(z.string()),
539
548
  product_id: z.string(),
540
549
  product_price_id: z.string(),
541
550
  discount_id: z.nullable(z.string()),
@@ -552,6 +561,7 @@ export const Checkout$inboundSchema: z.ZodType<
552
561
  customer_billing_address: z.nullable(Address$inboundSchema),
553
562
  customer_tax_id: z.nullable(z.string()),
554
563
  payment_processor_metadata: z.record(z.string()),
564
+ subtotal_amount: z.nullable(z.number().int()),
555
565
  metadata: z.record(z.union([z.string(), z.number().int(), z.boolean()])),
556
566
  customer_external_id: z.nullable(z.string()),
557
567
  products: z.array(CheckoutProduct$inboundSchema),
@@ -583,8 +593,9 @@ export const Checkout$inboundSchema: z.ZodType<
583
593
  "expires_at": "expiresAt",
584
594
  "success_url": "successUrl",
585
595
  "embed_origin": "embedOrigin",
596
+ "discount_amount": "discountAmount",
597
+ "net_amount": "netAmount",
586
598
  "tax_amount": "taxAmount",
587
- "subtotal_amount": "subtotalAmount",
588
599
  "total_amount": "totalAmount",
589
600
  "product_id": "productId",
590
601
  "product_price_id": "productPriceId",
@@ -602,6 +613,7 @@ export const Checkout$inboundSchema: z.ZodType<
602
613
  "customer_billing_address": "customerBillingAddress",
603
614
  "customer_tax_id": "customerTaxId",
604
615
  "payment_processor_metadata": "paymentProcessorMetadata",
616
+ "subtotal_amount": "subtotalAmount",
605
617
  "customer_external_id": "customerExternalId",
606
618
  "product_price": "productPrice",
607
619
  "subscription_id": "subscriptionId",
@@ -626,10 +638,11 @@ export type Checkout$Outbound = {
626
638
  success_url: string;
627
639
  embed_origin: string | null;
628
640
  amount: number | null;
641
+ discount_amount: number | null;
642
+ net_amount: number | null;
629
643
  tax_amount: number | null;
630
- currency: string | null;
631
- subtotal_amount: number | null;
632
644
  total_amount: number | null;
645
+ currency: string | null;
633
646
  product_id: string;
634
647
  product_price_id: string;
635
648
  discount_id: string | null;
@@ -646,6 +659,7 @@ export type Checkout$Outbound = {
646
659
  customer_billing_address: Address$Outbound | null;
647
660
  customer_tax_id: string | null;
648
661
  payment_processor_metadata: { [k: string]: string };
662
+ subtotal_amount: number | null;
649
663
  metadata: { [k: string]: string | number | boolean };
650
664
  customer_external_id: string | null;
651
665
  products: Array<CheckoutProduct$Outbound>;
@@ -689,10 +703,11 @@ export const Checkout$outboundSchema: z.ZodType<
689
703
  successUrl: z.string(),
690
704
  embedOrigin: z.nullable(z.string()),
691
705
  amount: z.nullable(z.number().int()),
706
+ discountAmount: z.nullable(z.number().int()),
707
+ netAmount: z.nullable(z.number().int()),
692
708
  taxAmount: z.nullable(z.number().int()),
693
- currency: z.nullable(z.string()),
694
- subtotalAmount: z.nullable(z.number().int()),
695
709
  totalAmount: z.nullable(z.number().int()),
710
+ currency: z.nullable(z.string()),
696
711
  productId: z.string(),
697
712
  productPriceId: z.string(),
698
713
  discountId: z.nullable(z.string()),
@@ -709,6 +724,7 @@ export const Checkout$outboundSchema: z.ZodType<
709
724
  customerBillingAddress: z.nullable(Address$outboundSchema),
710
725
  customerTaxId: z.nullable(z.string()),
711
726
  paymentProcessorMetadata: z.record(z.string()),
727
+ subtotalAmount: z.nullable(z.number().int()),
712
728
  metadata: z.record(z.union([z.string(), z.number().int(), z.boolean()])),
713
729
  customerExternalId: z.nullable(z.string()),
714
730
  products: z.array(CheckoutProduct$outboundSchema),
@@ -740,8 +756,9 @@ export const Checkout$outboundSchema: z.ZodType<
740
756
  expiresAt: "expires_at",
741
757
  successUrl: "success_url",
742
758
  embedOrigin: "embed_origin",
759
+ discountAmount: "discount_amount",
760
+ netAmount: "net_amount",
743
761
  taxAmount: "tax_amount",
744
- subtotalAmount: "subtotal_amount",
745
762
  totalAmount: "total_amount",
746
763
  productId: "product_id",
747
764
  productPriceId: "product_price_id",
@@ -759,6 +776,7 @@ export const Checkout$outboundSchema: z.ZodType<
759
776
  customerBillingAddress: "customer_billing_address",
760
777
  customerTaxId: "customer_tax_id",
761
778
  paymentProcessorMetadata: "payment_processor_metadata",
779
+ subtotalAmount: "subtotal_amount",
762
780
  customerExternalId: "customer_external_id",
763
781
  productPrice: "product_price",
764
782
  subscriptionId: "subscription_id",
@@ -14,7 +14,21 @@ export type CheckoutLinkUpdateMetadata = string | number | boolean;
14
14
  * Schema to update an existing checkout link.
15
15
  */
16
16
  export type CheckoutLinkUpdate = {
17
- metadata?: { [k: string]: string | number | boolean } | null | undefined;
17
+ /**
18
+ * Key-value object allowing you to store additional information.
19
+ *
20
+ * @remarks
21
+ *
22
+ * The key must be a string with a maximum length of **40 characters**.
23
+ * The value must be either:
24
+ *
25
+ * * A string with a maximum length of **500 characters**
26
+ * * An integer
27
+ * * A boolean
28
+ *
29
+ * You can store up to **50 key-value pairs**.
30
+ */
31
+ metadata?: { [k: string]: string | number | boolean } | undefined;
18
32
  /**
19
33
  * List of products that will be available to select at checkout.
20
34
  */
@@ -88,9 +102,8 @@ export const CheckoutLinkUpdate$inboundSchema: z.ZodType<
88
102
  z.ZodTypeDef,
89
103
  unknown
90
104
  > = z.object({
91
- metadata: z.nullable(
92
- z.record(z.union([z.string(), z.number().int(), z.boolean()])),
93
- ).optional(),
105
+ metadata: z.record(z.union([z.string(), z.number().int(), z.boolean()]))
106
+ .optional(),
94
107
  products: z.nullable(z.array(z.string())).optional(),
95
108
  label: z.nullable(z.string()).optional(),
96
109
  allow_discount_codes: z.nullable(z.boolean()).optional(),
@@ -106,7 +119,7 @@ export const CheckoutLinkUpdate$inboundSchema: z.ZodType<
106
119
 
107
120
  /** @internal */
108
121
  export type CheckoutLinkUpdate$Outbound = {
109
- metadata?: { [k: string]: string | number | boolean } | null | undefined;
122
+ metadata?: { [k: string]: string | number | boolean } | undefined;
110
123
  products?: Array<string> | null | undefined;
111
124
  label?: string | null | undefined;
112
125
  allow_discount_codes?: boolean | null | undefined;
@@ -120,9 +133,8 @@ export const CheckoutLinkUpdate$outboundSchema: z.ZodType<
120
133
  z.ZodTypeDef,
121
134
  CheckoutLinkUpdate
122
135
  > = z.object({
123
- metadata: z.nullable(
124
- z.record(z.union([z.string(), z.number().int(), z.boolean()])),
125
- ).optional(),
136
+ metadata: z.record(z.union([z.string(), z.number().int(), z.boolean()]))
137
+ .optional(),
126
138
  products: z.nullable(z.array(z.string())).optional(),
127
139
  label: z.nullable(z.string()).optional(),
128
140
  allowDiscountCodes: z.nullable(z.boolean()).optional(),
@@ -139,21 +139,25 @@ export type CheckoutPublic = {
139
139
  embedOrigin: string | null;
140
140
  amount: number | null;
141
141
  /**
142
- * Computed tax amount to pay in cents.
142
+ * Discount amount in cents.
143
143
  */
144
- taxAmount: number | null;
144
+ discountAmount: number | null;
145
145
  /**
146
- * Currency code of the checkout session.
146
+ * Amount in cents, after discounts but before taxes.
147
147
  */
148
- currency: string | null;
148
+ netAmount: number | null;
149
149
  /**
150
- * Subtotal amount in cents, including discounts and before tax.
150
+ * Sales tax amount in cents.
151
151
  */
152
- subtotalAmount: number | null;
152
+ taxAmount: number | null;
153
153
  /**
154
- * Total amount to pay in cents, including discounts and after tax.
154
+ * Amount in cents, after discounts and taxes.
155
155
  */
156
156
  totalAmount: number | null;
157
+ /**
158
+ * Currency code of the checkout session.
159
+ */
160
+ currency: string | null;
157
161
  /**
158
162
  * ID of the product to checkout.
159
163
  */
@@ -203,6 +207,10 @@ export type CheckoutPublic = {
203
207
  customerBillingAddress: Address | null;
204
208
  customerTaxId: string | null;
205
209
  paymentProcessorMetadata: { [k: string]: string };
210
+ /**
211
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
212
+ */
213
+ subtotalAmount: number | null;
206
214
  /**
207
215
  * List of products available to select.
208
216
  */
@@ -436,10 +444,11 @@ export const CheckoutPublic$inboundSchema: z.ZodType<
436
444
  success_url: z.string(),
437
445
  embed_origin: z.nullable(z.string()),
438
446
  amount: z.nullable(z.number().int()),
447
+ discount_amount: z.nullable(z.number().int()),
448
+ net_amount: z.nullable(z.number().int()),
439
449
  tax_amount: z.nullable(z.number().int()),
440
- currency: z.nullable(z.string()),
441
- subtotal_amount: z.nullable(z.number().int()),
442
450
  total_amount: z.nullable(z.number().int()),
451
+ currency: z.nullable(z.string()),
443
452
  product_id: z.string(),
444
453
  product_price_id: z.string(),
445
454
  discount_id: z.nullable(z.string()),
@@ -456,6 +465,7 @@ export const CheckoutPublic$inboundSchema: z.ZodType<
456
465
  customer_billing_address: z.nullable(Address$inboundSchema),
457
466
  customer_tax_id: z.nullable(z.string()),
458
467
  payment_processor_metadata: z.record(z.string()),
468
+ subtotal_amount: z.nullable(z.number().int()),
459
469
  products: z.array(CheckoutProduct$inboundSchema),
460
470
  product: CheckoutProduct$inboundSchema,
461
471
  product_price: z.union([
@@ -482,8 +492,9 @@ export const CheckoutPublic$inboundSchema: z.ZodType<
482
492
  "expires_at": "expiresAt",
483
493
  "success_url": "successUrl",
484
494
  "embed_origin": "embedOrigin",
495
+ "discount_amount": "discountAmount",
496
+ "net_amount": "netAmount",
485
497
  "tax_amount": "taxAmount",
486
- "subtotal_amount": "subtotalAmount",
487
498
  "total_amount": "totalAmount",
488
499
  "product_id": "productId",
489
500
  "product_price_id": "productPriceId",
@@ -501,6 +512,7 @@ export const CheckoutPublic$inboundSchema: z.ZodType<
501
512
  "customer_billing_address": "customerBillingAddress",
502
513
  "customer_tax_id": "customerTaxId",
503
514
  "payment_processor_metadata": "paymentProcessorMetadata",
515
+ "subtotal_amount": "subtotalAmount",
504
516
  "product_price": "productPrice",
505
517
  "attached_custom_fields": "attachedCustomFields",
506
518
  });
@@ -522,10 +534,11 @@ export type CheckoutPublic$Outbound = {
522
534
  success_url: string;
523
535
  embed_origin: string | null;
524
536
  amount: number | null;
537
+ discount_amount: number | null;
538
+ net_amount: number | null;
525
539
  tax_amount: number | null;
526
- currency: string | null;
527
- subtotal_amount: number | null;
528
540
  total_amount: number | null;
541
+ currency: string | null;
529
542
  product_id: string;
530
543
  product_price_id: string;
531
544
  discount_id: string | null;
@@ -542,6 +555,7 @@ export type CheckoutPublic$Outbound = {
542
555
  customer_billing_address: Address$Outbound | null;
543
556
  customer_tax_id: string | null;
544
557
  payment_processor_metadata: { [k: string]: string };
558
+ subtotal_amount: number | null;
545
559
  products: Array<CheckoutProduct$Outbound>;
546
560
  product: CheckoutProduct$Outbound;
547
561
  product_price: LegacyRecurringProductPrice$Outbound | ProductPrice$Outbound;
@@ -582,10 +596,11 @@ export const CheckoutPublic$outboundSchema: z.ZodType<
582
596
  successUrl: z.string(),
583
597
  embedOrigin: z.nullable(z.string()),
584
598
  amount: z.nullable(z.number().int()),
599
+ discountAmount: z.nullable(z.number().int()),
600
+ netAmount: z.nullable(z.number().int()),
585
601
  taxAmount: z.nullable(z.number().int()),
586
- currency: z.nullable(z.string()),
587
- subtotalAmount: z.nullable(z.number().int()),
588
602
  totalAmount: z.nullable(z.number().int()),
603
+ currency: z.nullable(z.string()),
589
604
  productId: z.string(),
590
605
  productPriceId: z.string(),
591
606
  discountId: z.nullable(z.string()),
@@ -602,6 +617,7 @@ export const CheckoutPublic$outboundSchema: z.ZodType<
602
617
  customerBillingAddress: z.nullable(Address$outboundSchema),
603
618
  customerTaxId: z.nullable(z.string()),
604
619
  paymentProcessorMetadata: z.record(z.string()),
620
+ subtotalAmount: z.nullable(z.number().int()),
605
621
  products: z.array(CheckoutProduct$outboundSchema),
606
622
  product: CheckoutProduct$outboundSchema,
607
623
  productPrice: z.union([
@@ -628,8 +644,9 @@ export const CheckoutPublic$outboundSchema: z.ZodType<
628
644
  expiresAt: "expires_at",
629
645
  successUrl: "success_url",
630
646
  embedOrigin: "embed_origin",
647
+ discountAmount: "discount_amount",
648
+ netAmount: "net_amount",
631
649
  taxAmount: "tax_amount",
632
- subtotalAmount: "subtotal_amount",
633
650
  totalAmount: "total_amount",
634
651
  productId: "product_id",
635
652
  productPriceId: "product_price_id",
@@ -647,6 +664,7 @@ export const CheckoutPublic$outboundSchema: z.ZodType<
647
664
  customerBillingAddress: "customer_billing_address",
648
665
  customerTaxId: "customer_tax_id",
649
666
  paymentProcessorMetadata: "payment_processor_metadata",
667
+ subtotalAmount: "subtotal_amount",
650
668
  productPrice: "product_price",
651
669
  attachedCustomFields: "attached_custom_fields",
652
670
  });
@@ -143,21 +143,25 @@ export type CheckoutPublicConfirmed = {
143
143
  embedOrigin: string | null;
144
144
  amount: number | null;
145
145
  /**
146
- * Computed tax amount to pay in cents.
146
+ * Discount amount in cents.
147
147
  */
148
- taxAmount: number | null;
148
+ discountAmount: number | null;
149
149
  /**
150
- * Currency code of the checkout session.
150
+ * Amount in cents, after discounts but before taxes.
151
151
  */
152
- currency: string | null;
152
+ netAmount: number | null;
153
153
  /**
154
- * Subtotal amount in cents, including discounts and before tax.
154
+ * Sales tax amount in cents.
155
155
  */
156
- subtotalAmount: number | null;
156
+ taxAmount: number | null;
157
157
  /**
158
- * Total amount to pay in cents, including discounts and after tax.
158
+ * Amount in cents, after discounts and taxes.
159
159
  */
160
160
  totalAmount: number | null;
161
+ /**
162
+ * Currency code of the checkout session.
163
+ */
164
+ currency: string | null;
161
165
  /**
162
166
  * ID of the product to checkout.
163
167
  */
@@ -207,6 +211,10 @@ export type CheckoutPublicConfirmed = {
207
211
  customerBillingAddress: Address | null;
208
212
  customerTaxId: string | null;
209
213
  paymentProcessorMetadata: { [k: string]: string };
214
+ /**
215
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
216
+ */
217
+ subtotalAmount: number | null;
210
218
  /**
211
219
  * List of products available to select.
212
220
  */
@@ -452,10 +460,11 @@ export const CheckoutPublicConfirmed$inboundSchema: z.ZodType<
452
460
  success_url: z.string(),
453
461
  embed_origin: z.nullable(z.string()),
454
462
  amount: z.nullable(z.number().int()),
463
+ discount_amount: z.nullable(z.number().int()),
464
+ net_amount: z.nullable(z.number().int()),
455
465
  tax_amount: z.nullable(z.number().int()),
456
- currency: z.nullable(z.string()),
457
- subtotal_amount: z.nullable(z.number().int()),
458
466
  total_amount: z.nullable(z.number().int()),
467
+ currency: z.nullable(z.string()),
459
468
  product_id: z.string(),
460
469
  product_price_id: z.string(),
461
470
  discount_id: z.nullable(z.string()),
@@ -472,6 +481,7 @@ export const CheckoutPublicConfirmed$inboundSchema: z.ZodType<
472
481
  customer_billing_address: z.nullable(Address$inboundSchema),
473
482
  customer_tax_id: z.nullable(z.string()),
474
483
  payment_processor_metadata: z.record(z.string()),
484
+ subtotal_amount: z.nullable(z.number().int()),
475
485
  products: z.array(CheckoutProduct$inboundSchema),
476
486
  product: CheckoutProduct$inboundSchema,
477
487
  product_price: z.union([
@@ -499,8 +509,9 @@ export const CheckoutPublicConfirmed$inboundSchema: z.ZodType<
499
509
  "expires_at": "expiresAt",
500
510
  "success_url": "successUrl",
501
511
  "embed_origin": "embedOrigin",
512
+ "discount_amount": "discountAmount",
513
+ "net_amount": "netAmount",
502
514
  "tax_amount": "taxAmount",
503
- "subtotal_amount": "subtotalAmount",
504
515
  "total_amount": "totalAmount",
505
516
  "product_id": "productId",
506
517
  "product_price_id": "productPriceId",
@@ -518,6 +529,7 @@ export const CheckoutPublicConfirmed$inboundSchema: z.ZodType<
518
529
  "customer_billing_address": "customerBillingAddress",
519
530
  "customer_tax_id": "customerTaxId",
520
531
  "payment_processor_metadata": "paymentProcessorMetadata",
532
+ "subtotal_amount": "subtotalAmount",
521
533
  "product_price": "productPrice",
522
534
  "attached_custom_fields": "attachedCustomFields",
523
535
  "customer_session_token": "customerSessionToken",
@@ -540,10 +552,11 @@ export type CheckoutPublicConfirmed$Outbound = {
540
552
  success_url: string;
541
553
  embed_origin: string | null;
542
554
  amount: number | null;
555
+ discount_amount: number | null;
556
+ net_amount: number | null;
543
557
  tax_amount: number | null;
544
- currency: string | null;
545
- subtotal_amount: number | null;
546
558
  total_amount: number | null;
559
+ currency: string | null;
547
560
  product_id: string;
548
561
  product_price_id: string;
549
562
  discount_id: string | null;
@@ -560,6 +573,7 @@ export type CheckoutPublicConfirmed$Outbound = {
560
573
  customer_billing_address: Address$Outbound | null;
561
574
  customer_tax_id: string | null;
562
575
  payment_processor_metadata: { [k: string]: string };
576
+ subtotal_amount: number | null;
563
577
  products: Array<CheckoutProduct$Outbound>;
564
578
  product: CheckoutProduct$Outbound;
565
579
  product_price: LegacyRecurringProductPrice$Outbound | ProductPrice$Outbound;
@@ -601,10 +615,11 @@ export const CheckoutPublicConfirmed$outboundSchema: z.ZodType<
601
615
  successUrl: z.string(),
602
616
  embedOrigin: z.nullable(z.string()),
603
617
  amount: z.nullable(z.number().int()),
618
+ discountAmount: z.nullable(z.number().int()),
619
+ netAmount: z.nullable(z.number().int()),
604
620
  taxAmount: z.nullable(z.number().int()),
605
- currency: z.nullable(z.string()),
606
- subtotalAmount: z.nullable(z.number().int()),
607
621
  totalAmount: z.nullable(z.number().int()),
622
+ currency: z.nullable(z.string()),
608
623
  productId: z.string(),
609
624
  productPriceId: z.string(),
610
625
  discountId: z.nullable(z.string()),
@@ -621,6 +636,7 @@ export const CheckoutPublicConfirmed$outboundSchema: z.ZodType<
621
636
  customerBillingAddress: z.nullable(Address$outboundSchema),
622
637
  customerTaxId: z.nullable(z.string()),
623
638
  paymentProcessorMetadata: z.record(z.string()),
639
+ subtotalAmount: z.nullable(z.number().int()),
624
640
  products: z.array(CheckoutProduct$outboundSchema),
625
641
  product: CheckoutProduct$outboundSchema,
626
642
  productPrice: z.union([
@@ -648,8 +664,9 @@ export const CheckoutPublicConfirmed$outboundSchema: z.ZodType<
648
664
  expiresAt: "expires_at",
649
665
  successUrl: "success_url",
650
666
  embedOrigin: "embed_origin",
667
+ discountAmount: "discount_amount",
668
+ netAmount: "net_amount",
651
669
  taxAmount: "tax_amount",
652
- subtotalAmount: "subtotal_amount",
653
670
  totalAmount: "total_amount",
654
671
  productId: "product_id",
655
672
  productPriceId: "product_price_id",
@@ -667,6 +684,7 @@ export const CheckoutPublicConfirmed$outboundSchema: z.ZodType<
667
684
  customerBillingAddress: "customer_billing_address",
668
685
  customerTaxId: "customer_tax_id",
669
686
  paymentProcessorMetadata: "payment_processor_metadata",
687
+ subtotalAmount: "subtotal_amount",
670
688
  productPrice: "product_price",
671
689
  attachedCustomFields: "attached_custom_fields",
672
690
  customerSessionToken: "customer_session_token",
@@ -29,7 +29,6 @@ export type CheckoutUpdate = {
29
29
  */
30
30
  customFieldData?:
31
31
  | { [k: string]: string | number | boolean | Date | null }
32
- | null
33
32
  | undefined;
34
33
  /**
35
34
  * ID of the product to checkout. Must be present in the checkout's product list.
@@ -46,7 +45,21 @@ export type CheckoutUpdate = {
46
45
  customerEmail?: string | null | undefined;
47
46
  customerBillingAddress?: Address | null | undefined;
48
47
  customerTaxId?: string | null | undefined;
49
- metadata?: { [k: string]: string | number | boolean } | null | undefined;
48
+ /**
49
+ * Key-value object allowing you to store additional information.
50
+ *
51
+ * @remarks
52
+ *
53
+ * The key must be a string with a maximum length of **40 characters**.
54
+ * The value must be either:
55
+ *
56
+ * * A string with a maximum length of **500 characters**
57
+ * * An integer
58
+ * * A boolean
59
+ *
60
+ * You can store up to **50 key-value pairs**.
61
+ */
62
+ metadata?: { [k: string]: string | number | boolean } | undefined;
50
63
  /**
51
64
  * ID of the discount to apply to the checkout.
52
65
  */
@@ -252,16 +265,14 @@ export const CheckoutUpdate$inboundSchema: z.ZodType<
252
265
  z.ZodTypeDef,
253
266
  unknown
254
267
  > = z.object({
255
- custom_field_data: z.nullable(
256
- z.record(
257
- z.nullable(
258
- z.union([
259
- z.string(),
260
- z.number().int(),
261
- z.boolean(),
262
- z.string().datetime({ offset: true }).transform(v => new Date(v)),
263
- ]),
264
- ),
268
+ custom_field_data: z.record(
269
+ z.nullable(
270
+ z.union([
271
+ z.string(),
272
+ z.number().int(),
273
+ z.boolean(),
274
+ z.string().datetime({ offset: true }).transform(v => new Date(v)),
275
+ ]),
265
276
  ),
266
277
  ).optional(),
267
278
  product_id: z.nullable(z.string()).optional(),
@@ -271,9 +282,8 @@ export const CheckoutUpdate$inboundSchema: z.ZodType<
271
282
  customer_email: z.nullable(z.string()).optional(),
272
283
  customer_billing_address: z.nullable(Address$inboundSchema).optional(),
273
284
  customer_tax_id: z.nullable(z.string()).optional(),
274
- metadata: z.nullable(
275
- z.record(z.union([z.string(), z.number().int(), z.boolean()])),
276
- ).optional(),
285
+ metadata: z.record(z.union([z.string(), z.number().int(), z.boolean()]))
286
+ .optional(),
277
287
  discount_id: z.nullable(z.string()).optional(),
278
288
  allow_discount_codes: z.nullable(z.boolean()).optional(),
279
289
  customer_ip_address: z.nullable(z.string()).optional(),
@@ -304,7 +314,6 @@ export const CheckoutUpdate$inboundSchema: z.ZodType<
304
314
  export type CheckoutUpdate$Outbound = {
305
315
  custom_field_data?:
306
316
  | { [k: string]: string | number | boolean | string | null }
307
- | null
308
317
  | undefined;
309
318
  product_id?: string | null | undefined;
310
319
  product_price_id?: string | null | undefined;
@@ -313,7 +322,7 @@ export type CheckoutUpdate$Outbound = {
313
322
  customer_email?: string | null | undefined;
314
323
  customer_billing_address?: Address$Outbound | null | undefined;
315
324
  customer_tax_id?: string | null | undefined;
316
- metadata?: { [k: string]: string | number | boolean } | null | undefined;
325
+ metadata?: { [k: string]: string | number | boolean } | undefined;
317
326
  discount_id?: string | null | undefined;
318
327
  allow_discount_codes?: boolean | null | undefined;
319
328
  customer_ip_address?: string | null | undefined;
@@ -331,16 +340,14 @@ export const CheckoutUpdate$outboundSchema: z.ZodType<
331
340
  z.ZodTypeDef,
332
341
  CheckoutUpdate
333
342
  > = z.object({
334
- customFieldData: z.nullable(
335
- z.record(
336
- z.nullable(
337
- z.union([
338
- z.string(),
339
- z.number().int(),
340
- z.boolean(),
341
- z.date().transform(v => v.toISOString()),
342
- ]),
343
- ),
343
+ customFieldData: z.record(
344
+ z.nullable(
345
+ z.union([
346
+ z.string(),
347
+ z.number().int(),
348
+ z.boolean(),
349
+ z.date().transform(v => v.toISOString()),
350
+ ]),
344
351
  ),
345
352
  ).optional(),
346
353
  productId: z.nullable(z.string()).optional(),
@@ -350,9 +357,8 @@ export const CheckoutUpdate$outboundSchema: z.ZodType<
350
357
  customerEmail: z.nullable(z.string()).optional(),
351
358
  customerBillingAddress: z.nullable(Address$outboundSchema).optional(),
352
359
  customerTaxId: z.nullable(z.string()).optional(),
353
- metadata: z.nullable(
354
- z.record(z.union([z.string(), z.number().int(), z.boolean()])),
355
- ).optional(),
360
+ metadata: z.record(z.union([z.string(), z.number().int(), z.boolean()]))
361
+ .optional(),
356
362
  discountId: z.nullable(z.string()).optional(),
357
363
  allowDiscountCodes: z.nullable(z.boolean()).optional(),
358
364
  customerIpAddress: z.nullable(z.string()).optional(),
@@ -29,7 +29,6 @@ export type CheckoutUpdatePublic = {
29
29
  */
30
30
  customFieldData?:
31
31
  | { [k: string]: string | number | boolean | Date | null }
32
- | null
33
32
  | undefined;
34
33
  /**
35
34
  * ID of the product to checkout. Must be present in the checkout's product list.
@@ -125,16 +124,14 @@ export const CheckoutUpdatePublic$inboundSchema: z.ZodType<
125
124
  z.ZodTypeDef,
126
125
  unknown
127
126
  > = z.object({
128
- custom_field_data: z.nullable(
129
- z.record(
130
- z.nullable(
131
- z.union([
132
- z.string(),
133
- z.number().int(),
134
- z.boolean(),
135
- z.string().datetime({ offset: true }).transform(v => new Date(v)),
136
- ]),
137
- ),
127
+ custom_field_data: z.record(
128
+ z.nullable(
129
+ z.union([
130
+ z.string(),
131
+ z.number().int(),
132
+ z.boolean(),
133
+ z.string().datetime({ offset: true }).transform(v => new Date(v)),
134
+ ]),
138
135
  ),
139
136
  ).optional(),
140
137
  product_id: z.nullable(z.string()).optional(),
@@ -162,7 +159,6 @@ export const CheckoutUpdatePublic$inboundSchema: z.ZodType<
162
159
  export type CheckoutUpdatePublic$Outbound = {
163
160
  custom_field_data?:
164
161
  | { [k: string]: string | number | boolean | string | null }
165
- | null
166
162
  | undefined;
167
163
  product_id?: string | null | undefined;
168
164
  product_price_id?: string | null | undefined;
@@ -180,16 +176,14 @@ export const CheckoutUpdatePublic$outboundSchema: z.ZodType<
180
176
  z.ZodTypeDef,
181
177
  CheckoutUpdatePublic
182
178
  > = z.object({
183
- customFieldData: z.nullable(
184
- z.record(
185
- z.nullable(
186
- z.union([
187
- z.string(),
188
- z.number().int(),
189
- z.boolean(),
190
- z.date().transform(v => v.toISOString()),
191
- ]),
192
- ),
179
+ customFieldData: z.record(
180
+ z.nullable(
181
+ z.union([
182
+ z.string(),
183
+ z.number().int(),
184
+ z.boolean(),
185
+ z.date().transform(v => v.toISOString()),
186
+ ]),
193
187
  ),
194
188
  ).optional(),
195
189
  productId: z.nullable(z.string()).optional(),