orb-billing 5.44.0 → 5.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/core.d.ts +1 -1
  3. package/core.d.ts.map +1 -1
  4. package/core.js +8 -17
  5. package/core.js.map +1 -1
  6. package/core.mjs +8 -17
  7. package/core.mjs.map +1 -1
  8. package/index.d.mts +91 -5
  9. package/index.d.ts +91 -5
  10. package/index.d.ts.map +1 -1
  11. package/index.js +90 -2
  12. package/index.js.map +1 -1
  13. package/index.mjs +91 -3
  14. package/index.mjs.map +1 -1
  15. package/internal/utils/query.d.ts +2 -0
  16. package/internal/utils/query.d.ts.map +1 -0
  17. package/internal/utils/query.js +33 -0
  18. package/internal/utils/query.js.map +1 -0
  19. package/internal/utils/query.mjs +6 -0
  20. package/internal/utils/query.mjs.map +1 -0
  21. package/package.json +1 -1
  22. package/resources/alerts.d.ts +21 -0
  23. package/resources/alerts.d.ts.map +1 -1
  24. package/resources/alerts.js +6 -0
  25. package/resources/alerts.js.map +1 -1
  26. package/resources/alerts.mjs +6 -0
  27. package/resources/alerts.mjs.map +1 -1
  28. package/resources/beta/beta.d.ts +8293 -140
  29. package/resources/beta/beta.d.ts.map +1 -1
  30. package/resources/beta/beta.js +5 -0
  31. package/resources/beta/beta.js.map +1 -1
  32. package/resources/beta/beta.mjs +5 -0
  33. package/resources/beta/beta.mjs.map +1 -1
  34. package/resources/beta/external-plan-id.d.ts +8293 -140
  35. package/resources/beta/external-plan-id.d.ts.map +1 -1
  36. package/resources/beta/external-plan-id.js +5 -0
  37. package/resources/beta/external-plan-id.js.map +1 -1
  38. package/resources/beta/external-plan-id.mjs +5 -0
  39. package/resources/beta/external-plan-id.mjs.map +1 -1
  40. package/resources/coupons/coupons.d.ts +3 -0
  41. package/resources/coupons/coupons.d.ts.map +1 -1
  42. package/resources/coupons/coupons.js +3 -0
  43. package/resources/coupons/coupons.js.map +1 -1
  44. package/resources/coupons/coupons.mjs +3 -0
  45. package/resources/coupons/coupons.mjs.map +1 -1
  46. package/resources/coupons/subscriptions.d.ts +3 -0
  47. package/resources/coupons/subscriptions.d.ts.map +1 -1
  48. package/resources/coupons/subscriptions.js +3 -0
  49. package/resources/coupons/subscriptions.js.map +1 -1
  50. package/resources/coupons/subscriptions.mjs +3 -0
  51. package/resources/coupons/subscriptions.mjs.map +1 -1
  52. package/resources/credit-blocks.d.ts +85 -1
  53. package/resources/credit-blocks.d.ts.map +1 -1
  54. package/resources/credit-blocks.js +22 -0
  55. package/resources/credit-blocks.js.map +1 -1
  56. package/resources/credit-blocks.mjs +22 -0
  57. package/resources/credit-blocks.mjs.map +1 -1
  58. package/resources/credit-notes.d.ts +4 -0
  59. package/resources/credit-notes.d.ts.map +1 -1
  60. package/resources/credit-notes.js +4 -0
  61. package/resources/credit-notes.js.map +1 -1
  62. package/resources/credit-notes.mjs +4 -0
  63. package/resources/credit-notes.mjs.map +1 -1
  64. package/resources/customers/balance-transactions.d.ts +16 -0
  65. package/resources/customers/balance-transactions.d.ts.map +1 -1
  66. package/resources/customers/balance-transactions.js +16 -0
  67. package/resources/customers/balance-transactions.js.map +1 -1
  68. package/resources/customers/balance-transactions.mjs +16 -0
  69. package/resources/customers/balance-transactions.mjs.map +1 -1
  70. package/resources/customers/costs.d.ts +16 -0
  71. package/resources/customers/costs.d.ts.map +1 -1
  72. package/resources/customers/costs.js +16 -0
  73. package/resources/customers/costs.js.map +1 -1
  74. package/resources/customers/costs.mjs +16 -0
  75. package/resources/customers/costs.mjs.map +1 -1
  76. package/resources/customers/credits/credits.d.ts +39 -0
  77. package/resources/customers/credits/credits.d.ts.map +1 -1
  78. package/resources/customers/credits/credits.js +3 -0
  79. package/resources/customers/credits/credits.js.map +1 -1
  80. package/resources/customers/credits/credits.mjs +3 -0
  81. package/resources/customers/credits/credits.mjs.map +1 -1
  82. package/resources/customers/credits/ledger.d.ts +31 -4
  83. package/resources/customers/credits/ledger.d.ts.map +1 -1
  84. package/resources/customers/credits/ledger.js +19 -2
  85. package/resources/customers/credits/ledger.js.map +1 -1
  86. package/resources/customers/credits/ledger.mjs +19 -2
  87. package/resources/customers/credits/ledger.mjs.map +1 -1
  88. package/resources/customers/credits/top-ups.d.ts +3 -0
  89. package/resources/customers/credits/top-ups.d.ts.map +1 -1
  90. package/resources/customers/credits/top-ups.js +3 -0
  91. package/resources/customers/credits/top-ups.js.map +1 -1
  92. package/resources/customers/credits/top-ups.mjs +3 -0
  93. package/resources/customers/credits/top-ups.mjs.map +1 -1
  94. package/resources/customers/customers.d.ts +33 -12
  95. package/resources/customers/customers.d.ts.map +1 -1
  96. package/resources/customers/customers.js +20 -3
  97. package/resources/customers/customers.js.map +1 -1
  98. package/resources/customers/customers.mjs +20 -3
  99. package/resources/customers/customers.mjs.map +1 -1
  100. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts +1 -1
  101. package/resources/dimensional-price-groups/external-dimensional-price-group-id.d.ts.map +1 -1
  102. package/resources/events/backfills.d.ts +5 -0
  103. package/resources/events/backfills.d.ts.map +1 -1
  104. package/resources/events/backfills.js +5 -0
  105. package/resources/events/backfills.js.map +1 -1
  106. package/resources/events/backfills.mjs +5 -0
  107. package/resources/events/backfills.mjs.map +1 -1
  108. package/resources/events/events.d.ts +5 -0
  109. package/resources/events/events.d.ts.map +1 -1
  110. package/resources/events/events.js +5 -0
  111. package/resources/events/events.js.map +1 -1
  112. package/resources/events/events.mjs +5 -0
  113. package/resources/events/events.mjs.map +1 -1
  114. package/resources/events/volume.d.ts +5 -0
  115. package/resources/events/volume.d.ts.map +1 -1
  116. package/resources/events/volume.js +5 -0
  117. package/resources/events/volume.js.map +1 -1
  118. package/resources/events/volume.mjs +5 -0
  119. package/resources/events/volume.mjs.map +1 -1
  120. package/resources/index.d.ts +4 -2
  121. package/resources/index.d.ts.map +1 -1
  122. package/resources/index.js +7 -1
  123. package/resources/index.js.map +1 -1
  124. package/resources/index.mjs +3 -1
  125. package/resources/index.mjs.map +1 -1
  126. package/resources/invoice-line-items.d.ts +6 -0
  127. package/resources/invoice-line-items.d.ts.map +1 -1
  128. package/resources/invoice-line-items.js +6 -0
  129. package/resources/invoice-line-items.js.map +1 -1
  130. package/resources/invoice-line-items.mjs +6 -0
  131. package/resources/invoice-line-items.mjs.map +1 -1
  132. package/resources/invoices.d.ts +432 -7
  133. package/resources/invoices.d.ts.map +1 -1
  134. package/resources/invoices.js +18 -5
  135. package/resources/invoices.js.map +1 -1
  136. package/resources/invoices.mjs +18 -5
  137. package/resources/invoices.mjs.map +1 -1
  138. package/resources/items.d.ts +6 -2
  139. package/resources/items.d.ts.map +1 -1
  140. package/resources/items.js +4 -0
  141. package/resources/items.js.map +1 -1
  142. package/resources/items.mjs +4 -0
  143. package/resources/items.mjs.map +1 -1
  144. package/resources/license-types.d.ts +113 -0
  145. package/resources/license-types.d.ts.map +1 -0
  146. package/resources/license-types.js +44 -0
  147. package/resources/license-types.js.map +1 -0
  148. package/resources/license-types.mjs +39 -0
  149. package/resources/license-types.mjs.map +1 -0
  150. package/resources/licenses/external-licenses.d.ts +114 -0
  151. package/resources/licenses/external-licenses.d.ts.map +1 -0
  152. package/resources/licenses/external-licenses.js +18 -0
  153. package/resources/licenses/external-licenses.js.map +1 -0
  154. package/resources/licenses/external-licenses.mjs +14 -0
  155. package/resources/licenses/external-licenses.mjs.map +1 -0
  156. package/resources/licenses/index.d.ts +4 -0
  157. package/resources/licenses/index.d.ts.map +1 -0
  158. package/resources/licenses/index.js +12 -0
  159. package/resources/licenses/index.js.map +1 -0
  160. package/resources/licenses/index.mjs +5 -0
  161. package/resources/licenses/index.mjs.map +1 -0
  162. package/resources/licenses/licenses.d.ts +133 -0
  163. package/resources/licenses/licenses.d.ts.map +1 -0
  164. package/resources/licenses/licenses.js +86 -0
  165. package/resources/licenses/licenses.js.map +1 -0
  166. package/resources/licenses/licenses.mjs +58 -0
  167. package/resources/licenses/licenses.mjs.map +1 -0
  168. package/resources/licenses/usage.d.ts +211 -0
  169. package/resources/licenses/usage.d.ts.map +1 -0
  170. package/resources/licenses/usage.js +25 -0
  171. package/resources/licenses/usage.js.map +1 -0
  172. package/resources/licenses/usage.mjs +21 -0
  173. package/resources/licenses/usage.mjs.map +1 -0
  174. package/resources/licenses.d.ts +2 -0
  175. package/resources/licenses.d.ts.map +1 -0
  176. package/resources/licenses.js +19 -0
  177. package/resources/licenses.js.map +1 -0
  178. package/resources/licenses.mjs +3 -0
  179. package/resources/licenses.mjs.map +1 -0
  180. package/resources/metrics.d.ts +7 -0
  181. package/resources/metrics.d.ts.map +1 -1
  182. package/resources/metrics.js +4 -0
  183. package/resources/metrics.js.map +1 -1
  184. package/resources/metrics.mjs +4 -0
  185. package/resources/metrics.mjs.map +1 -1
  186. package/resources/plans/external-plan-id.d.ts +5 -0
  187. package/resources/plans/external-plan-id.d.ts.map +1 -1
  188. package/resources/plans/external-plan-id.js +5 -0
  189. package/resources/plans/external-plan-id.js.map +1 -1
  190. package/resources/plans/external-plan-id.mjs +5 -0
  191. package/resources/plans/external-plan-id.mjs.map +1 -1
  192. package/resources/plans/migrations.d.ts +5 -0
  193. package/resources/plans/migrations.d.ts.map +1 -1
  194. package/resources/plans/migrations.js +5 -0
  195. package/resources/plans/migrations.js.map +1 -1
  196. package/resources/plans/migrations.mjs +5 -0
  197. package/resources/plans/migrations.mjs.map +1 -1
  198. package/resources/plans/plans.d.ts +4200 -121
  199. package/resources/plans/plans.d.ts.map +1 -1
  200. package/resources/plans/plans.js +5 -0
  201. package/resources/plans/plans.js.map +1 -1
  202. package/resources/plans/plans.mjs +5 -0
  203. package/resources/plans/plans.mjs.map +1 -1
  204. package/resources/prices/external-price-id.d.ts +9 -0
  205. package/resources/prices/external-price-id.d.ts.map +1 -1
  206. package/resources/prices/external-price-id.js +9 -0
  207. package/resources/prices/external-price-id.js.map +1 -1
  208. package/resources/prices/external-price-id.mjs +9 -0
  209. package/resources/prices/external-price-id.mjs.map +1 -1
  210. package/resources/prices/prices.d.ts +198 -0
  211. package/resources/prices/prices.d.ts.map +1 -1
  212. package/resources/prices/prices.js +9 -0
  213. package/resources/prices/prices.js.map +1 -1
  214. package/resources/prices/prices.mjs +9 -0
  215. package/resources/prices/prices.mjs.map +1 -1
  216. package/resources/shared.d.ts +1040 -6
  217. package/resources/shared.d.ts.map +1 -1
  218. package/resources/shared.js.map +1 -1
  219. package/resources/shared.mjs.map +1 -1
  220. package/resources/subscriptions.d.ts +262 -0
  221. package/resources/subscriptions.d.ts.map +1 -1
  222. package/resources/subscriptions.js.map +1 -1
  223. package/resources/subscriptions.mjs.map +1 -1
  224. package/src/core.ts +10 -21
  225. package/src/index.ts +149 -5
  226. package/src/internal/utils/query.ts +7 -0
  227. package/src/resources/alerts.ts +24 -0
  228. package/src/resources/beta/beta.ts +9945 -194
  229. package/src/resources/beta/external-plan-id.ts +9945 -194
  230. package/src/resources/coupons/coupons.ts +3 -0
  231. package/src/resources/coupons/subscriptions.ts +3 -0
  232. package/src/resources/credit-blocks.ts +110 -1
  233. package/src/resources/credit-notes.ts +4 -0
  234. package/src/resources/customers/balance-transactions.ts +16 -0
  235. package/src/resources/customers/costs.ts +16 -0
  236. package/src/resources/customers/credits/credits.ts +45 -0
  237. package/src/resources/customers/credits/ledger.ts +33 -4
  238. package/src/resources/customers/credits/top-ups.ts +3 -0
  239. package/src/resources/customers/customers.ts +61 -12
  240. package/src/resources/dimensional-price-groups/external-dimensional-price-group-id.ts +1 -1
  241. package/src/resources/events/backfills.ts +5 -0
  242. package/src/resources/events/events.ts +5 -0
  243. package/src/resources/events/volume.ts +5 -0
  244. package/src/resources/index.ts +29 -1
  245. package/src/resources/invoice-line-items.ts +6 -0
  246. package/src/resources/invoices.ts +523 -6
  247. package/src/resources/items.ts +8 -2
  248. package/src/resources/license-types.ts +163 -0
  249. package/src/resources/licenses/external-licenses.ts +147 -0
  250. package/src/resources/licenses/index.ts +27 -0
  251. package/src/resources/licenses/licenses.ts +248 -0
  252. package/src/resources/licenses/usage.ts +280 -0
  253. package/src/resources/licenses.ts +3 -0
  254. package/src/resources/metrics.ts +6 -0
  255. package/src/resources/plans/external-plan-id.ts +5 -0
  256. package/src/resources/plans/migrations.ts +5 -0
  257. package/src/resources/plans/plans.ts +5004 -126
  258. package/src/resources/prices/external-price-id.ts +9 -0
  259. package/src/resources/prices/prices.ts +237 -0
  260. package/src/resources/shared.ts +1213 -0
  261. package/src/resources/subscriptions.ts +311 -0
  262. package/src/version.ts +1 -1
  263. package/version.d.ts +1 -1
  264. package/version.js +1 -1
  265. package/version.mjs +1 -1
@@ -7,6 +7,12 @@ import * as Shared from './shared';
7
7
  import { InvoicesPage } from './shared';
8
8
  import { Page, type PageParams } from '../pagination';
9
9
 
10
+ /**
11
+ * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the request for payment for
12
+ * a single subscription. This includes a set of line items, which correspond to prices in the subscription's plan and
13
+ * can represent fixed recurring fees or usage-based fees. They are generated at the end of a billing period, or as
14
+ * the result of an action, such as a cancellation.
15
+ */
10
16
  export class Invoices extends APIResource {
11
17
  /**
12
18
  * This endpoint is used to create a one-off invoice for a customer.
@@ -16,13 +22,14 @@ export class Invoices extends APIResource {
16
22
  }
17
23
 
18
24
  /**
19
- * This endpoint allows you to update the `metadata`, `net_terms`, `due_date`, and
20
- * `invoice_date` properties on an invoice. If you pass null for the metadata
21
- * value, it will clear any existing metadata for that invoice.
25
+ * This endpoint allows you to update the `metadata`, `net_terms`, `due_date`,
26
+ * `invoice_date`, and `auto_collection` properties on an invoice. If you pass null
27
+ * for the metadata value, it will clear any existing metadata for that invoice.
22
28
  *
23
29
  * `metadata` can be modified regardless of invoice state. `net_terms`, `due_date`,
24
- * and `invoice_date` can only be modified if the invoice is in a `draft` state.
25
- * `invoice_date` can only be modified for non-subscription invoices.
30
+ * `invoice_date`, and `auto_collection` can only be modified if the invoice is in
31
+ * a `draft` state. `invoice_date` can only be modified for non-subscription
32
+ * invoices.
26
33
  */
27
34
  update(
28
35
  invoiceId: string,
@@ -125,6 +132,37 @@ export class Invoices extends APIResource {
125
132
  return this._client.post(`/invoices/${invoiceId}/issue`, { body, ...options });
126
133
  }
127
134
 
135
+ /**
136
+ * This endpoint allows an eligible invoice to be issued manually. This is only
137
+ * possible with invoices where status is `draft`, `will_auto_issue` is false, and
138
+ * an `eligible_to_issue_at` is a time in the past. Issuing an invoice could
139
+ * possibly trigger side effects, some of which could be customer-visible (e.g.
140
+ * sending emails, auto-collecting payment, syncing the invoice to external
141
+ * providers, etc).
142
+ *
143
+ * This is a lighter-weight alternative to the issue invoice endpoint, returning an
144
+ * invoice summary without any line item details.
145
+ */
146
+ issueSummary(
147
+ invoiceId: string,
148
+ body?: InvoiceIssueSummaryParams,
149
+ options?: Core.RequestOptions,
150
+ ): Core.APIPromise<InvoiceIssueSummaryResponse>;
151
+ issueSummary(
152
+ invoiceId: string,
153
+ options?: Core.RequestOptions,
154
+ ): Core.APIPromise<InvoiceIssueSummaryResponse>;
155
+ issueSummary(
156
+ invoiceId: string,
157
+ body: InvoiceIssueSummaryParams | Core.RequestOptions = {},
158
+ options?: Core.RequestOptions,
159
+ ): Core.APIPromise<InvoiceIssueSummaryResponse> {
160
+ if (isRequestOptions(body)) {
161
+ return this.issueSummary(invoiceId, {}, body);
162
+ }
163
+ return this._client.post(`/invoices/summary/${invoiceId}/issue`, { body, ...options });
164
+ }
165
+
128
166
  /**
129
167
  * This is a lighter-weight endpoint that returns a list of all
130
168
  * [`Invoice`](/core-concepts#invoice) summaries for an account in a list format.
@@ -789,6 +827,458 @@ export namespace InvoiceFetchUpcomingResponse {
789
827
  }
790
828
  }
791
829
 
830
+ /**
831
+ * #InvoiceApiResourceWithoutLineItems
832
+ */
833
+ export interface InvoiceIssueSummaryResponse {
834
+ id: string;
835
+
836
+ /**
837
+ * This is the final amount required to be charged to the customer and reflects the
838
+ * application of the customer balance to the `total` of the invoice.
839
+ */
840
+ amount_due: string;
841
+
842
+ auto_collection: InvoiceIssueSummaryResponse.AutoCollection;
843
+
844
+ billing_address: Shared.Address | null;
845
+
846
+ /**
847
+ * The creation time of the resource in Orb.
848
+ */
849
+ created_at: string;
850
+
851
+ /**
852
+ * A list of credit notes associated with the invoice
853
+ */
854
+ credit_notes: Array<InvoiceIssueSummaryResponse.CreditNote>;
855
+
856
+ /**
857
+ * An ISO 4217 currency string or `credits`
858
+ */
859
+ currency: string;
860
+
861
+ customer: Shared.CustomerMinified;
862
+
863
+ customer_balance_transactions: Array<InvoiceIssueSummaryResponse.CustomerBalanceTransaction>;
864
+
865
+ /**
866
+ * Tax IDs are commonly required to be displayed on customer invoices, which are
867
+ * added to the headers of invoices.
868
+ *
869
+ * ### Supported Tax ID Countries and Types
870
+ *
871
+ * | Country | Type | Description |
872
+ * | ---------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
873
+ * | Albania | `al_tin` | Albania Tax Identification Number |
874
+ * | Andorra | `ad_nrt` | Andorran NRT Number |
875
+ * | Angola | `ao_tin` | Angola Tax Identification Number |
876
+ * | Argentina | `ar_cuit` | Argentinian Tax ID Number |
877
+ * | Armenia | `am_tin` | Armenia Tax Identification Number |
878
+ * | Aruba | `aw_tin` | Aruba Tax Identification Number |
879
+ * | Australia | `au_abn` | Australian Business Number (AU ABN) |
880
+ * | Australia | `au_arn` | Australian Taxation Office Reference Number |
881
+ * | Austria | `eu_vat` | European VAT Number |
882
+ * | Azerbaijan | `az_tin` | Azerbaijan Tax Identification Number |
883
+ * | Bahamas | `bs_tin` | Bahamas Tax Identification Number |
884
+ * | Bahrain | `bh_vat` | Bahraini VAT Number |
885
+ * | Bangladesh | `bd_bin` | Bangladesh Business Identification Number |
886
+ * | Barbados | `bb_tin` | Barbados Tax Identification Number |
887
+ * | Belarus | `by_tin` | Belarus TIN Number |
888
+ * | Belgium | `eu_vat` | European VAT Number |
889
+ * | Benin | `bj_ifu` | Benin Tax Identification Number (Identifiant Fiscal Unique) |
890
+ * | Bolivia | `bo_tin` | Bolivian Tax ID |
891
+ * | Bosnia and Herzegovina | `ba_tin` | Bosnia and Herzegovina Tax Identification Number |
892
+ * | Brazil | `br_cnpj` | Brazilian CNPJ Number |
893
+ * | Brazil | `br_cpf` | Brazilian CPF Number |
894
+ * | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code |
895
+ * | Bulgaria | `eu_vat` | European VAT Number |
896
+ * | Burkina Faso | `bf_ifu` | Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique) |
897
+ * | Cambodia | `kh_tin` | Cambodia Tax Identification Number |
898
+ * | Cameroon | `cm_niu` | Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique) |
899
+ * | Canada | `ca_bn` | Canadian BN |
900
+ * | Canada | `ca_gst_hst` | Canadian GST/HST Number |
901
+ * | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) |
902
+ * | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) |
903
+ * | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) |
904
+ * | Canada | `ca_qst` | Canadian QST Number (Québec) |
905
+ * | Cape Verde | `cv_nif` | Cape Verde Tax Identification Number (Número de Identificação Fiscal) |
906
+ * | Chile | `cl_tin` | Chilean TIN |
907
+ * | China | `cn_tin` | Chinese Tax ID |
908
+ * | Colombia | `co_nit` | Colombian NIT Number |
909
+ * | Congo-Kinshasa | `cd_nif` | Congo (DR) Tax Identification Number (Número de Identificação Fiscal) |
910
+ * | Costa Rica | `cr_tin` | Costa Rican Tax ID |
911
+ * | Croatia | `eu_vat` | European VAT Number |
912
+ * | Croatia | `hr_oib` | Croatian Personal Identification Number (OIB) |
913
+ * | Cyprus | `eu_vat` | European VAT Number |
914
+ * | Czech Republic | `eu_vat` | European VAT Number |
915
+ * | Denmark | `eu_vat` | European VAT Number |
916
+ * | Dominican Republic | `do_rcn` | Dominican RCN Number |
917
+ * | Ecuador | `ec_ruc` | Ecuadorian RUC Number |
918
+ * | Egypt | `eg_tin` | Egyptian Tax Identification Number |
919
+ * | El Salvador | `sv_nit` | El Salvadorian NIT Number |
920
+ * | Estonia | `eu_vat` | European VAT Number |
921
+ * | Ethiopia | `et_tin` | Ethiopia Tax Identification Number |
922
+ * | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme |
923
+ * | Finland | `eu_vat` | European VAT Number |
924
+ * | France | `eu_vat` | European VAT Number |
925
+ * | Georgia | `ge_vat` | Georgian VAT |
926
+ * | Germany | `de_stn` | German Tax Number (Steuernummer) |
927
+ * | Germany | `eu_vat` | European VAT Number |
928
+ * | Greece | `eu_vat` | European VAT Number |
929
+ * | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) |
930
+ * | Hong Kong | `hk_br` | Hong Kong BR Number |
931
+ * | Hungary | `eu_vat` | European VAT Number |
932
+ * | Hungary | `hu_tin` | Hungary Tax Number (adószám) |
933
+ * | Iceland | `is_vat` | Icelandic VAT |
934
+ * | India | `in_gst` | Indian GST Number |
935
+ * | Indonesia | `id_npwp` | Indonesian NPWP Number |
936
+ * | Ireland | `eu_vat` | European VAT Number |
937
+ * | Israel | `il_vat` | Israel VAT |
938
+ * | Italy | `eu_vat` | European VAT Number |
939
+ * | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
940
+ * | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
941
+ * | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
942
+ * | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number |
943
+ * | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number |
944
+ * | Kyrgyzstan | `kg_tin` | Kyrgyzstan Tax Identification Number |
945
+ * | Laos | `la_tin` | Laos Tax Identification Number |
946
+ * | Latvia | `eu_vat` | European VAT Number |
947
+ * | Liechtenstein | `li_uid` | Liechtensteinian UID Number |
948
+ * | Liechtenstein | `li_vat` | Liechtenstein VAT Number |
949
+ * | Lithuania | `eu_vat` | European VAT Number |
950
+ * | Luxembourg | `eu_vat` | European VAT Number |
951
+ * | Malaysia | `my_frp` | Malaysian FRP Number |
952
+ * | Malaysia | `my_itn` | Malaysian ITN |
953
+ * | Malaysia | `my_sst` | Malaysian SST Number |
954
+ * | Malta | `eu_vat` | European VAT Number |
955
+ * | Mauritania | `mr_nif` | Mauritania Tax Identification Number (Número de Identificação Fiscal) |
956
+ * | Mexico | `mx_rfc` | Mexican RFC Number |
957
+ * | Moldova | `md_vat` | Moldova VAT Number |
958
+ * | Montenegro | `me_pib` | Montenegro PIB Number |
959
+ * | Morocco | `ma_vat` | Morocco VAT Number |
960
+ * | Nepal | `np_pan` | Nepal PAN Number |
961
+ * | Netherlands | `eu_vat` | European VAT Number |
962
+ * | New Zealand | `nz_gst` | New Zealand GST Number |
963
+ * | Nigeria | `ng_tin` | Nigerian Tax Identification Number |
964
+ * | North Macedonia | `mk_vat` | North Macedonia VAT Number |
965
+ * | Northern Ireland | `eu_vat` | Northern Ireland VAT Number |
966
+ * | Norway | `no_vat` | Norwegian VAT Number |
967
+ * | Norway | `no_voec` | Norwegian VAT on e-commerce Number |
968
+ * | Oman | `om_vat` | Omani VAT Number |
969
+ * | Peru | `pe_ruc` | Peruvian RUC Number |
970
+ * | Philippines | `ph_tin` | Philippines Tax Identification Number |
971
+ * | Poland | `eu_vat` | European VAT Number |
972
+ * | Poland | `pl_nip` | Polish Tax ID Number |
973
+ * | Portugal | `eu_vat` | European VAT Number |
974
+ * | Romania | `eu_vat` | European VAT Number |
975
+ * | Romania | `ro_tin` | Romanian Tax ID Number |
976
+ * | Russia | `ru_inn` | Russian INN |
977
+ * | Russia | `ru_kpp` | Russian KPP |
978
+ * | Saudi Arabia | `sa_vat` | Saudi Arabia VAT |
979
+ * | Senegal | `sn_ninea` | Senegal NINEA Number |
980
+ * | Serbia | `rs_pib` | Serbian PIB Number |
981
+ * | Singapore | `sg_gst` | Singaporean GST |
982
+ * | Singapore | `sg_uen` | Singaporean UEN |
983
+ * | Slovakia | `eu_vat` | European VAT Number |
984
+ * | Slovenia | `eu_vat` | European VAT Number |
985
+ * | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) |
986
+ * | South Africa | `za_vat` | South African VAT Number |
987
+ * | South Korea | `kr_brn` | Korean BRN |
988
+ * | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) |
989
+ * | Spain | `eu_vat` | European VAT Number |
990
+ * | Suriname | `sr_fin` | Suriname FIN Number |
991
+ * | Sweden | `eu_vat` | European VAT Number |
992
+ * | Switzerland | `ch_uid` | Switzerland UID Number |
993
+ * | Switzerland | `ch_vat` | Switzerland VAT Number |
994
+ * | Taiwan | `tw_vat` | Taiwanese VAT |
995
+ * | Tajikistan | `tj_tin` | Tajikistan Tax Identification Number |
996
+ * | Tanzania | `tz_vat` | Tanzania VAT Number |
997
+ * | Thailand | `th_vat` | Thai VAT |
998
+ * | Turkey | `tr_tin` | Turkish Tax Identification Number |
999
+ * | Uganda | `ug_tin` | Uganda Tax Identification Number |
1000
+ * | Ukraine | `ua_vat` | Ukrainian VAT |
1001
+ * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN |
1002
+ * | United Kingdom | `gb_vat` | United Kingdom VAT Number |
1003
+ * | United States | `us_ein` | United States EIN |
1004
+ * | Uruguay | `uy_ruc` | Uruguayan RUC Number |
1005
+ * | Uzbekistan | `uz_tin` | Uzbekistan TIN Number |
1006
+ * | Uzbekistan | `uz_vat` | Uzbekistan VAT Number |
1007
+ * | Venezuela | `ve_rif` | Venezuelan RIF Number |
1008
+ * | Vietnam | `vn_tin` | Vietnamese Tax ID Number |
1009
+ * | Zambia | `zm_tin` | Zambia Tax Identification Number |
1010
+ * | Zimbabwe | `zw_tin` | Zimbabwe Tax Identification Number |
1011
+ */
1012
+ customer_tax_id: Shared.CustomerTaxID | null;
1013
+
1014
+ /**
1015
+ * When the invoice payment is due. The due date is null if the invoice is not yet
1016
+ * finalized.
1017
+ */
1018
+ due_date: string | null;
1019
+
1020
+ /**
1021
+ * If the invoice has a status of `draft`, this will be the time that the invoice
1022
+ * will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is
1023
+ * true, the invoice will automatically begin issuing at this time.
1024
+ */
1025
+ eligible_to_issue_at: string | null;
1026
+
1027
+ /**
1028
+ * A URL for the customer-facing invoice portal. This URL expires 30 days after the
1029
+ * invoice's due date, or 60 days after being re-generated through the UI.
1030
+ */
1031
+ hosted_invoice_url: string | null;
1032
+
1033
+ /**
1034
+ * The scheduled date of the invoice
1035
+ */
1036
+ invoice_date: string;
1037
+
1038
+ /**
1039
+ * Automatically generated invoice number to help track and reconcile invoices.
1040
+ * Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per
1041
+ * account or customer.
1042
+ */
1043
+ invoice_number: string;
1044
+
1045
+ /**
1046
+ * The link to download the PDF representation of the `Invoice`.
1047
+ */
1048
+ invoice_pdf: string | null;
1049
+
1050
+ invoice_source: 'subscription' | 'partial' | 'one_off';
1051
+
1052
+ /**
1053
+ * If the invoice failed to issue, this will be the last time it failed to issue
1054
+ * (even if it is now in a different state.)
1055
+ */
1056
+ issue_failed_at: string | null;
1057
+
1058
+ /**
1059
+ * If the invoice has been issued, this will be the time it transitioned to
1060
+ * `issued` (even if it is now in a different state.)
1061
+ */
1062
+ issued_at: string | null;
1063
+
1064
+ /**
1065
+ * Free-form text which is available on the invoice PDF and the Orb invoice portal.
1066
+ */
1067
+ memo: string | null;
1068
+
1069
+ /**
1070
+ * User specified key-value pairs for the resource. If not present, this defaults
1071
+ * to an empty dictionary. Individual keys can be removed by setting the value to
1072
+ * `null`, and the entire metadata mapping can be cleared by setting `metadata` to
1073
+ * `null`.
1074
+ */
1075
+ metadata: { [key: string]: string };
1076
+
1077
+ /**
1078
+ * If the invoice has a status of `paid`, this gives a timestamp when the invoice
1079
+ * was paid.
1080
+ */
1081
+ paid_at: string | null;
1082
+
1083
+ /**
1084
+ * A list of payment attempts associated with the invoice
1085
+ */
1086
+ payment_attempts: Array<InvoiceIssueSummaryResponse.PaymentAttempt>;
1087
+
1088
+ /**
1089
+ * If payment was attempted on this invoice but failed, this will be the time of
1090
+ * the most recent attempt.
1091
+ */
1092
+ payment_failed_at: string | null;
1093
+
1094
+ /**
1095
+ * If payment was attempted on this invoice, this will be the start time of the
1096
+ * most recent attempt. This field is especially useful for delayed-notification
1097
+ * payment mechanisms (like bank transfers), where payment can take 3 days or more.
1098
+ */
1099
+ payment_started_at: string | null;
1100
+
1101
+ /**
1102
+ * If the invoice is in draft, this timestamp will reflect when the invoice is
1103
+ * scheduled to be issued.
1104
+ */
1105
+ scheduled_issue_at: string | null;
1106
+
1107
+ shipping_address: Shared.Address | null;
1108
+
1109
+ status: 'issued' | 'paid' | 'synced' | 'void' | 'draft';
1110
+
1111
+ subscription: Shared.SubscriptionMinified | null;
1112
+
1113
+ /**
1114
+ * If the invoice failed to sync, this will be the last time an external invoicing
1115
+ * provider sync was attempted. This field will always be `null` for invoices using
1116
+ * Orb Invoicing.
1117
+ */
1118
+ sync_failed_at: string | null;
1119
+
1120
+ /**
1121
+ * The total after any minimums and discounts have been applied.
1122
+ */
1123
+ total: string;
1124
+
1125
+ /**
1126
+ * If the invoice has a status of `void`, this gives a timestamp when the invoice
1127
+ * was voided.
1128
+ */
1129
+ voided_at: string | null;
1130
+
1131
+ /**
1132
+ * This is true if the invoice will be automatically issued in the future, and
1133
+ * false otherwise.
1134
+ */
1135
+ will_auto_issue: boolean;
1136
+ }
1137
+
1138
+ export namespace InvoiceIssueSummaryResponse {
1139
+ export interface AutoCollection {
1140
+ /**
1141
+ * True only if auto-collection is enabled for this invoice.
1142
+ */
1143
+ enabled: boolean | null;
1144
+
1145
+ /**
1146
+ * If the invoice is scheduled for auto-collection, this field will reflect when
1147
+ * the next attempt will occur. If dunning has been exhausted, or auto-collection
1148
+ * is not enabled for this invoice, this field will be `null`.
1149
+ */
1150
+ next_attempt_at: string | null;
1151
+
1152
+ /**
1153
+ * Number of auto-collection payment attempts.
1154
+ */
1155
+ num_attempts: number | null;
1156
+
1157
+ /**
1158
+ * If Orb has ever attempted payment auto-collection for this invoice, this field
1159
+ * will reflect when that attempt occurred. In conjunction with `next_attempt_at`,
1160
+ * this can be used to tell whether the invoice is currently in dunning (that is,
1161
+ * `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or
1162
+ * if dunning has been exhausted (`previously_attempted_at` is non-null, but
1163
+ * `next_attempt_time` is null).
1164
+ */
1165
+ previously_attempted_at: string | null;
1166
+ }
1167
+
1168
+ export interface CreditNote {
1169
+ id: string;
1170
+
1171
+ credit_note_number: string;
1172
+
1173
+ /**
1174
+ * An optional memo supplied on the credit note.
1175
+ */
1176
+ memo: string | null;
1177
+
1178
+ reason: string;
1179
+
1180
+ total: string;
1181
+
1182
+ type: string;
1183
+
1184
+ /**
1185
+ * If the credit note has a status of `void`, this gives a timestamp when the
1186
+ * credit note was voided.
1187
+ */
1188
+ voided_at: string | null;
1189
+ }
1190
+
1191
+ export interface CustomerBalanceTransaction {
1192
+ /**
1193
+ * A unique id for this transaction.
1194
+ */
1195
+ id: string;
1196
+
1197
+ action:
1198
+ | 'applied_to_invoice'
1199
+ | 'manual_adjustment'
1200
+ | 'prorated_refund'
1201
+ | 'revert_prorated_refund'
1202
+ | 'return_from_voiding'
1203
+ | 'credit_note_applied'
1204
+ | 'credit_note_voided'
1205
+ | 'overpayment_refund'
1206
+ | 'external_payment'
1207
+ | 'small_invoice_carryover';
1208
+
1209
+ /**
1210
+ * The value of the amount changed in the transaction.
1211
+ */
1212
+ amount: string;
1213
+
1214
+ /**
1215
+ * The creation time of this transaction.
1216
+ */
1217
+ created_at: string;
1218
+
1219
+ credit_note: Shared.CreditNoteTiny | null;
1220
+
1221
+ /**
1222
+ * An optional description provided for manual customer balance adjustments.
1223
+ */
1224
+ description: string | null;
1225
+
1226
+ /**
1227
+ * The new value of the customer's balance prior to the transaction, in the
1228
+ * customer's currency.
1229
+ */
1230
+ ending_balance: string;
1231
+
1232
+ invoice: Shared.InvoiceTiny | null;
1233
+
1234
+ /**
1235
+ * The original value of the customer's balance prior to the transaction, in the
1236
+ * customer's currency.
1237
+ */
1238
+ starting_balance: string;
1239
+
1240
+ type: 'increment' | 'decrement';
1241
+ }
1242
+
1243
+ export interface PaymentAttempt {
1244
+ /**
1245
+ * The ID of the payment attempt.
1246
+ */
1247
+ id: string;
1248
+
1249
+ /**
1250
+ * The amount of the payment attempt.
1251
+ */
1252
+ amount: string;
1253
+
1254
+ /**
1255
+ * The time at which the payment attempt was created.
1256
+ */
1257
+ created_at: string;
1258
+
1259
+ /**
1260
+ * The payment provider that attempted to collect the payment.
1261
+ */
1262
+ payment_provider: 'stripe' | null;
1263
+
1264
+ /**
1265
+ * The ID of the payment attempt in the payment provider.
1266
+ */
1267
+ payment_provider_id: string | null;
1268
+
1269
+ /**
1270
+ * URL to the downloadable PDF version of the receipt. This field will be `null`
1271
+ * for payment attempts that did not succeed.
1272
+ */
1273
+ receipt_pdf: string | null;
1274
+
1275
+ /**
1276
+ * Whether the payment attempt succeeded.
1277
+ */
1278
+ succeeded: boolean;
1279
+ }
1280
+ }
1281
+
792
1282
  /**
793
1283
  * #InvoiceApiResourceWithoutLineItems
794
1284
  */
@@ -1256,6 +1746,13 @@ export interface InvoiceCreateParams {
1256
1746
 
1257
1747
  line_items: Array<InvoiceCreateParams.LineItem>;
1258
1748
 
1749
+ /**
1750
+ * Determines whether this invoice will automatically attempt to charge a saved
1751
+ * payment method, if any. If not specified, the invoice inherits the customer's
1752
+ * auto_collection setting.
1753
+ */
1754
+ auto_collection?: boolean | null;
1755
+
1259
1756
  /**
1260
1757
  * The id of the `Customer` to create this invoice for. One of `customer_id` and
1261
1758
  * `external_customer_id` are required.
@@ -1343,6 +1840,13 @@ export namespace InvoiceCreateParams {
1343
1840
  }
1344
1841
 
1345
1842
  export interface InvoiceUpdateParams {
1843
+ /**
1844
+ * Determines whether this invoice will automatically attempt to charge a saved
1845
+ * payment method, if any. Can only be modified on draft invoices. If not
1846
+ * specified, the invoice's existing setting is unchanged.
1847
+ */
1848
+ auto_collection?: boolean | null;
1849
+
1346
1850
  /**
1347
1851
  * An optional custom due date for the invoice. If not set, the due date will be
1348
1852
  * calculated based on the `net_terms` value.
@@ -1428,6 +1932,17 @@ export interface InvoiceIssueParams {
1428
1932
  synchronous?: boolean;
1429
1933
  }
1430
1934
 
1935
+ export interface InvoiceIssueSummaryParams {
1936
+ /**
1937
+ * If true, the invoice will be issued synchronously. If false, the invoice will be
1938
+ * issued asynchronously. The synchronous option is only available for invoices
1939
+ * that have no usage fees. If the invoice is configured to sync to an external
1940
+ * provider, a successful response from this endpoint guarantees the invoice is
1941
+ * present in the provider.
1942
+ */
1943
+ synchronous?: boolean;
1944
+ }
1945
+
1431
1946
  export interface InvoiceListSummaryParams extends PageParams {
1432
1947
  amount?: string | null;
1433
1948
 
@@ -1465,7 +1980,7 @@ export interface InvoiceListSummaryParams extends PageParams {
1465
1980
 
1466
1981
  is_recurring?: boolean | null;
1467
1982
 
1468
- status?: Array<'draft' | 'issued' | 'paid' | 'synced' | 'void'> | null;
1983
+ status?: 'draft' | 'issued' | 'paid' | 'synced' | 'void' | null;
1469
1984
 
1470
1985
  subscription_id?: string | null;
1471
1986
  }
@@ -1492,6 +2007,7 @@ Invoices.InvoiceListSummaryResponsesPage = InvoiceListSummaryResponsesPage;
1492
2007
  export declare namespace Invoices {
1493
2008
  export {
1494
2009
  type InvoiceFetchUpcomingResponse as InvoiceFetchUpcomingResponse,
2010
+ type InvoiceIssueSummaryResponse as InvoiceIssueSummaryResponse,
1495
2011
  type InvoiceListSummaryResponse as InvoiceListSummaryResponse,
1496
2012
  InvoiceListSummaryResponsesPage as InvoiceListSummaryResponsesPage,
1497
2013
  type InvoiceCreateParams as InvoiceCreateParams,
@@ -1499,6 +2015,7 @@ export declare namespace Invoices {
1499
2015
  type InvoiceListParams as InvoiceListParams,
1500
2016
  type InvoiceFetchUpcomingParams as InvoiceFetchUpcomingParams,
1501
2017
  type InvoiceIssueParams as InvoiceIssueParams,
2018
+ type InvoiceIssueSummaryParams as InvoiceIssueSummaryParams,
1502
2019
  type InvoiceListSummaryParams as InvoiceListSummaryParams,
1503
2020
  type InvoiceMarkPaidParams as InvoiceMarkPaidParams,
1504
2021
  };
@@ -5,6 +5,10 @@ import { isRequestOptions } from '../core';
5
5
  import * as Core from '../core';
6
6
  import { Page, type PageParams } from '../pagination';
7
7
 
8
+ /**
9
+ * The Item resource represents a sellable product or good. Items are associated with all line items, billable metrics,
10
+ * and prices and are used for defining external sync behavior for invoices and tax calculation purposes.
11
+ */
8
12
  export class Items extends APIResource {
9
13
  /**
10
14
  * This endpoint is used to create an [Item](/core-concepts#item).
@@ -111,7 +115,8 @@ export namespace Item {
111
115
  | 'taxjar'
112
116
  | 'avalara'
113
117
  | 'anrok'
114
- | 'numeral';
118
+ | 'numeral'
119
+ | 'stripe_tax';
115
120
 
116
121
  /**
117
122
  * The identifier of this item in the external system.
@@ -164,7 +169,8 @@ export namespace ItemUpdateParams {
164
169
  | 'taxjar'
165
170
  | 'avalara'
166
171
  | 'anrok'
167
- | 'numeral';
172
+ | 'numeral'
173
+ | 'stripe_tax';
168
174
 
169
175
  /**
170
176
  * The identifier of this item in the external system.