@paid-ai/paid-node 1.7.1 → 2.0.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 (2036) hide show
  1. package/dist/cjs/Client.d.ts +33 -0
  2. package/dist/cjs/Client.js +83 -28
  3. package/dist/cjs/api/errors/BadRequestError.d.ts +1 -2
  4. package/dist/cjs/api/errors/ConflictError.d.ts +1 -2
  5. package/dist/cjs/api/errors/ForbiddenError.d.ts +1 -2
  6. package/dist/cjs/api/errors/InternalServerError.d.ts +1 -2
  7. package/dist/cjs/api/errors/NotFoundError.d.ts +1 -2
  8. package/dist/cjs/api/errors/RequestTimeoutError.d.ts +6 -0
  9. package/dist/cjs/api/errors/RequestTimeoutError.js +50 -0
  10. package/dist/cjs/api/errors/TooManyRequestsError.d.ts +6 -0
  11. package/dist/cjs/api/errors/TooManyRequestsError.js +50 -0
  12. package/dist/cjs/api/errors/UnprocessableEntityError.d.ts +6 -0
  13. package/dist/cjs/api/errors/UnprocessableEntityError.js +50 -0
  14. package/dist/cjs/api/errors/index.d.ts +3 -0
  15. package/dist/cjs/api/errors/index.js +3 -0
  16. package/dist/cjs/api/resources/amendments/client/Client.d.ts +83 -0
  17. package/dist/cjs/api/resources/amendments/client/Client.js +313 -0
  18. package/dist/cjs/api/resources/amendments/client/index.d.ts +1 -0
  19. package/dist/cjs/api/resources/amendments/client/index.js +17 -0
  20. package/dist/cjs/api/resources/amendments/client/requests/GetOrderAmendmentOptionsRequest.d.ts +10 -0
  21. package/dist/cjs/api/resources/amendments/client/requests/UnifiedAmendmentExecuteRequest.d.ts +35 -0
  22. package/dist/cjs/api/resources/amendments/client/requests/UnifiedAmendmentExecuteRequest.js +14 -0
  23. package/dist/cjs/api/resources/amendments/client/requests/UnifiedAmendmentPreviewRequest.d.ts +33 -0
  24. package/dist/cjs/api/resources/amendments/client/requests/UnifiedAmendmentPreviewRequest.js +14 -0
  25. package/dist/cjs/api/resources/amendments/client/requests/index.d.ts +3 -0
  26. package/dist/cjs/api/resources/amendments/client/requests/index.js +2 -0
  27. package/dist/cjs/api/resources/amendments/index.d.ts +1 -0
  28. package/dist/cjs/api/resources/amendments/index.js +17 -0
  29. package/dist/cjs/api/resources/analytics/client/Client.d.ts +64 -0
  30. package/dist/cjs/api/resources/analytics/client/Client.js +276 -0
  31. package/dist/cjs/api/resources/analytics/client/index.d.ts +1 -0
  32. package/dist/cjs/api/resources/analytics/client/index.js +17 -0
  33. package/dist/cjs/api/resources/analytics/client/requests/GetSignalsMetadataRequest.d.ts +12 -0
  34. package/dist/cjs/api/resources/analytics/client/requests/index.d.ts +1 -0
  35. package/dist/cjs/api/resources/analytics/client/requests/index.js +2 -0
  36. package/dist/cjs/api/resources/analytics/index.d.ts +1 -0
  37. package/dist/cjs/api/resources/analytics/index.js +17 -0
  38. package/dist/cjs/api/resources/analyticsExperimental/client/Client.d.ts +70 -0
  39. package/dist/cjs/api/resources/analyticsExperimental/client/Client.js +282 -0
  40. package/dist/cjs/api/resources/analyticsExperimental/client/index.d.ts +1 -0
  41. package/dist/cjs/api/resources/analyticsExperimental/client/index.js +17 -0
  42. package/dist/cjs/api/resources/analyticsExperimental/client/requests/GetExperimentalSignalsMetadataRequest.d.ts +12 -0
  43. package/dist/cjs/api/resources/analyticsExperimental/client/requests/GetExperimentalSignalsMetadataRequest.js +3 -0
  44. package/dist/cjs/api/resources/analyticsExperimental/client/requests/index.d.ts +1 -0
  45. package/dist/cjs/api/resources/analyticsExperimental/client/requests/index.js +2 -0
  46. package/dist/cjs/api/resources/analyticsExperimental/index.d.ts +1 -0
  47. package/dist/cjs/api/resources/analyticsExperimental/index.js +17 -0
  48. package/dist/cjs/api/resources/checkouts/client/Client.d.ts +2 -1
  49. package/dist/cjs/api/resources/checkouts/client/Client.js +4 -1
  50. package/dist/cjs/api/resources/checkouts/client/requests/CreateCheckoutRequest.d.ts +8 -1
  51. package/dist/cjs/api/resources/contacts/client/Client.d.ts +6 -4
  52. package/dist/cjs/api/resources/contacts/client/Client.js +10 -4
  53. package/dist/cjs/api/resources/credits/client/Client.d.ts +76 -2
  54. package/dist/cjs/api/resources/credits/client/Client.js +371 -5
  55. package/dist/cjs/api/resources/credits/client/index.d.ts +1 -1
  56. package/dist/cjs/api/resources/credits/client/index.js +15 -0
  57. package/dist/cjs/api/resources/credits/client/requests/CreateCreditCurrencyRequest.d.ts +16 -0
  58. package/dist/cjs/api/resources/credits/client/requests/CreateCreditCurrencyRequest.js +3 -0
  59. package/dist/cjs/api/resources/credits/client/requests/GetCreditTransactionSummaryRequest.d.ts +33 -0
  60. package/dist/cjs/api/resources/credits/client/requests/GetCreditTransactionSummaryRequest.js +3 -0
  61. package/dist/cjs/api/resources/credits/client/requests/ListCreditCurrenciesRequest.d.ts +9 -0
  62. package/dist/cjs/api/resources/credits/client/requests/ListCreditCurrenciesRequest.js +3 -0
  63. package/dist/cjs/api/resources/credits/client/requests/ListCreditTransactionsRequest.d.ts +27 -0
  64. package/dist/cjs/api/resources/credits/client/requests/ListCreditTransactionsRequest.js +3 -0
  65. package/dist/cjs/api/resources/credits/client/requests/UpdateCreditCurrencyRequest.d.ts +24 -0
  66. package/dist/cjs/api/resources/credits/client/requests/UpdateCreditCurrencyRequest.js +12 -0
  67. package/dist/cjs/api/resources/credits/client/requests/index.d.ts +5 -0
  68. package/dist/cjs/api/resources/credits/client/requests/index.js +2 -0
  69. package/dist/cjs/api/resources/credits/index.d.ts +1 -0
  70. package/dist/cjs/api/resources/credits/index.js +1 -0
  71. package/dist/cjs/api/resources/credits/types/GetCreditTransactionSummaryRequestGroupBy.d.ts +4 -0
  72. package/dist/cjs/api/resources/credits/types/GetCreditTransactionSummaryRequestGroupBy.js +7 -0
  73. package/dist/cjs/api/resources/credits/types/GetCreditTransactionSummaryRequestInterval.d.ts +6 -0
  74. package/dist/cjs/api/resources/credits/types/GetCreditTransactionSummaryRequestInterval.js +9 -0
  75. package/dist/cjs/api/resources/credits/types/GetCreditTransactionSummaryRequestType.d.ts +6 -0
  76. package/dist/cjs/api/resources/credits/types/GetCreditTransactionSummaryRequestType.js +9 -0
  77. package/dist/cjs/api/resources/credits/types/ListCreditCurrenciesRequestStatus.d.ts +6 -0
  78. package/dist/cjs/api/resources/credits/types/ListCreditCurrenciesRequestStatus.js +9 -0
  79. package/dist/cjs/api/resources/credits/types/ListCreditTransactionsRequestType.d.ts +6 -0
  80. package/dist/cjs/api/resources/credits/types/ListCreditTransactionsRequestType.js +9 -0
  81. package/dist/cjs/api/resources/credits/types/index.d.ts +5 -0
  82. package/dist/cjs/api/resources/credits/types/index.js +21 -0
  83. package/dist/cjs/api/resources/customViewsExperimental/client/Client.d.ts +200 -0
  84. package/dist/cjs/api/resources/customViewsExperimental/client/Client.js +785 -0
  85. package/dist/cjs/api/resources/customViewsExperimental/client/index.d.ts +1 -0
  86. package/dist/cjs/api/resources/customViewsExperimental/client/index.js +17 -0
  87. package/dist/cjs/api/resources/customViewsExperimental/client/requests/CreateCustomViewRequest.d.ts +70 -0
  88. package/dist/cjs/api/resources/customViewsExperimental/client/requests/CreateCustomViewRequest.js +26 -0
  89. package/dist/cjs/api/resources/customViewsExperimental/client/requests/GetCustomViewCustomerUnitsRequest.d.ts +14 -0
  90. package/dist/cjs/api/resources/customViewsExperimental/client/requests/GetCustomViewCustomerUnitsRequest.js +3 -0
  91. package/dist/cjs/api/resources/customViewsExperimental/client/requests/GetCustomViewDataRequest.d.ts +28 -0
  92. package/dist/cjs/api/resources/customViewsExperimental/client/requests/GetCustomViewDataRequest.js +3 -0
  93. package/dist/cjs/api/resources/customViewsExperimental/client/requests/GetCustomViewEmbedTokenRequest.d.ts +14 -0
  94. package/dist/cjs/api/resources/customViewsExperimental/client/requests/GetCustomViewEmbedTokenRequest.js +3 -0
  95. package/dist/cjs/api/resources/customViewsExperimental/client/requests/GetCustomViewRequest.d.ts +9 -0
  96. package/dist/cjs/api/resources/customViewsExperimental/client/requests/GetCustomViewRequest.js +3 -0
  97. package/dist/cjs/api/resources/customViewsExperimental/client/requests/PublishCustomViewRequest.d.ts +9 -0
  98. package/dist/cjs/api/resources/customViewsExperimental/client/requests/PublishCustomViewRequest.js +3 -0
  99. package/dist/cjs/api/resources/customViewsExperimental/client/requests/UpdateCustomViewPeriodRequest.d.ts +46 -0
  100. package/dist/cjs/api/resources/customViewsExperimental/client/requests/UpdateCustomViewPeriodRequest.js +21 -0
  101. package/dist/cjs/api/resources/customViewsExperimental/client/requests/UpdateCustomViewRequest.d.ts +30 -0
  102. package/dist/cjs/api/resources/customViewsExperimental/client/requests/UpdateCustomViewRequest.js +3 -0
  103. package/dist/cjs/api/resources/customViewsExperimental/client/requests/index.d.ts +8 -0
  104. package/dist/cjs/api/resources/customViewsExperimental/client/requests/index.js +2 -0
  105. package/dist/cjs/api/resources/customViewsExperimental/index.d.ts +2 -0
  106. package/dist/cjs/api/resources/customViewsExperimental/index.js +18 -0
  107. package/dist/cjs/api/resources/customViewsExperimental/types/GetCustomViewDataRequestIncludeDraft.d.ts +5 -0
  108. package/dist/cjs/api/resources/customViewsExperimental/types/GetCustomViewDataRequestIncludeDraft.js +8 -0
  109. package/dist/cjs/api/resources/customViewsExperimental/types/GetCustomViewDataRequestPeriodKind.d.ts +5 -0
  110. package/dist/cjs/api/resources/customViewsExperimental/types/GetCustomViewDataRequestPeriodKind.js +8 -0
  111. package/dist/cjs/api/resources/customViewsExperimental/types/GetCustomViewDataRequestPeriodUnit.d.ts +6 -0
  112. package/dist/cjs/api/resources/customViewsExperimental/types/GetCustomViewDataRequestPeriodUnit.js +9 -0
  113. package/dist/cjs/api/resources/customViewsExperimental/types/GetCustomViewDataRequestUnitMode.d.ts +6 -0
  114. package/dist/cjs/api/resources/customViewsExperimental/types/GetCustomViewDataRequestUnitMode.js +9 -0
  115. package/dist/cjs/api/resources/customViewsExperimental/types/index.d.ts +4 -0
  116. package/dist/cjs/api/resources/customViewsExperimental/types/index.js +20 -0
  117. package/dist/cjs/api/resources/customerPortals/client/Client.d.ts +1 -1
  118. package/dist/cjs/api/resources/customerPortals/client/Client.js +1 -1
  119. package/dist/cjs/api/resources/customers/client/Client.d.ts +1049 -15
  120. package/dist/cjs/api/resources/customers/client/Client.js +4104 -99
  121. package/dist/cjs/api/resources/customers/client/requests/CreateCustomerAliasByExternalIdRequest.d.ts +15 -0
  122. package/dist/cjs/api/resources/customers/client/requests/CreateCustomerAliasByExternalIdRequest.js +3 -0
  123. package/dist/cjs/api/resources/customers/client/requests/CreateCustomerAliasRequest.d.ts +15 -0
  124. package/dist/cjs/api/resources/customers/client/requests/CreateCustomerAliasRequest.js +3 -0
  125. package/dist/cjs/api/resources/customers/client/requests/CreateCustomerApiKeyByExternalIdRequest.d.ts +15 -0
  126. package/dist/cjs/api/resources/customers/client/requests/CreateCustomerApiKeyByExternalIdRequest.js +3 -0
  127. package/dist/cjs/api/resources/customers/client/requests/CreateCustomerApiKeyRequest.d.ts +15 -0
  128. package/dist/cjs/api/resources/customers/client/requests/CreateCustomerApiKeyRequest.js +3 -0
  129. package/dist/cjs/api/resources/customers/client/requests/CreateCustomerFundingInstructionsByExternalIdRequest.d.ts +12 -0
  130. package/dist/cjs/api/resources/customers/client/requests/CreateCustomerFundingInstructionsByExternalIdRequest.js +3 -0
  131. package/dist/cjs/api/resources/customers/client/requests/CreateCustomerFundingInstructionsRequest.d.ts +13 -0
  132. package/dist/cjs/api/resources/customers/client/requests/CreateCustomerFundingInstructionsRequest.js +3 -0
  133. package/dist/cjs/api/resources/customers/client/requests/CreateCustomerRequest.d.ts +1 -1
  134. package/dist/cjs/api/resources/customers/client/requests/CreateCustomerUnitAliasByExternalIdRequest.d.ts +18 -0
  135. package/dist/cjs/api/resources/customers/client/requests/CreateCustomerUnitAliasByExternalIdRequest.js +3 -0
  136. package/dist/cjs/api/resources/customers/client/requests/CreateCustomerUnitAliasByKeyRequest.d.ts +15 -0
  137. package/dist/cjs/api/resources/customers/client/requests/CreateCustomerUnitAliasByKeyRequest.js +3 -0
  138. package/dist/cjs/api/resources/customers/client/requests/CreateCustomerUnitAliasRequest.d.ts +18 -0
  139. package/dist/cjs/api/resources/customers/client/requests/CreateCustomerUnitAliasRequest.js +3 -0
  140. package/dist/cjs/api/resources/customers/client/requests/CreateCustomerUnitByExternalIdRequest.d.ts +15 -0
  141. package/dist/cjs/api/resources/customers/client/requests/CreateCustomerUnitByExternalIdRequest.js +3 -0
  142. package/dist/cjs/api/resources/customers/client/requests/CreateCustomerUnitRequest.d.ts +15 -0
  143. package/dist/cjs/api/resources/customers/client/requests/CreateCustomerUnitRequest.js +3 -0
  144. package/dist/cjs/api/resources/customers/client/requests/CustomerUnitCreateUnderParent.d.ts +21 -0
  145. package/dist/cjs/api/resources/customers/client/requests/CustomerUnitCreateUnderParent.js +3 -0
  146. package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerAliasByExternalIdRequest.d.ts +13 -0
  147. package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerAliasByExternalIdRequest.js +3 -0
  148. package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerAliasRequest.d.ts +13 -0
  149. package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerAliasRequest.js +3 -0
  150. package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerByExternalIdRequest.d.ts +2 -1
  151. package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerByIdRequest.d.ts +2 -1
  152. package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerUnitAliasByExternalIdRequest.d.ts +16 -0
  153. package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerUnitAliasByExternalIdRequest.js +3 -0
  154. package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerUnitAliasByKeyRequest.d.ts +13 -0
  155. package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerUnitAliasByKeyRequest.js +3 -0
  156. package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerUnitAliasRequest.d.ts +16 -0
  157. package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerUnitAliasRequest.js +3 -0
  158. package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerUnitByExternalIdRequest.d.ts +13 -0
  159. package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerUnitByExternalIdRequest.js +3 -0
  160. package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerUnitRequest.d.ts +13 -0
  161. package/dist/cjs/api/resources/customers/client/requests/DeleteCustomerUnitRequest.js +3 -0
  162. package/dist/cjs/api/resources/customers/client/requests/EndCustomerUnitCapByExternalIdRequest.d.ts +16 -0
  163. package/dist/cjs/api/resources/customers/client/requests/EndCustomerUnitCapByExternalIdRequest.js +3 -0
  164. package/dist/cjs/api/resources/customers/client/requests/EndCustomerUnitCapRequest.d.ts +16 -0
  165. package/dist/cjs/api/resources/customers/client/requests/EndCustomerUnitCapRequest.js +3 -0
  166. package/dist/cjs/api/resources/customers/client/requests/GetCustomerByExternalIdRequest.d.ts +2 -1
  167. package/dist/cjs/api/resources/customers/client/requests/GetCustomerByIdRequest.d.ts +2 -1
  168. package/dist/cjs/api/resources/customers/client/requests/GetCustomerCreditBalancesByExternalIdRequest.d.ts +2 -1
  169. package/dist/cjs/api/resources/customers/client/requests/GetCustomerCreditBalancesRequest.d.ts +2 -1
  170. package/dist/cjs/api/resources/customers/client/requests/GetCustomerFundingInstructionsByExternalIdRequest.d.ts +11 -0
  171. package/dist/cjs/api/resources/customers/client/requests/GetCustomerFundingInstructionsByExternalIdRequest.js +3 -0
  172. package/dist/cjs/api/resources/customers/client/requests/GetCustomerFundingInstructionsRequest.d.ts +12 -0
  173. package/dist/cjs/api/resources/customers/client/requests/GetCustomerFundingInstructionsRequest.js +3 -0
  174. package/dist/cjs/api/resources/customers/client/requests/GetCustomerStateByExternalIdRequest.d.ts +10 -0
  175. package/dist/cjs/api/resources/customers/client/requests/GetCustomerStateByExternalIdRequest.js +3 -0
  176. package/dist/cjs/api/resources/customers/client/requests/GetCustomerStateByIdRequest.d.ts +10 -0
  177. package/dist/cjs/api/resources/customers/client/requests/GetCustomerStateByIdRequest.js +3 -0
  178. package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitByExternalIdRequest.d.ts +13 -0
  179. package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitByExternalIdRequest.js +3 -0
  180. package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitByKeyRequest.d.ts +10 -0
  181. package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitByKeyRequest.js +3 -0
  182. package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitCapByExternalIdRequest.d.ts +16 -0
  183. package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitCapByExternalIdRequest.js +3 -0
  184. package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitCapRequest.d.ts +16 -0
  185. package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitCapRequest.js +3 -0
  186. package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitRequest.d.ts +13 -0
  187. package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitRequest.js +3 -0
  188. package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitSpendByExternalIdRequest.d.ts +22 -0
  189. package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitSpendByExternalIdRequest.js +3 -0
  190. package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitSpendRequest.d.ts +22 -0
  191. package/dist/cjs/api/resources/customers/client/requests/GetCustomerUnitSpendRequest.js +3 -0
  192. package/dist/cjs/api/resources/customers/client/requests/GrantCustomerCreditsByExternalIdRequest.d.ts +19 -0
  193. package/dist/cjs/api/resources/customers/client/requests/GrantCustomerCreditsByExternalIdRequest.js +3 -0
  194. package/dist/cjs/api/resources/customers/client/requests/GrantCustomerCreditsRequest.d.ts +19 -0
  195. package/dist/cjs/api/resources/customers/client/requests/GrantCustomerCreditsRequest.js +3 -0
  196. package/dist/cjs/api/resources/customers/client/requests/ListCustomerAliasesByExternalIdRequest.d.ts +12 -0
  197. package/dist/cjs/api/resources/customers/client/requests/ListCustomerAliasesByExternalIdRequest.js +3 -0
  198. package/dist/cjs/api/resources/customers/client/requests/ListCustomerAliasesRequest.d.ts +12 -0
  199. package/dist/cjs/api/resources/customers/client/requests/ListCustomerAliasesRequest.js +3 -0
  200. package/dist/cjs/api/resources/customers/client/requests/ListCustomerApiKeysByExternalIdRequest.d.ts +12 -0
  201. package/dist/cjs/api/resources/customers/client/requests/ListCustomerApiKeysByExternalIdRequest.js +3 -0
  202. package/dist/cjs/api/resources/customers/client/requests/ListCustomerApiKeysRequest.d.ts +12 -0
  203. package/dist/cjs/api/resources/customers/client/requests/ListCustomerApiKeysRequest.js +3 -0
  204. package/dist/cjs/api/resources/customers/client/requests/ListCustomerPendingCreditConsumptionByExternalIdRequest.d.ts +12 -0
  205. package/dist/cjs/api/resources/customers/client/requests/ListCustomerPendingCreditConsumptionByExternalIdRequest.js +3 -0
  206. package/dist/cjs/api/resources/customers/client/requests/ListCustomerPendingCreditConsumptionRequest.d.ts +12 -0
  207. package/dist/cjs/api/resources/customers/client/requests/ListCustomerPendingCreditConsumptionRequest.js +3 -0
  208. package/dist/cjs/api/resources/customers/client/requests/ListCustomerUnitAliasesByExternalIdRequest.d.ts +15 -0
  209. package/dist/cjs/api/resources/customers/client/requests/ListCustomerUnitAliasesByExternalIdRequest.js +3 -0
  210. package/dist/cjs/api/resources/customers/client/requests/ListCustomerUnitAliasesByKeyRequest.d.ts +12 -0
  211. package/dist/cjs/api/resources/customers/client/requests/ListCustomerUnitAliasesByKeyRequest.js +3 -0
  212. package/dist/cjs/api/resources/customers/client/requests/ListCustomerUnitAliasesRequest.d.ts +15 -0
  213. package/dist/cjs/api/resources/customers/client/requests/ListCustomerUnitAliasesRequest.js +3 -0
  214. package/dist/cjs/api/resources/customers/client/requests/ListCustomerUnitsByExternalIdRequest.d.ts +20 -0
  215. package/dist/cjs/api/resources/customers/client/requests/ListCustomerUnitsByExternalIdRequest.js +3 -0
  216. package/dist/cjs/api/resources/customers/client/requests/ListCustomerUnitsRequest.d.ts +20 -0
  217. package/dist/cjs/api/resources/customers/client/requests/ListCustomerUnitsRequest.js +3 -0
  218. package/dist/cjs/api/resources/customers/client/requests/ListCustomersRequest.d.ts +13 -0
  219. package/dist/cjs/api/resources/customers/client/requests/RevokeCustomerApiKeyByExternalIdRequest.d.ts +13 -0
  220. package/dist/cjs/api/resources/customers/client/requests/RevokeCustomerApiKeyByExternalIdRequest.js +3 -0
  221. package/dist/cjs/api/resources/customers/client/requests/RevokeCustomerApiKeyRequest.d.ts +13 -0
  222. package/dist/cjs/api/resources/customers/client/requests/RevokeCustomerApiKeyRequest.js +3 -0
  223. package/dist/cjs/api/resources/customers/client/requests/SetCustomerUnitCapByExternalIdRequest.d.ts +18 -0
  224. package/dist/cjs/api/resources/customers/client/requests/SetCustomerUnitCapByExternalIdRequest.js +3 -0
  225. package/dist/cjs/api/resources/customers/client/requests/SetCustomerUnitCapRequest.d.ts +18 -0
  226. package/dist/cjs/api/resources/customers/client/requests/SetCustomerUnitCapRequest.js +3 -0
  227. package/dist/cjs/api/resources/customers/client/requests/UpdateCustomerByExternalIdRequest.d.ts +2 -1
  228. package/dist/cjs/api/resources/customers/client/requests/UpdateCustomerByIdRequest.d.ts +2 -1
  229. package/dist/cjs/api/resources/customers/client/requests/UpdateCustomerUnitByExternalIdRequest.d.ts +16 -0
  230. package/dist/cjs/api/resources/customers/client/requests/UpdateCustomerUnitByExternalIdRequest.js +3 -0
  231. package/dist/cjs/api/resources/customers/client/requests/UpdateCustomerUnitRequest.d.ts +16 -0
  232. package/dist/cjs/api/resources/customers/client/requests/UpdateCustomerUnitRequest.js +3 -0
  233. package/dist/cjs/api/resources/customers/client/requests/index.d.ts +51 -0
  234. package/dist/cjs/api/resources/customers/index.d.ts +1 -0
  235. package/dist/cjs/api/resources/customers/index.js +1 -0
  236. package/dist/cjs/api/resources/customers/types/DeleteCustomerUnitAliasByExternalIdResponse.d.ts +1 -0
  237. package/dist/cjs/api/resources/customers/types/DeleteCustomerUnitAliasByExternalIdResponse.js +3 -0
  238. package/dist/cjs/api/resources/customers/types/DeleteCustomerUnitAliasByKeyResponse.d.ts +1 -0
  239. package/dist/cjs/api/resources/customers/types/DeleteCustomerUnitAliasByKeyResponse.js +3 -0
  240. package/dist/cjs/api/resources/customers/types/DeleteCustomerUnitAliasResponse.d.ts +1 -0
  241. package/dist/cjs/api/resources/customers/types/DeleteCustomerUnitAliasResponse.js +3 -0
  242. package/dist/cjs/api/resources/customers/types/ListCustomerUnitsByExternalIdRequestStatus.d.ts +6 -0
  243. package/dist/cjs/api/resources/customers/types/ListCustomerUnitsByExternalIdRequestStatus.js +9 -0
  244. package/dist/cjs/api/resources/customers/types/ListCustomerUnitsRequestStatus.d.ts +6 -0
  245. package/dist/cjs/api/resources/customers/types/ListCustomerUnitsRequestStatus.js +9 -0
  246. package/dist/cjs/api/resources/customers/types/ListCustomersRequestCreationState.d.ts +5 -0
  247. package/dist/cjs/api/resources/customers/types/ListCustomersRequestCreationState.js +8 -0
  248. package/dist/cjs/api/resources/customers/types/ListCustomersRequestStatus.d.ts +5 -0
  249. package/dist/cjs/api/resources/customers/types/ListCustomersRequestStatus.js +8 -0
  250. package/dist/cjs/api/resources/customers/types/index.d.ts +7 -0
  251. package/dist/cjs/api/resources/customers/types/index.js +23 -0
  252. package/dist/cjs/api/resources/deliveredValue/client/Client.d.ts +60 -0
  253. package/dist/cjs/api/resources/deliveredValue/client/Client.js +248 -0
  254. package/dist/cjs/api/resources/deliveredValue/client/index.d.ts +1 -0
  255. package/dist/cjs/api/resources/deliveredValue/client/index.js +17 -0
  256. package/dist/cjs/api/resources/deliveredValue/client/requests/GetDeliveredValueRequest.d.ts +18 -0
  257. package/dist/cjs/api/resources/deliveredValue/client/requests/GetDeliveredValueRequest.js +3 -0
  258. package/dist/cjs/api/resources/deliveredValue/client/requests/GetDeliveredValueSummaryRequest.d.ts +29 -0
  259. package/dist/cjs/api/resources/deliveredValue/client/requests/GetDeliveredValueSummaryRequest.js +3 -0
  260. package/dist/cjs/api/resources/deliveredValue/client/requests/index.d.ts +2 -0
  261. package/dist/cjs/api/resources/deliveredValue/client/requests/index.js +2 -0
  262. package/dist/cjs/api/resources/deliveredValue/index.d.ts +2 -0
  263. package/dist/cjs/api/resources/deliveredValue/index.js +18 -0
  264. package/dist/cjs/api/resources/deliveredValue/types/GetDeliveredValueSummaryRequestGroupBy.d.ts +7 -0
  265. package/dist/cjs/api/resources/deliveredValue/types/GetDeliveredValueSummaryRequestGroupBy.js +10 -0
  266. package/dist/cjs/api/resources/deliveredValue/types/GetDeliveredValueSummaryRequestInterval.d.ts +8 -0
  267. package/dist/cjs/api/resources/deliveredValue/types/GetDeliveredValueSummaryRequestInterval.js +11 -0
  268. package/dist/cjs/api/resources/deliveredValue/types/index.d.ts +2 -0
  269. package/dist/cjs/api/resources/deliveredValue/types/index.js +18 -0
  270. package/dist/cjs/api/resources/index.d.ts +30 -0
  271. package/dist/cjs/api/resources/index.js +31 -1
  272. package/dist/cjs/api/resources/invoices/client/Client.js +37 -1
  273. package/dist/cjs/api/resources/invoices/client/requests/ListInvoicesRequest.d.ts +25 -0
  274. package/dist/cjs/api/resources/invoices/index.d.ts +1 -0
  275. package/dist/cjs/api/resources/invoices/index.js +1 -0
  276. package/dist/cjs/api/resources/invoices/types/ListInvoicesRequestPaymentStatus.d.ts +8 -0
  277. package/dist/cjs/api/resources/invoices/types/ListInvoicesRequestPaymentStatus.js +11 -0
  278. package/dist/cjs/api/resources/invoices/types/ListInvoicesRequestStatus.d.ts +10 -0
  279. package/dist/cjs/api/resources/invoices/types/ListInvoicesRequestStatus.js +13 -0
  280. package/dist/cjs/api/resources/invoices/types/index.d.ts +2 -0
  281. package/dist/cjs/api/resources/invoices/types/index.js +18 -0
  282. package/dist/cjs/api/resources/orders/client/Client.d.ts +105 -1
  283. package/dist/cjs/api/resources/orders/client/Client.js +245 -2
  284. package/dist/cjs/api/resources/orders/client/requests/ActivateOrderByIdRequest.d.ts +9 -0
  285. package/dist/cjs/api/resources/orders/client/requests/ActivateOrderByIdRequest.js +3 -0
  286. package/dist/cjs/api/resources/orders/client/requests/CreateOrderRequest.d.ts +14 -1
  287. package/dist/cjs/api/resources/orders/client/requests/CreateOrderRequest.js +12 -0
  288. package/dist/cjs/api/resources/orders/client/requests/ListOrdersRequest.d.ts +19 -0
  289. package/dist/cjs/api/resources/orders/client/requests/ProvisionRequest.d.ts +82 -0
  290. package/dist/cjs/api/resources/orders/client/requests/ProvisionRequest.js +3 -0
  291. package/dist/cjs/api/resources/orders/client/requests/UpdateOrderRequest.d.ts +14 -1
  292. package/dist/cjs/api/resources/orders/client/requests/UpdateOrderRequest.js +12 -0
  293. package/dist/cjs/api/resources/orders/client/requests/index.d.ts +2 -0
  294. package/dist/cjs/api/resources/orders/types/ListOrdersRequestCreationState.d.ts +5 -0
  295. package/dist/cjs/api/resources/orders/types/ListOrdersRequestCreationState.js +8 -0
  296. package/dist/cjs/api/resources/orders/types/OrderStatusFilter.d.ts +7 -0
  297. package/dist/cjs/api/resources/orders/types/OrderStatusFilter.js +10 -0
  298. package/dist/cjs/api/resources/orders/types/index.d.ts +2 -0
  299. package/dist/cjs/api/resources/orders/types/index.js +2 -0
  300. package/dist/cjs/api/resources/paymentAllocations/client/Client.d.ts +56 -0
  301. package/dist/cjs/api/resources/paymentAllocations/client/Client.js +227 -0
  302. package/dist/cjs/api/resources/paymentAllocations/client/index.d.ts +1 -0
  303. package/dist/cjs/api/resources/paymentAllocations/client/index.js +17 -0
  304. package/dist/cjs/api/resources/paymentAllocations/client/requests/CreatePaymentAllocationRequest.d.ts +17 -0
  305. package/dist/cjs/api/resources/paymentAllocations/client/requests/CreatePaymentAllocationRequest.js +3 -0
  306. package/dist/cjs/api/resources/paymentAllocations/client/requests/ListPaymentAllocationsRequest.d.ts +15 -0
  307. package/dist/cjs/api/resources/paymentAllocations/client/requests/ListPaymentAllocationsRequest.js +3 -0
  308. package/dist/cjs/api/resources/paymentAllocations/client/requests/index.d.ts +2 -0
  309. package/dist/cjs/api/resources/paymentAllocations/client/requests/index.js +2 -0
  310. package/dist/cjs/api/resources/paymentAllocations/index.d.ts +1 -0
  311. package/dist/cjs/api/resources/paymentAllocations/index.js +17 -0
  312. package/dist/cjs/api/resources/paymentMethods/client/Client.d.ts +104 -0
  313. package/dist/cjs/api/resources/paymentMethods/client/Client.js +446 -0
  314. package/dist/cjs/api/resources/paymentMethods/client/index.d.ts +1 -0
  315. package/dist/cjs/api/resources/paymentMethods/client/index.js +17 -0
  316. package/dist/cjs/api/resources/paymentMethods/client/requests/CreatePaymentMethodRequest.d.ts +18 -0
  317. package/dist/cjs/api/resources/paymentMethods/client/requests/CreatePaymentMethodRequest.js +3 -0
  318. package/dist/cjs/api/resources/paymentMethods/client/requests/DeletePaymentMethodRequest.d.ts +9 -0
  319. package/dist/cjs/api/resources/paymentMethods/client/requests/DeletePaymentMethodRequest.js +3 -0
  320. package/dist/cjs/api/resources/paymentMethods/client/requests/GetPaymentMethodRequest.d.ts +9 -0
  321. package/dist/cjs/api/resources/paymentMethods/client/requests/GetPaymentMethodRequest.js +3 -0
  322. package/dist/cjs/api/resources/paymentMethods/client/requests/ListPaymentMethodsRequest.d.ts +14 -0
  323. package/dist/cjs/api/resources/paymentMethods/client/requests/ListPaymentMethodsRequest.js +3 -0
  324. package/dist/cjs/api/resources/paymentMethods/client/requests/UpdateDefaultPaymentMethodRequest.d.ts +9 -0
  325. package/dist/cjs/api/resources/paymentMethods/client/requests/UpdateDefaultPaymentMethodRequest.js +3 -0
  326. package/dist/cjs/api/resources/paymentMethods/client/requests/index.d.ts +5 -0
  327. package/dist/cjs/api/resources/paymentMethods/client/requests/index.js +2 -0
  328. package/dist/cjs/api/resources/paymentMethods/index.d.ts +1 -0
  329. package/dist/cjs/api/resources/paymentMethods/index.js +17 -0
  330. package/dist/cjs/api/resources/payments/client/Client.d.ts +68 -0
  331. package/dist/cjs/api/resources/payments/client/Client.js +293 -0
  332. package/dist/cjs/api/resources/payments/client/index.d.ts +1 -0
  333. package/dist/cjs/api/resources/payments/client/index.js +17 -0
  334. package/dist/cjs/api/resources/payments/client/requests/CreatePaymentRequest.d.ts +25 -0
  335. package/dist/cjs/api/resources/payments/client/requests/CreatePaymentRequest.js +3 -0
  336. package/dist/cjs/api/resources/payments/client/requests/GetPaymentRequest.d.ts +9 -0
  337. package/dist/cjs/api/resources/payments/client/requests/GetPaymentRequest.js +3 -0
  338. package/dist/cjs/api/resources/payments/client/requests/ListPaymentsRequest.d.ts +15 -0
  339. package/dist/cjs/api/resources/payments/client/requests/ListPaymentsRequest.js +3 -0
  340. package/dist/cjs/api/resources/payments/client/requests/index.d.ts +3 -0
  341. package/dist/cjs/api/resources/payments/client/requests/index.js +2 -0
  342. package/dist/cjs/api/resources/payments/index.d.ts +2 -0
  343. package/dist/cjs/api/resources/payments/index.js +18 -0
  344. package/dist/cjs/api/resources/payments/types/ListPaymentsRequestStatus.d.ts +9 -0
  345. package/dist/cjs/api/resources/payments/types/ListPaymentsRequestStatus.js +12 -0
  346. package/dist/cjs/api/resources/payments/types/index.d.ts +1 -0
  347. package/dist/cjs/api/resources/payments/types/index.js +17 -0
  348. package/dist/cjs/api/resources/plans/client/Client.d.ts +152 -0
  349. package/dist/cjs/api/resources/plans/client/Client.js +593 -0
  350. package/dist/cjs/api/resources/plans/client/index.d.ts +1 -0
  351. package/dist/cjs/api/resources/plans/client/index.js +17 -0
  352. package/dist/cjs/api/resources/plans/client/requests/CreatePlanRequest.d.ts +28 -0
  353. package/dist/cjs/api/resources/plans/client/requests/CreatePlanRequest.js +3 -0
  354. package/dist/cjs/api/resources/plans/client/requests/GetPlanByExternalIdRequest.d.ts +9 -0
  355. package/dist/cjs/api/resources/plans/client/requests/GetPlanByExternalIdRequest.js +3 -0
  356. package/dist/cjs/api/resources/plans/client/requests/GetPlanByIdRequest.d.ts +9 -0
  357. package/dist/cjs/api/resources/plans/client/requests/GetPlanByIdRequest.js +3 -0
  358. package/dist/cjs/api/resources/plans/client/requests/ListPlansRequest.d.ts +12 -0
  359. package/dist/cjs/api/resources/plans/client/requests/ListPlansRequest.js +3 -0
  360. package/dist/cjs/api/resources/plans/client/requests/UpdatePlanByExternalIdRequest.d.ts +12 -0
  361. package/dist/cjs/api/resources/plans/client/requests/UpdatePlanByExternalIdRequest.js +3 -0
  362. package/dist/cjs/api/resources/plans/client/requests/UpdatePlanByIdRequest.d.ts +12 -0
  363. package/dist/cjs/api/resources/plans/client/requests/UpdatePlanByIdRequest.js +3 -0
  364. package/dist/cjs/api/resources/plans/client/requests/UpdatePlanUpgradePathRequest.d.ts +15 -0
  365. package/dist/cjs/api/resources/plans/client/requests/UpdatePlanUpgradePathRequest.js +3 -0
  366. package/dist/cjs/api/resources/plans/client/requests/index.d.ts +7 -0
  367. package/dist/cjs/api/resources/plans/client/requests/index.js +2 -0
  368. package/dist/cjs/api/resources/plans/index.d.ts +1 -0
  369. package/dist/cjs/api/resources/plans/index.js +17 -0
  370. package/dist/cjs/api/resources/pricing/client/Client.d.ts +2 -2
  371. package/dist/cjs/api/resources/pricing/client/Client.js +2 -2
  372. package/dist/cjs/api/resources/pricing/client/requests/UpdatePricingRequest.d.ts +1 -1
  373. package/dist/cjs/api/resources/products/client/Client.d.ts +9 -9
  374. package/dist/cjs/api/resources/products/client/Client.js +15 -6
  375. package/dist/cjs/api/resources/products/client/requests/ListProductsRequest.d.ts +6 -0
  376. package/dist/cjs/api/resources/signals/client/Client.d.ts +175 -4
  377. package/dist/cjs/api/resources/signals/client/Client.js +569 -4
  378. package/dist/cjs/api/resources/signals/client/requests/BulkSignalsRequest.d.ts +17 -3
  379. package/dist/cjs/api/resources/signals/client/requests/CreateSignalSummaryExportRequest.d.ts +56 -0
  380. package/dist/cjs/api/resources/signals/client/requests/CreateSignalSummaryExportRequest.js +12 -0
  381. package/dist/cjs/api/resources/signals/client/requests/GetSignalByIdRequest.d.ts +10 -0
  382. package/dist/cjs/api/resources/signals/client/requests/GetSignalByIdRequest.js +3 -0
  383. package/dist/cjs/api/resources/signals/client/requests/GetSignalSummaryExportRequest.d.ts +9 -0
  384. package/dist/cjs/api/resources/signals/client/requests/GetSignalSummaryExportRequest.js +3 -0
  385. package/dist/cjs/api/resources/signals/client/requests/GetSignalSummaryRequest.d.ts +45 -0
  386. package/dist/cjs/api/resources/signals/client/requests/GetSignalSummaryRequest.js +3 -0
  387. package/dist/cjs/api/resources/signals/client/requests/ListSignalsRequest.d.ts +22 -0
  388. package/dist/cjs/api/resources/signals/client/requests/ListSignalsRequest.js +3 -0
  389. package/dist/cjs/api/resources/signals/client/requests/SignalLookupRequest.d.ts +10 -0
  390. package/dist/cjs/api/resources/signals/client/requests/SignalLookupRequest.js +3 -0
  391. package/dist/cjs/api/resources/signals/client/requests/index.d.ts +6 -0
  392. package/dist/cjs/api/resources/signals/index.d.ts +1 -0
  393. package/dist/cjs/api/resources/signals/index.js +1 -0
  394. package/dist/cjs/api/resources/signals/types/GetSignalSummaryRequestGroupBy.d.ts +5 -0
  395. package/dist/cjs/api/resources/signals/types/GetSignalSummaryRequestGroupBy.js +8 -0
  396. package/dist/cjs/api/resources/signals/types/GetSignalSummaryRequestInterval.d.ts +7 -0
  397. package/dist/cjs/api/resources/signals/types/GetSignalSummaryRequestInterval.js +10 -0
  398. package/dist/cjs/api/resources/signals/types/index.d.ts +2 -0
  399. package/dist/cjs/api/resources/signals/types/index.js +18 -0
  400. package/dist/cjs/api/resources/valueMetrics/client/Client.d.ts +111 -0
  401. package/dist/cjs/api/resources/valueMetrics/client/Client.js +446 -0
  402. package/dist/cjs/api/resources/valueMetrics/client/index.d.ts +1 -0
  403. package/dist/cjs/api/resources/valueMetrics/client/index.js +17 -0
  404. package/dist/cjs/api/resources/valueMetrics/client/requests/ArchiveValueMetricRequest.d.ts +10 -0
  405. package/dist/cjs/api/resources/valueMetrics/client/requests/ArchiveValueMetricRequest.js +3 -0
  406. package/dist/cjs/api/resources/valueMetrics/client/requests/CreateValueMetricRequest.d.ts +57 -0
  407. package/dist/cjs/api/resources/valueMetrics/client/requests/CreateValueMetricRequest.js +15 -0
  408. package/dist/cjs/api/resources/valueMetrics/client/requests/GetValueMetricRequest.d.ts +9 -0
  409. package/dist/cjs/api/resources/valueMetrics/client/requests/GetValueMetricRequest.js +3 -0
  410. package/dist/cjs/api/resources/valueMetrics/client/requests/ListValueMetricsRequest.d.ts +10 -0
  411. package/dist/cjs/api/resources/valueMetrics/client/requests/ListValueMetricsRequest.js +3 -0
  412. package/dist/cjs/api/resources/valueMetrics/client/requests/UpdateValueMetricRequest.d.ts +43 -0
  413. package/dist/cjs/api/resources/valueMetrics/client/requests/UpdateValueMetricRequest.js +15 -0
  414. package/dist/cjs/api/resources/valueMetrics/client/requests/index.d.ts +5 -0
  415. package/dist/cjs/api/resources/valueMetrics/client/requests/index.js +2 -0
  416. package/dist/cjs/api/resources/valueMetrics/index.d.ts +1 -0
  417. package/dist/cjs/api/resources/valueMetrics/index.js +17 -0
  418. package/dist/cjs/api/resources/valueModels/client/Client.d.ts +120 -0
  419. package/dist/cjs/api/resources/valueModels/client/Client.js +425 -0
  420. package/dist/cjs/api/resources/valueModels/client/index.d.ts +1 -0
  421. package/dist/cjs/api/resources/valueModels/client/index.js +17 -0
  422. package/dist/cjs/api/resources/valueModels/client/requests/GetValueModelVersionRequest.d.ts +9 -0
  423. package/dist/cjs/api/resources/valueModels/client/requests/GetValueModelVersionRequest.js +3 -0
  424. package/dist/cjs/api/resources/valueModels/client/requests/ListValueModelVersionsRequest.d.ts +8 -0
  425. package/dist/cjs/api/resources/valueModels/client/requests/ListValueModelVersionsRequest.js +3 -0
  426. package/dist/cjs/api/resources/valueModels/client/requests/RefreshValueModelBackfillRequest.d.ts +5 -0
  427. package/dist/cjs/api/resources/valueModels/client/requests/RefreshValueModelBackfillRequest.js +3 -0
  428. package/dist/cjs/api/resources/valueModels/client/requests/ValueModelUploadRequest.d.ts +46 -0
  429. package/dist/cjs/api/resources/valueModels/client/requests/ValueModelUploadRequest.js +3 -0
  430. package/dist/cjs/api/resources/valueModels/client/requests/index.d.ts +4 -0
  431. package/dist/cjs/api/resources/valueModels/client/requests/index.js +2 -0
  432. package/dist/cjs/api/resources/valueModels/index.d.ts +1 -0
  433. package/dist/cjs/api/resources/valueModels/index.js +17 -0
  434. package/dist/cjs/api/resources/valueReceipts/client/Client.d.ts +45 -14
  435. package/dist/cjs/api/resources/valueReceipts/client/Client.js +156 -46
  436. package/dist/cjs/api/resources/valueReceipts/client/requests/PublishValueReceiptBody.d.ts +1 -0
  437. package/dist/cjs/api/resources/valueReceipts/client/requests/index.d.ts +0 -1
  438. package/dist/cjs/api/resources/webhooks/client/Client.d.ts +19 -4
  439. package/dist/cjs/api/resources/webhooks/client/Client.js +71 -3
  440. package/dist/cjs/api/resources/webhooks/client/requests/RotateWebhookSecretRequest.d.ts +5 -0
  441. package/dist/cjs/api/resources/webhooks/client/requests/RotateWebhookSecretRequest.js +3 -0
  442. package/dist/cjs/api/resources/webhooks/client/requests/TestWebhookRequest.d.ts +1 -1
  443. package/dist/cjs/api/resources/webhooks/client/requests/UpdateWebhookRequest.d.ts +2 -2
  444. package/dist/cjs/api/resources/webhooks/client/requests/index.d.ts +1 -0
  445. package/dist/cjs/api/resources/webhooks/types/TestWebhookRequestWebhookName.d.ts +2 -1
  446. package/dist/cjs/api/resources/webhooks/types/TestWebhookRequestWebhookName.js +2 -1
  447. package/dist/cjs/api/resources/webhooks/types/UpdateWebhookRequestWebhookName.d.ts +2 -1
  448. package/dist/cjs/api/resources/webhooks/types/UpdateWebhookRequestWebhookName.js +2 -1
  449. package/dist/cjs/api/types/AddAttributeIntent.d.ts +45 -0
  450. package/dist/cjs/api/types/AddAttributeIntent.js +24 -0
  451. package/dist/cjs/api/types/AddFromCatalogIntent.d.ts +22 -0
  452. package/dist/cjs/api/types/AddFromCatalogIntent.js +13 -0
  453. package/dist/cjs/api/types/AmendmentAddAttributeOptions.d.ts +9 -0
  454. package/dist/cjs/api/types/AmendmentAddAttributeOptions.js +3 -0
  455. package/dist/cjs/api/types/AmendmentAddAxisOptions.d.ts +10 -0
  456. package/dist/cjs/api/types/AmendmentAddAxisOptions.js +3 -0
  457. package/dist/cjs/api/types/AmendmentAttributeOptions.d.ts +14 -0
  458. package/dist/cjs/api/types/AmendmentAttributeOptions.js +3 -0
  459. package/dist/cjs/api/types/AmendmentAttributeState.d.ts +24 -0
  460. package/dist/cjs/api/types/AmendmentAttributeState.js +3 -0
  461. package/dist/cjs/api/types/AmendmentAxisChoiceValue.d.ts +10 -0
  462. package/dist/cjs/api/types/AmendmentAxisChoiceValue.js +13 -0
  463. package/dist/cjs/api/types/AmendmentAxisId.d.ts +8 -0
  464. package/dist/cjs/api/types/AmendmentAxisId.js +11 -0
  465. package/dist/cjs/api/types/AmendmentAxisOptions.d.ts +16 -0
  466. package/dist/cjs/api/types/AmendmentAxisOptions.js +3 -0
  467. package/dist/cjs/api/types/AmendmentAxisRelevance.d.ts +6 -0
  468. package/dist/cjs/api/types/AmendmentAxisRelevance.js +9 -0
  469. package/dist/cjs/api/types/AmendmentBillingType.d.ts +6 -0
  470. package/dist/cjs/api/types/AmendmentBillingType.js +9 -0
  471. package/dist/cjs/api/types/AmendmentChargeType.d.ts +8 -0
  472. package/dist/cjs/api/types/AmendmentChargeType.js +11 -0
  473. package/dist/cjs/api/types/AmendmentCreditEffectKind.d.ts +6 -0
  474. package/dist/cjs/api/types/AmendmentCreditEffectKind.js +9 -0
  475. package/dist/cjs/api/types/AmendmentErrorResponse.d.ts +7 -0
  476. package/dist/cjs/api/types/AmendmentErrorResponse.js +3 -0
  477. package/dist/cjs/api/types/AmendmentIntentKind.d.ts +10 -0
  478. package/dist/cjs/api/types/AmendmentIntentKind.js +13 -0
  479. package/dist/cjs/api/types/AmendmentIntentOptions.d.ts +7 -0
  480. package/dist/cjs/api/types/AmendmentIntentOptions.js +3 -0
  481. package/dist/cjs/api/types/AmendmentLineOptions.d.ts +12 -0
  482. package/dist/cjs/api/types/AmendmentLineOptions.js +3 -0
  483. package/dist/cjs/api/types/AmendmentMoneyBilling.d.ts +6 -0
  484. package/dist/cjs/api/types/AmendmentMoneyBilling.js +9 -0
  485. package/dist/cjs/api/types/AmendmentOptions.d.ts +26 -0
  486. package/dist/cjs/api/types/AmendmentOptions.js +3 -0
  487. package/dist/cjs/api/types/AmendmentPlan.d.ts +24 -0
  488. package/dist/cjs/api/types/AmendmentPlan.js +3 -0
  489. package/dist/cjs/api/types/AmendmentPlanAttributeDiff.d.ts +18 -0
  490. package/dist/cjs/api/types/AmendmentPlanAttributeDiff.js +3 -0
  491. package/dist/cjs/api/types/AmendmentPlanChange.d.ts +9 -0
  492. package/dist/cjs/api/types/AmendmentPlanChange.js +12 -0
  493. package/dist/cjs/api/types/AmendmentPlanCreditEffect.d.ts +15 -0
  494. package/dist/cjs/api/types/AmendmentPlanCreditEffect.js +3 -0
  495. package/dist/cjs/api/types/AmendmentPlanLineType.d.ts +8 -0
  496. package/dist/cjs/api/types/AmendmentPlanLineType.js +11 -0
  497. package/dist/cjs/api/types/AmendmentPlanMoneyEffect.d.ts +31 -0
  498. package/dist/cjs/api/types/AmendmentPlanMoneyEffect.js +13 -0
  499. package/dist/cjs/api/types/AmendmentPlanTreatmentResolution.d.ts +12 -0
  500. package/dist/cjs/api/types/AmendmentPlanTreatmentResolution.js +3 -0
  501. package/dist/cjs/api/types/AmendmentPlanUsageEffect.d.ts +17 -0
  502. package/dist/cjs/api/types/AmendmentPlanUsageEffect.js +12 -0
  503. package/dist/cjs/api/types/AmendmentPricingClause.d.ts +14 -0
  504. package/dist/cjs/api/types/AmendmentPricingClause.js +3 -0
  505. package/dist/cjs/api/types/AmendmentPricingModel.d.ts +11 -0
  506. package/dist/cjs/api/types/AmendmentPricingModel.js +14 -0
  507. package/dist/cjs/api/types/AmendmentTreatmentSource.d.ts +7 -0
  508. package/dist/cjs/api/types/AmendmentTreatmentSource.js +10 -0
  509. package/dist/cjs/api/types/AnalyticsColumn.d.ts +5 -0
  510. package/dist/cjs/api/types/AnalyticsColumn.js +3 -0
  511. package/dist/cjs/api/types/AnalyticsQueryRequest.d.ts +4 -0
  512. package/dist/cjs/api/types/AnalyticsQueryRequest.js +3 -0
  513. package/dist/cjs/api/types/AnalyticsQueryResponse.d.ts +15 -0
  514. package/dist/cjs/api/types/AnalyticsQueryResponse.js +3 -0
  515. package/dist/cjs/api/types/AnalyticsSchemaColumn.d.ts +6 -0
  516. package/dist/cjs/api/types/AnalyticsSchemaColumn.js +3 -0
  517. package/dist/cjs/api/types/AnalyticsSchemaResponse.d.ts +4 -0
  518. package/dist/cjs/api/types/AnalyticsSchemaResponse.js +3 -0
  519. package/dist/cjs/api/types/AnalyticsSchemaView.d.ts +6 -0
  520. package/dist/cjs/api/types/AnalyticsSchemaView.js +3 -0
  521. package/dist/cjs/api/types/Attribution.d.ts +3 -0
  522. package/dist/cjs/api/types/BackfillResponse.d.ts +4 -0
  523. package/dist/cjs/api/types/BackfillResponse.js +3 -0
  524. package/dist/cjs/api/types/ChargeStubAddAxisOptions.d.ts +34 -0
  525. package/dist/cjs/api/types/ChargeStubAddAxisOptions.js +19 -0
  526. package/dist/cjs/api/types/ChargeStubAxisOptions.d.ts +33 -0
  527. package/dist/cjs/api/types/ChargeStubAxisOptions.js +19 -0
  528. package/dist/cjs/api/types/Checkout.d.ts +6 -0
  529. package/dist/cjs/api/types/CheckoutCustomCard.d.ts +10 -0
  530. package/dist/cjs/api/types/CheckoutCustomCard.js +3 -0
  531. package/dist/cjs/api/types/CheckoutCustomCardInput.d.ts +10 -0
  532. package/dist/cjs/api/types/CheckoutCustomCardInput.js +3 -0
  533. package/dist/cjs/api/types/CheckoutDetails.d.ts +7 -0
  534. package/dist/cjs/api/types/CheckoutPlan.d.ts +4 -0
  535. package/dist/cjs/api/types/CheckoutPlan.js +3 -0
  536. package/dist/cjs/api/types/CheckoutPlanInput.d.ts +6 -0
  537. package/dist/cjs/api/types/CheckoutPlanInput.js +3 -0
  538. package/dist/cjs/api/types/CheckoutProduct.d.ts +3 -0
  539. package/dist/cjs/api/types/CheckoutProductInput.d.ts +3 -0
  540. package/dist/cjs/api/types/CheckoutSelectedProduct.d.ts +8 -0
  541. package/dist/cjs/api/types/CheckoutSelectedProduct.js +3 -0
  542. package/dist/cjs/api/types/CreateOrderLineAttributeRequest.d.ts +47 -5
  543. package/dist/cjs/api/types/CreateOrderLineAttributeRequest.js +11 -0
  544. package/dist/cjs/api/types/CreateOrderLineRequest.d.ts +4 -0
  545. package/dist/cjs/api/types/CreditBalance.d.ts +3 -1
  546. package/dist/cjs/api/types/CreditBenefitInput.d.ts +12 -5
  547. package/dist/cjs/api/types/CreditBenefitInput.js +2 -0
  548. package/dist/cjs/api/types/CreditBenefitOutput.d.ts +8 -6
  549. package/dist/cjs/api/types/CreditCurrency.d.ts +17 -0
  550. package/dist/cjs/api/types/CreditCurrency.js +9 -0
  551. package/dist/cjs/api/types/CreditGrant.d.ts +3 -0
  552. package/dist/cjs/api/types/CreditGrantAddAxisOptions.d.ts +24 -0
  553. package/dist/cjs/api/types/CreditGrantAddAxisOptions.js +3 -0
  554. package/dist/cjs/api/types/CreditGrantAxisOptions.d.ts +23 -0
  555. package/dist/cjs/api/types/CreditGrantAxisOptions.js +3 -0
  556. package/dist/cjs/api/types/CreditGrantCreateRequest.d.ts +12 -0
  557. package/dist/cjs/api/types/CreditGrantCreateRequest.js +3 -0
  558. package/dist/cjs/api/types/CreditGrantCurrency.d.ts +6 -0
  559. package/dist/cjs/api/types/CreditGrantCurrency.js +3 -0
  560. package/dist/cjs/api/types/CreditGrantCustomer.d.ts +6 -0
  561. package/dist/cjs/api/types/CreditGrantCustomer.js +3 -0
  562. package/dist/cjs/api/types/CreditGrantResult.d.ts +19 -0
  563. package/dist/cjs/api/types/CreditGrantResult.js +11 -0
  564. package/dist/cjs/api/types/CreditGrantValue.d.ts +7 -0
  565. package/dist/cjs/api/types/CreditGrantValue.js +10 -0
  566. package/dist/cjs/api/types/CreditTransaction.d.ts +31 -0
  567. package/dist/cjs/api/types/CreditTransaction.js +13 -0
  568. package/dist/cjs/api/types/CreditTransactionCurrency.d.ts +6 -0
  569. package/dist/cjs/api/types/CreditTransactionCurrency.js +3 -0
  570. package/dist/cjs/api/types/CreditTransactionCustomer.d.ts +6 -0
  571. package/dist/cjs/api/types/CreditTransactionCustomer.js +3 -0
  572. package/dist/cjs/api/types/CreditTransactionListResponse.d.ts +6 -0
  573. package/dist/cjs/api/types/CreditTransactionListResponse.js +3 -0
  574. package/dist/cjs/api/types/CreditTransactionProduct.d.ts +11 -0
  575. package/dist/cjs/api/types/CreditTransactionProduct.js +3 -0
  576. package/dist/cjs/api/types/CreditTransactionSummaryBucket.d.ts +25 -0
  577. package/dist/cjs/api/types/CreditTransactionSummaryBucket.js +3 -0
  578. package/dist/cjs/api/types/CreditTransactionSummaryResponse.d.ts +32 -0
  579. package/dist/cjs/api/types/CreditTransactionSummaryResponse.js +23 -0
  580. package/dist/cjs/api/types/CurrencyCode.d.ts +4 -0
  581. package/dist/cjs/api/types/CurrencyCode.js +3 -0
  582. package/dist/cjs/api/types/CustomView.d.ts +29 -0
  583. package/dist/cjs/api/types/CustomView.js +17 -0
  584. package/dist/cjs/api/types/CustomViewAuthoringDetail.d.ts +73 -0
  585. package/dist/cjs/api/types/CustomViewAuthoringDetail.js +30 -0
  586. package/dist/cjs/api/types/CustomViewAuthoringGuide.d.ts +6 -0
  587. package/dist/cjs/api/types/CustomViewAuthoringGuide.js +3 -0
  588. package/dist/cjs/api/types/CustomViewContextCap.d.ts +27 -0
  589. package/dist/cjs/api/types/CustomViewContextCap.js +11 -0
  590. package/dist/cjs/api/types/CustomViewCustomerUnit.d.ts +16 -0
  591. package/dist/cjs/api/types/CustomViewCustomerUnit.js +3 -0
  592. package/dist/cjs/api/types/CustomViewDataContext.d.ts +57 -0
  593. package/dist/cjs/api/types/CustomViewDataContext.js +21 -0
  594. package/dist/cjs/api/types/CustomViewDetail.d.ts +64 -0
  595. package/dist/cjs/api/types/CustomViewDetail.js +30 -0
  596. package/dist/cjs/api/types/CustomViewEmbedTokenResponse.d.ts +6 -0
  597. package/dist/cjs/api/types/CustomViewEmbedTokenResponse.js +3 -0
  598. package/dist/cjs/api/types/CustomViewFilter.d.ts +6 -0
  599. package/dist/cjs/api/types/CustomViewFilter.js +3 -0
  600. package/dist/cjs/api/types/CustomViewListResponse.d.ts +4 -0
  601. package/dist/cjs/api/types/CustomViewListResponse.js +3 -0
  602. package/dist/cjs/api/types/CustomViewPreviewHarness.d.ts +4 -0
  603. package/dist/cjs/api/types/CustomViewPreviewHarness.js +3 -0
  604. package/dist/cjs/api/types/CustomViewPreviewHarnessColumn.d.ts +16 -0
  605. package/dist/cjs/api/types/CustomViewPreviewHarnessColumn.js +14 -0
  606. package/dist/cjs/api/types/CustomViewPreviewHarnessRequest.d.ts +12 -0
  607. package/dist/cjs/api/types/CustomViewPreviewHarnessRequest.js +3 -0
  608. package/dist/cjs/api/types/CustomViewQuery.d.ts +6 -0
  609. package/dist/cjs/api/types/CustomViewQuery.js +3 -0
  610. package/dist/cjs/api/types/CustomViewSummary.d.ts +61 -0
  611. package/dist/cjs/api/types/CustomViewSummary.js +30 -0
  612. package/dist/cjs/api/types/CustomViewUnitSelection.d.ts +14 -0
  613. package/dist/cjs/api/types/CustomViewUnitSelection.js +3 -0
  614. package/dist/cjs/api/types/CustomViewValidationFinding.d.ts +8 -0
  615. package/dist/cjs/api/types/CustomViewValidationFinding.js +3 -0
  616. package/dist/cjs/api/types/Customer.d.ts +14 -2
  617. package/dist/cjs/api/types/Customer.js +9 -0
  618. package/dist/cjs/api/types/CustomerAlias.d.ts +12 -0
  619. package/dist/cjs/api/types/CustomerAlias.js +3 -0
  620. package/dist/cjs/api/types/CustomerAliasCreateRequest.d.ts +8 -0
  621. package/dist/cjs/api/types/CustomerAliasCreateRequest.js +3 -0
  622. package/dist/cjs/api/types/CustomerAliasListResponse.d.ts +5 -0
  623. package/dist/cjs/api/types/CustomerAliasListResponse.js +3 -0
  624. package/dist/cjs/api/types/CustomerApiKey.d.ts +31 -0
  625. package/dist/cjs/api/types/CustomerApiKey.js +13 -0
  626. package/dist/cjs/api/types/CustomerApiKeyCreate.d.ts +8 -0
  627. package/dist/cjs/api/types/CustomerApiKeyCreate.js +3 -0
  628. package/dist/cjs/api/types/CustomerApiKeyCreated.d.ts +33 -0
  629. package/dist/cjs/api/types/CustomerApiKeyCreated.js +13 -0
  630. package/dist/cjs/api/types/CustomerApiKeyList.d.ts +5 -0
  631. package/dist/cjs/api/types/CustomerApiKeyList.js +3 -0
  632. package/dist/cjs/api/types/CustomerAttribution.d.ts +3 -0
  633. package/dist/{esm/api/types/CustomerBillingAddress.d.mts → cjs/api/types/CustomerBillingAddressInput.d.ts} +1 -1
  634. package/dist/cjs/api/types/CustomerBillingAddressInput.js +3 -0
  635. package/dist/cjs/api/types/CustomerBillingAddressResponse.d.ts +11 -0
  636. package/dist/cjs/api/types/CustomerBillingAddressResponse.js +3 -0
  637. package/dist/cjs/api/types/CustomerConnections.d.ts +7 -0
  638. package/dist/cjs/api/types/CustomerConnections.js +3 -0
  639. package/dist/cjs/api/types/CustomerFundingInstructions.d.ts +24 -0
  640. package/dist/cjs/api/types/CustomerFundingInstructions.js +10 -0
  641. package/dist/cjs/api/types/CustomerFundingInstructionsCreateRequest.d.ts +4 -0
  642. package/dist/cjs/api/types/CustomerFundingInstructionsCreateRequest.js +3 -0
  643. package/dist/cjs/api/types/CustomerState.d.ts +10 -0
  644. package/dist/cjs/api/types/CustomerState.js +3 -0
  645. package/dist/cjs/api/types/CustomerStateCheckoutLink.d.ts +18 -0
  646. package/dist/cjs/api/types/CustomerStateCheckoutLink.js +13 -0
  647. package/dist/cjs/api/types/CustomerStateCreditBalance.d.ts +6 -0
  648. package/dist/cjs/api/types/CustomerStateCreditBalance.js +3 -0
  649. package/dist/cjs/api/types/CustomerStateCreditSummary.d.ts +4 -0
  650. package/dist/cjs/api/types/CustomerStateCreditSummary.js +3 -0
  651. package/dist/cjs/api/types/CustomerStateCustomer.d.ts +8 -0
  652. package/dist/cjs/api/types/CustomerStateCustomer.js +3 -0
  653. package/dist/cjs/api/types/CustomerStateOrder.d.ts +21 -0
  654. package/dist/cjs/api/types/CustomerStateOrder.js +13 -0
  655. package/dist/cjs/api/types/CustomerStateProductRef.d.ts +5 -0
  656. package/dist/cjs/api/types/CustomerStateProductRef.js +3 -0
  657. package/dist/cjs/api/types/CustomerStateSeat.d.ts +17 -0
  658. package/dist/cjs/api/types/CustomerStateSeat.js +11 -0
  659. package/dist/cjs/api/types/CustomerStateSeatAssignee.d.ts +6 -0
  660. package/dist/cjs/api/types/CustomerStateSeatAssignee.js +3 -0
  661. package/dist/cjs/api/types/CustomerStateSeats.d.ts +7 -0
  662. package/dist/cjs/api/types/CustomerStateSeats.js +3 -0
  663. package/dist/cjs/api/types/CustomerUnit.d.ts +36 -0
  664. package/dist/cjs/api/types/CustomerUnit.js +13 -0
  665. package/dist/cjs/api/types/CustomerUnitAttribution.d.ts +7 -0
  666. package/dist/cjs/api/types/CustomerUnitAttribution.js +3 -0
  667. package/dist/cjs/api/types/CustomerUnitByKey.d.ts +37 -0
  668. package/dist/cjs/api/types/CustomerUnitByKey.js +13 -0
  669. package/dist/cjs/api/types/CustomerUnitCapCurrentPeriod.d.ts +11 -0
  670. package/dist/cjs/api/types/CustomerUnitCapCurrentPeriod.js +3 -0
  671. package/dist/cjs/api/types/CustomerUnitCapEndResponse.d.ts +12 -0
  672. package/dist/cjs/api/types/CustomerUnitCapEndResponse.js +3 -0
  673. package/dist/cjs/api/types/CustomerUnitCapEndedPolicy.d.ts +26 -0
  674. package/dist/cjs/api/types/CustomerUnitCapEndedPolicy.js +11 -0
  675. package/dist/cjs/api/types/CustomerUnitCapPeriod.d.ts +6 -0
  676. package/dist/cjs/api/types/CustomerUnitCapPeriod.js +3 -0
  677. package/dist/cjs/api/types/CustomerUnitCapPolicy.d.ts +26 -0
  678. package/dist/cjs/api/types/CustomerUnitCapPolicy.js +11 -0
  679. package/dist/cjs/api/types/CustomerUnitCapResponse.d.ts +11 -0
  680. package/dist/cjs/api/types/CustomerUnitCapResponse.js +3 -0
  681. package/dist/cjs/api/types/CustomerUnitCapSavedPolicy.d.ts +26 -0
  682. package/dist/cjs/api/types/CustomerUnitCapSavedPolicy.js +11 -0
  683. package/dist/cjs/api/types/CustomerUnitCapSchedule.d.ts +9 -0
  684. package/dist/cjs/api/types/CustomerUnitCapSchedule.js +3 -0
  685. package/dist/cjs/api/types/CustomerUnitCapScheduleInput.d.ts +9 -0
  686. package/dist/cjs/api/types/CustomerUnitCapScheduleInput.js +3 -0
  687. package/dist/cjs/api/types/CustomerUnitCapSet.d.ts +19 -0
  688. package/dist/cjs/api/types/CustomerUnitCapSet.js +11 -0
  689. package/dist/cjs/api/types/CustomerUnitCapSetResponse.d.ts +13 -0
  690. package/dist/cjs/api/types/CustomerUnitCapSetResponse.js +3 -0
  691. package/dist/cjs/api/types/CustomerUnitCreate.d.ts +14 -0
  692. package/dist/cjs/api/types/CustomerUnitCreate.js +3 -0
  693. package/dist/cjs/api/types/CustomerUnitCreatedUnderParent.d.ts +34 -0
  694. package/dist/cjs/api/types/CustomerUnitCreatedUnderParent.js +13 -0
  695. package/dist/cjs/api/types/CustomerUnitListResponse.d.ts +6 -0
  696. package/dist/cjs/api/types/CustomerUnitListResponse.js +3 -0
  697. package/dist/cjs/api/types/CustomerUnitSpendResponse.d.ts +12 -0
  698. package/dist/cjs/api/types/CustomerUnitSpendResponse.js +3 -0
  699. package/dist/cjs/api/types/CustomerUnitSpendWindow.d.ts +9 -0
  700. package/dist/cjs/api/types/CustomerUnitSpendWindow.js +3 -0
  701. package/dist/cjs/api/types/CustomerUnitUpdate.d.ts +12 -0
  702. package/dist/cjs/api/types/CustomerUnitUpdate.js +3 -0
  703. package/dist/cjs/api/types/DeliveredValueCalculation.d.ts +11 -0
  704. package/dist/cjs/api/types/DeliveredValueCalculation.js +3 -0
  705. package/dist/cjs/api/types/DeliveredValueCalculationTerm.d.ts +34 -0
  706. package/dist/cjs/api/types/DeliveredValueCalculationTerm.js +24 -0
  707. package/dist/cjs/api/types/DeliveredValueMetric.d.ts +54 -0
  708. package/dist/cjs/api/types/DeliveredValueMetric.js +3 -0
  709. package/dist/cjs/api/types/DeliveredValueResponse.d.ts +34 -0
  710. package/dist/cjs/api/types/DeliveredValueResponse.js +3 -0
  711. package/dist/cjs/api/types/DeliveredValueSignal.d.ts +14 -0
  712. package/dist/cjs/api/types/DeliveredValueSignal.js +3 -0
  713. package/dist/cjs/api/types/DeliveredValueSignalValue.d.ts +8 -0
  714. package/dist/cjs/api/types/DeliveredValueSignalValue.js +3 -0
  715. package/dist/cjs/api/types/DeliveredValueSummaryBucket.d.ts +20 -0
  716. package/dist/cjs/api/types/DeliveredValueSummaryBucket.js +3 -0
  717. package/dist/cjs/api/types/DeliveredValueSummaryResponse.d.ts +41 -0
  718. package/dist/cjs/api/types/DeliveredValueSummaryResponse.js +22 -0
  719. package/dist/cjs/api/types/EndAttributeIntent.d.ts +16 -0
  720. package/dist/cjs/api/types/EndAttributeIntent.js +14 -0
  721. package/dist/cjs/api/types/GrantCustomerCreditsResponse.d.ts +9 -0
  722. package/dist/cjs/api/types/GrantCustomerCreditsResponse.js +3 -0
  723. package/dist/cjs/api/types/Invoice.d.ts +3 -0
  724. package/dist/cjs/api/types/MoneyAxisOptions.d.ts +23 -0
  725. package/dist/cjs/api/types/MoneyAxisOptions.js +3 -0
  726. package/dist/cjs/api/types/MoneyAxisValue.d.ts +6 -0
  727. package/dist/cjs/api/types/MoneyAxisValue.js +9 -0
  728. package/dist/cjs/api/types/Order.d.ts +1 -0
  729. package/dist/cjs/api/types/OrderLine.d.ts +2 -0
  730. package/dist/cjs/api/types/OrderLineType.d.ts +7 -0
  731. package/dist/cjs/api/types/OrderLineType.js +10 -0
  732. package/dist/cjs/api/types/Payment.d.ts +30 -0
  733. package/dist/cjs/api/types/Payment.js +3 -0
  734. package/dist/cjs/api/types/PaymentAllocation.d.ts +21 -0
  735. package/dist/cjs/api/types/PaymentAllocation.js +3 -0
  736. package/dist/cjs/api/types/PaymentAllocationCreateResponse.d.ts +4 -0
  737. package/dist/cjs/api/types/PaymentAllocationCreateResponse.js +3 -0
  738. package/dist/cjs/api/types/PaymentAllocationInput.d.ts +8 -0
  739. package/dist/cjs/api/types/PaymentAllocationInput.js +3 -0
  740. package/dist/cjs/api/types/PaymentAllocationListResponse.d.ts +5 -0
  741. package/dist/cjs/api/types/PaymentAllocationListResponse.js +3 -0
  742. package/dist/cjs/api/types/PaymentCreateStatus.d.ts +6 -0
  743. package/dist/cjs/api/types/PaymentCreateStatus.js +9 -0
  744. package/dist/cjs/api/types/PaymentListResponse.d.ts +5 -0
  745. package/dist/cjs/api/types/PaymentListResponse.js +3 -0
  746. package/dist/cjs/api/types/PaymentMethod.d.ts +15 -0
  747. package/dist/cjs/api/types/PaymentMethod.js +3 -0
  748. package/dist/cjs/api/types/PaymentMethodCard.d.ts +13 -0
  749. package/dist/cjs/api/types/PaymentMethodCard.js +3 -0
  750. package/dist/cjs/api/types/PaymentMethodListResponse.d.ts +5 -0
  751. package/dist/cjs/api/types/PaymentMethodListResponse.js +3 -0
  752. package/dist/cjs/api/types/PaymentMethodSetup.d.ts +21 -0
  753. package/dist/cjs/api/types/PaymentMethodSetup.js +3 -0
  754. package/dist/cjs/api/types/PaymentType.d.ts +9 -0
  755. package/dist/cjs/api/types/PaymentType.js +12 -0
  756. package/dist/cjs/api/types/PendingCreditConsumption.d.ts +16 -0
  757. package/dist/cjs/api/types/PendingCreditConsumption.js +3 -0
  758. package/dist/cjs/api/types/PendingCreditConsumptionCurrency.d.ts +9 -0
  759. package/dist/cjs/api/types/PendingCreditConsumptionCurrency.js +3 -0
  760. package/dist/cjs/api/types/PendingCreditConsumptionListResponse.d.ts +6 -0
  761. package/dist/cjs/api/types/PendingCreditConsumptionListResponse.js +3 -0
  762. package/dist/cjs/api/types/Plan.d.ts +22 -0
  763. package/dist/cjs/api/types/Plan.js +11 -0
  764. package/dist/cjs/api/types/PlanAttribute.d.ts +8 -0
  765. package/dist/cjs/api/types/PlanAttribute.js +3 -0
  766. package/dist/cjs/api/types/PlanAttributeInput.d.ts +7 -0
  767. package/dist/cjs/api/types/PlanAttributeInput.js +3 -0
  768. package/dist/cjs/api/types/PlanCreditBenefit.d.ts +35 -0
  769. package/dist/cjs/api/types/PlanCreditBenefit.js +20 -0
  770. package/dist/cjs/api/types/PlanListResponse.d.ts +5 -0
  771. package/dist/cjs/api/types/PlanListResponse.js +3 -0
  772. package/dist/cjs/api/types/PlanPricing.d.ts +31 -0
  773. package/dist/cjs/api/types/PlanPricing.js +24 -0
  774. package/dist/cjs/api/types/PlanRef.d.ts +5 -0
  775. package/dist/cjs/api/types/PlanRef.js +3 -0
  776. package/dist/cjs/api/types/PlanUpgradePathGroup.d.ts +4 -0
  777. package/dist/cjs/api/types/PlanUpgradePathGroup.js +3 -0
  778. package/dist/cjs/api/types/PlanUpgradePathResponse.d.ts +4 -0
  779. package/dist/cjs/api/types/PlanUpgradePathResponse.js +3 -0
  780. package/dist/cjs/api/types/PlannedAdd.d.ts +28 -0
  781. package/dist/cjs/api/types/PlannedAdd.js +13 -0
  782. package/dist/cjs/api/types/PlannedCopy.d.ts +10 -0
  783. package/dist/cjs/api/types/PlannedCopy.js +3 -0
  784. package/dist/cjs/api/types/PlannedEnd.d.ts +10 -0
  785. package/dist/cjs/api/types/PlannedEnd.js +3 -0
  786. package/dist/cjs/api/types/PlannedOperations.d.ts +13 -0
  787. package/dist/cjs/api/types/PlannedOperations.js +3 -0
  788. package/dist/cjs/api/types/PlannedOrderTerm.d.ts +10 -0
  789. package/dist/cjs/api/types/PlannedOrderTerm.js +3 -0
  790. package/dist/cjs/api/types/PlannedReplace.d.ts +15 -0
  791. package/dist/cjs/api/types/PlannedReplace.js +3 -0
  792. package/dist/cjs/api/types/PricingInput.d.ts +4 -1
  793. package/dist/cjs/api/types/PricingOutput.d.ts +10 -0
  794. package/dist/cjs/api/types/PricingOutput.js +5 -0
  795. package/dist/cjs/api/types/PricingPricePointOutput.d.ts +2 -22
  796. package/dist/cjs/api/types/PricingPricePointOutput.js +0 -14
  797. package/dist/cjs/api/types/PricingTierOutput.d.ts +16 -0
  798. package/dist/cjs/api/types/PricingTierOutput.js +11 -0
  799. package/dist/cjs/api/types/ProductAttributeOutput.d.ts +8 -0
  800. package/dist/cjs/api/types/ProductAttributeOutput.js +3 -0
  801. package/dist/cjs/api/types/ProductAttributeUpsert.d.ts +9 -0
  802. package/dist/cjs/api/types/ProductAttributeUpsert.js +3 -0
  803. package/dist/cjs/api/types/ProductCreditBenefitInput.d.ts +37 -0
  804. package/dist/cjs/api/types/ProductCreditBenefitInput.js +22 -0
  805. package/dist/cjs/api/types/ProductCreditBenefitOutput.d.ts +15 -0
  806. package/dist/cjs/api/types/ProductCreditBenefitOutput.js +3 -0
  807. package/dist/cjs/api/types/ProductDetail.d.ts +14 -0
  808. package/dist/cjs/api/types/ProductDetail.js +3 -0
  809. package/dist/cjs/api/types/ProductOneTimePerUnitInput.d.ts +21 -0
  810. package/dist/cjs/api/types/ProductOneTimePerUnitInput.js +18 -0
  811. package/dist/cjs/api/types/ProductPricePointOutput.d.ts +9 -0
  812. package/dist/cjs/api/types/ProductPricePointOutput.js +3 -0
  813. package/dist/cjs/api/types/ProductPricingInput.d.ts +49 -0
  814. package/dist/cjs/api/types/ProductPricingInput.js +3 -0
  815. package/dist/cjs/api/types/ProductPricingOutput.d.ts +46 -0
  816. package/dist/cjs/api/types/ProductPricingOutput.js +28 -0
  817. package/dist/cjs/api/types/ProductPricingTierOutput.d.ts +16 -0
  818. package/dist/cjs/api/types/ProductPricingTierOutput.js +11 -0
  819. package/dist/cjs/api/types/ProductRecurringGraduatedInput.d.ts +22 -0
  820. package/dist/cjs/api/types/ProductRecurringGraduatedInput.js +18 -0
  821. package/dist/cjs/api/types/ProductRecurringPerUnitInput.d.ts +22 -0
  822. package/dist/cjs/api/types/ProductRecurringPerUnitInput.js +18 -0
  823. package/dist/cjs/api/types/ProductRecurringPercentOfTotalInput.d.ts +23 -0
  824. package/dist/cjs/api/types/ProductRecurringPercentOfTotalInput.js +18 -0
  825. package/dist/cjs/api/types/ProductRecurringVolumeInput.d.ts +22 -0
  826. package/dist/cjs/api/types/ProductRecurringVolumeInput.js +18 -0
  827. package/dist/cjs/api/types/ProductSeatBasedGraduatedInput.d.ts +22 -0
  828. package/dist/cjs/api/types/ProductSeatBasedGraduatedInput.js +18 -0
  829. package/dist/cjs/api/types/ProductSeatBasedPerUnitInput.d.ts +22 -0
  830. package/dist/cjs/api/types/ProductSeatBasedPerUnitInput.js +18 -0
  831. package/dist/cjs/api/types/ProductSeatBasedPrepaidCreditsInput.d.ts +29 -0
  832. package/dist/cjs/api/types/ProductSeatBasedPrepaidCreditsInput.js +18 -0
  833. package/dist/cjs/api/types/ProductSeatBasedVolumeInput.d.ts +22 -0
  834. package/dist/cjs/api/types/ProductSeatBasedVolumeInput.js +18 -0
  835. package/dist/cjs/api/types/ProductSimplePricePoint.d.ts +29 -0
  836. package/dist/cjs/api/types/ProductSimplePricePoint.js +17 -0
  837. package/dist/cjs/api/types/ProductTieredPricePoint.d.ts +29 -0
  838. package/dist/cjs/api/types/ProductTieredPricePoint.js +17 -0
  839. package/dist/cjs/api/types/ProductUsageBracketedPrepaidCreditsInput.d.ts +61 -0
  840. package/dist/cjs/api/types/ProductUsageBracketedPrepaidCreditsInput.js +29 -0
  841. package/dist/cjs/api/types/ProductUsageCostPlusInput.d.ts +31 -0
  842. package/dist/cjs/api/types/ProductUsageCostPlusInput.js +23 -0
  843. package/dist/cjs/api/types/ProductUsageGraduatedInput.d.ts +31 -0
  844. package/dist/cjs/api/types/ProductUsageGraduatedInput.js +23 -0
  845. package/dist/cjs/api/types/ProductUsagePerUnitInput.d.ts +31 -0
  846. package/dist/cjs/api/types/ProductUsagePerUnitInput.js +23 -0
  847. package/dist/cjs/api/types/ProductUsagePrepaidCreditsInput.d.ts +50 -0
  848. package/dist/cjs/api/types/ProductUsagePrepaidCreditsInput.js +29 -0
  849. package/dist/cjs/api/types/ProductUsageVolumeInput.d.ts +31 -0
  850. package/dist/cjs/api/types/ProductUsageVolumeInput.js +23 -0
  851. package/dist/cjs/api/types/ProvisionBillingFrequencyOverride.d.ts +14 -0
  852. package/dist/cjs/api/types/ProvisionBillingFrequencyOverride.js +14 -0
  853. package/dist/cjs/api/types/ProvisionContact.d.ts +20 -0
  854. package/dist/cjs/api/types/ProvisionContact.js +14 -0
  855. package/dist/cjs/api/types/ProvisionCreatedContact.d.ts +14 -0
  856. package/dist/cjs/api/types/ProvisionCreatedContact.js +12 -0
  857. package/dist/cjs/api/types/ProvisionCreatedCustomer.d.ts +14 -0
  858. package/dist/cjs/api/types/ProvisionCreatedCustomer.js +12 -0
  859. package/dist/cjs/api/types/ProvisionCreatedOrder.d.ts +17 -0
  860. package/dist/cjs/api/types/ProvisionCreatedOrder.js +12 -0
  861. package/dist/cjs/api/types/ProvisionCreatedOrderLine.d.ts +17 -0
  862. package/dist/cjs/api/types/ProvisionCreatedOrderLine.js +12 -0
  863. package/dist/cjs/api/types/ProvisionCreditBenefit.d.ts +44 -0
  864. package/dist/cjs/api/types/ProvisionCreditBenefit.js +26 -0
  865. package/dist/cjs/api/types/ProvisionCustomer.d.ts +23 -0
  866. package/dist/cjs/api/types/ProvisionCustomer.js +12 -0
  867. package/dist/cjs/api/types/ProvisionExternalReference.d.ts +16 -0
  868. package/dist/cjs/api/types/ProvisionExternalReference.js +14 -0
  869. package/dist/cjs/api/types/ProvisionOrder.d.ts +39 -0
  870. package/dist/cjs/api/types/ProvisionOrder.js +20 -0
  871. package/dist/cjs/api/types/ProvisionOrderLine.d.ts +12 -0
  872. package/dist/cjs/api/types/ProvisionOrderLine.js +3 -0
  873. package/dist/cjs/api/types/ProvisionOrderLineAttribute.d.ts +96 -0
  874. package/dist/cjs/api/types/ProvisionOrderLineAttribute.js +50 -0
  875. package/dist/cjs/api/types/ProvisionOrderLineType.d.ts +7 -0
  876. package/dist/cjs/api/types/ProvisionOrderLineType.js +10 -0
  877. package/dist/cjs/api/types/ProvisionProduct.d.ts +95 -0
  878. package/dist/cjs/api/types/ProvisionProduct.js +52 -0
  879. package/dist/cjs/api/types/ProvisionResponse.d.ts +17 -0
  880. package/dist/cjs/api/types/ProvisionResponse.js +12 -0
  881. package/dist/cjs/api/types/RenderBundleEdit.d.ts +8 -0
  882. package/dist/cjs/api/types/RenderBundleEdit.js +3 -0
  883. package/dist/cjs/api/types/RotateWebhookSecretResponse.d.ts +4 -0
  884. package/dist/cjs/api/types/RotateWebhookSecretResponse.js +3 -0
  885. package/dist/cjs/api/types/SeatBasedPrepaidCreditsInput.d.ts +4 -0
  886. package/dist/cjs/api/types/Signal.d.ts +9 -2
  887. package/dist/cjs/api/types/SignalListItem.d.ts +20 -0
  888. package/dist/cjs/api/types/SignalListItem.js +3 -0
  889. package/dist/cjs/api/types/SignalListResponse.d.ts +5 -0
  890. package/dist/cjs/api/types/SignalListResponse.js +3 -0
  891. package/dist/cjs/api/types/SignalLookupResponse.d.ts +7 -0
  892. package/dist/cjs/api/types/SignalLookupResponse.js +3 -0
  893. package/dist/cjs/api/types/SignalSummaryBandsDimension.d.ts +21 -0
  894. package/dist/cjs/api/types/SignalSummaryBandsDimension.js +3 -0
  895. package/dist/cjs/api/types/SignalSummaryColumn.d.ts +8 -0
  896. package/dist/cjs/api/types/SignalSummaryColumn.js +3 -0
  897. package/dist/cjs/api/types/SignalSummaryDefinitionSpec.d.ts +21 -0
  898. package/dist/cjs/api/types/SignalSummaryDefinitionSpec.js +11 -0
  899. package/dist/cjs/api/types/SignalSummaryDefinitionSpecDimensionsItem.d.ts +10 -0
  900. package/dist/cjs/api/types/SignalSummaryDefinitionSpecDimensionsItem.js +3 -0
  901. package/dist/cjs/api/types/SignalSummaryExport.d.ts +36 -0
  902. package/dist/cjs/api/types/SignalSummaryExport.js +18 -0
  903. package/dist/cjs/api/types/SignalSummaryGroups.d.ts +9 -0
  904. package/dist/cjs/api/types/SignalSummaryGroups.js +3 -0
  905. package/dist/cjs/api/types/SignalSummaryMeasure.d.ts +16 -0
  906. package/dist/cjs/api/types/SignalSummaryMeasure.js +14 -0
  907. package/dist/cjs/api/types/SignalSummaryPage.d.ts +8 -0
  908. package/dist/cjs/api/types/SignalSummaryPage.js +3 -0
  909. package/dist/cjs/api/types/SignalSummaryPoint.d.ts +16 -0
  910. package/dist/cjs/api/types/SignalSummaryPoint.js +3 -0
  911. package/dist/cjs/api/types/SignalSummaryPresenceDimension.d.ts +23 -0
  912. package/dist/cjs/api/types/SignalSummaryPresenceDimension.js +3 -0
  913. package/dist/cjs/api/types/SignalSummaryResponse.d.ts +29 -0
  914. package/dist/cjs/api/types/SignalSummaryResponse.js +19 -0
  915. package/dist/cjs/api/types/SignalSummarySignalSelection.d.ts +8 -0
  916. package/dist/cjs/api/types/SignalSummarySignalSelection.js +3 -0
  917. package/dist/cjs/api/types/SignalSummarySpecInput.d.ts +21 -0
  918. package/dist/cjs/api/types/SignalSummarySpecInput.js +11 -0
  919. package/dist/cjs/api/types/SignalSummarySpecInputDimensionsItem.d.ts +10 -0
  920. package/dist/cjs/api/types/SignalSummarySpecInputDimensionsItem.js +3 -0
  921. package/dist/cjs/api/types/SignalsMetadataResponse.d.ts +49 -0
  922. package/dist/cjs/api/types/SignalsMetadataResponse.js +27 -0
  923. package/dist/cjs/api/types/StripeConnection.d.ts +7 -0
  924. package/dist/cjs/api/types/StripeConnection.js +3 -0
  925. package/dist/cjs/api/{resources/valueReceipts/client/requests → types}/SyncValueReceiptRequest.d.ts +0 -7
  926. package/dist/cjs/api/types/SyncValueReceiptRequest.js +3 -0
  927. package/dist/cjs/api/types/UnifiedAmendmentIntent.d.ts +25 -0
  928. package/dist/cjs/api/types/UnifiedAmendmentIntent.js +3 -0
  929. package/dist/cjs/api/types/UnifiedAmendmentResponse.d.ts +19 -0
  930. package/dist/cjs/api/types/UnifiedAmendmentResponse.js +3 -0
  931. package/dist/cjs/api/types/UpdateContactRequest.d.ts +1 -0
  932. package/dist/cjs/api/types/UpdateCustomerRequest.d.ts +1 -1
  933. package/dist/cjs/api/types/UpdateLineTermIntent.d.ts +18 -0
  934. package/dist/cjs/api/types/UpdateLineTermIntent.js +14 -0
  935. package/dist/cjs/api/types/UpdateOrderTermIntent.d.ts +18 -0
  936. package/dist/cjs/api/types/UpdateOrderTermIntent.js +14 -0
  937. package/dist/cjs/api/types/UpdatePlanRequest.d.ts +18 -0
  938. package/dist/cjs/api/types/UpdatePlanRequest.js +12 -0
  939. package/dist/cjs/api/types/UpdatePricingIntent.d.ts +22 -0
  940. package/dist/cjs/api/types/UpdatePricingIntent.js +14 -0
  941. package/dist/cjs/api/types/UpdateProductRequest.d.ts +2 -0
  942. package/dist/cjs/api/types/UpdateQuantityIntent.d.ts +18 -0
  943. package/dist/cjs/api/types/UpdateQuantityIntent.js +14 -0
  944. package/dist/cjs/api/types/UsageAttributionAxisOptions.d.ts +23 -0
  945. package/dist/cjs/api/types/UsageAttributionAxisOptions.js +3 -0
  946. package/dist/cjs/api/types/UsageAttributionAxisValue.d.ts +6 -0
  947. package/dist/cjs/api/types/UsageAttributionAxisValue.js +9 -0
  948. package/dist/cjs/api/types/UsageBracketedPrepaidCreditsInput.d.ts +61 -0
  949. package/dist/cjs/api/types/UsageBracketedPrepaidCreditsInput.js +29 -0
  950. package/dist/cjs/api/types/UsageCostPlusInput.d.ts +8 -0
  951. package/dist/cjs/api/types/UsageCostPlusInput.js +5 -0
  952. package/dist/cjs/api/types/UsageGraduatedInput.d.ts +8 -0
  953. package/dist/cjs/api/types/UsageGraduatedInput.js +5 -0
  954. package/dist/cjs/api/types/UsagePerUnitInput.d.ts +8 -0
  955. package/dist/cjs/api/types/UsagePerUnitInput.js +5 -0
  956. package/dist/cjs/api/types/UsagePrepaidCreditsInput.d.ts +24 -0
  957. package/dist/cjs/api/types/UsagePrepaidCreditsInput.js +11 -0
  958. package/dist/cjs/api/types/UsageVolumeInput.d.ts +8 -0
  959. package/dist/cjs/api/types/UsageVolumeInput.js +5 -0
  960. package/dist/cjs/api/types/ValidateCustomViewRequest.d.ts +55 -0
  961. package/dist/cjs/api/types/ValidateCustomViewRequest.js +26 -0
  962. package/dist/cjs/api/types/ValidateCustomViewResponse.d.ts +7 -0
  963. package/dist/cjs/api/types/ValidateCustomViewResponse.js +3 -0
  964. package/dist/cjs/api/types/ValueMetricDetail.d.ts +47 -0
  965. package/dist/cjs/api/types/ValueMetricDetail.js +3 -0
  966. package/dist/cjs/api/types/ValueMetricFormula.d.ts +9 -0
  967. package/dist/cjs/api/types/ValueMetricFormula.js +3 -0
  968. package/dist/cjs/api/types/ValueMetricFormulaVariable.d.ts +31 -0
  969. package/dist/cjs/api/types/ValueMetricFormulaVariable.js +24 -0
  970. package/dist/cjs/api/types/ValueMetricListResponse.d.ts +5 -0
  971. package/dist/cjs/api/types/ValueMetricListResponse.js +3 -0
  972. package/dist/cjs/api/types/ValueMetricMonetaryConversion.d.ts +6 -0
  973. package/dist/cjs/api/types/ValueMetricMonetaryConversion.js +3 -0
  974. package/dist/cjs/api/types/ValueMetricSignalBinding.d.ts +14 -0
  975. package/dist/cjs/api/types/ValueMetricSignalBinding.js +3 -0
  976. package/dist/cjs/api/types/ValueMetricSummary.d.ts +30 -0
  977. package/dist/cjs/api/types/ValueMetricSummary.js +3 -0
  978. package/dist/cjs/api/types/ValueMetricUnit.d.ts +27 -0
  979. package/dist/cjs/api/types/ValueMetricUnit.js +20 -0
  980. package/dist/cjs/api/types/ValueMetricValidationResponse.d.ts +13 -0
  981. package/dist/cjs/api/types/ValueMetricValidationResponse.js +3 -0
  982. package/dist/cjs/api/types/ValueMetricVariableEdit.d.ts +26 -0
  983. package/dist/cjs/api/types/ValueMetricVariableEdit.js +19 -0
  984. package/dist/cjs/api/types/ValueMetricWriteAck.d.ts +6 -0
  985. package/dist/cjs/api/types/ValueMetricWriteAck.js +3 -0
  986. package/dist/cjs/api/types/ValueModelAuthoringGuide.d.ts +22 -0
  987. package/dist/cjs/api/types/ValueModelAuthoringGuide.js +3 -0
  988. package/dist/cjs/api/types/ValueModelContent.d.ts +359 -0
  989. package/dist/cjs/api/types/ValueModelContent.js +148 -0
  990. package/dist/cjs/api/types/ValueModelDetail.d.ts +12 -0
  991. package/dist/cjs/api/types/ValueModelDetail.js +3 -0
  992. package/dist/cjs/api/types/ValueModelSummary.d.ts +18 -0
  993. package/dist/cjs/api/types/ValueModelSummary.js +12 -0
  994. package/dist/cjs/api/types/ValueModelVersionListResponse.d.ts +5 -0
  995. package/dist/cjs/api/types/ValueModelVersionListResponse.js +3 -0
  996. package/dist/cjs/api/types/ValueReceiptDetail.d.ts +1 -0
  997. package/dist/cjs/api/types/ValueReceiptSummary.d.ts +1 -0
  998. package/dist/cjs/api/types/ValueReceiptSyncResponse.d.ts +2 -0
  999. package/dist/cjs/api/types/ViewCustomerUnitsResponse.d.ts +7 -0
  1000. package/dist/cjs/api/types/ViewCustomerUnitsResponse.js +3 -0
  1001. package/dist/cjs/api/types/ViewDataResponse.d.ts +6 -0
  1002. package/dist/cjs/api/types/ViewDataResponse.js +3 -0
  1003. package/dist/cjs/api/types/Webhook.d.ts +2 -1
  1004. package/dist/cjs/api/types/Webhook.js +2 -1
  1005. package/dist/cjs/api/types/WebhookListResponse.d.ts +2 -0
  1006. package/dist/cjs/api/types/WebhookUpdateResponse.d.ts +27 -0
  1007. package/dist/cjs/api/types/WebhookUpdateResponse.js +19 -0
  1008. package/dist/cjs/api/types/WritableOrderLineType.d.ts +6 -0
  1009. package/dist/cjs/api/types/WritableOrderLineType.js +9 -0
  1010. package/dist/cjs/api/types/WritableProvisionOrderLineType.d.ts +6 -0
  1011. package/dist/cjs/api/types/WritableProvisionOrderLineType.js +9 -0
  1012. package/dist/cjs/api/types/index.d.ts +258 -1
  1013. package/dist/cjs/api/types/index.js +258 -1
  1014. package/dist/cjs/version.d.ts +1 -1
  1015. package/dist/cjs/version.js +1 -1
  1016. package/dist/esm/Client.d.mts +33 -0
  1017. package/dist/esm/Client.mjs +57 -2
  1018. package/dist/esm/api/errors/BadRequestError.d.mts +1 -2
  1019. package/dist/esm/api/errors/ConflictError.d.mts +1 -2
  1020. package/dist/esm/api/errors/ForbiddenError.d.mts +1 -2
  1021. package/dist/esm/api/errors/InternalServerError.d.mts +1 -2
  1022. package/dist/esm/api/errors/NotFoundError.d.mts +1 -2
  1023. package/dist/esm/api/errors/RequestTimeoutError.d.mts +6 -0
  1024. package/dist/esm/api/errors/RequestTimeoutError.mjs +13 -0
  1025. package/dist/esm/api/errors/TooManyRequestsError.d.mts +6 -0
  1026. package/dist/esm/api/errors/TooManyRequestsError.mjs +13 -0
  1027. package/dist/esm/api/errors/UnprocessableEntityError.d.mts +6 -0
  1028. package/dist/esm/api/errors/UnprocessableEntityError.mjs +13 -0
  1029. package/dist/esm/api/errors/index.d.mts +3 -0
  1030. package/dist/esm/api/errors/index.mjs +3 -0
  1031. package/dist/esm/api/resources/amendments/client/Client.d.mts +83 -0
  1032. package/dist/esm/api/resources/amendments/client/Client.mjs +276 -0
  1033. package/dist/esm/api/resources/amendments/client/index.d.mts +1 -0
  1034. package/dist/esm/api/resources/amendments/client/index.mjs +1 -0
  1035. package/dist/esm/api/resources/amendments/client/requests/GetOrderAmendmentOptionsRequest.d.mts +10 -0
  1036. package/dist/esm/api/resources/amendments/client/requests/UnifiedAmendmentExecuteRequest.d.mts +35 -0
  1037. package/dist/esm/api/resources/amendments/client/requests/UnifiedAmendmentExecuteRequest.mjs +11 -0
  1038. package/dist/esm/api/resources/amendments/client/requests/UnifiedAmendmentPreviewRequest.d.mts +33 -0
  1039. package/dist/esm/api/resources/amendments/client/requests/UnifiedAmendmentPreviewRequest.mjs +11 -0
  1040. package/dist/esm/api/resources/amendments/client/requests/index.d.mts +3 -0
  1041. package/dist/esm/api/resources/amendments/client/requests/index.mjs +1 -0
  1042. package/dist/esm/api/resources/amendments/index.d.mts +1 -0
  1043. package/dist/esm/api/resources/amendments/index.mjs +1 -0
  1044. package/dist/esm/api/resources/analytics/client/Client.d.mts +64 -0
  1045. package/dist/esm/api/resources/analytics/client/Client.mjs +239 -0
  1046. package/dist/esm/api/resources/analytics/client/index.d.mts +1 -0
  1047. package/dist/esm/api/resources/analytics/client/index.mjs +1 -0
  1048. package/dist/esm/api/resources/analytics/client/requests/GetSignalsMetadataRequest.d.mts +12 -0
  1049. package/dist/esm/api/resources/analytics/client/requests/index.d.mts +1 -0
  1050. package/dist/esm/api/resources/analytics/client/requests/index.mjs +1 -0
  1051. package/dist/esm/api/resources/analytics/index.d.mts +1 -0
  1052. package/dist/esm/api/resources/analytics/index.mjs +1 -0
  1053. package/dist/esm/api/resources/analyticsExperimental/client/Client.d.mts +70 -0
  1054. package/dist/esm/api/resources/analyticsExperimental/client/Client.mjs +245 -0
  1055. package/dist/esm/api/resources/analyticsExperimental/client/index.d.mts +1 -0
  1056. package/dist/esm/api/resources/analyticsExperimental/client/index.mjs +1 -0
  1057. package/dist/esm/api/resources/analyticsExperimental/client/requests/GetExperimentalSignalsMetadataRequest.d.mts +12 -0
  1058. package/dist/esm/api/resources/analyticsExperimental/client/requests/GetExperimentalSignalsMetadataRequest.mjs +2 -0
  1059. package/dist/esm/api/resources/analyticsExperimental/client/requests/index.d.mts +1 -0
  1060. package/dist/esm/api/resources/analyticsExperimental/client/requests/index.mjs +1 -0
  1061. package/dist/esm/api/resources/analyticsExperimental/index.d.mts +1 -0
  1062. package/dist/esm/api/resources/analyticsExperimental/index.mjs +1 -0
  1063. package/dist/esm/api/resources/checkouts/client/Client.d.mts +2 -1
  1064. package/dist/esm/api/resources/checkouts/client/Client.mjs +4 -1
  1065. package/dist/esm/api/resources/checkouts/client/requests/CreateCheckoutRequest.d.mts +8 -1
  1066. package/dist/esm/api/resources/contacts/client/Client.d.mts +6 -4
  1067. package/dist/esm/api/resources/contacts/client/Client.mjs +10 -4
  1068. package/dist/esm/api/resources/credits/client/Client.d.mts +76 -2
  1069. package/dist/esm/api/resources/credits/client/Client.mjs +371 -5
  1070. package/dist/esm/api/resources/credits/client/index.d.mts +1 -1
  1071. package/dist/esm/api/resources/credits/client/index.mjs +1 -1
  1072. package/dist/esm/api/resources/credits/client/requests/CreateCreditCurrencyRequest.d.mts +16 -0
  1073. package/dist/esm/api/resources/credits/client/requests/CreateCreditCurrencyRequest.mjs +2 -0
  1074. package/dist/esm/api/resources/credits/client/requests/GetCreditTransactionSummaryRequest.d.mts +33 -0
  1075. package/dist/esm/api/resources/credits/client/requests/GetCreditTransactionSummaryRequest.mjs +2 -0
  1076. package/dist/esm/api/resources/credits/client/requests/ListCreditCurrenciesRequest.d.mts +9 -0
  1077. package/dist/esm/api/resources/credits/client/requests/ListCreditCurrenciesRequest.mjs +2 -0
  1078. package/dist/esm/api/resources/credits/client/requests/ListCreditTransactionsRequest.d.mts +27 -0
  1079. package/dist/esm/api/resources/credits/client/requests/ListCreditTransactionsRequest.mjs +2 -0
  1080. package/dist/esm/api/resources/credits/client/requests/UpdateCreditCurrencyRequest.d.mts +24 -0
  1081. package/dist/esm/api/resources/credits/client/requests/UpdateCreditCurrencyRequest.mjs +9 -0
  1082. package/dist/esm/api/resources/credits/client/requests/index.d.mts +5 -0
  1083. package/dist/esm/api/resources/credits/client/requests/index.mjs +1 -0
  1084. package/dist/esm/api/resources/credits/index.d.mts +1 -0
  1085. package/dist/esm/api/resources/credits/index.mjs +1 -0
  1086. package/dist/esm/api/resources/credits/types/GetCreditTransactionSummaryRequestGroupBy.d.mts +4 -0
  1087. package/dist/esm/api/resources/credits/types/GetCreditTransactionSummaryRequestGroupBy.mjs +4 -0
  1088. package/dist/esm/api/resources/credits/types/GetCreditTransactionSummaryRequestInterval.d.mts +6 -0
  1089. package/dist/esm/api/resources/credits/types/GetCreditTransactionSummaryRequestInterval.mjs +6 -0
  1090. package/dist/esm/api/resources/credits/types/GetCreditTransactionSummaryRequestType.d.mts +6 -0
  1091. package/dist/esm/api/resources/credits/types/GetCreditTransactionSummaryRequestType.mjs +6 -0
  1092. package/dist/esm/api/resources/credits/types/ListCreditCurrenciesRequestStatus.d.mts +6 -0
  1093. package/dist/esm/api/resources/credits/types/ListCreditCurrenciesRequestStatus.mjs +6 -0
  1094. package/dist/esm/api/resources/credits/types/ListCreditTransactionsRequestType.d.mts +6 -0
  1095. package/dist/esm/api/resources/credits/types/ListCreditTransactionsRequestType.mjs +6 -0
  1096. package/dist/esm/api/resources/credits/types/index.d.mts +5 -0
  1097. package/dist/esm/api/resources/credits/types/index.mjs +5 -0
  1098. package/dist/esm/api/resources/customViewsExperimental/client/Client.d.mts +200 -0
  1099. package/dist/esm/api/resources/customViewsExperimental/client/Client.mjs +748 -0
  1100. package/dist/esm/api/resources/customViewsExperimental/client/index.d.mts +1 -0
  1101. package/dist/esm/api/resources/customViewsExperimental/client/index.mjs +1 -0
  1102. package/dist/esm/api/resources/customViewsExperimental/client/requests/CreateCustomViewRequest.d.mts +70 -0
  1103. package/dist/esm/api/resources/customViewsExperimental/client/requests/CreateCustomViewRequest.mjs +23 -0
  1104. package/dist/esm/api/resources/customViewsExperimental/client/requests/GetCustomViewCustomerUnitsRequest.d.mts +14 -0
  1105. package/dist/esm/api/resources/customViewsExperimental/client/requests/GetCustomViewCustomerUnitsRequest.mjs +2 -0
  1106. package/dist/esm/api/resources/customViewsExperimental/client/requests/GetCustomViewDataRequest.d.mts +28 -0
  1107. package/dist/esm/api/resources/customViewsExperimental/client/requests/GetCustomViewDataRequest.mjs +2 -0
  1108. package/dist/esm/api/resources/customViewsExperimental/client/requests/GetCustomViewEmbedTokenRequest.d.mts +14 -0
  1109. package/dist/esm/api/resources/customViewsExperimental/client/requests/GetCustomViewEmbedTokenRequest.mjs +2 -0
  1110. package/dist/esm/api/resources/customViewsExperimental/client/requests/GetCustomViewRequest.d.mts +9 -0
  1111. package/dist/esm/api/resources/customViewsExperimental/client/requests/GetCustomViewRequest.mjs +2 -0
  1112. package/dist/esm/api/resources/customViewsExperimental/client/requests/PublishCustomViewRequest.d.mts +9 -0
  1113. package/dist/esm/api/resources/customViewsExperimental/client/requests/PublishCustomViewRequest.mjs +2 -0
  1114. package/dist/esm/api/resources/customViewsExperimental/client/requests/UpdateCustomViewPeriodRequest.d.mts +46 -0
  1115. package/dist/esm/api/resources/customViewsExperimental/client/requests/UpdateCustomViewPeriodRequest.mjs +18 -0
  1116. package/dist/esm/api/resources/customViewsExperimental/client/requests/UpdateCustomViewRequest.d.mts +30 -0
  1117. package/dist/esm/api/resources/customViewsExperimental/client/requests/UpdateCustomViewRequest.mjs +2 -0
  1118. package/dist/esm/api/resources/customViewsExperimental/client/requests/index.d.mts +8 -0
  1119. package/dist/esm/api/resources/customViewsExperimental/client/requests/index.mjs +1 -0
  1120. package/dist/esm/api/resources/customViewsExperimental/index.d.mts +2 -0
  1121. package/dist/esm/api/resources/customViewsExperimental/index.mjs +2 -0
  1122. package/dist/esm/api/resources/customViewsExperimental/types/GetCustomViewDataRequestIncludeDraft.d.mts +5 -0
  1123. package/dist/esm/api/resources/customViewsExperimental/types/GetCustomViewDataRequestIncludeDraft.mjs +5 -0
  1124. package/dist/esm/api/resources/customViewsExperimental/types/GetCustomViewDataRequestPeriodKind.d.mts +5 -0
  1125. package/dist/esm/api/resources/customViewsExperimental/types/GetCustomViewDataRequestPeriodKind.mjs +5 -0
  1126. package/dist/esm/api/resources/customViewsExperimental/types/GetCustomViewDataRequestPeriodUnit.d.mts +6 -0
  1127. package/dist/esm/api/resources/customViewsExperimental/types/GetCustomViewDataRequestPeriodUnit.mjs +6 -0
  1128. package/dist/esm/api/resources/customViewsExperimental/types/GetCustomViewDataRequestUnitMode.d.mts +6 -0
  1129. package/dist/esm/api/resources/customViewsExperimental/types/GetCustomViewDataRequestUnitMode.mjs +6 -0
  1130. package/dist/esm/api/resources/customViewsExperimental/types/index.d.mts +4 -0
  1131. package/dist/esm/api/resources/customViewsExperimental/types/index.mjs +4 -0
  1132. package/dist/esm/api/resources/customerPortals/client/Client.d.mts +1 -1
  1133. package/dist/esm/api/resources/customerPortals/client/Client.mjs +1 -1
  1134. package/dist/esm/api/resources/customers/client/Client.d.mts +1049 -15
  1135. package/dist/esm/api/resources/customers/client/Client.mjs +4104 -99
  1136. package/dist/esm/api/resources/customers/client/requests/CreateCustomerAliasByExternalIdRequest.d.mts +15 -0
  1137. package/dist/esm/api/resources/customers/client/requests/CreateCustomerAliasByExternalIdRequest.mjs +2 -0
  1138. package/dist/esm/api/resources/customers/client/requests/CreateCustomerAliasRequest.d.mts +15 -0
  1139. package/dist/esm/api/resources/customers/client/requests/CreateCustomerAliasRequest.mjs +2 -0
  1140. package/dist/esm/api/resources/customers/client/requests/CreateCustomerApiKeyByExternalIdRequest.d.mts +15 -0
  1141. package/dist/esm/api/resources/customers/client/requests/CreateCustomerApiKeyByExternalIdRequest.mjs +2 -0
  1142. package/dist/esm/api/resources/customers/client/requests/CreateCustomerApiKeyRequest.d.mts +15 -0
  1143. package/dist/esm/api/resources/customers/client/requests/CreateCustomerApiKeyRequest.mjs +2 -0
  1144. package/dist/esm/api/resources/customers/client/requests/CreateCustomerFundingInstructionsByExternalIdRequest.d.mts +12 -0
  1145. package/dist/esm/api/resources/customers/client/requests/CreateCustomerFundingInstructionsByExternalIdRequest.mjs +2 -0
  1146. package/dist/esm/api/resources/customers/client/requests/CreateCustomerFundingInstructionsRequest.d.mts +13 -0
  1147. package/dist/esm/api/resources/customers/client/requests/CreateCustomerFundingInstructionsRequest.mjs +2 -0
  1148. package/dist/esm/api/resources/customers/client/requests/CreateCustomerRequest.d.mts +1 -1
  1149. package/dist/esm/api/resources/customers/client/requests/CreateCustomerUnitAliasByExternalIdRequest.d.mts +18 -0
  1150. package/dist/esm/api/resources/customers/client/requests/CreateCustomerUnitAliasByExternalIdRequest.mjs +2 -0
  1151. package/dist/esm/api/resources/customers/client/requests/CreateCustomerUnitAliasByKeyRequest.d.mts +15 -0
  1152. package/dist/esm/api/resources/customers/client/requests/CreateCustomerUnitAliasByKeyRequest.mjs +2 -0
  1153. package/dist/esm/api/resources/customers/client/requests/CreateCustomerUnitAliasRequest.d.mts +18 -0
  1154. package/dist/esm/api/resources/customers/client/requests/CreateCustomerUnitAliasRequest.mjs +2 -0
  1155. package/dist/esm/api/resources/customers/client/requests/CreateCustomerUnitByExternalIdRequest.d.mts +15 -0
  1156. package/dist/esm/api/resources/customers/client/requests/CreateCustomerUnitByExternalIdRequest.mjs +2 -0
  1157. package/dist/esm/api/resources/customers/client/requests/CreateCustomerUnitRequest.d.mts +15 -0
  1158. package/dist/esm/api/resources/customers/client/requests/CreateCustomerUnitRequest.mjs +2 -0
  1159. package/dist/esm/api/resources/customers/client/requests/CustomerUnitCreateUnderParent.d.mts +21 -0
  1160. package/dist/esm/api/resources/customers/client/requests/CustomerUnitCreateUnderParent.mjs +2 -0
  1161. package/dist/esm/api/resources/customers/client/requests/DeleteCustomerAliasByExternalIdRequest.d.mts +13 -0
  1162. package/dist/esm/api/resources/customers/client/requests/DeleteCustomerAliasByExternalIdRequest.mjs +2 -0
  1163. package/dist/esm/api/resources/customers/client/requests/DeleteCustomerAliasRequest.d.mts +13 -0
  1164. package/dist/esm/api/resources/customers/client/requests/DeleteCustomerAliasRequest.mjs +2 -0
  1165. package/dist/esm/api/resources/customers/client/requests/DeleteCustomerByExternalIdRequest.d.mts +2 -1
  1166. package/dist/esm/api/resources/customers/client/requests/DeleteCustomerByIdRequest.d.mts +2 -1
  1167. package/dist/esm/api/resources/customers/client/requests/DeleteCustomerUnitAliasByExternalIdRequest.d.mts +16 -0
  1168. package/dist/esm/api/resources/customers/client/requests/DeleteCustomerUnitAliasByExternalIdRequest.mjs +2 -0
  1169. package/dist/esm/api/resources/customers/client/requests/DeleteCustomerUnitAliasByKeyRequest.d.mts +13 -0
  1170. package/dist/esm/api/resources/customers/client/requests/DeleteCustomerUnitAliasByKeyRequest.mjs +2 -0
  1171. package/dist/esm/api/resources/customers/client/requests/DeleteCustomerUnitAliasRequest.d.mts +16 -0
  1172. package/dist/esm/api/resources/customers/client/requests/DeleteCustomerUnitAliasRequest.mjs +2 -0
  1173. package/dist/esm/api/resources/customers/client/requests/DeleteCustomerUnitByExternalIdRequest.d.mts +13 -0
  1174. package/dist/esm/api/resources/customers/client/requests/DeleteCustomerUnitByExternalIdRequest.mjs +2 -0
  1175. package/dist/esm/api/resources/customers/client/requests/DeleteCustomerUnitRequest.d.mts +13 -0
  1176. package/dist/esm/api/resources/customers/client/requests/DeleteCustomerUnitRequest.mjs +2 -0
  1177. package/dist/esm/api/resources/customers/client/requests/EndCustomerUnitCapByExternalIdRequest.d.mts +16 -0
  1178. package/dist/esm/api/resources/customers/client/requests/EndCustomerUnitCapByExternalIdRequest.mjs +2 -0
  1179. package/dist/esm/api/resources/customers/client/requests/EndCustomerUnitCapRequest.d.mts +16 -0
  1180. package/dist/esm/api/resources/customers/client/requests/EndCustomerUnitCapRequest.mjs +2 -0
  1181. package/dist/esm/api/resources/customers/client/requests/GetCustomerByExternalIdRequest.d.mts +2 -1
  1182. package/dist/esm/api/resources/customers/client/requests/GetCustomerByIdRequest.d.mts +2 -1
  1183. package/dist/esm/api/resources/customers/client/requests/GetCustomerCreditBalancesByExternalIdRequest.d.mts +2 -1
  1184. package/dist/esm/api/resources/customers/client/requests/GetCustomerCreditBalancesRequest.d.mts +2 -1
  1185. package/dist/esm/api/resources/customers/client/requests/GetCustomerFundingInstructionsByExternalIdRequest.d.mts +11 -0
  1186. package/dist/esm/api/resources/customers/client/requests/GetCustomerFundingInstructionsByExternalIdRequest.mjs +2 -0
  1187. package/dist/esm/api/resources/customers/client/requests/GetCustomerFundingInstructionsRequest.d.mts +12 -0
  1188. package/dist/esm/api/resources/customers/client/requests/GetCustomerFundingInstructionsRequest.mjs +2 -0
  1189. package/dist/esm/api/resources/customers/client/requests/GetCustomerStateByExternalIdRequest.d.mts +10 -0
  1190. package/dist/esm/api/resources/customers/client/requests/GetCustomerStateByExternalIdRequest.mjs +2 -0
  1191. package/dist/esm/api/resources/customers/client/requests/GetCustomerStateByIdRequest.d.mts +10 -0
  1192. package/dist/esm/api/resources/customers/client/requests/GetCustomerStateByIdRequest.mjs +2 -0
  1193. package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitByExternalIdRequest.d.mts +13 -0
  1194. package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitByExternalIdRequest.mjs +2 -0
  1195. package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitByKeyRequest.d.mts +10 -0
  1196. package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitByKeyRequest.mjs +2 -0
  1197. package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitCapByExternalIdRequest.d.mts +16 -0
  1198. package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitCapByExternalIdRequest.mjs +2 -0
  1199. package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitCapRequest.d.mts +16 -0
  1200. package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitCapRequest.mjs +2 -0
  1201. package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitRequest.d.mts +13 -0
  1202. package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitRequest.mjs +2 -0
  1203. package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitSpendByExternalIdRequest.d.mts +22 -0
  1204. package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitSpendByExternalIdRequest.mjs +2 -0
  1205. package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitSpendRequest.d.mts +22 -0
  1206. package/dist/esm/api/resources/customers/client/requests/GetCustomerUnitSpendRequest.mjs +2 -0
  1207. package/dist/esm/api/resources/customers/client/requests/GrantCustomerCreditsByExternalIdRequest.d.mts +19 -0
  1208. package/dist/esm/api/resources/customers/client/requests/GrantCustomerCreditsByExternalIdRequest.mjs +2 -0
  1209. package/dist/esm/api/resources/customers/client/requests/GrantCustomerCreditsRequest.d.mts +19 -0
  1210. package/dist/esm/api/resources/customers/client/requests/GrantCustomerCreditsRequest.mjs +2 -0
  1211. package/dist/esm/api/resources/customers/client/requests/ListCustomerAliasesByExternalIdRequest.d.mts +12 -0
  1212. package/dist/esm/api/resources/customers/client/requests/ListCustomerAliasesByExternalIdRequest.mjs +2 -0
  1213. package/dist/esm/api/resources/customers/client/requests/ListCustomerAliasesRequest.d.mts +12 -0
  1214. package/dist/esm/api/resources/customers/client/requests/ListCustomerAliasesRequest.mjs +2 -0
  1215. package/dist/esm/api/resources/customers/client/requests/ListCustomerApiKeysByExternalIdRequest.d.mts +12 -0
  1216. package/dist/esm/api/resources/customers/client/requests/ListCustomerApiKeysByExternalIdRequest.mjs +2 -0
  1217. package/dist/esm/api/resources/customers/client/requests/ListCustomerApiKeysRequest.d.mts +12 -0
  1218. package/dist/esm/api/resources/customers/client/requests/ListCustomerApiKeysRequest.mjs +2 -0
  1219. package/dist/esm/api/resources/customers/client/requests/ListCustomerPendingCreditConsumptionByExternalIdRequest.d.mts +12 -0
  1220. package/dist/esm/api/resources/customers/client/requests/ListCustomerPendingCreditConsumptionByExternalIdRequest.mjs +2 -0
  1221. package/dist/esm/api/resources/customers/client/requests/ListCustomerPendingCreditConsumptionRequest.d.mts +12 -0
  1222. package/dist/esm/api/resources/customers/client/requests/ListCustomerPendingCreditConsumptionRequest.mjs +2 -0
  1223. package/dist/esm/api/resources/customers/client/requests/ListCustomerUnitAliasesByExternalIdRequest.d.mts +15 -0
  1224. package/dist/esm/api/resources/customers/client/requests/ListCustomerUnitAliasesByExternalIdRequest.mjs +2 -0
  1225. package/dist/esm/api/resources/customers/client/requests/ListCustomerUnitAliasesByKeyRequest.d.mts +12 -0
  1226. package/dist/esm/api/resources/customers/client/requests/ListCustomerUnitAliasesByKeyRequest.mjs +2 -0
  1227. package/dist/esm/api/resources/customers/client/requests/ListCustomerUnitAliasesRequest.d.mts +15 -0
  1228. package/dist/esm/api/resources/customers/client/requests/ListCustomerUnitAliasesRequest.mjs +2 -0
  1229. package/dist/esm/api/resources/customers/client/requests/ListCustomerUnitsByExternalIdRequest.d.mts +20 -0
  1230. package/dist/esm/api/resources/customers/client/requests/ListCustomerUnitsByExternalIdRequest.mjs +2 -0
  1231. package/dist/esm/api/resources/customers/client/requests/ListCustomerUnitsRequest.d.mts +20 -0
  1232. package/dist/esm/api/resources/customers/client/requests/ListCustomerUnitsRequest.mjs +2 -0
  1233. package/dist/esm/api/resources/customers/client/requests/ListCustomersRequest.d.mts +13 -0
  1234. package/dist/esm/api/resources/customers/client/requests/RevokeCustomerApiKeyByExternalIdRequest.d.mts +13 -0
  1235. package/dist/esm/api/resources/customers/client/requests/RevokeCustomerApiKeyByExternalIdRequest.mjs +2 -0
  1236. package/dist/esm/api/resources/customers/client/requests/RevokeCustomerApiKeyRequest.d.mts +13 -0
  1237. package/dist/esm/api/resources/customers/client/requests/RevokeCustomerApiKeyRequest.mjs +2 -0
  1238. package/dist/esm/api/resources/customers/client/requests/SetCustomerUnitCapByExternalIdRequest.d.mts +18 -0
  1239. package/dist/esm/api/resources/customers/client/requests/SetCustomerUnitCapByExternalIdRequest.mjs +2 -0
  1240. package/dist/esm/api/resources/customers/client/requests/SetCustomerUnitCapRequest.d.mts +18 -0
  1241. package/dist/esm/api/resources/customers/client/requests/SetCustomerUnitCapRequest.mjs +2 -0
  1242. package/dist/esm/api/resources/customers/client/requests/UpdateCustomerByExternalIdRequest.d.mts +2 -1
  1243. package/dist/esm/api/resources/customers/client/requests/UpdateCustomerByIdRequest.d.mts +2 -1
  1244. package/dist/esm/api/resources/customers/client/requests/UpdateCustomerUnitByExternalIdRequest.d.mts +16 -0
  1245. package/dist/esm/api/resources/customers/client/requests/UpdateCustomerUnitByExternalIdRequest.mjs +2 -0
  1246. package/dist/esm/api/resources/customers/client/requests/UpdateCustomerUnitRequest.d.mts +16 -0
  1247. package/dist/esm/api/resources/customers/client/requests/UpdateCustomerUnitRequest.mjs +2 -0
  1248. package/dist/esm/api/resources/customers/client/requests/index.d.mts +51 -0
  1249. package/dist/esm/api/resources/customers/index.d.mts +1 -0
  1250. package/dist/esm/api/resources/customers/index.mjs +1 -0
  1251. package/dist/esm/api/resources/customers/types/DeleteCustomerUnitAliasByExternalIdResponse.d.mts +1 -0
  1252. package/dist/esm/api/resources/customers/types/DeleteCustomerUnitAliasByExternalIdResponse.mjs +2 -0
  1253. package/dist/esm/api/resources/customers/types/DeleteCustomerUnitAliasByKeyResponse.d.mts +1 -0
  1254. package/dist/esm/api/resources/customers/types/DeleteCustomerUnitAliasByKeyResponse.mjs +2 -0
  1255. package/dist/esm/api/resources/customers/types/DeleteCustomerUnitAliasResponse.d.mts +1 -0
  1256. package/dist/esm/api/resources/customers/types/DeleteCustomerUnitAliasResponse.mjs +2 -0
  1257. package/dist/esm/api/resources/customers/types/ListCustomerUnitsByExternalIdRequestStatus.d.mts +6 -0
  1258. package/dist/esm/api/resources/customers/types/ListCustomerUnitsByExternalIdRequestStatus.mjs +6 -0
  1259. package/dist/esm/api/resources/customers/types/ListCustomerUnitsRequestStatus.d.mts +6 -0
  1260. package/dist/esm/api/resources/customers/types/ListCustomerUnitsRequestStatus.mjs +6 -0
  1261. package/dist/esm/api/resources/customers/types/ListCustomersRequestCreationState.d.mts +5 -0
  1262. package/dist/esm/api/resources/customers/types/ListCustomersRequestCreationState.mjs +5 -0
  1263. package/dist/esm/api/resources/customers/types/ListCustomersRequestStatus.d.mts +5 -0
  1264. package/dist/esm/api/resources/customers/types/ListCustomersRequestStatus.mjs +5 -0
  1265. package/dist/esm/api/resources/customers/types/index.d.mts +7 -0
  1266. package/dist/esm/api/resources/customers/types/index.mjs +7 -0
  1267. package/dist/esm/api/resources/deliveredValue/client/Client.d.mts +60 -0
  1268. package/dist/esm/api/resources/deliveredValue/client/Client.mjs +211 -0
  1269. package/dist/esm/api/resources/deliveredValue/client/index.d.mts +1 -0
  1270. package/dist/esm/api/resources/deliveredValue/client/index.mjs +1 -0
  1271. package/dist/esm/api/resources/deliveredValue/client/requests/GetDeliveredValueRequest.d.mts +18 -0
  1272. package/dist/esm/api/resources/deliveredValue/client/requests/GetDeliveredValueRequest.mjs +2 -0
  1273. package/dist/esm/api/resources/deliveredValue/client/requests/GetDeliveredValueSummaryRequest.d.mts +29 -0
  1274. package/dist/esm/api/resources/deliveredValue/client/requests/GetDeliveredValueSummaryRequest.mjs +2 -0
  1275. package/dist/esm/api/resources/deliveredValue/client/requests/index.d.mts +2 -0
  1276. package/dist/esm/api/resources/deliveredValue/client/requests/index.mjs +1 -0
  1277. package/dist/esm/api/resources/deliveredValue/index.d.mts +2 -0
  1278. package/dist/esm/api/resources/deliveredValue/index.mjs +2 -0
  1279. package/dist/esm/api/resources/deliveredValue/types/GetDeliveredValueSummaryRequestGroupBy.d.mts +7 -0
  1280. package/dist/esm/api/resources/deliveredValue/types/GetDeliveredValueSummaryRequestGroupBy.mjs +7 -0
  1281. package/dist/esm/api/resources/deliveredValue/types/GetDeliveredValueSummaryRequestInterval.d.mts +8 -0
  1282. package/dist/esm/api/resources/deliveredValue/types/GetDeliveredValueSummaryRequestInterval.mjs +8 -0
  1283. package/dist/esm/api/resources/deliveredValue/types/index.d.mts +2 -0
  1284. package/dist/esm/api/resources/deliveredValue/types/index.mjs +2 -0
  1285. package/dist/esm/api/resources/index.d.mts +30 -0
  1286. package/dist/esm/api/resources/index.mjs +30 -0
  1287. package/dist/esm/api/resources/invoices/client/Client.mjs +37 -1
  1288. package/dist/esm/api/resources/invoices/client/requests/ListInvoicesRequest.d.mts +25 -0
  1289. package/dist/esm/api/resources/invoices/index.d.mts +1 -0
  1290. package/dist/esm/api/resources/invoices/index.mjs +1 -0
  1291. package/dist/esm/api/resources/invoices/types/ListInvoicesRequestPaymentStatus.d.mts +8 -0
  1292. package/dist/esm/api/resources/invoices/types/ListInvoicesRequestPaymentStatus.mjs +8 -0
  1293. package/dist/esm/api/resources/invoices/types/ListInvoicesRequestStatus.d.mts +10 -0
  1294. package/dist/esm/api/resources/invoices/types/ListInvoicesRequestStatus.mjs +10 -0
  1295. package/dist/esm/api/resources/invoices/types/index.d.mts +2 -0
  1296. package/dist/esm/api/resources/invoices/types/index.mjs +2 -0
  1297. package/dist/esm/api/resources/orders/client/Client.d.mts +105 -1
  1298. package/dist/esm/api/resources/orders/client/Client.mjs +245 -2
  1299. package/dist/esm/api/resources/orders/client/requests/ActivateOrderByIdRequest.d.mts +9 -0
  1300. package/dist/esm/api/resources/orders/client/requests/ActivateOrderByIdRequest.mjs +2 -0
  1301. package/dist/esm/api/resources/orders/client/requests/CreateOrderRequest.d.mts +14 -1
  1302. package/dist/esm/api/resources/orders/client/requests/CreateOrderRequest.mjs +11 -1
  1303. package/dist/esm/api/resources/orders/client/requests/ListOrdersRequest.d.mts +19 -0
  1304. package/dist/esm/api/resources/orders/client/requests/ProvisionRequest.d.mts +82 -0
  1305. package/dist/esm/api/resources/orders/client/requests/ProvisionRequest.mjs +2 -0
  1306. package/dist/esm/api/resources/orders/client/requests/UpdateOrderRequest.d.mts +14 -1
  1307. package/dist/esm/api/resources/orders/client/requests/UpdateOrderRequest.mjs +11 -1
  1308. package/dist/esm/api/resources/orders/client/requests/index.d.mts +2 -0
  1309. package/dist/esm/api/resources/orders/types/ListOrdersRequestCreationState.d.mts +5 -0
  1310. package/dist/esm/api/resources/orders/types/ListOrdersRequestCreationState.mjs +5 -0
  1311. package/dist/esm/api/resources/orders/types/OrderStatusFilter.d.mts +7 -0
  1312. package/dist/esm/api/resources/orders/types/OrderStatusFilter.mjs +7 -0
  1313. package/dist/esm/api/resources/orders/types/index.d.mts +2 -0
  1314. package/dist/esm/api/resources/orders/types/index.mjs +2 -0
  1315. package/dist/esm/api/resources/paymentAllocations/client/Client.d.mts +56 -0
  1316. package/dist/esm/api/resources/paymentAllocations/client/Client.mjs +190 -0
  1317. package/dist/esm/api/resources/paymentAllocations/client/index.d.mts +1 -0
  1318. package/dist/esm/api/resources/paymentAllocations/client/index.mjs +1 -0
  1319. package/dist/esm/api/resources/paymentAllocations/client/requests/CreatePaymentAllocationRequest.d.mts +17 -0
  1320. package/dist/esm/api/resources/paymentAllocations/client/requests/CreatePaymentAllocationRequest.mjs +2 -0
  1321. package/dist/esm/api/resources/paymentAllocations/client/requests/ListPaymentAllocationsRequest.d.mts +15 -0
  1322. package/dist/esm/api/resources/paymentAllocations/client/requests/ListPaymentAllocationsRequest.mjs +2 -0
  1323. package/dist/esm/api/resources/paymentAllocations/client/requests/index.d.mts +2 -0
  1324. package/dist/esm/api/resources/paymentAllocations/client/requests/index.mjs +1 -0
  1325. package/dist/esm/api/resources/paymentAllocations/index.d.mts +1 -0
  1326. package/dist/esm/api/resources/paymentAllocations/index.mjs +1 -0
  1327. package/dist/esm/api/resources/paymentMethods/client/Client.d.mts +104 -0
  1328. package/dist/esm/api/resources/paymentMethods/client/Client.mjs +409 -0
  1329. package/dist/esm/api/resources/paymentMethods/client/index.d.mts +1 -0
  1330. package/dist/esm/api/resources/paymentMethods/client/index.mjs +1 -0
  1331. package/dist/esm/api/resources/paymentMethods/client/requests/CreatePaymentMethodRequest.d.mts +18 -0
  1332. package/dist/esm/api/resources/paymentMethods/client/requests/CreatePaymentMethodRequest.mjs +2 -0
  1333. package/dist/esm/api/resources/paymentMethods/client/requests/DeletePaymentMethodRequest.d.mts +9 -0
  1334. package/dist/esm/api/resources/paymentMethods/client/requests/DeletePaymentMethodRequest.mjs +2 -0
  1335. package/dist/esm/api/resources/paymentMethods/client/requests/GetPaymentMethodRequest.d.mts +9 -0
  1336. package/dist/esm/api/resources/paymentMethods/client/requests/GetPaymentMethodRequest.mjs +2 -0
  1337. package/dist/esm/api/resources/paymentMethods/client/requests/ListPaymentMethodsRequest.d.mts +14 -0
  1338. package/dist/esm/api/resources/paymentMethods/client/requests/ListPaymentMethodsRequest.mjs +2 -0
  1339. package/dist/esm/api/resources/paymentMethods/client/requests/UpdateDefaultPaymentMethodRequest.d.mts +9 -0
  1340. package/dist/esm/api/resources/paymentMethods/client/requests/UpdateDefaultPaymentMethodRequest.mjs +2 -0
  1341. package/dist/esm/api/resources/paymentMethods/client/requests/index.d.mts +5 -0
  1342. package/dist/esm/api/resources/paymentMethods/client/requests/index.mjs +1 -0
  1343. package/dist/esm/api/resources/paymentMethods/index.d.mts +1 -0
  1344. package/dist/esm/api/resources/paymentMethods/index.mjs +1 -0
  1345. package/dist/esm/api/resources/payments/client/Client.d.mts +68 -0
  1346. package/dist/esm/api/resources/payments/client/Client.mjs +256 -0
  1347. package/dist/esm/api/resources/payments/client/index.d.mts +1 -0
  1348. package/dist/esm/api/resources/payments/client/index.mjs +1 -0
  1349. package/dist/esm/api/resources/payments/client/requests/CreatePaymentRequest.d.mts +25 -0
  1350. package/dist/esm/api/resources/payments/client/requests/CreatePaymentRequest.mjs +2 -0
  1351. package/dist/esm/api/resources/payments/client/requests/GetPaymentRequest.d.mts +9 -0
  1352. package/dist/esm/api/resources/payments/client/requests/GetPaymentRequest.mjs +2 -0
  1353. package/dist/esm/api/resources/payments/client/requests/ListPaymentsRequest.d.mts +15 -0
  1354. package/dist/esm/api/resources/payments/client/requests/ListPaymentsRequest.mjs +2 -0
  1355. package/dist/esm/api/resources/payments/client/requests/index.d.mts +3 -0
  1356. package/dist/esm/api/resources/payments/client/requests/index.mjs +1 -0
  1357. package/dist/esm/api/resources/payments/index.d.mts +2 -0
  1358. package/dist/esm/api/resources/payments/index.mjs +2 -0
  1359. package/dist/esm/api/resources/payments/types/ListPaymentsRequestStatus.d.mts +9 -0
  1360. package/dist/esm/api/resources/payments/types/ListPaymentsRequestStatus.mjs +9 -0
  1361. package/dist/esm/api/resources/payments/types/index.d.mts +1 -0
  1362. package/dist/esm/api/resources/payments/types/index.mjs +1 -0
  1363. package/dist/esm/api/resources/plans/client/Client.d.mts +152 -0
  1364. package/dist/esm/api/resources/plans/client/Client.mjs +556 -0
  1365. package/dist/esm/api/resources/plans/client/index.d.mts +1 -0
  1366. package/dist/esm/api/resources/plans/client/index.mjs +1 -0
  1367. package/dist/esm/api/resources/plans/client/requests/CreatePlanRequest.d.mts +28 -0
  1368. package/dist/esm/api/resources/plans/client/requests/CreatePlanRequest.mjs +2 -0
  1369. package/dist/esm/api/resources/plans/client/requests/GetPlanByExternalIdRequest.d.mts +9 -0
  1370. package/dist/esm/api/resources/plans/client/requests/GetPlanByExternalIdRequest.mjs +2 -0
  1371. package/dist/esm/api/resources/plans/client/requests/GetPlanByIdRequest.d.mts +9 -0
  1372. package/dist/esm/api/resources/plans/client/requests/GetPlanByIdRequest.mjs +2 -0
  1373. package/dist/esm/api/resources/plans/client/requests/ListPlansRequest.d.mts +12 -0
  1374. package/dist/esm/api/resources/plans/client/requests/ListPlansRequest.mjs +2 -0
  1375. package/dist/esm/api/resources/plans/client/requests/UpdatePlanByExternalIdRequest.d.mts +12 -0
  1376. package/dist/esm/api/resources/plans/client/requests/UpdatePlanByExternalIdRequest.mjs +2 -0
  1377. package/dist/esm/api/resources/plans/client/requests/UpdatePlanByIdRequest.d.mts +12 -0
  1378. package/dist/esm/api/resources/plans/client/requests/UpdatePlanByIdRequest.mjs +2 -0
  1379. package/dist/esm/api/resources/plans/client/requests/UpdatePlanUpgradePathRequest.d.mts +15 -0
  1380. package/dist/esm/api/resources/plans/client/requests/UpdatePlanUpgradePathRequest.mjs +2 -0
  1381. package/dist/esm/api/resources/plans/client/requests/index.d.mts +7 -0
  1382. package/dist/esm/api/resources/plans/client/requests/index.mjs +1 -0
  1383. package/dist/esm/api/resources/plans/index.d.mts +1 -0
  1384. package/dist/esm/api/resources/plans/index.mjs +1 -0
  1385. package/dist/esm/api/resources/pricing/client/Client.d.mts +2 -2
  1386. package/dist/esm/api/resources/pricing/client/Client.mjs +2 -2
  1387. package/dist/esm/api/resources/pricing/client/requests/UpdatePricingRequest.d.mts +1 -1
  1388. package/dist/esm/api/resources/products/client/Client.d.mts +9 -9
  1389. package/dist/esm/api/resources/products/client/Client.mjs +15 -6
  1390. package/dist/esm/api/resources/products/client/requests/ListProductsRequest.d.mts +6 -0
  1391. package/dist/esm/api/resources/signals/client/Client.d.mts +175 -4
  1392. package/dist/esm/api/resources/signals/client/Client.mjs +569 -4
  1393. package/dist/esm/api/resources/signals/client/requests/BulkSignalsRequest.d.mts +17 -3
  1394. package/dist/esm/api/resources/signals/client/requests/CreateSignalSummaryExportRequest.d.mts +56 -0
  1395. package/dist/esm/api/resources/signals/client/requests/CreateSignalSummaryExportRequest.mjs +9 -0
  1396. package/dist/esm/api/resources/signals/client/requests/GetSignalByIdRequest.d.mts +10 -0
  1397. package/dist/esm/api/resources/signals/client/requests/GetSignalByIdRequest.mjs +2 -0
  1398. package/dist/esm/api/resources/signals/client/requests/GetSignalSummaryExportRequest.d.mts +9 -0
  1399. package/dist/esm/api/resources/signals/client/requests/GetSignalSummaryExportRequest.mjs +2 -0
  1400. package/dist/esm/api/resources/signals/client/requests/GetSignalSummaryRequest.d.mts +45 -0
  1401. package/dist/esm/api/resources/signals/client/requests/GetSignalSummaryRequest.mjs +2 -0
  1402. package/dist/esm/api/resources/signals/client/requests/ListSignalsRequest.d.mts +22 -0
  1403. package/dist/esm/api/resources/signals/client/requests/ListSignalsRequest.mjs +2 -0
  1404. package/dist/esm/api/resources/signals/client/requests/SignalLookupRequest.d.mts +10 -0
  1405. package/dist/esm/api/resources/signals/client/requests/SignalLookupRequest.mjs +2 -0
  1406. package/dist/esm/api/resources/signals/client/requests/index.d.mts +6 -0
  1407. package/dist/esm/api/resources/signals/index.d.mts +1 -0
  1408. package/dist/esm/api/resources/signals/index.mjs +1 -0
  1409. package/dist/esm/api/resources/signals/types/GetSignalSummaryRequestGroupBy.d.mts +5 -0
  1410. package/dist/esm/api/resources/signals/types/GetSignalSummaryRequestGroupBy.mjs +5 -0
  1411. package/dist/esm/api/resources/signals/types/GetSignalSummaryRequestInterval.d.mts +7 -0
  1412. package/dist/esm/api/resources/signals/types/GetSignalSummaryRequestInterval.mjs +7 -0
  1413. package/dist/esm/api/resources/signals/types/index.d.mts +2 -0
  1414. package/dist/esm/api/resources/signals/types/index.mjs +2 -0
  1415. package/dist/esm/api/resources/valueMetrics/client/Client.d.mts +111 -0
  1416. package/dist/esm/api/resources/valueMetrics/client/Client.mjs +409 -0
  1417. package/dist/esm/api/resources/valueMetrics/client/index.d.mts +1 -0
  1418. package/dist/esm/api/resources/valueMetrics/client/index.mjs +1 -0
  1419. package/dist/esm/api/resources/valueMetrics/client/requests/ArchiveValueMetricRequest.d.mts +10 -0
  1420. package/dist/esm/api/resources/valueMetrics/client/requests/ArchiveValueMetricRequest.mjs +2 -0
  1421. package/dist/esm/api/resources/valueMetrics/client/requests/CreateValueMetricRequest.d.mts +57 -0
  1422. package/dist/esm/api/resources/valueMetrics/client/requests/CreateValueMetricRequest.mjs +12 -0
  1423. package/dist/esm/api/resources/valueMetrics/client/requests/GetValueMetricRequest.d.mts +9 -0
  1424. package/dist/esm/api/resources/valueMetrics/client/requests/GetValueMetricRequest.mjs +2 -0
  1425. package/dist/esm/api/resources/valueMetrics/client/requests/ListValueMetricsRequest.d.mts +10 -0
  1426. package/dist/esm/api/resources/valueMetrics/client/requests/ListValueMetricsRequest.mjs +2 -0
  1427. package/dist/esm/api/resources/valueMetrics/client/requests/UpdateValueMetricRequest.d.mts +43 -0
  1428. package/dist/esm/api/resources/valueMetrics/client/requests/UpdateValueMetricRequest.mjs +12 -0
  1429. package/dist/esm/api/resources/valueMetrics/client/requests/index.d.mts +5 -0
  1430. package/dist/esm/api/resources/valueMetrics/client/requests/index.mjs +1 -0
  1431. package/dist/esm/api/resources/valueMetrics/index.d.mts +1 -0
  1432. package/dist/esm/api/resources/valueMetrics/index.mjs +1 -0
  1433. package/dist/esm/api/resources/valueModels/client/Client.d.mts +120 -0
  1434. package/dist/esm/api/resources/valueModels/client/Client.mjs +388 -0
  1435. package/dist/esm/api/resources/valueModels/client/index.d.mts +1 -0
  1436. package/dist/esm/api/resources/valueModels/client/index.mjs +1 -0
  1437. package/dist/esm/api/resources/valueModels/client/requests/GetValueModelVersionRequest.d.mts +9 -0
  1438. package/dist/esm/api/resources/valueModels/client/requests/GetValueModelVersionRequest.mjs +2 -0
  1439. package/dist/esm/api/resources/valueModels/client/requests/ListValueModelVersionsRequest.d.mts +8 -0
  1440. package/dist/esm/api/resources/valueModels/client/requests/ListValueModelVersionsRequest.mjs +2 -0
  1441. package/dist/esm/api/resources/valueModels/client/requests/RefreshValueModelBackfillRequest.d.mts +5 -0
  1442. package/dist/esm/api/resources/valueModels/client/requests/RefreshValueModelBackfillRequest.mjs +2 -0
  1443. package/dist/esm/api/resources/valueModels/client/requests/ValueModelUploadRequest.d.mts +46 -0
  1444. package/dist/esm/api/resources/valueModels/client/requests/ValueModelUploadRequest.mjs +2 -0
  1445. package/dist/esm/api/resources/valueModels/client/requests/index.d.mts +4 -0
  1446. package/dist/esm/api/resources/valueModels/client/requests/index.mjs +1 -0
  1447. package/dist/esm/api/resources/valueModels/index.d.mts +1 -0
  1448. package/dist/esm/api/resources/valueModels/index.mjs +1 -0
  1449. package/dist/esm/api/resources/valueReceipts/client/Client.d.mts +45 -14
  1450. package/dist/esm/api/resources/valueReceipts/client/Client.mjs +156 -46
  1451. package/dist/esm/api/resources/valueReceipts/client/requests/PublishValueReceiptBody.d.mts +1 -0
  1452. package/dist/esm/api/resources/valueReceipts/client/requests/index.d.mts +0 -1
  1453. package/dist/esm/api/resources/webhooks/client/Client.d.mts +19 -4
  1454. package/dist/esm/api/resources/webhooks/client/Client.mjs +71 -3
  1455. package/dist/esm/api/resources/webhooks/client/requests/RotateWebhookSecretRequest.d.mts +5 -0
  1456. package/dist/esm/api/resources/webhooks/client/requests/RotateWebhookSecretRequest.mjs +2 -0
  1457. package/dist/esm/api/resources/webhooks/client/requests/TestWebhookRequest.d.mts +1 -1
  1458. package/dist/esm/api/resources/webhooks/client/requests/UpdateWebhookRequest.d.mts +2 -2
  1459. package/dist/esm/api/resources/webhooks/client/requests/index.d.mts +1 -0
  1460. package/dist/esm/api/resources/webhooks/types/TestWebhookRequestWebhookName.d.mts +2 -1
  1461. package/dist/esm/api/resources/webhooks/types/TestWebhookRequestWebhookName.mjs +2 -1
  1462. package/dist/esm/api/resources/webhooks/types/UpdateWebhookRequestWebhookName.d.mts +2 -1
  1463. package/dist/esm/api/resources/webhooks/types/UpdateWebhookRequestWebhookName.mjs +2 -1
  1464. package/dist/esm/api/types/AddAttributeIntent.d.mts +45 -0
  1465. package/dist/esm/api/types/AddAttributeIntent.mjs +21 -0
  1466. package/dist/esm/api/types/AddFromCatalogIntent.d.mts +22 -0
  1467. package/dist/esm/api/types/AddFromCatalogIntent.mjs +10 -0
  1468. package/dist/esm/api/types/AmendmentAddAttributeOptions.d.mts +9 -0
  1469. package/dist/esm/api/types/AmendmentAddAttributeOptions.mjs +2 -0
  1470. package/dist/esm/api/types/AmendmentAddAxisOptions.d.mts +10 -0
  1471. package/dist/esm/api/types/AmendmentAddAxisOptions.mjs +2 -0
  1472. package/dist/esm/api/types/AmendmentAttributeOptions.d.mts +14 -0
  1473. package/dist/esm/api/types/AmendmentAttributeOptions.mjs +2 -0
  1474. package/dist/esm/api/types/AmendmentAttributeState.d.mts +24 -0
  1475. package/dist/esm/api/types/AmendmentAttributeState.mjs +2 -0
  1476. package/dist/esm/api/types/AmendmentAxisChoiceValue.d.mts +10 -0
  1477. package/dist/esm/api/types/AmendmentAxisChoiceValue.mjs +10 -0
  1478. package/dist/esm/api/types/AmendmentAxisId.d.mts +8 -0
  1479. package/dist/esm/api/types/AmendmentAxisId.mjs +8 -0
  1480. package/dist/esm/api/types/AmendmentAxisOptions.d.mts +16 -0
  1481. package/dist/esm/api/types/AmendmentAxisOptions.mjs +2 -0
  1482. package/dist/esm/api/types/AmendmentAxisRelevance.d.mts +6 -0
  1483. package/dist/esm/api/types/AmendmentAxisRelevance.mjs +6 -0
  1484. package/dist/esm/api/types/AmendmentBillingType.d.mts +6 -0
  1485. package/dist/esm/api/types/AmendmentBillingType.mjs +6 -0
  1486. package/dist/esm/api/types/AmendmentChargeType.d.mts +8 -0
  1487. package/dist/esm/api/types/AmendmentChargeType.mjs +8 -0
  1488. package/dist/esm/api/types/AmendmentCreditEffectKind.d.mts +6 -0
  1489. package/dist/esm/api/types/AmendmentCreditEffectKind.mjs +6 -0
  1490. package/dist/esm/api/types/AmendmentErrorResponse.d.mts +7 -0
  1491. package/dist/esm/api/types/AmendmentErrorResponse.mjs +2 -0
  1492. package/dist/esm/api/types/AmendmentIntentKind.d.mts +10 -0
  1493. package/dist/esm/api/types/AmendmentIntentKind.mjs +10 -0
  1494. package/dist/esm/api/types/AmendmentIntentOptions.d.mts +7 -0
  1495. package/dist/esm/api/types/AmendmentIntentOptions.mjs +2 -0
  1496. package/dist/esm/api/types/AmendmentLineOptions.d.mts +12 -0
  1497. package/dist/esm/api/types/AmendmentLineOptions.mjs +2 -0
  1498. package/dist/esm/api/types/AmendmentMoneyBilling.d.mts +6 -0
  1499. package/dist/esm/api/types/AmendmentMoneyBilling.mjs +6 -0
  1500. package/dist/esm/api/types/AmendmentOptions.d.mts +26 -0
  1501. package/dist/esm/api/types/AmendmentOptions.mjs +2 -0
  1502. package/dist/esm/api/types/AmendmentPlan.d.mts +24 -0
  1503. package/dist/esm/api/types/AmendmentPlan.mjs +2 -0
  1504. package/dist/esm/api/types/AmendmentPlanAttributeDiff.d.mts +18 -0
  1505. package/dist/esm/api/types/AmendmentPlanAttributeDiff.mjs +2 -0
  1506. package/dist/esm/api/types/AmendmentPlanChange.d.mts +9 -0
  1507. package/dist/esm/api/types/AmendmentPlanChange.mjs +9 -0
  1508. package/dist/esm/api/types/AmendmentPlanCreditEffect.d.mts +15 -0
  1509. package/dist/esm/api/types/AmendmentPlanCreditEffect.mjs +2 -0
  1510. package/dist/esm/api/types/AmendmentPlanLineType.d.mts +8 -0
  1511. package/dist/esm/api/types/AmendmentPlanLineType.mjs +8 -0
  1512. package/dist/esm/api/types/AmendmentPlanMoneyEffect.d.mts +31 -0
  1513. package/dist/esm/api/types/AmendmentPlanMoneyEffect.mjs +10 -0
  1514. package/dist/esm/api/types/AmendmentPlanTreatmentResolution.d.mts +12 -0
  1515. package/dist/esm/api/types/AmendmentPlanTreatmentResolution.mjs +2 -0
  1516. package/dist/esm/api/types/AmendmentPlanUsageEffect.d.mts +17 -0
  1517. package/dist/esm/api/types/AmendmentPlanUsageEffect.mjs +9 -0
  1518. package/dist/esm/api/types/AmendmentPricingClause.d.mts +14 -0
  1519. package/dist/esm/api/types/AmendmentPricingClause.mjs +2 -0
  1520. package/dist/esm/api/types/AmendmentPricingModel.d.mts +11 -0
  1521. package/dist/esm/api/types/AmendmentPricingModel.mjs +11 -0
  1522. package/dist/esm/api/types/AmendmentTreatmentSource.d.mts +7 -0
  1523. package/dist/esm/api/types/AmendmentTreatmentSource.mjs +7 -0
  1524. package/dist/esm/api/types/AnalyticsColumn.d.mts +5 -0
  1525. package/dist/esm/api/types/AnalyticsColumn.mjs +2 -0
  1526. package/dist/esm/api/types/AnalyticsQueryRequest.d.mts +4 -0
  1527. package/dist/esm/api/types/AnalyticsQueryRequest.mjs +2 -0
  1528. package/dist/esm/api/types/AnalyticsQueryResponse.d.mts +15 -0
  1529. package/dist/esm/api/types/AnalyticsQueryResponse.mjs +2 -0
  1530. package/dist/esm/api/types/AnalyticsSchemaColumn.d.mts +6 -0
  1531. package/dist/esm/api/types/AnalyticsSchemaColumn.mjs +2 -0
  1532. package/dist/esm/api/types/AnalyticsSchemaResponse.d.mts +4 -0
  1533. package/dist/esm/api/types/AnalyticsSchemaResponse.mjs +2 -0
  1534. package/dist/esm/api/types/AnalyticsSchemaView.d.mts +6 -0
  1535. package/dist/esm/api/types/AnalyticsSchemaView.mjs +2 -0
  1536. package/dist/esm/api/types/Attribution.d.mts +3 -0
  1537. package/dist/esm/api/types/BackfillResponse.d.mts +4 -0
  1538. package/dist/esm/api/types/BackfillResponse.mjs +2 -0
  1539. package/dist/esm/api/types/ChargeStubAddAxisOptions.d.mts +34 -0
  1540. package/dist/esm/api/types/ChargeStubAddAxisOptions.mjs +16 -0
  1541. package/dist/esm/api/types/ChargeStubAxisOptions.d.mts +33 -0
  1542. package/dist/esm/api/types/ChargeStubAxisOptions.mjs +16 -0
  1543. package/dist/esm/api/types/Checkout.d.mts +6 -0
  1544. package/dist/esm/api/types/CheckoutCustomCard.d.mts +10 -0
  1545. package/dist/esm/api/types/CheckoutCustomCard.mjs +2 -0
  1546. package/dist/esm/api/types/CheckoutCustomCardInput.d.mts +10 -0
  1547. package/dist/esm/api/types/CheckoutCustomCardInput.mjs +2 -0
  1548. package/dist/esm/api/types/CheckoutDetails.d.mts +7 -0
  1549. package/dist/esm/api/types/CheckoutPlan.d.mts +4 -0
  1550. package/dist/esm/api/types/CheckoutPlan.mjs +2 -0
  1551. package/dist/esm/api/types/CheckoutPlanInput.d.mts +6 -0
  1552. package/dist/esm/api/types/CheckoutPlanInput.mjs +2 -0
  1553. package/dist/esm/api/types/CheckoutProduct.d.mts +3 -0
  1554. package/dist/esm/api/types/CheckoutProductInput.d.mts +3 -0
  1555. package/dist/esm/api/types/CheckoutSelectedProduct.d.mts +8 -0
  1556. package/dist/esm/api/types/CheckoutSelectedProduct.mjs +2 -0
  1557. package/dist/esm/api/types/CreateOrderLineAttributeRequest.d.mts +47 -5
  1558. package/dist/esm/api/types/CreateOrderLineAttributeRequest.mjs +11 -0
  1559. package/dist/esm/api/types/CreateOrderLineRequest.d.mts +4 -0
  1560. package/dist/esm/api/types/CreditBalance.d.mts +3 -1
  1561. package/dist/esm/api/types/CreditBenefitInput.d.mts +12 -5
  1562. package/dist/esm/api/types/CreditBenefitInput.mjs +2 -0
  1563. package/dist/esm/api/types/CreditBenefitOutput.d.mts +8 -6
  1564. package/dist/esm/api/types/CreditCurrency.d.mts +17 -0
  1565. package/dist/esm/api/types/CreditCurrency.mjs +8 -1
  1566. package/dist/esm/api/types/CreditGrant.d.mts +3 -0
  1567. package/dist/esm/api/types/CreditGrantAddAxisOptions.d.mts +24 -0
  1568. package/dist/esm/api/types/CreditGrantAddAxisOptions.mjs +2 -0
  1569. package/dist/esm/api/types/CreditGrantAxisOptions.d.mts +23 -0
  1570. package/dist/esm/api/types/CreditGrantAxisOptions.mjs +2 -0
  1571. package/dist/esm/api/types/CreditGrantCreateRequest.d.mts +12 -0
  1572. package/dist/esm/api/types/CreditGrantCreateRequest.mjs +2 -0
  1573. package/dist/esm/api/types/CreditGrantCurrency.d.mts +6 -0
  1574. package/dist/esm/api/types/CreditGrantCurrency.mjs +2 -0
  1575. package/dist/esm/api/types/CreditGrantCustomer.d.mts +6 -0
  1576. package/dist/esm/api/types/CreditGrantCustomer.mjs +2 -0
  1577. package/dist/esm/api/types/CreditGrantResult.d.mts +19 -0
  1578. package/dist/esm/api/types/CreditGrantResult.mjs +8 -0
  1579. package/dist/esm/api/types/CreditGrantValue.d.mts +7 -0
  1580. package/dist/esm/api/types/CreditGrantValue.mjs +7 -0
  1581. package/dist/esm/api/types/CreditTransaction.d.mts +31 -0
  1582. package/dist/esm/api/types/CreditTransaction.mjs +10 -0
  1583. package/dist/esm/api/types/CreditTransactionCurrency.d.mts +6 -0
  1584. package/dist/esm/api/types/CreditTransactionCurrency.mjs +2 -0
  1585. package/dist/esm/api/types/CreditTransactionCustomer.d.mts +6 -0
  1586. package/dist/esm/api/types/CreditTransactionCustomer.mjs +2 -0
  1587. package/dist/esm/api/types/CreditTransactionListResponse.d.mts +6 -0
  1588. package/dist/esm/api/types/CreditTransactionListResponse.mjs +2 -0
  1589. package/dist/esm/api/types/CreditTransactionProduct.d.mts +11 -0
  1590. package/dist/esm/api/types/CreditTransactionProduct.mjs +2 -0
  1591. package/dist/esm/api/types/CreditTransactionSummaryBucket.d.mts +25 -0
  1592. package/dist/esm/api/types/CreditTransactionSummaryBucket.mjs +2 -0
  1593. package/dist/esm/api/types/CreditTransactionSummaryResponse.d.mts +32 -0
  1594. package/dist/esm/api/types/CreditTransactionSummaryResponse.mjs +20 -0
  1595. package/dist/esm/api/types/CurrencyCode.d.mts +4 -0
  1596. package/dist/esm/api/types/CurrencyCode.mjs +2 -0
  1597. package/dist/esm/api/types/CustomView.d.mts +29 -0
  1598. package/dist/esm/api/types/CustomView.mjs +14 -0
  1599. package/dist/esm/api/types/CustomViewAuthoringDetail.d.mts +73 -0
  1600. package/dist/esm/api/types/CustomViewAuthoringDetail.mjs +27 -0
  1601. package/dist/esm/api/types/CustomViewAuthoringGuide.d.mts +6 -0
  1602. package/dist/esm/api/types/CustomViewAuthoringGuide.mjs +2 -0
  1603. package/dist/esm/api/types/CustomViewContextCap.d.mts +27 -0
  1604. package/dist/esm/api/types/CustomViewContextCap.mjs +8 -0
  1605. package/dist/esm/api/types/CustomViewCustomerUnit.d.mts +16 -0
  1606. package/dist/esm/api/types/CustomViewCustomerUnit.mjs +2 -0
  1607. package/dist/esm/api/types/CustomViewDataContext.d.mts +57 -0
  1608. package/dist/esm/api/types/CustomViewDataContext.mjs +18 -0
  1609. package/dist/esm/api/types/CustomViewDetail.d.mts +64 -0
  1610. package/dist/esm/api/types/CustomViewDetail.mjs +27 -0
  1611. package/dist/esm/api/types/CustomViewEmbedTokenResponse.d.mts +6 -0
  1612. package/dist/esm/api/types/CustomViewEmbedTokenResponse.mjs +2 -0
  1613. package/dist/esm/api/types/CustomViewFilter.d.mts +6 -0
  1614. package/dist/esm/api/types/CustomViewFilter.mjs +2 -0
  1615. package/dist/esm/api/types/CustomViewListResponse.d.mts +4 -0
  1616. package/dist/esm/api/types/CustomViewListResponse.mjs +2 -0
  1617. package/dist/esm/api/types/CustomViewPreviewHarness.d.mts +4 -0
  1618. package/dist/esm/api/types/CustomViewPreviewHarness.mjs +2 -0
  1619. package/dist/esm/api/types/CustomViewPreviewHarnessColumn.d.mts +16 -0
  1620. package/dist/esm/api/types/CustomViewPreviewHarnessColumn.mjs +11 -0
  1621. package/dist/esm/api/types/CustomViewPreviewHarnessRequest.d.mts +12 -0
  1622. package/dist/esm/api/types/CustomViewPreviewHarnessRequest.mjs +2 -0
  1623. package/dist/esm/api/types/CustomViewQuery.d.mts +6 -0
  1624. package/dist/esm/api/types/CustomViewQuery.mjs +2 -0
  1625. package/dist/esm/api/types/CustomViewSummary.d.mts +61 -0
  1626. package/dist/esm/api/types/CustomViewSummary.mjs +27 -0
  1627. package/dist/esm/api/types/CustomViewUnitSelection.d.mts +14 -0
  1628. package/dist/esm/api/types/CustomViewUnitSelection.mjs +2 -0
  1629. package/dist/esm/api/types/CustomViewValidationFinding.d.mts +8 -0
  1630. package/dist/esm/api/types/CustomViewValidationFinding.mjs +2 -0
  1631. package/dist/esm/api/types/Customer.d.mts +14 -2
  1632. package/dist/esm/api/types/Customer.mjs +8 -1
  1633. package/dist/esm/api/types/CustomerAlias.d.mts +12 -0
  1634. package/dist/esm/api/types/CustomerAlias.mjs +2 -0
  1635. package/dist/esm/api/types/CustomerAliasCreateRequest.d.mts +8 -0
  1636. package/dist/esm/api/types/CustomerAliasCreateRequest.mjs +2 -0
  1637. package/dist/esm/api/types/CustomerAliasListResponse.d.mts +5 -0
  1638. package/dist/esm/api/types/CustomerAliasListResponse.mjs +2 -0
  1639. package/dist/esm/api/types/CustomerApiKey.d.mts +31 -0
  1640. package/dist/esm/api/types/CustomerApiKey.mjs +10 -0
  1641. package/dist/esm/api/types/CustomerApiKeyCreate.d.mts +8 -0
  1642. package/dist/esm/api/types/CustomerApiKeyCreate.mjs +2 -0
  1643. package/dist/esm/api/types/CustomerApiKeyCreated.d.mts +33 -0
  1644. package/dist/esm/api/types/CustomerApiKeyCreated.mjs +10 -0
  1645. package/dist/esm/api/types/CustomerApiKeyList.d.mts +5 -0
  1646. package/dist/esm/api/types/CustomerApiKeyList.mjs +2 -0
  1647. package/dist/esm/api/types/CustomerAttribution.d.mts +3 -0
  1648. package/dist/{cjs/api/types/CustomerBillingAddress.d.ts → esm/api/types/CustomerBillingAddressInput.d.mts} +1 -1
  1649. package/dist/esm/api/types/CustomerBillingAddressInput.mjs +2 -0
  1650. package/dist/esm/api/types/CustomerBillingAddressResponse.d.mts +11 -0
  1651. package/dist/esm/api/types/CustomerBillingAddressResponse.mjs +2 -0
  1652. package/dist/esm/api/types/CustomerConnections.d.mts +7 -0
  1653. package/dist/esm/api/types/CustomerConnections.mjs +2 -0
  1654. package/dist/esm/api/types/CustomerFundingInstructions.d.mts +24 -0
  1655. package/dist/esm/api/types/CustomerFundingInstructions.mjs +7 -0
  1656. package/dist/esm/api/types/CustomerFundingInstructionsCreateRequest.d.mts +4 -0
  1657. package/dist/esm/api/types/CustomerFundingInstructionsCreateRequest.mjs +2 -0
  1658. package/dist/esm/api/types/CustomerState.d.mts +10 -0
  1659. package/dist/esm/api/types/CustomerState.mjs +2 -0
  1660. package/dist/esm/api/types/CustomerStateCheckoutLink.d.mts +18 -0
  1661. package/dist/esm/api/types/CustomerStateCheckoutLink.mjs +10 -0
  1662. package/dist/esm/api/types/CustomerStateCreditBalance.d.mts +6 -0
  1663. package/dist/esm/api/types/CustomerStateCreditBalance.mjs +2 -0
  1664. package/dist/esm/api/types/CustomerStateCreditSummary.d.mts +4 -0
  1665. package/dist/esm/api/types/CustomerStateCreditSummary.mjs +2 -0
  1666. package/dist/esm/api/types/CustomerStateCustomer.d.mts +8 -0
  1667. package/dist/esm/api/types/CustomerStateCustomer.mjs +2 -0
  1668. package/dist/esm/api/types/CustomerStateOrder.d.mts +21 -0
  1669. package/dist/esm/api/types/CustomerStateOrder.mjs +10 -0
  1670. package/dist/esm/api/types/CustomerStateProductRef.d.mts +5 -0
  1671. package/dist/esm/api/types/CustomerStateProductRef.mjs +2 -0
  1672. package/dist/esm/api/types/CustomerStateSeat.d.mts +17 -0
  1673. package/dist/esm/api/types/CustomerStateSeat.mjs +8 -0
  1674. package/dist/esm/api/types/CustomerStateSeatAssignee.d.mts +6 -0
  1675. package/dist/esm/api/types/CustomerStateSeatAssignee.mjs +2 -0
  1676. package/dist/esm/api/types/CustomerStateSeats.d.mts +7 -0
  1677. package/dist/esm/api/types/CustomerStateSeats.mjs +2 -0
  1678. package/dist/esm/api/types/CustomerUnit.d.mts +36 -0
  1679. package/dist/esm/api/types/CustomerUnit.mjs +10 -0
  1680. package/dist/esm/api/types/CustomerUnitAttribution.d.mts +7 -0
  1681. package/dist/esm/api/types/CustomerUnitAttribution.mjs +2 -0
  1682. package/dist/esm/api/types/CustomerUnitByKey.d.mts +37 -0
  1683. package/dist/esm/api/types/CustomerUnitByKey.mjs +10 -0
  1684. package/dist/esm/api/types/CustomerUnitCapCurrentPeriod.d.mts +11 -0
  1685. package/dist/esm/api/types/CustomerUnitCapCurrentPeriod.mjs +2 -0
  1686. package/dist/esm/api/types/CustomerUnitCapEndResponse.d.mts +12 -0
  1687. package/dist/esm/api/types/CustomerUnitCapEndResponse.mjs +2 -0
  1688. package/dist/esm/api/types/CustomerUnitCapEndedPolicy.d.mts +26 -0
  1689. package/dist/esm/api/types/CustomerUnitCapEndedPolicy.mjs +8 -0
  1690. package/dist/esm/api/types/CustomerUnitCapPeriod.d.mts +6 -0
  1691. package/dist/esm/api/types/CustomerUnitCapPeriod.mjs +2 -0
  1692. package/dist/esm/api/types/CustomerUnitCapPolicy.d.mts +26 -0
  1693. package/dist/esm/api/types/CustomerUnitCapPolicy.mjs +8 -0
  1694. package/dist/esm/api/types/CustomerUnitCapResponse.d.mts +11 -0
  1695. package/dist/esm/api/types/CustomerUnitCapResponse.mjs +2 -0
  1696. package/dist/esm/api/types/CustomerUnitCapSavedPolicy.d.mts +26 -0
  1697. package/dist/esm/api/types/CustomerUnitCapSavedPolicy.mjs +8 -0
  1698. package/dist/esm/api/types/CustomerUnitCapSchedule.d.mts +9 -0
  1699. package/dist/esm/api/types/CustomerUnitCapSchedule.mjs +2 -0
  1700. package/dist/esm/api/types/CustomerUnitCapScheduleInput.d.mts +9 -0
  1701. package/dist/esm/api/types/CustomerUnitCapScheduleInput.mjs +2 -0
  1702. package/dist/esm/api/types/CustomerUnitCapSet.d.mts +19 -0
  1703. package/dist/esm/api/types/CustomerUnitCapSet.mjs +8 -0
  1704. package/dist/esm/api/types/CustomerUnitCapSetResponse.d.mts +13 -0
  1705. package/dist/esm/api/types/CustomerUnitCapSetResponse.mjs +2 -0
  1706. package/dist/esm/api/types/CustomerUnitCreate.d.mts +14 -0
  1707. package/dist/esm/api/types/CustomerUnitCreate.mjs +2 -0
  1708. package/dist/esm/api/types/CustomerUnitCreatedUnderParent.d.mts +34 -0
  1709. package/dist/esm/api/types/CustomerUnitCreatedUnderParent.mjs +10 -0
  1710. package/dist/esm/api/types/CustomerUnitListResponse.d.mts +6 -0
  1711. package/dist/esm/api/types/CustomerUnitListResponse.mjs +2 -0
  1712. package/dist/esm/api/types/CustomerUnitSpendResponse.d.mts +12 -0
  1713. package/dist/esm/api/types/CustomerUnitSpendResponse.mjs +2 -0
  1714. package/dist/esm/api/types/CustomerUnitSpendWindow.d.mts +9 -0
  1715. package/dist/esm/api/types/CustomerUnitSpendWindow.mjs +2 -0
  1716. package/dist/esm/api/types/CustomerUnitUpdate.d.mts +12 -0
  1717. package/dist/esm/api/types/CustomerUnitUpdate.mjs +2 -0
  1718. package/dist/esm/api/types/DeliveredValueCalculation.d.mts +11 -0
  1719. package/dist/esm/api/types/DeliveredValueCalculation.mjs +2 -0
  1720. package/dist/esm/api/types/DeliveredValueCalculationTerm.d.mts +34 -0
  1721. package/dist/esm/api/types/DeliveredValueCalculationTerm.mjs +21 -0
  1722. package/dist/esm/api/types/DeliveredValueMetric.d.mts +54 -0
  1723. package/dist/esm/api/types/DeliveredValueMetric.mjs +2 -0
  1724. package/dist/esm/api/types/DeliveredValueResponse.d.mts +34 -0
  1725. package/dist/esm/api/types/DeliveredValueResponse.mjs +2 -0
  1726. package/dist/esm/api/types/DeliveredValueSignal.d.mts +14 -0
  1727. package/dist/esm/api/types/DeliveredValueSignal.mjs +2 -0
  1728. package/dist/esm/api/types/DeliveredValueSignalValue.d.mts +8 -0
  1729. package/dist/esm/api/types/DeliveredValueSignalValue.mjs +2 -0
  1730. package/dist/esm/api/types/DeliveredValueSummaryBucket.d.mts +20 -0
  1731. package/dist/esm/api/types/DeliveredValueSummaryBucket.mjs +2 -0
  1732. package/dist/esm/api/types/DeliveredValueSummaryResponse.d.mts +41 -0
  1733. package/dist/esm/api/types/DeliveredValueSummaryResponse.mjs +19 -0
  1734. package/dist/esm/api/types/EndAttributeIntent.d.mts +16 -0
  1735. package/dist/esm/api/types/EndAttributeIntent.mjs +11 -0
  1736. package/dist/esm/api/types/GrantCustomerCreditsResponse.d.mts +9 -0
  1737. package/dist/esm/api/types/GrantCustomerCreditsResponse.mjs +2 -0
  1738. package/dist/esm/api/types/Invoice.d.mts +3 -0
  1739. package/dist/esm/api/types/MoneyAxisOptions.d.mts +23 -0
  1740. package/dist/esm/api/types/MoneyAxisOptions.mjs +2 -0
  1741. package/dist/esm/api/types/MoneyAxisValue.d.mts +6 -0
  1742. package/dist/esm/api/types/MoneyAxisValue.mjs +6 -0
  1743. package/dist/esm/api/types/Order.d.mts +1 -0
  1744. package/dist/esm/api/types/OrderLine.d.mts +2 -0
  1745. package/dist/esm/api/types/OrderLineType.d.mts +7 -0
  1746. package/dist/esm/api/types/OrderLineType.mjs +7 -0
  1747. package/dist/esm/api/types/Payment.d.mts +30 -0
  1748. package/dist/esm/api/types/Payment.mjs +2 -0
  1749. package/dist/esm/api/types/PaymentAllocation.d.mts +21 -0
  1750. package/dist/esm/api/types/PaymentAllocation.mjs +2 -0
  1751. package/dist/esm/api/types/PaymentAllocationCreateResponse.d.mts +4 -0
  1752. package/dist/esm/api/types/PaymentAllocationCreateResponse.mjs +2 -0
  1753. package/dist/esm/api/types/PaymentAllocationInput.d.mts +8 -0
  1754. package/dist/esm/api/types/PaymentAllocationInput.mjs +2 -0
  1755. package/dist/esm/api/types/PaymentAllocationListResponse.d.mts +5 -0
  1756. package/dist/esm/api/types/PaymentAllocationListResponse.mjs +2 -0
  1757. package/dist/esm/api/types/PaymentCreateStatus.d.mts +6 -0
  1758. package/dist/esm/api/types/PaymentCreateStatus.mjs +6 -0
  1759. package/dist/esm/api/types/PaymentListResponse.d.mts +5 -0
  1760. package/dist/esm/api/types/PaymentListResponse.mjs +2 -0
  1761. package/dist/esm/api/types/PaymentMethod.d.mts +15 -0
  1762. package/dist/esm/api/types/PaymentMethod.mjs +2 -0
  1763. package/dist/esm/api/types/PaymentMethodCard.d.mts +13 -0
  1764. package/dist/esm/api/types/PaymentMethodCard.mjs +2 -0
  1765. package/dist/esm/api/types/PaymentMethodListResponse.d.mts +5 -0
  1766. package/dist/esm/api/types/PaymentMethodListResponse.mjs +2 -0
  1767. package/dist/esm/api/types/PaymentMethodSetup.d.mts +21 -0
  1768. package/dist/esm/api/types/PaymentMethodSetup.mjs +2 -0
  1769. package/dist/esm/api/types/PaymentType.d.mts +9 -0
  1770. package/dist/esm/api/types/PaymentType.mjs +9 -0
  1771. package/dist/esm/api/types/PendingCreditConsumption.d.mts +16 -0
  1772. package/dist/esm/api/types/PendingCreditConsumption.mjs +2 -0
  1773. package/dist/esm/api/types/PendingCreditConsumptionCurrency.d.mts +9 -0
  1774. package/dist/esm/api/types/PendingCreditConsumptionCurrency.mjs +2 -0
  1775. package/dist/esm/api/types/PendingCreditConsumptionListResponse.d.mts +6 -0
  1776. package/dist/esm/api/types/PendingCreditConsumptionListResponse.mjs +2 -0
  1777. package/dist/esm/api/types/Plan.d.mts +22 -0
  1778. package/dist/esm/api/types/Plan.mjs +8 -0
  1779. package/dist/esm/api/types/PlanAttribute.d.mts +8 -0
  1780. package/dist/esm/api/types/PlanAttribute.mjs +2 -0
  1781. package/dist/esm/api/types/PlanAttributeInput.d.mts +7 -0
  1782. package/dist/esm/api/types/PlanAttributeInput.mjs +2 -0
  1783. package/dist/esm/api/types/PlanCreditBenefit.d.mts +35 -0
  1784. package/dist/esm/api/types/PlanCreditBenefit.mjs +17 -0
  1785. package/dist/esm/api/types/PlanListResponse.d.mts +5 -0
  1786. package/dist/esm/api/types/PlanListResponse.mjs +2 -0
  1787. package/dist/esm/api/types/PlanPricing.d.mts +31 -0
  1788. package/dist/esm/api/types/PlanPricing.mjs +21 -0
  1789. package/dist/esm/api/types/PlanRef.d.mts +5 -0
  1790. package/dist/esm/api/types/PlanRef.mjs +2 -0
  1791. package/dist/esm/api/types/PlanUpgradePathGroup.d.mts +4 -0
  1792. package/dist/esm/api/types/PlanUpgradePathGroup.mjs +2 -0
  1793. package/dist/esm/api/types/PlanUpgradePathResponse.d.mts +4 -0
  1794. package/dist/esm/api/types/PlanUpgradePathResponse.mjs +2 -0
  1795. package/dist/esm/api/types/PlannedAdd.d.mts +28 -0
  1796. package/dist/esm/api/types/PlannedAdd.mjs +10 -0
  1797. package/dist/esm/api/types/PlannedCopy.d.mts +10 -0
  1798. package/dist/esm/api/types/PlannedCopy.mjs +2 -0
  1799. package/dist/esm/api/types/PlannedEnd.d.mts +10 -0
  1800. package/dist/esm/api/types/PlannedEnd.mjs +2 -0
  1801. package/dist/esm/api/types/PlannedOperations.d.mts +13 -0
  1802. package/dist/esm/api/types/PlannedOperations.mjs +2 -0
  1803. package/dist/esm/api/types/PlannedOrderTerm.d.mts +10 -0
  1804. package/dist/esm/api/types/PlannedOrderTerm.mjs +2 -0
  1805. package/dist/esm/api/types/PlannedReplace.d.mts +15 -0
  1806. package/dist/esm/api/types/PlannedReplace.mjs +2 -0
  1807. package/dist/esm/api/types/PricingInput.d.mts +4 -1
  1808. package/dist/esm/api/types/PricingOutput.d.mts +10 -0
  1809. package/dist/esm/api/types/PricingOutput.mjs +5 -0
  1810. package/dist/esm/api/types/PricingPricePointOutput.d.mts +2 -22
  1811. package/dist/esm/api/types/PricingPricePointOutput.mjs +1 -13
  1812. package/dist/esm/api/types/PricingTierOutput.d.mts +16 -0
  1813. package/dist/esm/api/types/PricingTierOutput.mjs +8 -0
  1814. package/dist/esm/api/types/ProductAttributeOutput.d.mts +8 -0
  1815. package/dist/esm/api/types/ProductAttributeOutput.mjs +2 -0
  1816. package/dist/esm/api/types/ProductAttributeUpsert.d.mts +9 -0
  1817. package/dist/esm/api/types/ProductAttributeUpsert.mjs +2 -0
  1818. package/dist/esm/api/types/ProductCreditBenefitInput.d.mts +37 -0
  1819. package/dist/esm/api/types/ProductCreditBenefitInput.mjs +19 -0
  1820. package/dist/esm/api/types/ProductCreditBenefitOutput.d.mts +15 -0
  1821. package/dist/esm/api/types/ProductCreditBenefitOutput.mjs +2 -0
  1822. package/dist/esm/api/types/ProductDetail.d.mts +14 -0
  1823. package/dist/esm/api/types/ProductDetail.mjs +2 -0
  1824. package/dist/esm/api/types/ProductOneTimePerUnitInput.d.mts +21 -0
  1825. package/dist/esm/api/types/ProductOneTimePerUnitInput.mjs +15 -0
  1826. package/dist/esm/api/types/ProductPricePointOutput.d.mts +9 -0
  1827. package/dist/esm/api/types/ProductPricePointOutput.mjs +2 -0
  1828. package/dist/esm/api/types/ProductPricingInput.d.mts +49 -0
  1829. package/dist/esm/api/types/ProductPricingInput.mjs +2 -0
  1830. package/dist/esm/api/types/ProductPricingOutput.d.mts +46 -0
  1831. package/dist/esm/api/types/ProductPricingOutput.mjs +25 -0
  1832. package/dist/esm/api/types/ProductPricingTierOutput.d.mts +16 -0
  1833. package/dist/esm/api/types/ProductPricingTierOutput.mjs +8 -0
  1834. package/dist/esm/api/types/ProductRecurringGraduatedInput.d.mts +22 -0
  1835. package/dist/esm/api/types/ProductRecurringGraduatedInput.mjs +15 -0
  1836. package/dist/esm/api/types/ProductRecurringPerUnitInput.d.mts +22 -0
  1837. package/dist/esm/api/types/ProductRecurringPerUnitInput.mjs +15 -0
  1838. package/dist/esm/api/types/ProductRecurringPercentOfTotalInput.d.mts +23 -0
  1839. package/dist/esm/api/types/ProductRecurringPercentOfTotalInput.mjs +15 -0
  1840. package/dist/esm/api/types/ProductRecurringVolumeInput.d.mts +22 -0
  1841. package/dist/esm/api/types/ProductRecurringVolumeInput.mjs +15 -0
  1842. package/dist/esm/api/types/ProductSeatBasedGraduatedInput.d.mts +22 -0
  1843. package/dist/esm/api/types/ProductSeatBasedGraduatedInput.mjs +15 -0
  1844. package/dist/esm/api/types/ProductSeatBasedPerUnitInput.d.mts +22 -0
  1845. package/dist/esm/api/types/ProductSeatBasedPerUnitInput.mjs +15 -0
  1846. package/dist/esm/api/types/ProductSeatBasedPrepaidCreditsInput.d.mts +29 -0
  1847. package/dist/esm/api/types/ProductSeatBasedPrepaidCreditsInput.mjs +15 -0
  1848. package/dist/esm/api/types/ProductSeatBasedVolumeInput.d.mts +22 -0
  1849. package/dist/esm/api/types/ProductSeatBasedVolumeInput.mjs +15 -0
  1850. package/dist/esm/api/types/ProductSimplePricePoint.d.mts +29 -0
  1851. package/dist/esm/api/types/ProductSimplePricePoint.mjs +14 -0
  1852. package/dist/esm/api/types/ProductTieredPricePoint.d.mts +29 -0
  1853. package/dist/esm/api/types/ProductTieredPricePoint.mjs +14 -0
  1854. package/dist/esm/api/types/ProductUsageBracketedPrepaidCreditsInput.d.mts +61 -0
  1855. package/dist/esm/api/types/ProductUsageBracketedPrepaidCreditsInput.mjs +26 -0
  1856. package/dist/esm/api/types/ProductUsageCostPlusInput.d.mts +31 -0
  1857. package/dist/esm/api/types/ProductUsageCostPlusInput.mjs +20 -0
  1858. package/dist/esm/api/types/ProductUsageGraduatedInput.d.mts +31 -0
  1859. package/dist/esm/api/types/ProductUsageGraduatedInput.mjs +20 -0
  1860. package/dist/esm/api/types/ProductUsagePerUnitInput.d.mts +31 -0
  1861. package/dist/esm/api/types/ProductUsagePerUnitInput.mjs +20 -0
  1862. package/dist/esm/api/types/ProductUsagePrepaidCreditsInput.d.mts +50 -0
  1863. package/dist/esm/api/types/ProductUsagePrepaidCreditsInput.mjs +26 -0
  1864. package/dist/esm/api/types/ProductUsageVolumeInput.d.mts +31 -0
  1865. package/dist/esm/api/types/ProductUsageVolumeInput.mjs +20 -0
  1866. package/dist/esm/api/types/ProvisionBillingFrequencyOverride.d.mts +14 -0
  1867. package/dist/esm/api/types/ProvisionBillingFrequencyOverride.mjs +11 -0
  1868. package/dist/esm/api/types/ProvisionContact.d.mts +20 -0
  1869. package/dist/esm/api/types/ProvisionContact.mjs +11 -0
  1870. package/dist/esm/api/types/ProvisionCreatedContact.d.mts +14 -0
  1871. package/dist/esm/api/types/ProvisionCreatedContact.mjs +9 -0
  1872. package/dist/esm/api/types/ProvisionCreatedCustomer.d.mts +14 -0
  1873. package/dist/esm/api/types/ProvisionCreatedCustomer.mjs +9 -0
  1874. package/dist/esm/api/types/ProvisionCreatedOrder.d.mts +17 -0
  1875. package/dist/esm/api/types/ProvisionCreatedOrder.mjs +9 -0
  1876. package/dist/esm/api/types/ProvisionCreatedOrderLine.d.mts +17 -0
  1877. package/dist/esm/api/types/ProvisionCreatedOrderLine.mjs +9 -0
  1878. package/dist/esm/api/types/ProvisionCreditBenefit.d.mts +44 -0
  1879. package/dist/esm/api/types/ProvisionCreditBenefit.mjs +23 -0
  1880. package/dist/esm/api/types/ProvisionCustomer.d.mts +23 -0
  1881. package/dist/esm/api/types/ProvisionCustomer.mjs +9 -0
  1882. package/dist/esm/api/types/ProvisionExternalReference.d.mts +16 -0
  1883. package/dist/esm/api/types/ProvisionExternalReference.mjs +11 -0
  1884. package/dist/esm/api/types/ProvisionOrder.d.mts +39 -0
  1885. package/dist/esm/api/types/ProvisionOrder.mjs +17 -0
  1886. package/dist/esm/api/types/ProvisionOrderLine.d.mts +12 -0
  1887. package/dist/esm/api/types/ProvisionOrderLine.mjs +2 -0
  1888. package/dist/esm/api/types/ProvisionOrderLineAttribute.d.mts +96 -0
  1889. package/dist/esm/api/types/ProvisionOrderLineAttribute.mjs +47 -0
  1890. package/dist/esm/api/types/ProvisionOrderLineType.d.mts +7 -0
  1891. package/dist/esm/api/types/ProvisionOrderLineType.mjs +7 -0
  1892. package/dist/esm/api/types/ProvisionProduct.d.mts +95 -0
  1893. package/dist/esm/api/types/ProvisionProduct.mjs +49 -0
  1894. package/dist/esm/api/types/ProvisionResponse.d.mts +17 -0
  1895. package/dist/esm/api/types/ProvisionResponse.mjs +9 -0
  1896. package/dist/esm/api/types/RenderBundleEdit.d.mts +8 -0
  1897. package/dist/esm/api/types/RenderBundleEdit.mjs +2 -0
  1898. package/dist/esm/api/types/RotateWebhookSecretResponse.d.mts +4 -0
  1899. package/dist/esm/api/types/RotateWebhookSecretResponse.mjs +2 -0
  1900. package/dist/esm/api/types/SeatBasedPrepaidCreditsInput.d.mts +4 -0
  1901. package/dist/esm/api/types/Signal.d.mts +9 -2
  1902. package/dist/esm/api/types/SignalListItem.d.mts +20 -0
  1903. package/dist/esm/api/types/SignalListItem.mjs +2 -0
  1904. package/dist/esm/api/types/SignalListResponse.d.mts +5 -0
  1905. package/dist/esm/api/types/SignalListResponse.mjs +2 -0
  1906. package/dist/esm/api/types/SignalLookupResponse.d.mts +7 -0
  1907. package/dist/esm/api/types/SignalLookupResponse.mjs +2 -0
  1908. package/dist/esm/api/types/SignalSummaryBandsDimension.d.mts +21 -0
  1909. package/dist/esm/api/types/SignalSummaryBandsDimension.mjs +2 -0
  1910. package/dist/esm/api/types/SignalSummaryColumn.d.mts +8 -0
  1911. package/dist/esm/api/types/SignalSummaryColumn.mjs +2 -0
  1912. package/dist/esm/api/types/SignalSummaryDefinitionSpec.d.mts +21 -0
  1913. package/dist/esm/api/types/SignalSummaryDefinitionSpec.mjs +8 -0
  1914. package/dist/esm/api/types/SignalSummaryDefinitionSpecDimensionsItem.d.mts +10 -0
  1915. package/dist/esm/api/types/SignalSummaryDefinitionSpecDimensionsItem.mjs +2 -0
  1916. package/dist/esm/api/types/SignalSummaryExport.d.mts +36 -0
  1917. package/dist/esm/api/types/SignalSummaryExport.mjs +15 -0
  1918. package/dist/esm/api/types/SignalSummaryGroups.d.mts +9 -0
  1919. package/dist/esm/api/types/SignalSummaryGroups.mjs +2 -0
  1920. package/dist/esm/api/types/SignalSummaryMeasure.d.mts +16 -0
  1921. package/dist/esm/api/types/SignalSummaryMeasure.mjs +11 -0
  1922. package/dist/esm/api/types/SignalSummaryPage.d.mts +8 -0
  1923. package/dist/esm/api/types/SignalSummaryPage.mjs +2 -0
  1924. package/dist/esm/api/types/SignalSummaryPoint.d.mts +16 -0
  1925. package/dist/esm/api/types/SignalSummaryPoint.mjs +2 -0
  1926. package/dist/esm/api/types/SignalSummaryPresenceDimension.d.mts +23 -0
  1927. package/dist/esm/api/types/SignalSummaryPresenceDimension.mjs +2 -0
  1928. package/dist/esm/api/types/SignalSummaryResponse.d.mts +29 -0
  1929. package/dist/esm/api/types/SignalSummaryResponse.mjs +16 -0
  1930. package/dist/esm/api/types/SignalSummarySignalSelection.d.mts +8 -0
  1931. package/dist/esm/api/types/SignalSummarySignalSelection.mjs +2 -0
  1932. package/dist/esm/api/types/SignalSummarySpecInput.d.mts +21 -0
  1933. package/dist/esm/api/types/SignalSummarySpecInput.mjs +8 -0
  1934. package/dist/esm/api/types/SignalSummarySpecInputDimensionsItem.d.mts +10 -0
  1935. package/dist/esm/api/types/SignalSummarySpecInputDimensionsItem.mjs +2 -0
  1936. package/dist/esm/api/types/SignalsMetadataResponse.d.mts +49 -0
  1937. package/dist/esm/api/types/SignalsMetadataResponse.mjs +24 -0
  1938. package/dist/esm/api/types/StripeConnection.d.mts +7 -0
  1939. package/dist/esm/api/types/StripeConnection.mjs +2 -0
  1940. package/dist/esm/api/{resources/valueReceipts/client/requests → types}/SyncValueReceiptRequest.d.mts +0 -7
  1941. package/dist/esm/api/types/SyncValueReceiptRequest.mjs +2 -0
  1942. package/dist/esm/api/types/UnifiedAmendmentIntent.d.mts +25 -0
  1943. package/dist/esm/api/types/UnifiedAmendmentIntent.mjs +2 -0
  1944. package/dist/esm/api/types/UnifiedAmendmentResponse.d.mts +19 -0
  1945. package/dist/esm/api/types/UnifiedAmendmentResponse.mjs +2 -0
  1946. package/dist/esm/api/types/UpdateContactRequest.d.mts +1 -0
  1947. package/dist/esm/api/types/UpdateCustomerRequest.d.mts +1 -1
  1948. package/dist/esm/api/types/UpdateLineTermIntent.d.mts +18 -0
  1949. package/dist/esm/api/types/UpdateLineTermIntent.mjs +11 -0
  1950. package/dist/esm/api/types/UpdateOrderTermIntent.d.mts +18 -0
  1951. package/dist/esm/api/types/UpdateOrderTermIntent.mjs +11 -0
  1952. package/dist/esm/api/types/UpdatePlanRequest.d.mts +18 -0
  1953. package/dist/esm/api/types/UpdatePlanRequest.mjs +9 -0
  1954. package/dist/esm/api/types/UpdatePricingIntent.d.mts +22 -0
  1955. package/dist/esm/api/types/UpdatePricingIntent.mjs +11 -0
  1956. package/dist/esm/api/types/UpdateProductRequest.d.mts +2 -0
  1957. package/dist/esm/api/types/UpdateQuantityIntent.d.mts +18 -0
  1958. package/dist/esm/api/types/UpdateQuantityIntent.mjs +11 -0
  1959. package/dist/esm/api/types/UsageAttributionAxisOptions.d.mts +23 -0
  1960. package/dist/esm/api/types/UsageAttributionAxisOptions.mjs +2 -0
  1961. package/dist/esm/api/types/UsageAttributionAxisValue.d.mts +6 -0
  1962. package/dist/esm/api/types/UsageAttributionAxisValue.mjs +6 -0
  1963. package/dist/esm/api/types/UsageBracketedPrepaidCreditsInput.d.mts +61 -0
  1964. package/dist/esm/api/types/UsageBracketedPrepaidCreditsInput.mjs +26 -0
  1965. package/dist/esm/api/types/UsageCostPlusInput.d.mts +8 -0
  1966. package/dist/esm/api/types/UsageCostPlusInput.mjs +5 -0
  1967. package/dist/esm/api/types/UsageGraduatedInput.d.mts +8 -0
  1968. package/dist/esm/api/types/UsageGraduatedInput.mjs +5 -0
  1969. package/dist/esm/api/types/UsagePerUnitInput.d.mts +8 -0
  1970. package/dist/esm/api/types/UsagePerUnitInput.mjs +5 -0
  1971. package/dist/esm/api/types/UsagePrepaidCreditsInput.d.mts +24 -0
  1972. package/dist/esm/api/types/UsagePrepaidCreditsInput.mjs +11 -0
  1973. package/dist/esm/api/types/UsageVolumeInput.d.mts +8 -0
  1974. package/dist/esm/api/types/UsageVolumeInput.mjs +5 -0
  1975. package/dist/esm/api/types/ValidateCustomViewRequest.d.mts +55 -0
  1976. package/dist/esm/api/types/ValidateCustomViewRequest.mjs +23 -0
  1977. package/dist/esm/api/types/ValidateCustomViewResponse.d.mts +7 -0
  1978. package/dist/esm/api/types/ValidateCustomViewResponse.mjs +2 -0
  1979. package/dist/esm/api/types/ValueMetricDetail.d.mts +47 -0
  1980. package/dist/esm/api/types/ValueMetricDetail.mjs +2 -0
  1981. package/dist/esm/api/types/ValueMetricFormula.d.mts +9 -0
  1982. package/dist/esm/api/types/ValueMetricFormula.mjs +2 -0
  1983. package/dist/esm/api/types/ValueMetricFormulaVariable.d.mts +31 -0
  1984. package/dist/esm/api/types/ValueMetricFormulaVariable.mjs +21 -0
  1985. package/dist/esm/api/types/ValueMetricListResponse.d.mts +5 -0
  1986. package/dist/esm/api/types/ValueMetricListResponse.mjs +2 -0
  1987. package/dist/esm/api/types/ValueMetricMonetaryConversion.d.mts +6 -0
  1988. package/dist/esm/api/types/ValueMetricMonetaryConversion.mjs +2 -0
  1989. package/dist/esm/api/types/ValueMetricSignalBinding.d.mts +14 -0
  1990. package/dist/esm/api/types/ValueMetricSignalBinding.mjs +2 -0
  1991. package/dist/esm/api/types/ValueMetricSummary.d.mts +30 -0
  1992. package/dist/esm/api/types/ValueMetricSummary.mjs +2 -0
  1993. package/dist/esm/api/types/ValueMetricUnit.d.mts +27 -0
  1994. package/dist/esm/api/types/ValueMetricUnit.mjs +17 -0
  1995. package/dist/esm/api/types/ValueMetricValidationResponse.d.mts +13 -0
  1996. package/dist/esm/api/types/ValueMetricValidationResponse.mjs +2 -0
  1997. package/dist/esm/api/types/ValueMetricVariableEdit.d.mts +26 -0
  1998. package/dist/esm/api/types/ValueMetricVariableEdit.mjs +16 -0
  1999. package/dist/esm/api/types/ValueMetricWriteAck.d.mts +6 -0
  2000. package/dist/esm/api/types/ValueMetricWriteAck.mjs +2 -0
  2001. package/dist/esm/api/types/ValueModelAuthoringGuide.d.mts +22 -0
  2002. package/dist/esm/api/types/ValueModelAuthoringGuide.mjs +2 -0
  2003. package/dist/esm/api/types/ValueModelContent.d.mts +359 -0
  2004. package/dist/esm/api/types/ValueModelContent.mjs +145 -0
  2005. package/dist/esm/api/types/ValueModelDetail.d.mts +12 -0
  2006. package/dist/esm/api/types/ValueModelDetail.mjs +2 -0
  2007. package/dist/esm/api/types/ValueModelSummary.d.mts +18 -0
  2008. package/dist/esm/api/types/ValueModelSummary.mjs +9 -0
  2009. package/dist/esm/api/types/ValueModelVersionListResponse.d.mts +5 -0
  2010. package/dist/esm/api/types/ValueModelVersionListResponse.mjs +2 -0
  2011. package/dist/esm/api/types/ValueReceiptDetail.d.mts +1 -0
  2012. package/dist/esm/api/types/ValueReceiptSummary.d.mts +1 -0
  2013. package/dist/esm/api/types/ValueReceiptSyncResponse.d.mts +2 -0
  2014. package/dist/esm/api/types/ViewCustomerUnitsResponse.d.mts +7 -0
  2015. package/dist/esm/api/types/ViewCustomerUnitsResponse.mjs +2 -0
  2016. package/dist/esm/api/types/ViewDataResponse.d.mts +6 -0
  2017. package/dist/esm/api/types/ViewDataResponse.mjs +2 -0
  2018. package/dist/esm/api/types/Webhook.d.mts +2 -1
  2019. package/dist/esm/api/types/Webhook.mjs +2 -1
  2020. package/dist/esm/api/types/WebhookListResponse.d.mts +2 -0
  2021. package/dist/esm/api/types/WebhookUpdateResponse.d.mts +27 -0
  2022. package/dist/esm/api/types/WebhookUpdateResponse.mjs +16 -0
  2023. package/dist/esm/api/types/WritableOrderLineType.d.mts +6 -0
  2024. package/dist/esm/api/types/WritableOrderLineType.mjs +6 -0
  2025. package/dist/esm/api/types/WritableProvisionOrderLineType.d.mts +6 -0
  2026. package/dist/esm/api/types/WritableProvisionOrderLineType.mjs +6 -0
  2027. package/dist/esm/api/types/index.d.mts +258 -1
  2028. package/dist/esm/api/types/index.mjs +258 -1
  2029. package/dist/esm/version.d.mts +1 -1
  2030. package/dist/esm/version.mjs +1 -1
  2031. package/package.json +1 -1
  2032. package/reference.md +7975 -382
  2033. /package/dist/cjs/api/resources/{valueReceipts/client/requests/SyncValueReceiptRequest.js → amendments/client/requests/GetOrderAmendmentOptionsRequest.js} +0 -0
  2034. /package/dist/cjs/api/{types/CustomerBillingAddress.js → resources/analytics/client/requests/GetSignalsMetadataRequest.js} +0 -0
  2035. /package/dist/esm/api/resources/{valueReceipts/client/requests/SyncValueReceiptRequest.mjs → amendments/client/requests/GetOrderAmendmentOptionsRequest.mjs} +0 -0
  2036. /package/dist/esm/api/{types/CustomerBillingAddress.mjs → resources/analytics/client/requests/GetSignalsMetadataRequest.mjs} +0 -0
@@ -47,7 +47,7 @@ export class Customers {
47
47
  __listCustomers() {
48
48
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
49
49
  var _a, _b, _c, _d, _e, _f, _g, _h;
50
- const { limit, offset } = request;
50
+ const { limit, offset, name, status, creationState, createdAtFrom, createdAtTo, externalId } = request;
51
51
  const _queryParams = {};
52
52
  if (limit != null) {
53
53
  _queryParams.limit = limit.toString();
@@ -55,6 +55,24 @@ export class Customers {
55
55
  if (offset != null) {
56
56
  _queryParams.offset = offset.toString();
57
57
  }
58
+ if (name != null) {
59
+ _queryParams.name = name;
60
+ }
61
+ if (status != null) {
62
+ _queryParams.status = status;
63
+ }
64
+ if (creationState != null) {
65
+ _queryParams.creationState = creationState;
66
+ }
67
+ if (createdAtFrom != null) {
68
+ _queryParams.createdAtFrom = createdAtFrom;
69
+ }
70
+ if (createdAtTo != null) {
71
+ _queryParams.createdAtTo = createdAtTo;
72
+ }
73
+ if (externalId != null) {
74
+ _queryParams.externalId = externalId;
75
+ }
58
76
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
59
77
  const _response = yield core.fetcher({
60
78
  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, "customers/"),
@@ -102,13 +120,14 @@ export class Customers {
102
120
  });
103
121
  }
104
122
  /**
105
- * Creates a new customer for the organization
123
+ * Creates a new customer for the organization. `externalId` shares one set of ids with customer unit ids and aliases, unique across the organization and ignoring letter case: an external id that another customer already holds as a unit id or alias, or as its external id in another case, is refused with `409 EXTERNAL_ID_IN_USE`. The same id in the same case is `400 DUPLICATE_EXTERNAL_ID`, as before.
106
124
  *
107
125
  * @param {Paid.CreateCustomerRequest} request
108
126
  * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
109
127
  *
110
128
  * @throws {@link Paid.BadRequestError}
111
129
  * @throws {@link Paid.ForbiddenError}
130
+ * @throws {@link Paid.ConflictError}
112
131
  * @throws {@link Paid.InternalServerError}
113
132
  *
114
133
  * @example
@@ -144,6 +163,8 @@ export class Customers {
144
163
  throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
145
164
  case 403:
146
165
  throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
166
+ case 409:
167
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
147
168
  case 500:
148
169
  throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
149
170
  default:
@@ -172,33 +193,41 @@ export class Customers {
172
193
  });
173
194
  }
174
195
  /**
175
- * Get a customer by ID
196
+ * List alternate external identifiers that resolve to a customer by Paid display ID.
176
197
  *
177
- * @param {Paid.GetCustomerByIdRequest} request
198
+ * @param {Paid.ListCustomerAliasesRequest} request
178
199
  * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
179
200
  *
201
+ * @throws {@link Paid.BadRequestError}
180
202
  * @throws {@link Paid.ForbiddenError}
181
203
  * @throws {@link Paid.NotFoundError}
182
204
  * @throws {@link Paid.InternalServerError}
183
205
  *
184
206
  * @example
185
- * await client.customers.getCustomerById({
186
- * id: "id"
207
+ * await client.customers.listCustomerAliases({
208
+ * id: "cus_abc123"
187
209
  * })
188
210
  */
189
- getCustomerById(request, requestOptions) {
190
- return core.HttpResponsePromise.fromPromise(this.__getCustomerById(request, requestOptions));
211
+ listCustomerAliases(request, requestOptions) {
212
+ return core.HttpResponsePromise.fromPromise(this.__listCustomerAliases(request, requestOptions));
191
213
  }
192
- __getCustomerById(request, requestOptions) {
214
+ __listCustomerAliases(request, requestOptions) {
193
215
  return __awaiter(this, void 0, void 0, function* () {
194
216
  var _a, _b, _c, _d, _e, _f, _g, _h;
195
- const { id } = request;
217
+ const { id, limit, offset } = request;
218
+ const _queryParams = {};
219
+ if (limit != null) {
220
+ _queryParams.limit = limit.toString();
221
+ }
222
+ if (offset != null) {
223
+ _queryParams.offset = offset.toString();
224
+ }
196
225
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
197
226
  const _response = yield core.fetcher({
198
- 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, `customers/${core.url.encodePathParam(id)}`),
227
+ 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, `customers/${core.url.encodePathParam(id)}/aliases`),
199
228
  method: "GET",
200
229
  headers: _headers,
201
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
230
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
202
231
  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,
203
232
  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,
204
233
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -208,6 +237,8 @@ export class Customers {
208
237
  }
209
238
  if (_response.error.reason === "status-code") {
210
239
  switch (_response.error.statusCode) {
240
+ case 400:
241
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
211
242
  case 403:
212
243
  throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
213
244
  case 404:
@@ -230,7 +261,7 @@ export class Customers {
230
261
  rawResponse: _response.rawResponse,
231
262
  });
232
263
  case "timeout":
233
- throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}.");
264
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/aliases.");
234
265
  case "unknown":
235
266
  throw new errors.PaidError({
236
267
  message: _response.error.errorMessage,
@@ -240,33 +271,36 @@ export class Customers {
240
271
  });
241
272
  }
242
273
  /**
243
- * Update a customer by ID
274
+ * Create an alternate external identifier for a customer by Paid display ID. The alias shares one set of ids with customer external ids and unit ids, unique within the organization and ignoring letter case: an alias that another customer already holds as its external id, a unit id or an alias is refused with `409 EXTERNAL_ID_IN_USE` (an exact match keeps its older code, `ALIAS_CONFLICTS_WITH_CUSTOMER_EXTERNAL_ID` or `CUSTOMER_ALIAS_ALREADY_EXISTS`).
244
275
  *
245
- * @param {Paid.UpdateCustomerByIdRequest} request
276
+ * @param {Paid.CreateCustomerAliasRequest} request
246
277
  * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
247
278
  *
248
279
  * @throws {@link Paid.BadRequestError}
249
280
  * @throws {@link Paid.ForbiddenError}
250
281
  * @throws {@link Paid.NotFoundError}
282
+ * @throws {@link Paid.ConflictError}
251
283
  * @throws {@link Paid.InternalServerError}
252
284
  *
253
285
  * @example
254
- * await client.customers.updateCustomerById({
255
- * id: "id",
256
- * body: {}
286
+ * await client.customers.createCustomerAlias({
287
+ * id: "cus_abc123",
288
+ * body: {
289
+ * alias: "child-customer-1"
290
+ * }
257
291
  * })
258
292
  */
259
- updateCustomerById(request, requestOptions) {
260
- return core.HttpResponsePromise.fromPromise(this.__updateCustomerById(request, requestOptions));
293
+ createCustomerAlias(request, requestOptions) {
294
+ return core.HttpResponsePromise.fromPromise(this.__createCustomerAlias(request, requestOptions));
261
295
  }
262
- __updateCustomerById(request, requestOptions) {
296
+ __createCustomerAlias(request, requestOptions) {
263
297
  return __awaiter(this, void 0, void 0, function* () {
264
298
  var _a, _b, _c, _d, _e, _f, _g, _h;
265
299
  const { id, body: _body } = request;
266
300
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
267
301
  const _response = yield core.fetcher({
268
- 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, `customers/${core.url.encodePathParam(id)}`),
269
- method: "PUT",
302
+ 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, `customers/${core.url.encodePathParam(id)}/aliases`),
303
+ method: "POST",
270
304
  headers: _headers,
271
305
  contentType: "application/json",
272
306
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
@@ -287,6 +321,8 @@ export class Customers {
287
321
  throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
288
322
  case 404:
289
323
  throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
324
+ case 409:
325
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
290
326
  case 500:
291
327
  throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
292
328
  default:
@@ -305,7 +341,7 @@ export class Customers {
305
341
  rawResponse: _response.rawResponse,
306
342
  });
307
343
  case "timeout":
308
- throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /customers/{id}.");
344
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/{id}/aliases.");
309
345
  case "unknown":
310
346
  throw new errors.PaidError({
311
347
  message: _response.error.errorMessage,
@@ -315,31 +351,31 @@ export class Customers {
315
351
  });
316
352
  }
317
353
  /**
318
- * Delete a customer by ID
354
+ * Remove an alternate external identifier from a customer by Paid display ID.
319
355
  *
320
- * @param {Paid.DeleteCustomerByIdRequest} request
356
+ * @param {Paid.DeleteCustomerAliasRequest} request
321
357
  * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
322
358
  *
323
- * @throws {@link Paid.BadRequestError}
324
359
  * @throws {@link Paid.ForbiddenError}
325
360
  * @throws {@link Paid.NotFoundError}
326
361
  * @throws {@link Paid.InternalServerError}
327
362
  *
328
363
  * @example
329
- * await client.customers.deleteCustomerById({
330
- * id: "id"
364
+ * await client.customers.deleteCustomerAlias({
365
+ * id: "cus_abc123",
366
+ * alias: "child-customer-1"
331
367
  * })
332
368
  */
333
- deleteCustomerById(request, requestOptions) {
334
- return core.HttpResponsePromise.fromPromise(this.__deleteCustomerById(request, requestOptions));
369
+ deleteCustomerAlias(request, requestOptions) {
370
+ return core.HttpResponsePromise.fromPromise(this.__deleteCustomerAlias(request, requestOptions));
335
371
  }
336
- __deleteCustomerById(request, requestOptions) {
372
+ __deleteCustomerAlias(request, requestOptions) {
337
373
  return __awaiter(this, void 0, void 0, function* () {
338
374
  var _a, _b, _c, _d, _e, _f, _g, _h;
339
- const { id } = request;
375
+ const { id, alias } = request;
340
376
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
341
377
  const _response = yield core.fetcher({
342
- 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, `customers/${core.url.encodePathParam(id)}`),
378
+ 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, `customers/${core.url.encodePathParam(id)}/aliases/${core.url.encodePathParam(alias)}`),
343
379
  method: "DELETE",
344
380
  headers: _headers,
345
381
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
@@ -352,8 +388,6 @@ export class Customers {
352
388
  }
353
389
  if (_response.error.reason === "status-code") {
354
390
  switch (_response.error.statusCode) {
355
- case 400:
356
- throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
357
391
  case 403:
358
392
  throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
359
393
  case 404:
@@ -376,7 +410,7 @@ export class Customers {
376
410
  rawResponse: _response.rawResponse,
377
411
  });
378
412
  case "timeout":
379
- throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/{id}.");
413
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/{id}/aliases/{alias}.");
380
414
  case "unknown":
381
415
  throw new errors.PaidError({
382
416
  message: _response.error.errorMessage,
@@ -386,9 +420,9 @@ export class Customers {
386
420
  });
387
421
  }
388
422
  /**
389
- * Get a customer by external ID
423
+ * Get a customer by Paid display ID. Use the value returned as `customer.id`, for example `cus_abc123`. If you have your own customer ID, use `GET /api/v2/customers/external/{externalId}`.
390
424
  *
391
- * @param {Paid.GetCustomerByExternalIdRequest} request
425
+ * @param {Paid.GetCustomerByIdRequest} request
392
426
  * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
393
427
  *
394
428
  * @throws {@link Paid.ForbiddenError}
@@ -396,20 +430,20 @@ export class Customers {
396
430
  * @throws {@link Paid.InternalServerError}
397
431
  *
398
432
  * @example
399
- * await client.customers.getCustomerByExternalId({
400
- * externalId: "externalId"
433
+ * await client.customers.getCustomerById({
434
+ * id: "cus_abc123"
401
435
  * })
402
436
  */
403
- getCustomerByExternalId(request, requestOptions) {
404
- return core.HttpResponsePromise.fromPromise(this.__getCustomerByExternalId(request, requestOptions));
437
+ getCustomerById(request, requestOptions) {
438
+ return core.HttpResponsePromise.fromPromise(this.__getCustomerById(request, requestOptions));
405
439
  }
406
- __getCustomerByExternalId(request, requestOptions) {
440
+ __getCustomerById(request, requestOptions) {
407
441
  return __awaiter(this, void 0, void 0, function* () {
408
442
  var _a, _b, _c, _d, _e, _f, _g, _h;
409
- const { externalId } = request;
443
+ const { id } = request;
410
444
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
411
445
  const _response = yield core.fetcher({
412
- 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, `customers/external/${core.url.encodePathParam(externalId)}`),
446
+ 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, `customers/${core.url.encodePathParam(id)}`),
413
447
  method: "GET",
414
448
  headers: _headers,
415
449
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
@@ -444,7 +478,7 @@ export class Customers {
444
478
  rawResponse: _response.rawResponse,
445
479
  });
446
480
  case "timeout":
447
- throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}.");
481
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}.");
448
482
  case "unknown":
449
483
  throw new errors.PaidError({
450
484
  message: _response.error.errorMessage,
@@ -454,32 +488,33 @@ export class Customers {
454
488
  });
455
489
  }
456
490
  /**
457
- * Update a customer by external ID
491
+ * Update a customer by Paid display ID. Use the value returned as `customer.id`, for example `cus_abc123`. If you have your own customer ID, use `PUT /api/v2/customers/external/{externalId}`. Changing `externalId` follows the organization-wide id rule: a new id that another customer already holds as its external id, a unit id or an alias, ignoring letter case, is refused with `409 EXTERNAL_ID_IN_USE`; the same id in the same case stays `400 DUPLICATE_EXTERNAL_ID`. When the id changes, the previous id is kept as an alias of the customer, so signals that still use it keep resolving to it.
458
492
  *
459
- * @param {Paid.UpdateCustomerByExternalIdRequest} request
493
+ * @param {Paid.UpdateCustomerByIdRequest} request
460
494
  * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
461
495
  *
462
496
  * @throws {@link Paid.BadRequestError}
463
497
  * @throws {@link Paid.ForbiddenError}
464
498
  * @throws {@link Paid.NotFoundError}
499
+ * @throws {@link Paid.ConflictError}
465
500
  * @throws {@link Paid.InternalServerError}
466
501
  *
467
502
  * @example
468
- * await client.customers.updateCustomerByExternalId({
469
- * externalId: "externalId",
503
+ * await client.customers.updateCustomerById({
504
+ * id: "cus_abc123",
470
505
  * body: {}
471
506
  * })
472
507
  */
473
- updateCustomerByExternalId(request, requestOptions) {
474
- return core.HttpResponsePromise.fromPromise(this.__updateCustomerByExternalId(request, requestOptions));
508
+ updateCustomerById(request, requestOptions) {
509
+ return core.HttpResponsePromise.fromPromise(this.__updateCustomerById(request, requestOptions));
475
510
  }
476
- __updateCustomerByExternalId(request, requestOptions) {
511
+ __updateCustomerById(request, requestOptions) {
477
512
  return __awaiter(this, void 0, void 0, function* () {
478
513
  var _a, _b, _c, _d, _e, _f, _g, _h;
479
- const { externalId, body: _body } = request;
514
+ const { id, body: _body } = request;
480
515
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
481
516
  const _response = yield core.fetcher({
482
- 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, `customers/external/${core.url.encodePathParam(externalId)}`),
517
+ 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, `customers/${core.url.encodePathParam(id)}`),
483
518
  method: "PUT",
484
519
  headers: _headers,
485
520
  contentType: "application/json",
@@ -501,6 +536,8 @@ export class Customers {
501
536
  throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
502
537
  case 404:
503
538
  throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
539
+ case 409:
540
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
504
541
  case 500:
505
542
  throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
506
543
  default:
@@ -519,7 +556,7 @@ export class Customers {
519
556
  rawResponse: _response.rawResponse,
520
557
  });
521
558
  case "timeout":
522
- throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /customers/external/{externalId}.");
559
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /customers/{id}.");
523
560
  case "unknown":
524
561
  throw new errors.PaidError({
525
562
  message: _response.error.errorMessage,
@@ -529,31 +566,32 @@ export class Customers {
529
566
  });
530
567
  }
531
568
  /**
532
- * Delete a customer by external ID
569
+ * Delete a customer by Paid display ID. Use the value returned as `customer.id`, for example `cus_abc123`. If you have your own customer ID, use `DELETE /api/v2/customers/external/{externalId}`. A customer that still has orders, invoices, payments, contacts, child customers or other linked records is not deleted: the request returns 409 `CUSTOMER_HAS_ASSOCIATIONS` and `details` lists what is linked.
533
570
  *
534
- * @param {Paid.DeleteCustomerByExternalIdRequest} request
571
+ * @param {Paid.DeleteCustomerByIdRequest} request
535
572
  * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
536
573
  *
537
574
  * @throws {@link Paid.BadRequestError}
538
575
  * @throws {@link Paid.ForbiddenError}
539
576
  * @throws {@link Paid.NotFoundError}
577
+ * @throws {@link Paid.ConflictError}
540
578
  * @throws {@link Paid.InternalServerError}
541
579
  *
542
580
  * @example
543
- * await client.customers.deleteCustomerByExternalId({
544
- * externalId: "externalId"
581
+ * await client.customers.deleteCustomerById({
582
+ * id: "cus_abc123"
545
583
  * })
546
584
  */
547
- deleteCustomerByExternalId(request, requestOptions) {
548
- return core.HttpResponsePromise.fromPromise(this.__deleteCustomerByExternalId(request, requestOptions));
585
+ deleteCustomerById(request, requestOptions) {
586
+ return core.HttpResponsePromise.fromPromise(this.__deleteCustomerById(request, requestOptions));
549
587
  }
550
- __deleteCustomerByExternalId(request, requestOptions) {
588
+ __deleteCustomerById(request, requestOptions) {
551
589
  return __awaiter(this, void 0, void 0, function* () {
552
590
  var _a, _b, _c, _d, _e, _f, _g, _h;
553
- const { externalId } = request;
591
+ const { id } = request;
554
592
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
555
593
  const _response = yield core.fetcher({
556
- 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, `customers/external/${core.url.encodePathParam(externalId)}`),
594
+ 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, `customers/${core.url.encodePathParam(id)}`),
557
595
  method: "DELETE",
558
596
  headers: _headers,
559
597
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
@@ -572,6 +610,8 @@ export class Customers {
572
610
  throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
573
611
  case 404:
574
612
  throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
613
+ case 409:
614
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
575
615
  case 500:
576
616
  throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
577
617
  default:
@@ -590,7 +630,7 @@ export class Customers {
590
630
  rawResponse: _response.rawResponse,
591
631
  });
592
632
  case "timeout":
593
- throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/external/{externalId}.");
633
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/{id}.");
594
634
  case "unknown":
595
635
  throw new errors.PaidError({
596
636
  message: _response.error.errorMessage,
@@ -600,9 +640,9 @@ export class Customers {
600
640
  });
601
641
  }
602
642
  /**
603
- * Get current customer credit balances grouped by currency
643
+ * Get the current customer state by Paid display ID
604
644
  *
605
- * @param {Paid.GetCustomerCreditBalancesRequest} request
645
+ * @param {Paid.GetCustomerStateByIdRequest} request
606
646
  * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
607
647
  *
608
648
  * @throws {@link Paid.ForbiddenError}
@@ -610,20 +650,20 @@ export class Customers {
610
650
  * @throws {@link Paid.InternalServerError}
611
651
  *
612
652
  * @example
613
- * await client.customers.getCustomerCreditBalances({
614
- * id: "id"
653
+ * await client.customers.getCustomerStateById({
654
+ * id: "cus_abc123"
615
655
  * })
616
656
  */
617
- getCustomerCreditBalances(request, requestOptions) {
618
- return core.HttpResponsePromise.fromPromise(this.__getCustomerCreditBalances(request, requestOptions));
657
+ getCustomerStateById(request, requestOptions) {
658
+ return core.HttpResponsePromise.fromPromise(this.__getCustomerStateById(request, requestOptions));
619
659
  }
620
- __getCustomerCreditBalances(request, requestOptions) {
660
+ __getCustomerStateById(request, requestOptions) {
621
661
  return __awaiter(this, void 0, void 0, function* () {
622
662
  var _a, _b, _c, _d, _e, _f, _g, _h;
623
663
  const { id } = request;
624
664
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
625
665
  const _response = yield core.fetcher({
626
- 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, `customers/${core.url.encodePathParam(id)}/credits/balances`),
666
+ 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, `customers/${core.url.encodePathParam(id)}/state`),
627
667
  method: "GET",
628
668
  headers: _headers,
629
669
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
@@ -658,7 +698,7 @@ export class Customers {
658
698
  rawResponse: _response.rawResponse,
659
699
  });
660
700
  case "timeout":
661
- throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/credits/balances.");
701
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/state.");
662
702
  case "unknown":
663
703
  throw new errors.PaidError({
664
704
  message: _response.error.errorMessage,
@@ -668,33 +708,41 @@ export class Customers {
668
708
  });
669
709
  }
670
710
  /**
671
- * Get current customer credit balances grouped by currency, looked up by external ID
711
+ * List alternate external identifiers that resolve to a customer by external ID.
672
712
  *
673
- * @param {Paid.GetCustomerCreditBalancesByExternalIdRequest} request
713
+ * @param {Paid.ListCustomerAliasesByExternalIdRequest} request
674
714
  * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
675
715
  *
716
+ * @throws {@link Paid.BadRequestError}
676
717
  * @throws {@link Paid.ForbiddenError}
677
718
  * @throws {@link Paid.NotFoundError}
678
719
  * @throws {@link Paid.InternalServerError}
679
720
  *
680
721
  * @example
681
- * await client.customers.getCustomerCreditBalancesByExternalId({
682
- * externalId: "externalId"
722
+ * await client.customers.listCustomerAliasesByExternalId({
723
+ * externalId: "customer_123"
683
724
  * })
684
725
  */
685
- getCustomerCreditBalancesByExternalId(request, requestOptions) {
686
- return core.HttpResponsePromise.fromPromise(this.__getCustomerCreditBalancesByExternalId(request, requestOptions));
726
+ listCustomerAliasesByExternalId(request, requestOptions) {
727
+ return core.HttpResponsePromise.fromPromise(this.__listCustomerAliasesByExternalId(request, requestOptions));
687
728
  }
688
- __getCustomerCreditBalancesByExternalId(request, requestOptions) {
729
+ __listCustomerAliasesByExternalId(request, requestOptions) {
689
730
  return __awaiter(this, void 0, void 0, function* () {
690
731
  var _a, _b, _c, _d, _e, _f, _g, _h;
691
- const { externalId } = request;
732
+ const { externalId, limit, offset } = request;
733
+ const _queryParams = {};
734
+ if (limit != null) {
735
+ _queryParams.limit = limit.toString();
736
+ }
737
+ if (offset != null) {
738
+ _queryParams.offset = offset.toString();
739
+ }
692
740
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
693
741
  const _response = yield core.fetcher({
694
- 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, `customers/external/${core.url.encodePathParam(externalId)}/credits/balances`),
742
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/aliases`),
695
743
  method: "GET",
696
744
  headers: _headers,
697
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
745
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
698
746
  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,
699
747
  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,
700
748
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -704,6 +752,8 @@ export class Customers {
704
752
  }
705
753
  if (_response.error.reason === "status-code") {
706
754
  switch (_response.error.statusCode) {
755
+ case 400:
756
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
707
757
  case 403:
708
758
  throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
709
759
  case 404:
@@ -726,7 +776,7 @@ export class Customers {
726
776
  rawResponse: _response.rawResponse,
727
777
  });
728
778
  case "timeout":
729
- throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/credits/balances.");
779
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/aliases.");
730
780
  case "unknown":
731
781
  throw new errors.PaidError({
732
782
  message: _response.error.errorMessage,
@@ -736,33 +786,36 @@ export class Customers {
736
786
  });
737
787
  }
738
788
  /**
739
- * Create or update a customer user using customer and user external IDs
789
+ * Create an alternate external identifier for a customer by external ID. The alias shares one set of ids with customer external ids and unit ids, unique within the organization and ignoring letter case: an alias that another customer already holds as its external id, a unit id or an alias is refused with `409 EXTERNAL_ID_IN_USE` (an exact match keeps its older code, `ALIAS_CONFLICTS_WITH_CUSTOMER_EXTERNAL_ID` or `CUSTOMER_ALIAS_ALREADY_EXISTS`).
740
790
  *
741
- * @param {Paid.UpsertCustomerUserRequest} request
791
+ * @param {Paid.CreateCustomerAliasByExternalIdRequest} request
742
792
  * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
743
793
  *
744
794
  * @throws {@link Paid.BadRequestError}
745
795
  * @throws {@link Paid.ForbiddenError}
746
796
  * @throws {@link Paid.NotFoundError}
797
+ * @throws {@link Paid.ConflictError}
747
798
  * @throws {@link Paid.InternalServerError}
748
799
  *
749
800
  * @example
750
- * await client.customers.upsertCustomerUserByExternalId({
751
- * customerExternalId: "customerExternalId",
752
- * userExternalId: "userExternalId"
801
+ * await client.customers.createCustomerAliasByExternalId({
802
+ * externalId: "customer_123",
803
+ * body: {
804
+ * alias: "child-customer-1"
805
+ * }
753
806
  * })
754
807
  */
755
- upsertCustomerUserByExternalId(request, requestOptions) {
756
- return core.HttpResponsePromise.fromPromise(this.__upsertCustomerUserByExternalId(request, requestOptions));
808
+ createCustomerAliasByExternalId(request, requestOptions) {
809
+ return core.HttpResponsePromise.fromPromise(this.__createCustomerAliasByExternalId(request, requestOptions));
757
810
  }
758
- __upsertCustomerUserByExternalId(request, requestOptions) {
811
+ __createCustomerAliasByExternalId(request, requestOptions) {
759
812
  return __awaiter(this, void 0, void 0, function* () {
760
813
  var _a, _b, _c, _d, _e, _f, _g, _h;
761
- const { customerExternalId, userExternalId } = request, _body = __rest(request, ["customerExternalId", "userExternalId"]);
814
+ const { externalId, body: _body } = request;
762
815
  const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
763
816
  const _response = yield core.fetcher({
764
- 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, `customers/${core.url.encodePathParam(customerExternalId)}/users/${core.url.encodePathParam(userExternalId)}`),
765
- method: "PUT",
817
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/aliases`),
818
+ method: "POST",
766
819
  headers: _headers,
767
820
  contentType: "application/json",
768
821
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
@@ -783,6 +836,8 @@ export class Customers {
783
836
  throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
784
837
  case 404:
785
838
  throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
839
+ case 409:
840
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
786
841
  case 500:
787
842
  throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
788
843
  default:
@@ -801,7 +856,3957 @@ export class Customers {
801
856
  rawResponse: _response.rawResponse,
802
857
  });
803
858
  case "timeout":
804
- throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /customers/{customerExternalId}/users/{userExternalId}.");
859
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/external/{externalId}/aliases.");
860
+ case "unknown":
861
+ throw new errors.PaidError({
862
+ message: _response.error.errorMessage,
863
+ rawResponse: _response.rawResponse,
864
+ });
865
+ }
866
+ });
867
+ }
868
+ /**
869
+ * Remove an alternate external identifier from a customer by external ID.
870
+ *
871
+ * @param {Paid.DeleteCustomerAliasByExternalIdRequest} request
872
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
873
+ *
874
+ * @throws {@link Paid.ForbiddenError}
875
+ * @throws {@link Paid.NotFoundError}
876
+ * @throws {@link Paid.InternalServerError}
877
+ *
878
+ * @example
879
+ * await client.customers.deleteCustomerAliasByExternalId({
880
+ * externalId: "customer_123",
881
+ * alias: "child-customer-1"
882
+ * })
883
+ */
884
+ deleteCustomerAliasByExternalId(request, requestOptions) {
885
+ return core.HttpResponsePromise.fromPromise(this.__deleteCustomerAliasByExternalId(request, requestOptions));
886
+ }
887
+ __deleteCustomerAliasByExternalId(request, requestOptions) {
888
+ return __awaiter(this, void 0, void 0, function* () {
889
+ var _a, _b, _c, _d, _e, _f, _g, _h;
890
+ const { externalId, alias } = request;
891
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
892
+ const _response = yield core.fetcher({
893
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/aliases/${core.url.encodePathParam(alias)}`),
894
+ method: "DELETE",
895
+ headers: _headers,
896
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
897
+ 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,
898
+ 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,
899
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
900
+ });
901
+ if (_response.ok) {
902
+ return { data: _response.body, rawResponse: _response.rawResponse };
903
+ }
904
+ if (_response.error.reason === "status-code") {
905
+ switch (_response.error.statusCode) {
906
+ case 403:
907
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
908
+ case 404:
909
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
910
+ case 500:
911
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
912
+ default:
913
+ throw new errors.PaidError({
914
+ statusCode: _response.error.statusCode,
915
+ body: _response.error.body,
916
+ rawResponse: _response.rawResponse,
917
+ });
918
+ }
919
+ }
920
+ switch (_response.error.reason) {
921
+ case "non-json":
922
+ throw new errors.PaidError({
923
+ statusCode: _response.error.statusCode,
924
+ body: _response.error.rawBody,
925
+ rawResponse: _response.rawResponse,
926
+ });
927
+ case "timeout":
928
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/external/{externalId}/aliases/{alias}.");
929
+ case "unknown":
930
+ throw new errors.PaidError({
931
+ message: _response.error.errorMessage,
932
+ rawResponse: _response.rawResponse,
933
+ });
934
+ }
935
+ });
936
+ }
937
+ /**
938
+ * Get a customer by external ID
939
+ *
940
+ * @param {Paid.GetCustomerByExternalIdRequest} request
941
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
942
+ *
943
+ * @throws {@link Paid.ForbiddenError}
944
+ * @throws {@link Paid.NotFoundError}
945
+ * @throws {@link Paid.InternalServerError}
946
+ *
947
+ * @example
948
+ * await client.customers.getCustomerByExternalId({
949
+ * externalId: "customer_123"
950
+ * })
951
+ */
952
+ getCustomerByExternalId(request, requestOptions) {
953
+ return core.HttpResponsePromise.fromPromise(this.__getCustomerByExternalId(request, requestOptions));
954
+ }
955
+ __getCustomerByExternalId(request, requestOptions) {
956
+ return __awaiter(this, void 0, void 0, function* () {
957
+ var _a, _b, _c, _d, _e, _f, _g, _h;
958
+ const { externalId } = request;
959
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
960
+ const _response = yield core.fetcher({
961
+ 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, `customers/external/${core.url.encodePathParam(externalId)}`),
962
+ method: "GET",
963
+ headers: _headers,
964
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
965
+ 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,
966
+ 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,
967
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
968
+ });
969
+ if (_response.ok) {
970
+ return { data: _response.body, rawResponse: _response.rawResponse };
971
+ }
972
+ if (_response.error.reason === "status-code") {
973
+ switch (_response.error.statusCode) {
974
+ case 403:
975
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
976
+ case 404:
977
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
978
+ case 500:
979
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
980
+ default:
981
+ throw new errors.PaidError({
982
+ statusCode: _response.error.statusCode,
983
+ body: _response.error.body,
984
+ rawResponse: _response.rawResponse,
985
+ });
986
+ }
987
+ }
988
+ switch (_response.error.reason) {
989
+ case "non-json":
990
+ throw new errors.PaidError({
991
+ statusCode: _response.error.statusCode,
992
+ body: _response.error.rawBody,
993
+ rawResponse: _response.rawResponse,
994
+ });
995
+ case "timeout":
996
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}.");
997
+ case "unknown":
998
+ throw new errors.PaidError({
999
+ message: _response.error.errorMessage,
1000
+ rawResponse: _response.rawResponse,
1001
+ });
1002
+ }
1003
+ });
1004
+ }
1005
+ /**
1006
+ * Update a customer by external ID. Changing `externalId` follows the organization-wide id rule: a new id that another customer already holds as its external id, a unit id or an alias, ignoring letter case, is refused with `409 EXTERNAL_ID_IN_USE`; the same id in the same case stays `400 DUPLICATE_EXTERNAL_ID`. When the id changes, the previous id is kept as an alias of the customer, so signals that still use it keep resolving to it.
1007
+ *
1008
+ * @param {Paid.UpdateCustomerByExternalIdRequest} request
1009
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
1010
+ *
1011
+ * @throws {@link Paid.BadRequestError}
1012
+ * @throws {@link Paid.ForbiddenError}
1013
+ * @throws {@link Paid.NotFoundError}
1014
+ * @throws {@link Paid.ConflictError}
1015
+ * @throws {@link Paid.InternalServerError}
1016
+ *
1017
+ * @example
1018
+ * await client.customers.updateCustomerByExternalId({
1019
+ * externalId: "customer_123",
1020
+ * body: {}
1021
+ * })
1022
+ */
1023
+ updateCustomerByExternalId(request, requestOptions) {
1024
+ return core.HttpResponsePromise.fromPromise(this.__updateCustomerByExternalId(request, requestOptions));
1025
+ }
1026
+ __updateCustomerByExternalId(request, requestOptions) {
1027
+ return __awaiter(this, void 0, void 0, function* () {
1028
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1029
+ const { externalId, body: _body } = request;
1030
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1031
+ const _response = yield core.fetcher({
1032
+ 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, `customers/external/${core.url.encodePathParam(externalId)}`),
1033
+ method: "PUT",
1034
+ headers: _headers,
1035
+ contentType: "application/json",
1036
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1037
+ requestType: "json",
1038
+ body: _body,
1039
+ 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,
1040
+ 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,
1041
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1042
+ });
1043
+ if (_response.ok) {
1044
+ return { data: _response.body, rawResponse: _response.rawResponse };
1045
+ }
1046
+ if (_response.error.reason === "status-code") {
1047
+ switch (_response.error.statusCode) {
1048
+ case 400:
1049
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
1050
+ case 403:
1051
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
1052
+ case 404:
1053
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
1054
+ case 409:
1055
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
1056
+ case 500:
1057
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
1058
+ default:
1059
+ throw new errors.PaidError({
1060
+ statusCode: _response.error.statusCode,
1061
+ body: _response.error.body,
1062
+ rawResponse: _response.rawResponse,
1063
+ });
1064
+ }
1065
+ }
1066
+ switch (_response.error.reason) {
1067
+ case "non-json":
1068
+ throw new errors.PaidError({
1069
+ statusCode: _response.error.statusCode,
1070
+ body: _response.error.rawBody,
1071
+ rawResponse: _response.rawResponse,
1072
+ });
1073
+ case "timeout":
1074
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /customers/external/{externalId}.");
1075
+ case "unknown":
1076
+ throw new errors.PaidError({
1077
+ message: _response.error.errorMessage,
1078
+ rawResponse: _response.rawResponse,
1079
+ });
1080
+ }
1081
+ });
1082
+ }
1083
+ /**
1084
+ * Delete a customer by external ID. A customer that still has orders, invoices, payments, contacts, child customers or other linked records is not deleted: the request returns 409 `CUSTOMER_HAS_ASSOCIATIONS` and `details` lists what is linked.
1085
+ *
1086
+ * @param {Paid.DeleteCustomerByExternalIdRequest} request
1087
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
1088
+ *
1089
+ * @throws {@link Paid.BadRequestError}
1090
+ * @throws {@link Paid.ForbiddenError}
1091
+ * @throws {@link Paid.NotFoundError}
1092
+ * @throws {@link Paid.ConflictError}
1093
+ * @throws {@link Paid.InternalServerError}
1094
+ *
1095
+ * @example
1096
+ * await client.customers.deleteCustomerByExternalId({
1097
+ * externalId: "customer_123"
1098
+ * })
1099
+ */
1100
+ deleteCustomerByExternalId(request, requestOptions) {
1101
+ return core.HttpResponsePromise.fromPromise(this.__deleteCustomerByExternalId(request, requestOptions));
1102
+ }
1103
+ __deleteCustomerByExternalId(request, requestOptions) {
1104
+ return __awaiter(this, void 0, void 0, function* () {
1105
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1106
+ const { externalId } = request;
1107
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1108
+ const _response = yield core.fetcher({
1109
+ 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, `customers/external/${core.url.encodePathParam(externalId)}`),
1110
+ method: "DELETE",
1111
+ headers: _headers,
1112
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1113
+ 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,
1114
+ 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,
1115
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1116
+ });
1117
+ if (_response.ok) {
1118
+ return { data: _response.body, rawResponse: _response.rawResponse };
1119
+ }
1120
+ if (_response.error.reason === "status-code") {
1121
+ switch (_response.error.statusCode) {
1122
+ case 400:
1123
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
1124
+ case 403:
1125
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
1126
+ case 404:
1127
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
1128
+ case 409:
1129
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
1130
+ case 500:
1131
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
1132
+ default:
1133
+ throw new errors.PaidError({
1134
+ statusCode: _response.error.statusCode,
1135
+ body: _response.error.body,
1136
+ rawResponse: _response.rawResponse,
1137
+ });
1138
+ }
1139
+ }
1140
+ switch (_response.error.reason) {
1141
+ case "non-json":
1142
+ throw new errors.PaidError({
1143
+ statusCode: _response.error.statusCode,
1144
+ body: _response.error.rawBody,
1145
+ rawResponse: _response.rawResponse,
1146
+ });
1147
+ case "timeout":
1148
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/external/{externalId}.");
1149
+ case "unknown":
1150
+ throw new errors.PaidError({
1151
+ message: _response.error.errorMessage,
1152
+ rawResponse: _response.rawResponse,
1153
+ });
1154
+ }
1155
+ });
1156
+ }
1157
+ /**
1158
+ * Primary integration endpoint for agents and programmatic clients using their own customer IDs. Use the value you stored on `customer.externalId`, for example `customer_123`.
1159
+ *
1160
+ * @param {Paid.GetCustomerStateByExternalIdRequest} request
1161
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
1162
+ *
1163
+ * @throws {@link Paid.ForbiddenError}
1164
+ * @throws {@link Paid.NotFoundError}
1165
+ * @throws {@link Paid.InternalServerError}
1166
+ *
1167
+ * @example
1168
+ * await client.customers.getCustomerStateByExternalId({
1169
+ * externalId: "customer_123"
1170
+ * })
1171
+ */
1172
+ getCustomerStateByExternalId(request, requestOptions) {
1173
+ return core.HttpResponsePromise.fromPromise(this.__getCustomerStateByExternalId(request, requestOptions));
1174
+ }
1175
+ __getCustomerStateByExternalId(request, requestOptions) {
1176
+ return __awaiter(this, void 0, void 0, function* () {
1177
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1178
+ const { externalId } = request;
1179
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1180
+ const _response = yield core.fetcher({
1181
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/state`),
1182
+ method: "GET",
1183
+ headers: _headers,
1184
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1185
+ 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,
1186
+ 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,
1187
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1188
+ });
1189
+ if (_response.ok) {
1190
+ return { data: _response.body, rawResponse: _response.rawResponse };
1191
+ }
1192
+ if (_response.error.reason === "status-code") {
1193
+ switch (_response.error.statusCode) {
1194
+ case 403:
1195
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
1196
+ case 404:
1197
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
1198
+ case 500:
1199
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
1200
+ default:
1201
+ throw new errors.PaidError({
1202
+ statusCode: _response.error.statusCode,
1203
+ body: _response.error.body,
1204
+ rawResponse: _response.rawResponse,
1205
+ });
1206
+ }
1207
+ }
1208
+ switch (_response.error.reason) {
1209
+ case "non-json":
1210
+ throw new errors.PaidError({
1211
+ statusCode: _response.error.statusCode,
1212
+ body: _response.error.rawBody,
1213
+ rawResponse: _response.rawResponse,
1214
+ });
1215
+ case "timeout":
1216
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/state.");
1217
+ case "unknown":
1218
+ throw new errors.PaidError({
1219
+ message: _response.error.errorMessage,
1220
+ rawResponse: _response.rawResponse,
1221
+ });
1222
+ }
1223
+ });
1224
+ }
1225
+ /**
1226
+ * Get current customer credit balances grouped by currency for a Paid customer display ID. Use the value returned as `customer.id`, for example `cus_abc123`. If you have your own customer ID, use `/api/v2/customers/external/{externalId}/credits/balances`.
1227
+ *
1228
+ * @param {Paid.GetCustomerCreditBalancesRequest} request
1229
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
1230
+ *
1231
+ * @throws {@link Paid.ForbiddenError}
1232
+ * @throws {@link Paid.NotFoundError}
1233
+ * @throws {@link Paid.InternalServerError}
1234
+ *
1235
+ * @example
1236
+ * await client.customers.getCustomerCreditBalances({
1237
+ * id: "cus_abc123"
1238
+ * })
1239
+ */
1240
+ getCustomerCreditBalances(request, requestOptions) {
1241
+ return core.HttpResponsePromise.fromPromise(this.__getCustomerCreditBalances(request, requestOptions));
1242
+ }
1243
+ __getCustomerCreditBalances(request, requestOptions) {
1244
+ return __awaiter(this, void 0, void 0, function* () {
1245
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1246
+ const { id } = request;
1247
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1248
+ const _response = yield core.fetcher({
1249
+ 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, `customers/${core.url.encodePathParam(id)}/credits/balances`),
1250
+ method: "GET",
1251
+ headers: _headers,
1252
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1253
+ 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,
1254
+ 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,
1255
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1256
+ });
1257
+ if (_response.ok) {
1258
+ return { data: _response.body, rawResponse: _response.rawResponse };
1259
+ }
1260
+ if (_response.error.reason === "status-code") {
1261
+ switch (_response.error.statusCode) {
1262
+ case 403:
1263
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
1264
+ case 404:
1265
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
1266
+ case 500:
1267
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
1268
+ default:
1269
+ throw new errors.PaidError({
1270
+ statusCode: _response.error.statusCode,
1271
+ body: _response.error.body,
1272
+ rawResponse: _response.rawResponse,
1273
+ });
1274
+ }
1275
+ }
1276
+ switch (_response.error.reason) {
1277
+ case "non-json":
1278
+ throw new errors.PaidError({
1279
+ statusCode: _response.error.statusCode,
1280
+ body: _response.error.rawBody,
1281
+ rawResponse: _response.rawResponse,
1282
+ });
1283
+ case "timeout":
1284
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/credits/balances.");
1285
+ case "unknown":
1286
+ throw new errors.PaidError({
1287
+ message: _response.error.errorMessage,
1288
+ rawResponse: _response.rawResponse,
1289
+ });
1290
+ }
1291
+ });
1292
+ }
1293
+ /**
1294
+ * Immediately grant credits to a customer using an active credit currency key.
1295
+ *
1296
+ * @param {Paid.GrantCustomerCreditsRequest} request
1297
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
1298
+ *
1299
+ * @throws {@link Paid.BadRequestError}
1300
+ * @throws {@link Paid.ForbiddenError}
1301
+ * @throws {@link Paid.NotFoundError}
1302
+ * @throws {@link Paid.ConflictError}
1303
+ * @throws {@link Paid.InternalServerError}
1304
+ *
1305
+ * @example
1306
+ * await client.customers.grantCustomerCredits({
1307
+ * id: "cus_abc123",
1308
+ * body: {
1309
+ * creditCurrencyKey: "api_credits",
1310
+ * amount: 10000,
1311
+ * startsAt: "2026-06-05T12:00:00Z",
1312
+ * expiresAt: "2026-12-31T23:59:59Z",
1313
+ * idempotencyKey: "grant_acme_2026-06-05"
1314
+ * }
1315
+ * })
1316
+ */
1317
+ grantCustomerCredits(request, requestOptions) {
1318
+ return core.HttpResponsePromise.fromPromise(this.__grantCustomerCredits(request, requestOptions));
1319
+ }
1320
+ __grantCustomerCredits(request, requestOptions) {
1321
+ return __awaiter(this, void 0, void 0, function* () {
1322
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1323
+ const { id, body: _body } = request;
1324
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1325
+ const _response = yield core.fetcher({
1326
+ 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, `customers/${core.url.encodePathParam(id)}/credits/grants`),
1327
+ method: "POST",
1328
+ headers: _headers,
1329
+ contentType: "application/json",
1330
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1331
+ requestType: "json",
1332
+ body: _body,
1333
+ 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,
1334
+ 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,
1335
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1336
+ });
1337
+ if (_response.ok) {
1338
+ return { data: _response.body, rawResponse: _response.rawResponse };
1339
+ }
1340
+ if (_response.error.reason === "status-code") {
1341
+ switch (_response.error.statusCode) {
1342
+ case 400:
1343
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
1344
+ case 403:
1345
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
1346
+ case 404:
1347
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
1348
+ case 409:
1349
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
1350
+ case 500:
1351
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
1352
+ default:
1353
+ throw new errors.PaidError({
1354
+ statusCode: _response.error.statusCode,
1355
+ body: _response.error.body,
1356
+ rawResponse: _response.rawResponse,
1357
+ });
1358
+ }
1359
+ }
1360
+ switch (_response.error.reason) {
1361
+ case "non-json":
1362
+ throw new errors.PaidError({
1363
+ statusCode: _response.error.statusCode,
1364
+ body: _response.error.rawBody,
1365
+ rawResponse: _response.rawResponse,
1366
+ });
1367
+ case "timeout":
1368
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/{id}/credits/grants.");
1369
+ case "unknown":
1370
+ throw new errors.PaidError({
1371
+ message: _response.error.errorMessage,
1372
+ rawResponse: _response.rawResponse,
1373
+ });
1374
+ }
1375
+ });
1376
+ }
1377
+ /**
1378
+ * Get current customer credit balances grouped by currency, looked up by external ID
1379
+ *
1380
+ * @param {Paid.GetCustomerCreditBalancesByExternalIdRequest} request
1381
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
1382
+ *
1383
+ * @throws {@link Paid.ForbiddenError}
1384
+ * @throws {@link Paid.NotFoundError}
1385
+ * @throws {@link Paid.InternalServerError}
1386
+ *
1387
+ * @example
1388
+ * await client.customers.getCustomerCreditBalancesByExternalId({
1389
+ * externalId: "customer_123"
1390
+ * })
1391
+ */
1392
+ getCustomerCreditBalancesByExternalId(request, requestOptions) {
1393
+ return core.HttpResponsePromise.fromPromise(this.__getCustomerCreditBalancesByExternalId(request, requestOptions));
1394
+ }
1395
+ __getCustomerCreditBalancesByExternalId(request, requestOptions) {
1396
+ return __awaiter(this, void 0, void 0, function* () {
1397
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1398
+ const { externalId } = request;
1399
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1400
+ const _response = yield core.fetcher({
1401
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/credits/balances`),
1402
+ method: "GET",
1403
+ headers: _headers,
1404
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1405
+ 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,
1406
+ 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,
1407
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1408
+ });
1409
+ if (_response.ok) {
1410
+ return { data: _response.body, rawResponse: _response.rawResponse };
1411
+ }
1412
+ if (_response.error.reason === "status-code") {
1413
+ switch (_response.error.statusCode) {
1414
+ case 403:
1415
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
1416
+ case 404:
1417
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
1418
+ case 500:
1419
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
1420
+ default:
1421
+ throw new errors.PaidError({
1422
+ statusCode: _response.error.statusCode,
1423
+ body: _response.error.body,
1424
+ rawResponse: _response.rawResponse,
1425
+ });
1426
+ }
1427
+ }
1428
+ switch (_response.error.reason) {
1429
+ case "non-json":
1430
+ throw new errors.PaidError({
1431
+ statusCode: _response.error.statusCode,
1432
+ body: _response.error.rawBody,
1433
+ rawResponse: _response.rawResponse,
1434
+ });
1435
+ case "timeout":
1436
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/credits/balances.");
1437
+ case "unknown":
1438
+ throw new errors.PaidError({
1439
+ message: _response.error.errorMessage,
1440
+ rawResponse: _response.rawResponse,
1441
+ });
1442
+ }
1443
+ });
1444
+ }
1445
+ /**
1446
+ * List credit consumption that was recorded before a matching credit pool existed — for example usage that arrived before an invoice was paid or before a new period's credits were granted. Entries leave this list once they are applied to a pool or settled. Use the value returned as `customer.id`, for example `cus_abc123`. If you have your own customer ID, use `/api/v2/customers/external/{externalId}/credits/pending-consumption`.
1447
+ *
1448
+ * @param {Paid.ListCustomerPendingCreditConsumptionRequest} request
1449
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
1450
+ *
1451
+ * @throws {@link Paid.BadRequestError}
1452
+ * @throws {@link Paid.ForbiddenError}
1453
+ * @throws {@link Paid.NotFoundError}
1454
+ * @throws {@link Paid.InternalServerError}
1455
+ *
1456
+ * @example
1457
+ * await client.customers.listCustomerPendingCreditConsumption({
1458
+ * id: "cus_abc123"
1459
+ * })
1460
+ */
1461
+ listCustomerPendingCreditConsumption(request, requestOptions) {
1462
+ return core.HttpResponsePromise.fromPromise(this.__listCustomerPendingCreditConsumption(request, requestOptions));
1463
+ }
1464
+ __listCustomerPendingCreditConsumption(request, requestOptions) {
1465
+ return __awaiter(this, void 0, void 0, function* () {
1466
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1467
+ const { id, limit, offset } = request;
1468
+ const _queryParams = {};
1469
+ if (limit != null) {
1470
+ _queryParams.limit = limit.toString();
1471
+ }
1472
+ if (offset != null) {
1473
+ _queryParams.offset = offset.toString();
1474
+ }
1475
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1476
+ const _response = yield core.fetcher({
1477
+ 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, `customers/${core.url.encodePathParam(id)}/credits/pending-consumption`),
1478
+ method: "GET",
1479
+ headers: _headers,
1480
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
1481
+ 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,
1482
+ 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,
1483
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1484
+ });
1485
+ if (_response.ok) {
1486
+ return {
1487
+ data: _response.body,
1488
+ rawResponse: _response.rawResponse,
1489
+ };
1490
+ }
1491
+ if (_response.error.reason === "status-code") {
1492
+ switch (_response.error.statusCode) {
1493
+ case 400:
1494
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
1495
+ case 403:
1496
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
1497
+ case 404:
1498
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
1499
+ case 500:
1500
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
1501
+ default:
1502
+ throw new errors.PaidError({
1503
+ statusCode: _response.error.statusCode,
1504
+ body: _response.error.body,
1505
+ rawResponse: _response.rawResponse,
1506
+ });
1507
+ }
1508
+ }
1509
+ switch (_response.error.reason) {
1510
+ case "non-json":
1511
+ throw new errors.PaidError({
1512
+ statusCode: _response.error.statusCode,
1513
+ body: _response.error.rawBody,
1514
+ rawResponse: _response.rawResponse,
1515
+ });
1516
+ case "timeout":
1517
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/credits/pending-consumption.");
1518
+ case "unknown":
1519
+ throw new errors.PaidError({
1520
+ message: _response.error.errorMessage,
1521
+ rawResponse: _response.rawResponse,
1522
+ });
1523
+ }
1524
+ });
1525
+ }
1526
+ /**
1527
+ * List credit consumption recorded before a matching credit pool existed, for a customer looked up by external ID.
1528
+ *
1529
+ * @param {Paid.ListCustomerPendingCreditConsumptionByExternalIdRequest} request
1530
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
1531
+ *
1532
+ * @throws {@link Paid.BadRequestError}
1533
+ * @throws {@link Paid.ForbiddenError}
1534
+ * @throws {@link Paid.NotFoundError}
1535
+ * @throws {@link Paid.InternalServerError}
1536
+ *
1537
+ * @example
1538
+ * await client.customers.listCustomerPendingCreditConsumptionByExternalId({
1539
+ * externalId: "customer_123"
1540
+ * })
1541
+ */
1542
+ listCustomerPendingCreditConsumptionByExternalId(request, requestOptions) {
1543
+ return core.HttpResponsePromise.fromPromise(this.__listCustomerPendingCreditConsumptionByExternalId(request, requestOptions));
1544
+ }
1545
+ __listCustomerPendingCreditConsumptionByExternalId(request, requestOptions) {
1546
+ return __awaiter(this, void 0, void 0, function* () {
1547
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1548
+ const { externalId, limit, offset } = request;
1549
+ const _queryParams = {};
1550
+ if (limit != null) {
1551
+ _queryParams.limit = limit.toString();
1552
+ }
1553
+ if (offset != null) {
1554
+ _queryParams.offset = offset.toString();
1555
+ }
1556
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1557
+ const _response = yield core.fetcher({
1558
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/credits/pending-consumption`),
1559
+ method: "GET",
1560
+ headers: _headers,
1561
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
1562
+ 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,
1563
+ 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,
1564
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1565
+ });
1566
+ if (_response.ok) {
1567
+ return {
1568
+ data: _response.body,
1569
+ rawResponse: _response.rawResponse,
1570
+ };
1571
+ }
1572
+ if (_response.error.reason === "status-code") {
1573
+ switch (_response.error.statusCode) {
1574
+ case 400:
1575
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
1576
+ case 403:
1577
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
1578
+ case 404:
1579
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
1580
+ case 500:
1581
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
1582
+ default:
1583
+ throw new errors.PaidError({
1584
+ statusCode: _response.error.statusCode,
1585
+ body: _response.error.body,
1586
+ rawResponse: _response.rawResponse,
1587
+ });
1588
+ }
1589
+ }
1590
+ switch (_response.error.reason) {
1591
+ case "non-json":
1592
+ throw new errors.PaidError({
1593
+ statusCode: _response.error.statusCode,
1594
+ body: _response.error.rawBody,
1595
+ rawResponse: _response.rawResponse,
1596
+ });
1597
+ case "timeout":
1598
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/credits/pending-consumption.");
1599
+ case "unknown":
1600
+ throw new errors.PaidError({
1601
+ message: _response.error.errorMessage,
1602
+ rawResponse: _response.rawResponse,
1603
+ });
1604
+ }
1605
+ });
1606
+ }
1607
+ /**
1608
+ * Immediately grant credits to a customer looked up by external ID using an active credit currency key.
1609
+ *
1610
+ * @param {Paid.GrantCustomerCreditsByExternalIdRequest} request
1611
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
1612
+ *
1613
+ * @throws {@link Paid.BadRequestError}
1614
+ * @throws {@link Paid.ForbiddenError}
1615
+ * @throws {@link Paid.NotFoundError}
1616
+ * @throws {@link Paid.ConflictError}
1617
+ * @throws {@link Paid.InternalServerError}
1618
+ *
1619
+ * @example
1620
+ * await client.customers.grantCustomerCreditsByExternalId({
1621
+ * externalId: "customer_123",
1622
+ * body: {
1623
+ * creditCurrencyKey: "api_credits",
1624
+ * amount: 10000,
1625
+ * startsAt: "2026-06-05T12:00:00Z",
1626
+ * expiresAt: "2026-12-31T23:59:59Z",
1627
+ * idempotencyKey: "grant_acme_2026-06-05"
1628
+ * }
1629
+ * })
1630
+ */
1631
+ grantCustomerCreditsByExternalId(request, requestOptions) {
1632
+ return core.HttpResponsePromise.fromPromise(this.__grantCustomerCreditsByExternalId(request, requestOptions));
1633
+ }
1634
+ __grantCustomerCreditsByExternalId(request, requestOptions) {
1635
+ return __awaiter(this, void 0, void 0, function* () {
1636
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1637
+ const { externalId, body: _body } = request;
1638
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1639
+ const _response = yield core.fetcher({
1640
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/credits/grants`),
1641
+ method: "POST",
1642
+ headers: _headers,
1643
+ contentType: "application/json",
1644
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1645
+ requestType: "json",
1646
+ body: _body,
1647
+ 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,
1648
+ 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,
1649
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1650
+ });
1651
+ if (_response.ok) {
1652
+ return { data: _response.body, rawResponse: _response.rawResponse };
1653
+ }
1654
+ if (_response.error.reason === "status-code") {
1655
+ switch (_response.error.statusCode) {
1656
+ case 400:
1657
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
1658
+ case 403:
1659
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
1660
+ case 404:
1661
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
1662
+ case 409:
1663
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
1664
+ case 500:
1665
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
1666
+ default:
1667
+ throw new errors.PaidError({
1668
+ statusCode: _response.error.statusCode,
1669
+ body: _response.error.body,
1670
+ rawResponse: _response.rawResponse,
1671
+ });
1672
+ }
1673
+ }
1674
+ switch (_response.error.reason) {
1675
+ case "non-json":
1676
+ throw new errors.PaidError({
1677
+ statusCode: _response.error.statusCode,
1678
+ body: _response.error.rawBody,
1679
+ rawResponse: _response.rawResponse,
1680
+ });
1681
+ case "timeout":
1682
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/external/{externalId}/credits/grants.");
1683
+ case "unknown":
1684
+ throw new errors.PaidError({
1685
+ message: _response.error.errorMessage,
1686
+ rawResponse: _response.rawResponse,
1687
+ });
1688
+ }
1689
+ });
1690
+ }
1691
+ /**
1692
+ * Create or update a customer user using customer and user external IDs
1693
+ *
1694
+ * @param {Paid.UpsertCustomerUserRequest} request
1695
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
1696
+ *
1697
+ * @throws {@link Paid.BadRequestError}
1698
+ * @throws {@link Paid.ForbiddenError}
1699
+ * @throws {@link Paid.NotFoundError}
1700
+ * @throws {@link Paid.InternalServerError}
1701
+ *
1702
+ * @example
1703
+ * await client.customers.upsertCustomerUserByExternalId({
1704
+ * customerExternalId: "customerExternalId",
1705
+ * userExternalId: "userExternalId"
1706
+ * })
1707
+ */
1708
+ upsertCustomerUserByExternalId(request, requestOptions) {
1709
+ return core.HttpResponsePromise.fromPromise(this.__upsertCustomerUserByExternalId(request, requestOptions));
1710
+ }
1711
+ __upsertCustomerUserByExternalId(request, requestOptions) {
1712
+ return __awaiter(this, void 0, void 0, function* () {
1713
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1714
+ const { customerExternalId, userExternalId } = request, _body = __rest(request, ["customerExternalId", "userExternalId"]);
1715
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1716
+ const _response = yield core.fetcher({
1717
+ 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, `customers/${core.url.encodePathParam(customerExternalId)}/users/${core.url.encodePathParam(userExternalId)}`),
1718
+ method: "PUT",
1719
+ headers: _headers,
1720
+ contentType: "application/json",
1721
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1722
+ requestType: "json",
1723
+ body: _body,
1724
+ 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,
1725
+ 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,
1726
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1727
+ });
1728
+ if (_response.ok) {
1729
+ return { data: _response.body, rawResponse: _response.rawResponse };
1730
+ }
1731
+ if (_response.error.reason === "status-code") {
1732
+ switch (_response.error.statusCode) {
1733
+ case 400:
1734
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
1735
+ case 403:
1736
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
1737
+ case 404:
1738
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
1739
+ case 500:
1740
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
1741
+ default:
1742
+ throw new errors.PaidError({
1743
+ statusCode: _response.error.statusCode,
1744
+ body: _response.error.body,
1745
+ rawResponse: _response.rawResponse,
1746
+ });
1747
+ }
1748
+ }
1749
+ switch (_response.error.reason) {
1750
+ case "non-json":
1751
+ throw new errors.PaidError({
1752
+ statusCode: _response.error.statusCode,
1753
+ body: _response.error.rawBody,
1754
+ rawResponse: _response.rawResponse,
1755
+ });
1756
+ case "timeout":
1757
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /customers/{customerExternalId}/users/{userExternalId}.");
1758
+ case "unknown":
1759
+ throw new errors.PaidError({
1760
+ message: _response.error.errorMessage,
1761
+ rawResponse: _response.rawResponse,
1762
+ });
1763
+ }
1764
+ });
1765
+ }
1766
+ /**
1767
+ * Returns the virtual bank account (Stripe funding instructions) a customer can pay by bank transfer into, by Paid display ID.
1768
+ *
1769
+ * @param {Paid.GetCustomerFundingInstructionsRequest} request
1770
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
1771
+ *
1772
+ * @throws {@link Paid.BadRequestError}
1773
+ * @throws {@link Paid.ForbiddenError}
1774
+ * @throws {@link Paid.NotFoundError}
1775
+ * @throws {@link Paid.InternalServerError}
1776
+ *
1777
+ * @example
1778
+ * await client.customers.getCustomerFundingInstructions({
1779
+ * id: "cus_abc123",
1780
+ * currency: "USD"
1781
+ * })
1782
+ */
1783
+ getCustomerFundingInstructions(request, requestOptions) {
1784
+ return core.HttpResponsePromise.fromPromise(this.__getCustomerFundingInstructions(request, requestOptions));
1785
+ }
1786
+ __getCustomerFundingInstructions(request, requestOptions) {
1787
+ return __awaiter(this, void 0, void 0, function* () {
1788
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1789
+ const { id, currency } = request;
1790
+ const _queryParams = {};
1791
+ if (currency != null) {
1792
+ _queryParams.currency = currency;
1793
+ }
1794
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1795
+ const _response = yield core.fetcher({
1796
+ 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, `customers/${core.url.encodePathParam(id)}/funding-instructions`),
1797
+ method: "GET",
1798
+ headers: _headers,
1799
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
1800
+ 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,
1801
+ 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,
1802
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1803
+ });
1804
+ if (_response.ok) {
1805
+ return { data: _response.body, rawResponse: _response.rawResponse };
1806
+ }
1807
+ if (_response.error.reason === "status-code") {
1808
+ switch (_response.error.statusCode) {
1809
+ case 400:
1810
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
1811
+ case 403:
1812
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
1813
+ case 404:
1814
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
1815
+ case 500:
1816
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
1817
+ default:
1818
+ throw new errors.PaidError({
1819
+ statusCode: _response.error.statusCode,
1820
+ body: _response.error.body,
1821
+ rawResponse: _response.rawResponse,
1822
+ });
1823
+ }
1824
+ }
1825
+ switch (_response.error.reason) {
1826
+ case "non-json":
1827
+ throw new errors.PaidError({
1828
+ statusCode: _response.error.statusCode,
1829
+ body: _response.error.rawBody,
1830
+ rawResponse: _response.rawResponse,
1831
+ });
1832
+ case "timeout":
1833
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/funding-instructions.");
1834
+ case "unknown":
1835
+ throw new errors.PaidError({
1836
+ message: _response.error.errorMessage,
1837
+ rawResponse: _response.rawResponse,
1838
+ });
1839
+ }
1840
+ });
1841
+ }
1842
+ /**
1843
+ * Creates a dedicated virtual bank account for the customer to pay invoices by bank transfer, by Paid display ID. Returns the existing account if one already exists for the currency. Requires a live-mode organization with Stripe connected and Bank Transfers enabled on the Stripe account.
1844
+ *
1845
+ * @param {Paid.CreateCustomerFundingInstructionsRequest} request
1846
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
1847
+ *
1848
+ * @throws {@link Paid.BadRequestError}
1849
+ * @throws {@link Paid.ForbiddenError}
1850
+ * @throws {@link Paid.NotFoundError}
1851
+ * @throws {@link Paid.UnprocessableEntityError}
1852
+ * @throws {@link Paid.InternalServerError}
1853
+ *
1854
+ * @example
1855
+ * await client.customers.createCustomerFundingInstructions({
1856
+ * id: "cus_abc123",
1857
+ * body: {}
1858
+ * })
1859
+ */
1860
+ createCustomerFundingInstructions(request, requestOptions) {
1861
+ return core.HttpResponsePromise.fromPromise(this.__createCustomerFundingInstructions(request, requestOptions));
1862
+ }
1863
+ __createCustomerFundingInstructions(request, requestOptions) {
1864
+ return __awaiter(this, void 0, void 0, function* () {
1865
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1866
+ const { id, body: _body } = request;
1867
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1868
+ const _response = yield core.fetcher({
1869
+ 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, `customers/${core.url.encodePathParam(id)}/funding-instructions`),
1870
+ method: "POST",
1871
+ headers: _headers,
1872
+ contentType: "application/json",
1873
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1874
+ requestType: "json",
1875
+ body: _body,
1876
+ 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,
1877
+ 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,
1878
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1879
+ });
1880
+ if (_response.ok) {
1881
+ return { data: _response.body, rawResponse: _response.rawResponse };
1882
+ }
1883
+ if (_response.error.reason === "status-code") {
1884
+ switch (_response.error.statusCode) {
1885
+ case 400:
1886
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
1887
+ case 403:
1888
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
1889
+ case 404:
1890
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
1891
+ case 422:
1892
+ throw new Paid.UnprocessableEntityError(_response.error.body, _response.rawResponse);
1893
+ case 500:
1894
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
1895
+ default:
1896
+ throw new errors.PaidError({
1897
+ statusCode: _response.error.statusCode,
1898
+ body: _response.error.body,
1899
+ rawResponse: _response.rawResponse,
1900
+ });
1901
+ }
1902
+ }
1903
+ switch (_response.error.reason) {
1904
+ case "non-json":
1905
+ throw new errors.PaidError({
1906
+ statusCode: _response.error.statusCode,
1907
+ body: _response.error.rawBody,
1908
+ rawResponse: _response.rawResponse,
1909
+ });
1910
+ case "timeout":
1911
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/{id}/funding-instructions.");
1912
+ case "unknown":
1913
+ throw new errors.PaidError({
1914
+ message: _response.error.errorMessage,
1915
+ rawResponse: _response.rawResponse,
1916
+ });
1917
+ }
1918
+ });
1919
+ }
1920
+ /**
1921
+ * Returns the virtual bank account (Stripe funding instructions) a customer can pay by bank transfer into, by your external ID.
1922
+ *
1923
+ * @param {Paid.GetCustomerFundingInstructionsByExternalIdRequest} request
1924
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
1925
+ *
1926
+ * @throws {@link Paid.BadRequestError}
1927
+ * @throws {@link Paid.ForbiddenError}
1928
+ * @throws {@link Paid.NotFoundError}
1929
+ * @throws {@link Paid.InternalServerError}
1930
+ *
1931
+ * @example
1932
+ * await client.customers.getCustomerFundingInstructionsByExternalId({
1933
+ * externalId: "externalId",
1934
+ * currency: "USD"
1935
+ * })
1936
+ */
1937
+ getCustomerFundingInstructionsByExternalId(request, requestOptions) {
1938
+ return core.HttpResponsePromise.fromPromise(this.__getCustomerFundingInstructionsByExternalId(request, requestOptions));
1939
+ }
1940
+ __getCustomerFundingInstructionsByExternalId(request, requestOptions) {
1941
+ return __awaiter(this, void 0, void 0, function* () {
1942
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1943
+ const { externalId, currency } = request;
1944
+ const _queryParams = {};
1945
+ if (currency != null) {
1946
+ _queryParams.currency = currency;
1947
+ }
1948
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1949
+ const _response = yield core.fetcher({
1950
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/funding-instructions`),
1951
+ method: "GET",
1952
+ headers: _headers,
1953
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
1954
+ 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,
1955
+ 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,
1956
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1957
+ });
1958
+ if (_response.ok) {
1959
+ return { data: _response.body, rawResponse: _response.rawResponse };
1960
+ }
1961
+ if (_response.error.reason === "status-code") {
1962
+ switch (_response.error.statusCode) {
1963
+ case 400:
1964
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
1965
+ case 403:
1966
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
1967
+ case 404:
1968
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
1969
+ case 500:
1970
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
1971
+ default:
1972
+ throw new errors.PaidError({
1973
+ statusCode: _response.error.statusCode,
1974
+ body: _response.error.body,
1975
+ rawResponse: _response.rawResponse,
1976
+ });
1977
+ }
1978
+ }
1979
+ switch (_response.error.reason) {
1980
+ case "non-json":
1981
+ throw new errors.PaidError({
1982
+ statusCode: _response.error.statusCode,
1983
+ body: _response.error.rawBody,
1984
+ rawResponse: _response.rawResponse,
1985
+ });
1986
+ case "timeout":
1987
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/funding-instructions.");
1988
+ case "unknown":
1989
+ throw new errors.PaidError({
1990
+ message: _response.error.errorMessage,
1991
+ rawResponse: _response.rawResponse,
1992
+ });
1993
+ }
1994
+ });
1995
+ }
1996
+ /**
1997
+ * Creates a dedicated virtual bank account for the customer to pay invoices by bank transfer, by your external ID. Returns the existing account if one already exists for the currency. Requires a live-mode organization with Stripe connected and Bank Transfers enabled on the Stripe account.
1998
+ *
1999
+ * @param {Paid.CreateCustomerFundingInstructionsByExternalIdRequest} request
2000
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
2001
+ *
2002
+ * @throws {@link Paid.BadRequestError}
2003
+ * @throws {@link Paid.ForbiddenError}
2004
+ * @throws {@link Paid.NotFoundError}
2005
+ * @throws {@link Paid.UnprocessableEntityError}
2006
+ * @throws {@link Paid.InternalServerError}
2007
+ *
2008
+ * @example
2009
+ * await client.customers.createCustomerFundingInstructionsByExternalId({
2010
+ * externalId: "externalId",
2011
+ * body: {}
2012
+ * })
2013
+ */
2014
+ createCustomerFundingInstructionsByExternalId(request, requestOptions) {
2015
+ return core.HttpResponsePromise.fromPromise(this.__createCustomerFundingInstructionsByExternalId(request, requestOptions));
2016
+ }
2017
+ __createCustomerFundingInstructionsByExternalId(request, requestOptions) {
2018
+ return __awaiter(this, void 0, void 0, function* () {
2019
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2020
+ const { externalId, body: _body } = request;
2021
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2022
+ const _response = yield core.fetcher({
2023
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/funding-instructions`),
2024
+ method: "POST",
2025
+ headers: _headers,
2026
+ contentType: "application/json",
2027
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
2028
+ requestType: "json",
2029
+ body: _body,
2030
+ 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,
2031
+ 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,
2032
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
2033
+ });
2034
+ if (_response.ok) {
2035
+ return { data: _response.body, rawResponse: _response.rawResponse };
2036
+ }
2037
+ if (_response.error.reason === "status-code") {
2038
+ switch (_response.error.statusCode) {
2039
+ case 400:
2040
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
2041
+ case 403:
2042
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
2043
+ case 404:
2044
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
2045
+ case 422:
2046
+ throw new Paid.UnprocessableEntityError(_response.error.body, _response.rawResponse);
2047
+ case 500:
2048
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
2049
+ default:
2050
+ throw new errors.PaidError({
2051
+ statusCode: _response.error.statusCode,
2052
+ body: _response.error.body,
2053
+ rawResponse: _response.rawResponse,
2054
+ });
2055
+ }
2056
+ }
2057
+ switch (_response.error.reason) {
2058
+ case "non-json":
2059
+ throw new errors.PaidError({
2060
+ statusCode: _response.error.statusCode,
2061
+ body: _response.error.rawBody,
2062
+ rawResponse: _response.rawResponse,
2063
+ });
2064
+ case "timeout":
2065
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/external/{externalId}/funding-instructions.");
2066
+ case "unknown":
2067
+ throw new errors.PaidError({
2068
+ message: _response.error.errorMessage,
2069
+ rawResponse: _response.rawResponse,
2070
+ });
2071
+ }
2072
+ });
2073
+ }
2074
+ /**
2075
+ * Lists the customer's units as a flat list, newest last; assemble the tree from `parentExternalId` (`null` on the root unit, `isRoot: true`). Deleted units are hidden unless `status=DELETED` is given, drafts unless `status=DRAFT`. Filter by `externalType`, or by `parentExternalId` for one level of the tree. Addresses the customer by your external customer id.
2076
+ *
2077
+ * @param {Paid.ListCustomerUnitsByExternalIdRequest} request
2078
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
2079
+ *
2080
+ * @throws {@link Paid.BadRequestError}
2081
+ * @throws {@link Paid.ForbiddenError}
2082
+ * @throws {@link Paid.NotFoundError}
2083
+ * @throws {@link Paid.InternalServerError}
2084
+ *
2085
+ * @example
2086
+ * await client.customers.listCustomerUnitsByExternalId({
2087
+ * externalId: "customer_123",
2088
+ * parentExternalId: "dept-rnd"
2089
+ * })
2090
+ */
2091
+ listCustomerUnitsByExternalId(request, requestOptions) {
2092
+ return core.HttpResponsePromise.fromPromise(this.__listCustomerUnitsByExternalId(request, requestOptions));
2093
+ }
2094
+ __listCustomerUnitsByExternalId(request, requestOptions) {
2095
+ return __awaiter(this, void 0, void 0, function* () {
2096
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2097
+ const { externalId, limit, offset, status, externalType, parentExternalId } = request;
2098
+ const _queryParams = {};
2099
+ if (limit != null) {
2100
+ _queryParams.limit = limit.toString();
2101
+ }
2102
+ if (offset != null) {
2103
+ _queryParams.offset = offset.toString();
2104
+ }
2105
+ if (status != null) {
2106
+ _queryParams.status = status;
2107
+ }
2108
+ if (externalType != null) {
2109
+ _queryParams.externalType = externalType;
2110
+ }
2111
+ if (parentExternalId != null) {
2112
+ _queryParams.parentExternalId = parentExternalId;
2113
+ }
2114
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2115
+ const _response = yield core.fetcher({
2116
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/customer-units`),
2117
+ method: "GET",
2118
+ headers: _headers,
2119
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
2120
+ 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,
2121
+ 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,
2122
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
2123
+ });
2124
+ if (_response.ok) {
2125
+ return { data: _response.body, rawResponse: _response.rawResponse };
2126
+ }
2127
+ if (_response.error.reason === "status-code") {
2128
+ switch (_response.error.statusCode) {
2129
+ case 400:
2130
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
2131
+ case 403:
2132
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
2133
+ case 404:
2134
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
2135
+ case 500:
2136
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
2137
+ default:
2138
+ throw new errors.PaidError({
2139
+ statusCode: _response.error.statusCode,
2140
+ body: _response.error.body,
2141
+ rawResponse: _response.rawResponse,
2142
+ });
2143
+ }
2144
+ }
2145
+ switch (_response.error.reason) {
2146
+ case "non-json":
2147
+ throw new errors.PaidError({
2148
+ statusCode: _response.error.statusCode,
2149
+ body: _response.error.rawBody,
2150
+ rawResponse: _response.rawResponse,
2151
+ });
2152
+ case "timeout":
2153
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/customer-units.");
2154
+ case "unknown":
2155
+ throw new errors.PaidError({
2156
+ message: _response.error.errorMessage,
2157
+ rawResponse: _response.rawResponse,
2158
+ });
2159
+ }
2160
+ });
2161
+ }
2162
+ /**
2163
+ * Creates a unit for this customer. `externalId` is your own key for it: required, immutable, and unique within the organization (no other customer's unit id, external id or alias may be the same, ignoring letter case); every unit route addresses the unit by it, and `name` defaults to it. Omit `parentExternalId` to create the customer's root unit (its first unit; `409 ROOT_EXISTS` if it already has one — a customer created with an external id usable as a unit key already has its root, keyed by that external id, so name it as the parent instead); otherwise the parent must exist (`409 PARENT_NOT_FOUND`) and be ACTIVE. A create whose `externalId` is one of this customer's `DRAFT` units promotes the draft in place: same unit, same id, now ACTIVE with the request's name, type, metadata and parent (`parentExternalId` is required; a draft sits under the root). A signal that names a unit before it exists is accepted; with draft units enabled for your organization it creates a `DRAFT` unit under the customer's root that holds the key, and creating the unit with that key later promotes the draft; otherwise its spend attaches to the unit once you create it with that key. `409` also when the externalId is taken on this customer (`CUSTOMER_UNIT_EXISTS`) or by another customer of the organization (`EXTERNAL_ID_IN_USE`), the tree would get too deep, the customer is on seat-based billing, or a root unit is sent with `billable: false` (`ROOT_UNIT_ALWAYS_BILLABLE`). `403 FEATURE_NOT_ENABLED` for `billable: false` when non-billable units are not enabled for your organization. Addresses the customer by your external customer id.
2164
+ *
2165
+ * @param {Paid.CreateCustomerUnitByExternalIdRequest} request
2166
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
2167
+ *
2168
+ * @throws {@link Paid.BadRequestError}
2169
+ * @throws {@link Paid.ForbiddenError}
2170
+ * @throws {@link Paid.NotFoundError}
2171
+ * @throws {@link Paid.ConflictError}
2172
+ * @throws {@link Paid.InternalServerError}
2173
+ *
2174
+ * @example
2175
+ * await client.customers.createCustomerUnitByExternalId({
2176
+ * externalId: "customer_123",
2177
+ * body: {
2178
+ * externalId: "team-research"
2179
+ * }
2180
+ * })
2181
+ */
2182
+ createCustomerUnitByExternalId(request, requestOptions) {
2183
+ return core.HttpResponsePromise.fromPromise(this.__createCustomerUnitByExternalId(request, requestOptions));
2184
+ }
2185
+ __createCustomerUnitByExternalId(request, requestOptions) {
2186
+ return __awaiter(this, void 0, void 0, function* () {
2187
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2188
+ const { externalId, body: _body } = request;
2189
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2190
+ const _response = yield core.fetcher({
2191
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/customer-units`),
2192
+ method: "POST",
2193
+ headers: _headers,
2194
+ contentType: "application/json",
2195
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
2196
+ requestType: "json",
2197
+ body: _body,
2198
+ 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,
2199
+ 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,
2200
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
2201
+ });
2202
+ if (_response.ok) {
2203
+ return { data: _response.body, rawResponse: _response.rawResponse };
2204
+ }
2205
+ if (_response.error.reason === "status-code") {
2206
+ switch (_response.error.statusCode) {
2207
+ case 400:
2208
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
2209
+ case 403:
2210
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
2211
+ case 404:
2212
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
2213
+ case 409:
2214
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
2215
+ case 500:
2216
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
2217
+ default:
2218
+ throw new errors.PaidError({
2219
+ statusCode: _response.error.statusCode,
2220
+ body: _response.error.body,
2221
+ rawResponse: _response.rawResponse,
2222
+ });
2223
+ }
2224
+ }
2225
+ switch (_response.error.reason) {
2226
+ case "non-json":
2227
+ throw new errors.PaidError({
2228
+ statusCode: _response.error.statusCode,
2229
+ body: _response.error.rawBody,
2230
+ rawResponse: _response.rawResponse,
2231
+ });
2232
+ case "timeout":
2233
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/external/{externalId}/customer-units.");
2234
+ case "unknown":
2235
+ throw new errors.PaidError({
2236
+ message: _response.error.errorMessage,
2237
+ rawResponse: _response.rawResponse,
2238
+ });
2239
+ }
2240
+ });
2241
+ }
2242
+ /**
2243
+ * Returns one unit of this customer by its `externalId`, including a deleted one. `404` when the unit does not exist or belongs to another customer. Addresses the customer by your external customer id.
2244
+ *
2245
+ * @param {Paid.GetCustomerUnitByExternalIdRequest} request
2246
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
2247
+ *
2248
+ * @throws {@link Paid.BadRequestError}
2249
+ * @throws {@link Paid.ForbiddenError}
2250
+ * @throws {@link Paid.NotFoundError}
2251
+ * @throws {@link Paid.InternalServerError}
2252
+ *
2253
+ * @example
2254
+ * await client.customers.getCustomerUnitByExternalId({
2255
+ * externalId: "customer_123",
2256
+ * externalCustomerUnitId: "team-research"
2257
+ * })
2258
+ */
2259
+ getCustomerUnitByExternalId(request, requestOptions) {
2260
+ return core.HttpResponsePromise.fromPromise(this.__getCustomerUnitByExternalId(request, requestOptions));
2261
+ }
2262
+ __getCustomerUnitByExternalId(request, requestOptions) {
2263
+ return __awaiter(this, void 0, void 0, function* () {
2264
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2265
+ const { externalId, externalCustomerUnitId } = request;
2266
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2267
+ const _response = yield core.fetcher({
2268
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}`),
2269
+ method: "GET",
2270
+ headers: _headers,
2271
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
2272
+ 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,
2273
+ 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,
2274
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
2275
+ });
2276
+ if (_response.ok) {
2277
+ return { data: _response.body, rawResponse: _response.rawResponse };
2278
+ }
2279
+ if (_response.error.reason === "status-code") {
2280
+ switch (_response.error.statusCode) {
2281
+ case 400:
2282
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
2283
+ case 403:
2284
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
2285
+ case 404:
2286
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
2287
+ case 500:
2288
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
2289
+ default:
2290
+ throw new errors.PaidError({
2291
+ statusCode: _response.error.statusCode,
2292
+ body: _response.error.body,
2293
+ rawResponse: _response.rawResponse,
2294
+ });
2295
+ }
2296
+ }
2297
+ switch (_response.error.reason) {
2298
+ case "non-json":
2299
+ throw new errors.PaidError({
2300
+ statusCode: _response.error.statusCode,
2301
+ body: _response.error.rawBody,
2302
+ rawResponse: _response.rawResponse,
2303
+ });
2304
+ case "timeout":
2305
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/customer-units/{externalCustomerUnitId}.");
2306
+ case "unknown":
2307
+ throw new errors.PaidError({
2308
+ message: _response.error.errorMessage,
2309
+ rawResponse: _response.rawResponse,
2310
+ });
2311
+ }
2312
+ });
2313
+ }
2314
+ /**
2315
+ * Soft-deletes a unit: it stays readable with `status: DELETED` and cannot be reactivated. Spend history that references it is kept, and signals that keep naming it are still attributed to it. A `DRAFT` unit is deleted the same way: it stays readable as DELETED, its key stays reserved, and spend already keyed to it stays its own. `409` while the unit has ACTIVE or DRAFT children or a cap in force or scheduled; the root follows the same rules, and once it is deleted a new root can be created. Addresses the customer by your external customer id.
2316
+ *
2317
+ * @param {Paid.DeleteCustomerUnitByExternalIdRequest} request
2318
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
2319
+ *
2320
+ * @throws {@link Paid.BadRequestError}
2321
+ * @throws {@link Paid.ForbiddenError}
2322
+ * @throws {@link Paid.NotFoundError}
2323
+ * @throws {@link Paid.ConflictError}
2324
+ * @throws {@link Paid.InternalServerError}
2325
+ *
2326
+ * @example
2327
+ * await client.customers.deleteCustomerUnitByExternalId({
2328
+ * externalId: "customer_123",
2329
+ * externalCustomerUnitId: "team-research"
2330
+ * })
2331
+ */
2332
+ deleteCustomerUnitByExternalId(request, requestOptions) {
2333
+ return core.HttpResponsePromise.fromPromise(this.__deleteCustomerUnitByExternalId(request, requestOptions));
2334
+ }
2335
+ __deleteCustomerUnitByExternalId(request, requestOptions) {
2336
+ return __awaiter(this, void 0, void 0, function* () {
2337
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2338
+ const { externalId, externalCustomerUnitId } = request;
2339
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2340
+ const _response = yield core.fetcher({
2341
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}`),
2342
+ method: "DELETE",
2343
+ headers: _headers,
2344
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
2345
+ 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,
2346
+ 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,
2347
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
2348
+ });
2349
+ if (_response.ok) {
2350
+ return { data: _response.body, rawResponse: _response.rawResponse };
2351
+ }
2352
+ if (_response.error.reason === "status-code") {
2353
+ switch (_response.error.statusCode) {
2354
+ case 400:
2355
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
2356
+ case 403:
2357
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
2358
+ case 404:
2359
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
2360
+ case 409:
2361
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
2362
+ case 500:
2363
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
2364
+ default:
2365
+ throw new errors.PaidError({
2366
+ statusCode: _response.error.statusCode,
2367
+ body: _response.error.body,
2368
+ rawResponse: _response.rawResponse,
2369
+ });
2370
+ }
2371
+ }
2372
+ switch (_response.error.reason) {
2373
+ case "non-json":
2374
+ throw new errors.PaidError({
2375
+ statusCode: _response.error.statusCode,
2376
+ body: _response.error.rawBody,
2377
+ rawResponse: _response.rawResponse,
2378
+ });
2379
+ case "timeout":
2380
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/external/{externalId}/customer-units/{externalCustomerUnitId}.");
2381
+ case "unknown":
2382
+ throw new errors.PaidError({
2383
+ message: _response.error.errorMessage,
2384
+ rawResponse: _response.rawResponse,
2385
+ });
2386
+ }
2387
+ });
2388
+ }
2389
+ /**
2390
+ * Renames, re-types, re-parents or annotates a unit, the root included. `externalId` cannot change. Re-parenting (`parentExternalId`) moves the unit with everything under it. Spend already recorded keeps naming the unit it landed on; caps are evaluated on the current tree, so from the move on the unit's spend in the running cap period counts toward its new ancestors' caps and no longer toward the old ones. `billable` flips the unit's own setting; moving a unit under a non-billable one makes it non-billable in effect (`effectiveBillable`). `409` for a deleted unit (`CUSTOMER_UNIT_DELETED`), a draft (`CUSTOMER_UNIT_DRAFT`), a parent that does not exist or is not ACTIVE, a move of the root (`ROOT_UNIT_IMMOVABLE`), `billable: false` on the root (`ROOT_UNIT_ALWAYS_BILLABLE`), a move under the unit's own subtree, or a tree that would get too deep. `403 FEATURE_NOT_ENABLED` for `billable: false` when non-billable units are not enabled for your organization. Addresses the customer by your external customer id.
2391
+ *
2392
+ * @param {Paid.UpdateCustomerUnitByExternalIdRequest} request
2393
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
2394
+ *
2395
+ * @throws {@link Paid.BadRequestError}
2396
+ * @throws {@link Paid.ForbiddenError}
2397
+ * @throws {@link Paid.NotFoundError}
2398
+ * @throws {@link Paid.ConflictError}
2399
+ * @throws {@link Paid.InternalServerError}
2400
+ *
2401
+ * @example
2402
+ * await client.customers.updateCustomerUnitByExternalId({
2403
+ * externalId: "customer_123",
2404
+ * externalCustomerUnitId: "team-research",
2405
+ * body: {}
2406
+ * })
2407
+ */
2408
+ updateCustomerUnitByExternalId(request, requestOptions) {
2409
+ return core.HttpResponsePromise.fromPromise(this.__updateCustomerUnitByExternalId(request, requestOptions));
2410
+ }
2411
+ __updateCustomerUnitByExternalId(request, requestOptions) {
2412
+ return __awaiter(this, void 0, void 0, function* () {
2413
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2414
+ const { externalId, externalCustomerUnitId, body: _body } = request;
2415
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2416
+ const _response = yield core.fetcher({
2417
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}`),
2418
+ method: "PATCH",
2419
+ headers: _headers,
2420
+ contentType: "application/json",
2421
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
2422
+ requestType: "json",
2423
+ body: _body,
2424
+ 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,
2425
+ 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,
2426
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
2427
+ });
2428
+ if (_response.ok) {
2429
+ return { data: _response.body, rawResponse: _response.rawResponse };
2430
+ }
2431
+ if (_response.error.reason === "status-code") {
2432
+ switch (_response.error.statusCode) {
2433
+ case 400:
2434
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
2435
+ case 403:
2436
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
2437
+ case 404:
2438
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
2439
+ case 409:
2440
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
2441
+ case 500:
2442
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
2443
+ default:
2444
+ throw new errors.PaidError({
2445
+ statusCode: _response.error.statusCode,
2446
+ body: _response.error.body,
2447
+ rawResponse: _response.rawResponse,
2448
+ });
2449
+ }
2450
+ }
2451
+ switch (_response.error.reason) {
2452
+ case "non-json":
2453
+ throw new errors.PaidError({
2454
+ statusCode: _response.error.statusCode,
2455
+ body: _response.error.rawBody,
2456
+ rawResponse: _response.rawResponse,
2457
+ });
2458
+ case "timeout":
2459
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling PATCH /customers/external/{externalId}/customer-units/{externalCustomerUnitId}.");
2460
+ case "unknown":
2461
+ throw new errors.PaidError({
2462
+ message: _response.error.errorMessage,
2463
+ rawResponse: _response.rawResponse,
2464
+ });
2465
+ }
2466
+ });
2467
+ }
2468
+ /**
2469
+ * Lists the aliases that land signals on this unit. A customer-level alias (created on the customer routes) points at the customer's root unit, so it is listed under the root. Addresses the customer by your external customer id.
2470
+ *
2471
+ * @param {Paid.ListCustomerUnitAliasesByExternalIdRequest} request
2472
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
2473
+ *
2474
+ * @throws {@link Paid.BadRequestError}
2475
+ * @throws {@link Paid.ForbiddenError}
2476
+ * @throws {@link Paid.NotFoundError}
2477
+ * @throws {@link Paid.InternalServerError}
2478
+ *
2479
+ * @example
2480
+ * await client.customers.listCustomerUnitAliasesByExternalId({
2481
+ * externalId: "customer_123",
2482
+ * externalCustomerUnitId: "team-research"
2483
+ * })
2484
+ */
2485
+ listCustomerUnitAliasesByExternalId(request, requestOptions) {
2486
+ return core.HttpResponsePromise.fromPromise(this.__listCustomerUnitAliasesByExternalId(request, requestOptions));
2487
+ }
2488
+ __listCustomerUnitAliasesByExternalId(request, requestOptions) {
2489
+ return __awaiter(this, void 0, void 0, function* () {
2490
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2491
+ const { externalId, externalCustomerUnitId, limit, offset } = request;
2492
+ const _queryParams = {};
2493
+ if (limit != null) {
2494
+ _queryParams.limit = limit.toString();
2495
+ }
2496
+ if (offset != null) {
2497
+ _queryParams.offset = offset.toString();
2498
+ }
2499
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2500
+ const _response = yield core.fetcher({
2501
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/aliases`),
2502
+ method: "GET",
2503
+ headers: _headers,
2504
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
2505
+ 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,
2506
+ 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,
2507
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
2508
+ });
2509
+ if (_response.ok) {
2510
+ return { data: _response.body, rawResponse: _response.rawResponse };
2511
+ }
2512
+ if (_response.error.reason === "status-code") {
2513
+ switch (_response.error.statusCode) {
2514
+ case 400:
2515
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
2516
+ case 403:
2517
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
2518
+ case 404:
2519
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
2520
+ case 500:
2521
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
2522
+ default:
2523
+ throw new errors.PaidError({
2524
+ statusCode: _response.error.statusCode,
2525
+ body: _response.error.body,
2526
+ rawResponse: _response.rawResponse,
2527
+ });
2528
+ }
2529
+ }
2530
+ switch (_response.error.reason) {
2531
+ case "non-json":
2532
+ throw new errors.PaidError({
2533
+ statusCode: _response.error.statusCode,
2534
+ body: _response.error.rawBody,
2535
+ rawResponse: _response.rawResponse,
2536
+ });
2537
+ case "timeout":
2538
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/customer-units/{externalCustomerUnitId}/aliases.");
2539
+ case "unknown":
2540
+ throw new errors.PaidError({
2541
+ message: _response.error.errorMessage,
2542
+ rawResponse: _response.rawResponse,
2543
+ });
2544
+ }
2545
+ });
2546
+ }
2547
+ /**
2548
+ * Creates an alias that lands signals on this unit: a signal whose `externalCustomerId` is the alias resolves to this customer and, when it names no `customerUnit`, to this unit. The alias shares one set of ids with customer external ids and unit ids, unique within the organization and ignoring letter case: an alias another customer holds is refused with `409 EXTERNAL_ID_IN_USE`. Addresses the customer by your external customer id.
2549
+ *
2550
+ * @param {Paid.CreateCustomerUnitAliasByExternalIdRequest} request
2551
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
2552
+ *
2553
+ * @throws {@link Paid.BadRequestError}
2554
+ * @throws {@link Paid.ForbiddenError}
2555
+ * @throws {@link Paid.NotFoundError}
2556
+ * @throws {@link Paid.ConflictError}
2557
+ * @throws {@link Paid.InternalServerError}
2558
+ *
2559
+ * @example
2560
+ * await client.customers.createCustomerUnitAliasByExternalId({
2561
+ * externalId: "customer_123",
2562
+ * externalCustomerUnitId: "team-research",
2563
+ * body: {
2564
+ * alias: "child-customer-1"
2565
+ * }
2566
+ * })
2567
+ */
2568
+ createCustomerUnitAliasByExternalId(request, requestOptions) {
2569
+ return core.HttpResponsePromise.fromPromise(this.__createCustomerUnitAliasByExternalId(request, requestOptions));
2570
+ }
2571
+ __createCustomerUnitAliasByExternalId(request, requestOptions) {
2572
+ return __awaiter(this, void 0, void 0, function* () {
2573
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2574
+ const { externalId, externalCustomerUnitId, body: _body } = request;
2575
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2576
+ const _response = yield core.fetcher({
2577
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/aliases`),
2578
+ method: "POST",
2579
+ headers: _headers,
2580
+ contentType: "application/json",
2581
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
2582
+ requestType: "json",
2583
+ body: _body,
2584
+ 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,
2585
+ 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,
2586
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
2587
+ });
2588
+ if (_response.ok) {
2589
+ return { data: _response.body, rawResponse: _response.rawResponse };
2590
+ }
2591
+ if (_response.error.reason === "status-code") {
2592
+ switch (_response.error.statusCode) {
2593
+ case 400:
2594
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
2595
+ case 403:
2596
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
2597
+ case 404:
2598
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
2599
+ case 409:
2600
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
2601
+ case 500:
2602
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
2603
+ default:
2604
+ throw new errors.PaidError({
2605
+ statusCode: _response.error.statusCode,
2606
+ body: _response.error.body,
2607
+ rawResponse: _response.rawResponse,
2608
+ });
2609
+ }
2610
+ }
2611
+ switch (_response.error.reason) {
2612
+ case "non-json":
2613
+ throw new errors.PaidError({
2614
+ statusCode: _response.error.statusCode,
2615
+ body: _response.error.rawBody,
2616
+ rawResponse: _response.rawResponse,
2617
+ });
2618
+ case "timeout":
2619
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/external/{externalId}/customer-units/{externalCustomerUnitId}/aliases.");
2620
+ case "unknown":
2621
+ throw new errors.PaidError({
2622
+ message: _response.error.errorMessage,
2623
+ rawResponse: _response.rawResponse,
2624
+ });
2625
+ }
2626
+ });
2627
+ }
2628
+ /**
2629
+ * Deletes an alias of this unit. Signals still sent with it then resolve to nothing again. Addresses the customer by your external customer id.
2630
+ *
2631
+ * @param {Paid.DeleteCustomerUnitAliasByExternalIdRequest} request
2632
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
2633
+ *
2634
+ * @throws {@link Paid.BadRequestError}
2635
+ * @throws {@link Paid.ForbiddenError}
2636
+ * @throws {@link Paid.NotFoundError}
2637
+ * @throws {@link Paid.InternalServerError}
2638
+ *
2639
+ * @example
2640
+ * await client.customers.deleteCustomerUnitAliasByExternalId({
2641
+ * externalId: "customer_123",
2642
+ * externalCustomerUnitId: "team-research",
2643
+ * alias: "tenant-7-sandbox"
2644
+ * })
2645
+ */
2646
+ deleteCustomerUnitAliasByExternalId(request, requestOptions) {
2647
+ return core.HttpResponsePromise.fromPromise(this.__deleteCustomerUnitAliasByExternalId(request, requestOptions));
2648
+ }
2649
+ __deleteCustomerUnitAliasByExternalId(request, requestOptions) {
2650
+ return __awaiter(this, void 0, void 0, function* () {
2651
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2652
+ const { externalId, externalCustomerUnitId, alias } = request;
2653
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2654
+ const _response = yield core.fetcher({
2655
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/aliases/${core.url.encodePathParam(alias)}`),
2656
+ method: "DELETE",
2657
+ headers: _headers,
2658
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
2659
+ 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,
2660
+ 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,
2661
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
2662
+ });
2663
+ if (_response.ok) {
2664
+ return {
2665
+ data: _response.body,
2666
+ rawResponse: _response.rawResponse,
2667
+ };
2668
+ }
2669
+ if (_response.error.reason === "status-code") {
2670
+ switch (_response.error.statusCode) {
2671
+ case 400:
2672
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
2673
+ case 403:
2674
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
2675
+ case 404:
2676
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
2677
+ case 500:
2678
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
2679
+ default:
2680
+ throw new errors.PaidError({
2681
+ statusCode: _response.error.statusCode,
2682
+ body: _response.error.body,
2683
+ rawResponse: _response.rawResponse,
2684
+ });
2685
+ }
2686
+ }
2687
+ switch (_response.error.reason) {
2688
+ case "non-json":
2689
+ throw new errors.PaidError({
2690
+ statusCode: _response.error.statusCode,
2691
+ body: _response.error.rawBody,
2692
+ rawResponse: _response.rawResponse,
2693
+ });
2694
+ case "timeout":
2695
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/external/{externalId}/customer-units/{externalCustomerUnitId}/aliases/{alias}.");
2696
+ case "unknown":
2697
+ throw new errors.PaidError({
2698
+ message: _response.error.errorMessage,
2699
+ rawResponse: _response.rawResponse,
2700
+ });
2701
+ }
2702
+ });
2703
+ }
2704
+ /**
2705
+ * Lists the customer's units as a flat list, newest last; assemble the tree from `parentExternalId` (`null` on the root unit, `isRoot: true`). Deleted units are hidden unless `status=DELETED` is given, drafts unless `status=DRAFT`. Filter by `externalType`, or by `parentExternalId` for one level of the tree. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
2706
+ *
2707
+ * @param {Paid.ListCustomerUnitsRequest} request
2708
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
2709
+ *
2710
+ * @throws {@link Paid.BadRequestError}
2711
+ * @throws {@link Paid.ForbiddenError}
2712
+ * @throws {@link Paid.NotFoundError}
2713
+ * @throws {@link Paid.InternalServerError}
2714
+ *
2715
+ * @example
2716
+ * await client.customers.listCustomerUnits({
2717
+ * id: "cus_abc123",
2718
+ * parentExternalId: "dept-rnd"
2719
+ * })
2720
+ */
2721
+ listCustomerUnits(request, requestOptions) {
2722
+ return core.HttpResponsePromise.fromPromise(this.__listCustomerUnits(request, requestOptions));
2723
+ }
2724
+ __listCustomerUnits(request, requestOptions) {
2725
+ return __awaiter(this, void 0, void 0, function* () {
2726
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2727
+ const { id, limit, offset, status, externalType, parentExternalId } = request;
2728
+ const _queryParams = {};
2729
+ if (limit != null) {
2730
+ _queryParams.limit = limit.toString();
2731
+ }
2732
+ if (offset != null) {
2733
+ _queryParams.offset = offset.toString();
2734
+ }
2735
+ if (status != null) {
2736
+ _queryParams.status = status;
2737
+ }
2738
+ if (externalType != null) {
2739
+ _queryParams.externalType = externalType;
2740
+ }
2741
+ if (parentExternalId != null) {
2742
+ _queryParams.parentExternalId = parentExternalId;
2743
+ }
2744
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2745
+ const _response = yield core.fetcher({
2746
+ 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, `customers/${core.url.encodePathParam(id)}/customer-units`),
2747
+ method: "GET",
2748
+ headers: _headers,
2749
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
2750
+ 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,
2751
+ 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,
2752
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
2753
+ });
2754
+ if (_response.ok) {
2755
+ return { data: _response.body, rawResponse: _response.rawResponse };
2756
+ }
2757
+ if (_response.error.reason === "status-code") {
2758
+ switch (_response.error.statusCode) {
2759
+ case 400:
2760
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
2761
+ case 403:
2762
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
2763
+ case 404:
2764
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
2765
+ case 500:
2766
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
2767
+ default:
2768
+ throw new errors.PaidError({
2769
+ statusCode: _response.error.statusCode,
2770
+ body: _response.error.body,
2771
+ rawResponse: _response.rawResponse,
2772
+ });
2773
+ }
2774
+ }
2775
+ switch (_response.error.reason) {
2776
+ case "non-json":
2777
+ throw new errors.PaidError({
2778
+ statusCode: _response.error.statusCode,
2779
+ body: _response.error.rawBody,
2780
+ rawResponse: _response.rawResponse,
2781
+ });
2782
+ case "timeout":
2783
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/customer-units.");
2784
+ case "unknown":
2785
+ throw new errors.PaidError({
2786
+ message: _response.error.errorMessage,
2787
+ rawResponse: _response.rawResponse,
2788
+ });
2789
+ }
2790
+ });
2791
+ }
2792
+ /**
2793
+ * Creates a unit for this customer. `externalId` is your own key for it: required, immutable, and unique within the organization (no other customer's unit id, external id or alias may be the same, ignoring letter case); every unit route addresses the unit by it, and `name` defaults to it. Omit `parentExternalId` to create the customer's root unit (its first unit; `409 ROOT_EXISTS` if it already has one — a customer created with an external id usable as a unit key already has its root, keyed by that external id, so name it as the parent instead); otherwise the parent must exist (`409 PARENT_NOT_FOUND`) and be ACTIVE. A create whose `externalId` is one of this customer's `DRAFT` units promotes the draft in place: same unit, same id, now ACTIVE with the request's name, type, metadata and parent (`parentExternalId` is required; a draft sits under the root). A signal that names a unit before it exists is accepted; with draft units enabled for your organization it creates a `DRAFT` unit under the customer's root that holds the key, and creating the unit with that key later promotes the draft; otherwise its spend attaches to the unit once you create it with that key. `409` also when the externalId is taken on this customer (`CUSTOMER_UNIT_EXISTS`) or by another customer of the organization (`EXTERNAL_ID_IN_USE`), the tree would get too deep, the customer is on seat-based billing, or a root unit is sent with `billable: false` (`ROOT_UNIT_ALWAYS_BILLABLE`). `403 FEATURE_NOT_ENABLED` for `billable: false` when non-billable units are not enabled for your organization. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
2794
+ *
2795
+ * @param {Paid.CreateCustomerUnitRequest} request
2796
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
2797
+ *
2798
+ * @throws {@link Paid.BadRequestError}
2799
+ * @throws {@link Paid.ForbiddenError}
2800
+ * @throws {@link Paid.NotFoundError}
2801
+ * @throws {@link Paid.ConflictError}
2802
+ * @throws {@link Paid.InternalServerError}
2803
+ *
2804
+ * @example
2805
+ * await client.customers.createCustomerUnit({
2806
+ * id: "cus_abc123",
2807
+ * body: {
2808
+ * externalId: "team-research"
2809
+ * }
2810
+ * })
2811
+ */
2812
+ createCustomerUnit(request, requestOptions) {
2813
+ return core.HttpResponsePromise.fromPromise(this.__createCustomerUnit(request, requestOptions));
2814
+ }
2815
+ __createCustomerUnit(request, requestOptions) {
2816
+ return __awaiter(this, void 0, void 0, function* () {
2817
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2818
+ const { id, body: _body } = request;
2819
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2820
+ const _response = yield core.fetcher({
2821
+ 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, `customers/${core.url.encodePathParam(id)}/customer-units`),
2822
+ method: "POST",
2823
+ headers: _headers,
2824
+ contentType: "application/json",
2825
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
2826
+ requestType: "json",
2827
+ body: _body,
2828
+ 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,
2829
+ 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,
2830
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
2831
+ });
2832
+ if (_response.ok) {
2833
+ return { data: _response.body, rawResponse: _response.rawResponse };
2834
+ }
2835
+ if (_response.error.reason === "status-code") {
2836
+ switch (_response.error.statusCode) {
2837
+ case 400:
2838
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
2839
+ case 403:
2840
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
2841
+ case 404:
2842
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
2843
+ case 409:
2844
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
2845
+ case 500:
2846
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
2847
+ default:
2848
+ throw new errors.PaidError({
2849
+ statusCode: _response.error.statusCode,
2850
+ body: _response.error.body,
2851
+ rawResponse: _response.rawResponse,
2852
+ });
2853
+ }
2854
+ }
2855
+ switch (_response.error.reason) {
2856
+ case "non-json":
2857
+ throw new errors.PaidError({
2858
+ statusCode: _response.error.statusCode,
2859
+ body: _response.error.rawBody,
2860
+ rawResponse: _response.rawResponse,
2861
+ });
2862
+ case "timeout":
2863
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/{id}/customer-units.");
2864
+ case "unknown":
2865
+ throw new errors.PaidError({
2866
+ message: _response.error.errorMessage,
2867
+ rawResponse: _response.rawResponse,
2868
+ });
2869
+ }
2870
+ });
2871
+ }
2872
+ /**
2873
+ * Returns one unit of this customer by its `externalId`, including a deleted one. `404` when the unit does not exist or belongs to another customer. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
2874
+ *
2875
+ * @param {Paid.GetCustomerUnitRequest} request
2876
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
2877
+ *
2878
+ * @throws {@link Paid.BadRequestError}
2879
+ * @throws {@link Paid.ForbiddenError}
2880
+ * @throws {@link Paid.NotFoundError}
2881
+ * @throws {@link Paid.InternalServerError}
2882
+ *
2883
+ * @example
2884
+ * await client.customers.getCustomerUnit({
2885
+ * id: "cus_abc123",
2886
+ * externalCustomerUnitId: "team-research"
2887
+ * })
2888
+ */
2889
+ getCustomerUnit(request, requestOptions) {
2890
+ return core.HttpResponsePromise.fromPromise(this.__getCustomerUnit(request, requestOptions));
2891
+ }
2892
+ __getCustomerUnit(request, requestOptions) {
2893
+ return __awaiter(this, void 0, void 0, function* () {
2894
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2895
+ const { id, externalCustomerUnitId } = request;
2896
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2897
+ const _response = yield core.fetcher({
2898
+ 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, `customers/${core.url.encodePathParam(id)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}`),
2899
+ method: "GET",
2900
+ headers: _headers,
2901
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
2902
+ 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,
2903
+ 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,
2904
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
2905
+ });
2906
+ if (_response.ok) {
2907
+ return { data: _response.body, rawResponse: _response.rawResponse };
2908
+ }
2909
+ if (_response.error.reason === "status-code") {
2910
+ switch (_response.error.statusCode) {
2911
+ case 400:
2912
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
2913
+ case 403:
2914
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
2915
+ case 404:
2916
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
2917
+ case 500:
2918
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
2919
+ default:
2920
+ throw new errors.PaidError({
2921
+ statusCode: _response.error.statusCode,
2922
+ body: _response.error.body,
2923
+ rawResponse: _response.rawResponse,
2924
+ });
2925
+ }
2926
+ }
2927
+ switch (_response.error.reason) {
2928
+ case "non-json":
2929
+ throw new errors.PaidError({
2930
+ statusCode: _response.error.statusCode,
2931
+ body: _response.error.rawBody,
2932
+ rawResponse: _response.rawResponse,
2933
+ });
2934
+ case "timeout":
2935
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/customer-units/{externalCustomerUnitId}.");
2936
+ case "unknown":
2937
+ throw new errors.PaidError({
2938
+ message: _response.error.errorMessage,
2939
+ rawResponse: _response.rawResponse,
2940
+ });
2941
+ }
2942
+ });
2943
+ }
2944
+ /**
2945
+ * Soft-deletes a unit: it stays readable with `status: DELETED` and cannot be reactivated. Spend history that references it is kept, and signals that keep naming it are still attributed to it. A `DRAFT` unit is deleted the same way: it stays readable as DELETED, its key stays reserved, and spend already keyed to it stays its own. `409` while the unit has ACTIVE or DRAFT children or a cap in force or scheduled; the root follows the same rules, and once it is deleted a new root can be created. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
2946
+ *
2947
+ * @param {Paid.DeleteCustomerUnitRequest} request
2948
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
2949
+ *
2950
+ * @throws {@link Paid.BadRequestError}
2951
+ * @throws {@link Paid.ForbiddenError}
2952
+ * @throws {@link Paid.NotFoundError}
2953
+ * @throws {@link Paid.ConflictError}
2954
+ * @throws {@link Paid.InternalServerError}
2955
+ *
2956
+ * @example
2957
+ * await client.customers.deleteCustomerUnit({
2958
+ * id: "cus_abc123",
2959
+ * externalCustomerUnitId: "team-research"
2960
+ * })
2961
+ */
2962
+ deleteCustomerUnit(request, requestOptions) {
2963
+ return core.HttpResponsePromise.fromPromise(this.__deleteCustomerUnit(request, requestOptions));
2964
+ }
2965
+ __deleteCustomerUnit(request, requestOptions) {
2966
+ return __awaiter(this, void 0, void 0, function* () {
2967
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2968
+ const { id, externalCustomerUnitId } = request;
2969
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2970
+ const _response = yield core.fetcher({
2971
+ 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, `customers/${core.url.encodePathParam(id)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}`),
2972
+ method: "DELETE",
2973
+ headers: _headers,
2974
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
2975
+ 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,
2976
+ 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,
2977
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
2978
+ });
2979
+ if (_response.ok) {
2980
+ return { data: _response.body, rawResponse: _response.rawResponse };
2981
+ }
2982
+ if (_response.error.reason === "status-code") {
2983
+ switch (_response.error.statusCode) {
2984
+ case 400:
2985
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
2986
+ case 403:
2987
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
2988
+ case 404:
2989
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
2990
+ case 409:
2991
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
2992
+ case 500:
2993
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
2994
+ default:
2995
+ throw new errors.PaidError({
2996
+ statusCode: _response.error.statusCode,
2997
+ body: _response.error.body,
2998
+ rawResponse: _response.rawResponse,
2999
+ });
3000
+ }
3001
+ }
3002
+ switch (_response.error.reason) {
3003
+ case "non-json":
3004
+ throw new errors.PaidError({
3005
+ statusCode: _response.error.statusCode,
3006
+ body: _response.error.rawBody,
3007
+ rawResponse: _response.rawResponse,
3008
+ });
3009
+ case "timeout":
3010
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/{id}/customer-units/{externalCustomerUnitId}.");
3011
+ case "unknown":
3012
+ throw new errors.PaidError({
3013
+ message: _response.error.errorMessage,
3014
+ rawResponse: _response.rawResponse,
3015
+ });
3016
+ }
3017
+ });
3018
+ }
3019
+ /**
3020
+ * Renames, re-types, re-parents or annotates a unit, the root included. `externalId` cannot change. Re-parenting (`parentExternalId`) moves the unit with everything under it. Spend already recorded keeps naming the unit it landed on; caps are evaluated on the current tree, so from the move on the unit's spend in the running cap period counts toward its new ancestors' caps and no longer toward the old ones. `billable` flips the unit's own setting; moving a unit under a non-billable one makes it non-billable in effect (`effectiveBillable`). `409` for a deleted unit (`CUSTOMER_UNIT_DELETED`), a draft (`CUSTOMER_UNIT_DRAFT`), a parent that does not exist or is not ACTIVE, a move of the root (`ROOT_UNIT_IMMOVABLE`), `billable: false` on the root (`ROOT_UNIT_ALWAYS_BILLABLE`), a move under the unit's own subtree, or a tree that would get too deep. `403 FEATURE_NOT_ENABLED` for `billable: false` when non-billable units are not enabled for your organization. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
3021
+ *
3022
+ * @param {Paid.UpdateCustomerUnitRequest} request
3023
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
3024
+ *
3025
+ * @throws {@link Paid.BadRequestError}
3026
+ * @throws {@link Paid.ForbiddenError}
3027
+ * @throws {@link Paid.NotFoundError}
3028
+ * @throws {@link Paid.ConflictError}
3029
+ * @throws {@link Paid.InternalServerError}
3030
+ *
3031
+ * @example
3032
+ * await client.customers.updateCustomerUnit({
3033
+ * id: "cus_abc123",
3034
+ * externalCustomerUnitId: "team-research",
3035
+ * body: {}
3036
+ * })
3037
+ */
3038
+ updateCustomerUnit(request, requestOptions) {
3039
+ return core.HttpResponsePromise.fromPromise(this.__updateCustomerUnit(request, requestOptions));
3040
+ }
3041
+ __updateCustomerUnit(request, requestOptions) {
3042
+ return __awaiter(this, void 0, void 0, function* () {
3043
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3044
+ const { id, externalCustomerUnitId, body: _body } = request;
3045
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
3046
+ const _response = yield core.fetcher({
3047
+ 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, `customers/${core.url.encodePathParam(id)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}`),
3048
+ method: "PATCH",
3049
+ headers: _headers,
3050
+ contentType: "application/json",
3051
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
3052
+ requestType: "json",
3053
+ body: _body,
3054
+ 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,
3055
+ 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,
3056
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
3057
+ });
3058
+ if (_response.ok) {
3059
+ return { data: _response.body, rawResponse: _response.rawResponse };
3060
+ }
3061
+ if (_response.error.reason === "status-code") {
3062
+ switch (_response.error.statusCode) {
3063
+ case 400:
3064
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
3065
+ case 403:
3066
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
3067
+ case 404:
3068
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
3069
+ case 409:
3070
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
3071
+ case 500:
3072
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
3073
+ default:
3074
+ throw new errors.PaidError({
3075
+ statusCode: _response.error.statusCode,
3076
+ body: _response.error.body,
3077
+ rawResponse: _response.rawResponse,
3078
+ });
3079
+ }
3080
+ }
3081
+ switch (_response.error.reason) {
3082
+ case "non-json":
3083
+ throw new errors.PaidError({
3084
+ statusCode: _response.error.statusCode,
3085
+ body: _response.error.rawBody,
3086
+ rawResponse: _response.rawResponse,
3087
+ });
3088
+ case "timeout":
3089
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling PATCH /customers/{id}/customer-units/{externalCustomerUnitId}.");
3090
+ case "unknown":
3091
+ throw new errors.PaidError({
3092
+ message: _response.error.errorMessage,
3093
+ rawResponse: _response.rawResponse,
3094
+ });
3095
+ }
3096
+ });
3097
+ }
3098
+ /**
3099
+ * Lists the aliases that land signals on this unit. A customer-level alias (created on the customer routes) points at the customer's root unit, so it is listed under the root. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
3100
+ *
3101
+ * @param {Paid.ListCustomerUnitAliasesRequest} request
3102
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
3103
+ *
3104
+ * @throws {@link Paid.BadRequestError}
3105
+ * @throws {@link Paid.ForbiddenError}
3106
+ * @throws {@link Paid.NotFoundError}
3107
+ * @throws {@link Paid.InternalServerError}
3108
+ *
3109
+ * @example
3110
+ * await client.customers.listCustomerUnitAliases({
3111
+ * id: "cus_abc123",
3112
+ * externalCustomerUnitId: "team-research"
3113
+ * })
3114
+ */
3115
+ listCustomerUnitAliases(request, requestOptions) {
3116
+ return core.HttpResponsePromise.fromPromise(this.__listCustomerUnitAliases(request, requestOptions));
3117
+ }
3118
+ __listCustomerUnitAliases(request, requestOptions) {
3119
+ return __awaiter(this, void 0, void 0, function* () {
3120
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3121
+ const { id, externalCustomerUnitId, limit, offset } = request;
3122
+ const _queryParams = {};
3123
+ if (limit != null) {
3124
+ _queryParams.limit = limit.toString();
3125
+ }
3126
+ if (offset != null) {
3127
+ _queryParams.offset = offset.toString();
3128
+ }
3129
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
3130
+ const _response = yield core.fetcher({
3131
+ 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, `customers/${core.url.encodePathParam(id)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/aliases`),
3132
+ method: "GET",
3133
+ headers: _headers,
3134
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
3135
+ 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,
3136
+ 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,
3137
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
3138
+ });
3139
+ if (_response.ok) {
3140
+ return { data: _response.body, rawResponse: _response.rawResponse };
3141
+ }
3142
+ if (_response.error.reason === "status-code") {
3143
+ switch (_response.error.statusCode) {
3144
+ case 400:
3145
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
3146
+ case 403:
3147
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
3148
+ case 404:
3149
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
3150
+ case 500:
3151
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
3152
+ default:
3153
+ throw new errors.PaidError({
3154
+ statusCode: _response.error.statusCode,
3155
+ body: _response.error.body,
3156
+ rawResponse: _response.rawResponse,
3157
+ });
3158
+ }
3159
+ }
3160
+ switch (_response.error.reason) {
3161
+ case "non-json":
3162
+ throw new errors.PaidError({
3163
+ statusCode: _response.error.statusCode,
3164
+ body: _response.error.rawBody,
3165
+ rawResponse: _response.rawResponse,
3166
+ });
3167
+ case "timeout":
3168
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/customer-units/{externalCustomerUnitId}/aliases.");
3169
+ case "unknown":
3170
+ throw new errors.PaidError({
3171
+ message: _response.error.errorMessage,
3172
+ rawResponse: _response.rawResponse,
3173
+ });
3174
+ }
3175
+ });
3176
+ }
3177
+ /**
3178
+ * Creates an alias that lands signals on this unit: a signal whose `externalCustomerId` is the alias resolves to this customer and, when it names no `customerUnit`, to this unit. The alias shares one set of ids with customer external ids and unit ids, unique within the organization and ignoring letter case: an alias another customer holds is refused with `409 EXTERNAL_ID_IN_USE`. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
3179
+ *
3180
+ * @param {Paid.CreateCustomerUnitAliasRequest} request
3181
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
3182
+ *
3183
+ * @throws {@link Paid.BadRequestError}
3184
+ * @throws {@link Paid.ForbiddenError}
3185
+ * @throws {@link Paid.NotFoundError}
3186
+ * @throws {@link Paid.ConflictError}
3187
+ * @throws {@link Paid.InternalServerError}
3188
+ *
3189
+ * @example
3190
+ * await client.customers.createCustomerUnitAlias({
3191
+ * id: "cus_abc123",
3192
+ * externalCustomerUnitId: "team-research",
3193
+ * body: {
3194
+ * alias: "child-customer-1"
3195
+ * }
3196
+ * })
3197
+ */
3198
+ createCustomerUnitAlias(request, requestOptions) {
3199
+ return core.HttpResponsePromise.fromPromise(this.__createCustomerUnitAlias(request, requestOptions));
3200
+ }
3201
+ __createCustomerUnitAlias(request, requestOptions) {
3202
+ return __awaiter(this, void 0, void 0, function* () {
3203
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3204
+ const { id, externalCustomerUnitId, body: _body } = request;
3205
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
3206
+ const _response = yield core.fetcher({
3207
+ 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, `customers/${core.url.encodePathParam(id)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/aliases`),
3208
+ method: "POST",
3209
+ headers: _headers,
3210
+ contentType: "application/json",
3211
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
3212
+ requestType: "json",
3213
+ body: _body,
3214
+ 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,
3215
+ 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,
3216
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
3217
+ });
3218
+ if (_response.ok) {
3219
+ return { data: _response.body, rawResponse: _response.rawResponse };
3220
+ }
3221
+ if (_response.error.reason === "status-code") {
3222
+ switch (_response.error.statusCode) {
3223
+ case 400:
3224
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
3225
+ case 403:
3226
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
3227
+ case 404:
3228
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
3229
+ case 409:
3230
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
3231
+ case 500:
3232
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
3233
+ default:
3234
+ throw new errors.PaidError({
3235
+ statusCode: _response.error.statusCode,
3236
+ body: _response.error.body,
3237
+ rawResponse: _response.rawResponse,
3238
+ });
3239
+ }
3240
+ }
3241
+ switch (_response.error.reason) {
3242
+ case "non-json":
3243
+ throw new errors.PaidError({
3244
+ statusCode: _response.error.statusCode,
3245
+ body: _response.error.rawBody,
3246
+ rawResponse: _response.rawResponse,
3247
+ });
3248
+ case "timeout":
3249
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/{id}/customer-units/{externalCustomerUnitId}/aliases.");
3250
+ case "unknown":
3251
+ throw new errors.PaidError({
3252
+ message: _response.error.errorMessage,
3253
+ rawResponse: _response.rawResponse,
3254
+ });
3255
+ }
3256
+ });
3257
+ }
3258
+ /**
3259
+ * Deletes an alias of this unit. Signals still sent with it then resolve to nothing again. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
3260
+ *
3261
+ * @param {Paid.DeleteCustomerUnitAliasRequest} request
3262
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
3263
+ *
3264
+ * @throws {@link Paid.BadRequestError}
3265
+ * @throws {@link Paid.ForbiddenError}
3266
+ * @throws {@link Paid.NotFoundError}
3267
+ * @throws {@link Paid.InternalServerError}
3268
+ *
3269
+ * @example
3270
+ * await client.customers.deleteCustomerUnitAlias({
3271
+ * id: "cus_abc123",
3272
+ * externalCustomerUnitId: "team-research",
3273
+ * alias: "tenant-7-sandbox"
3274
+ * })
3275
+ */
3276
+ deleteCustomerUnitAlias(request, requestOptions) {
3277
+ return core.HttpResponsePromise.fromPromise(this.__deleteCustomerUnitAlias(request, requestOptions));
3278
+ }
3279
+ __deleteCustomerUnitAlias(request, requestOptions) {
3280
+ return __awaiter(this, void 0, void 0, function* () {
3281
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3282
+ const { id, externalCustomerUnitId, alias } = request;
3283
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
3284
+ const _response = yield core.fetcher({
3285
+ 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, `customers/${core.url.encodePathParam(id)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/aliases/${core.url.encodePathParam(alias)}`),
3286
+ method: "DELETE",
3287
+ headers: _headers,
3288
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
3289
+ 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,
3290
+ 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,
3291
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
3292
+ });
3293
+ if (_response.ok) {
3294
+ return { data: _response.body, rawResponse: _response.rawResponse };
3295
+ }
3296
+ if (_response.error.reason === "status-code") {
3297
+ switch (_response.error.statusCode) {
3298
+ case 400:
3299
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
3300
+ case 403:
3301
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
3302
+ case 404:
3303
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
3304
+ case 500:
3305
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
3306
+ default:
3307
+ throw new errors.PaidError({
3308
+ statusCode: _response.error.statusCode,
3309
+ body: _response.error.body,
3310
+ rawResponse: _response.rawResponse,
3311
+ });
3312
+ }
3313
+ }
3314
+ switch (_response.error.reason) {
3315
+ case "non-json":
3316
+ throw new errors.PaidError({
3317
+ statusCode: _response.error.statusCode,
3318
+ body: _response.error.rawBody,
3319
+ rawResponse: _response.rawResponse,
3320
+ });
3321
+ case "timeout":
3322
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/{id}/customer-units/{externalCustomerUnitId}/aliases/{alias}.");
3323
+ case "unknown":
3324
+ throw new errors.PaidError({
3325
+ message: _response.error.errorMessage,
3326
+ rawResponse: _response.rawResponse,
3327
+ });
3328
+ }
3329
+ });
3330
+ }
3331
+ /**
3332
+ * Returns a unit by its key without naming its customer. The answer carries the customer's ids (`customerId`, `customerExternalId`) so the customer routes are one hop away, but, like the create on this path, not Paid's unit id: a caller of these routes names units by key. The key is looked up across the organization ignoring letter case. When more than one unit carries it in another letter case (legacy duplicates across customers, or case variants on one customer), the exact spelling decides; when that does not single one out either, the answer is `409 CUSTOMER_UNIT_AMBIGUOUS`: use the customer's unit routes, where the key is exact.
3333
+ *
3334
+ * @param {Paid.GetCustomerUnitByKeyRequest} request
3335
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
3336
+ *
3337
+ * @throws {@link Paid.BadRequestError}
3338
+ * @throws {@link Paid.ForbiddenError}
3339
+ * @throws {@link Paid.NotFoundError}
3340
+ * @throws {@link Paid.ConflictError}
3341
+ * @throws {@link Paid.InternalServerError}
3342
+ *
3343
+ * @example
3344
+ * await client.customers.getCustomerUnitByKey({
3345
+ * externalCustomerUnitId: "team-research"
3346
+ * })
3347
+ */
3348
+ getCustomerUnitByKey(request, requestOptions) {
3349
+ return core.HttpResponsePromise.fromPromise(this.__getCustomerUnitByKey(request, requestOptions));
3350
+ }
3351
+ __getCustomerUnitByKey(request, requestOptions) {
3352
+ return __awaiter(this, void 0, void 0, function* () {
3353
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3354
+ const { externalCustomerUnitId } = request;
3355
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
3356
+ const _response = yield core.fetcher({
3357
+ 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, `customer-units/external/${core.url.encodePathParam(externalCustomerUnitId)}`),
3358
+ method: "GET",
3359
+ headers: _headers,
3360
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
3361
+ 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,
3362
+ 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,
3363
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
3364
+ });
3365
+ if (_response.ok) {
3366
+ return { data: _response.body, rawResponse: _response.rawResponse };
3367
+ }
3368
+ if (_response.error.reason === "status-code") {
3369
+ switch (_response.error.statusCode) {
3370
+ case 400:
3371
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
3372
+ case 403:
3373
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
3374
+ case 404:
3375
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
3376
+ case 409:
3377
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
3378
+ case 500:
3379
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
3380
+ default:
3381
+ throw new errors.PaidError({
3382
+ statusCode: _response.error.statusCode,
3383
+ body: _response.error.body,
3384
+ rawResponse: _response.rawResponse,
3385
+ });
3386
+ }
3387
+ }
3388
+ switch (_response.error.reason) {
3389
+ case "non-json":
3390
+ throw new errors.PaidError({
3391
+ statusCode: _response.error.statusCode,
3392
+ body: _response.error.rawBody,
3393
+ rawResponse: _response.rawResponse,
3394
+ });
3395
+ case "timeout":
3396
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customer-units/external/{externalCustomerUnitId}.");
3397
+ case "unknown":
3398
+ throw new errors.PaidError({
3399
+ message: _response.error.errorMessage,
3400
+ rawResponse: _response.rawResponse,
3401
+ });
3402
+ }
3403
+ });
3404
+ }
3405
+ /**
3406
+ * Lists the aliases that land signals on this unit, without naming its customer. The key is looked up across the organization ignoring letter case. When more than one unit carries it in another letter case (legacy duplicates across customers, or case variants on one customer), the exact spelling decides; when that does not single one out either, the answer is `409 CUSTOMER_UNIT_AMBIGUOUS`: use the customer's unit routes, where the key is exact.
3407
+ *
3408
+ * @param {Paid.ListCustomerUnitAliasesByKeyRequest} request
3409
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
3410
+ *
3411
+ * @throws {@link Paid.BadRequestError}
3412
+ * @throws {@link Paid.ForbiddenError}
3413
+ * @throws {@link Paid.NotFoundError}
3414
+ * @throws {@link Paid.ConflictError}
3415
+ * @throws {@link Paid.InternalServerError}
3416
+ *
3417
+ * @example
3418
+ * await client.customers.listCustomerUnitAliasesByKey({
3419
+ * externalCustomerUnitId: "team-research"
3420
+ * })
3421
+ */
3422
+ listCustomerUnitAliasesByKey(request, requestOptions) {
3423
+ return core.HttpResponsePromise.fromPromise(this.__listCustomerUnitAliasesByKey(request, requestOptions));
3424
+ }
3425
+ __listCustomerUnitAliasesByKey(request, requestOptions) {
3426
+ return __awaiter(this, void 0, void 0, function* () {
3427
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3428
+ const { externalCustomerUnitId, limit, offset } = request;
3429
+ const _queryParams = {};
3430
+ if (limit != null) {
3431
+ _queryParams.limit = limit.toString();
3432
+ }
3433
+ if (offset != null) {
3434
+ _queryParams.offset = offset.toString();
3435
+ }
3436
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
3437
+ const _response = yield core.fetcher({
3438
+ 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, `customer-units/external/${core.url.encodePathParam(externalCustomerUnitId)}/aliases`),
3439
+ method: "GET",
3440
+ headers: _headers,
3441
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
3442
+ 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,
3443
+ 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,
3444
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
3445
+ });
3446
+ if (_response.ok) {
3447
+ return { data: _response.body, rawResponse: _response.rawResponse };
3448
+ }
3449
+ if (_response.error.reason === "status-code") {
3450
+ switch (_response.error.statusCode) {
3451
+ case 400:
3452
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
3453
+ case 403:
3454
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
3455
+ case 404:
3456
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
3457
+ case 409:
3458
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
3459
+ case 500:
3460
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
3461
+ default:
3462
+ throw new errors.PaidError({
3463
+ statusCode: _response.error.statusCode,
3464
+ body: _response.error.body,
3465
+ rawResponse: _response.rawResponse,
3466
+ });
3467
+ }
3468
+ }
3469
+ switch (_response.error.reason) {
3470
+ case "non-json":
3471
+ throw new errors.PaidError({
3472
+ statusCode: _response.error.statusCode,
3473
+ body: _response.error.rawBody,
3474
+ rawResponse: _response.rawResponse,
3475
+ });
3476
+ case "timeout":
3477
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customer-units/external/{externalCustomerUnitId}/aliases.");
3478
+ case "unknown":
3479
+ throw new errors.PaidError({
3480
+ message: _response.error.errorMessage,
3481
+ rawResponse: _response.rawResponse,
3482
+ });
3483
+ }
3484
+ });
3485
+ }
3486
+ /**
3487
+ * Creates an alias that lands signals on this unit, without naming its customer: a signal whose `externalCustomerId` is the alias resolves to the unit's customer and is attributed to this unit. The alias must be unique within the organization ignoring letter case (`409 EXTERNAL_ID_IN_USE`). The key is looked up across the organization ignoring letter case. When more than one unit carries it in another letter case (legacy duplicates across customers, or case variants on one customer), the exact spelling decides; when that does not single one out either, the answer is `409 CUSTOMER_UNIT_AMBIGUOUS`: use the customer's unit routes, where the key is exact.
3488
+ *
3489
+ * @param {Paid.CreateCustomerUnitAliasByKeyRequest} request
3490
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
3491
+ *
3492
+ * @throws {@link Paid.BadRequestError}
3493
+ * @throws {@link Paid.ForbiddenError}
3494
+ * @throws {@link Paid.NotFoundError}
3495
+ * @throws {@link Paid.ConflictError}
3496
+ * @throws {@link Paid.InternalServerError}
3497
+ *
3498
+ * @example
3499
+ * await client.customers.createCustomerUnitAliasByKey({
3500
+ * externalCustomerUnitId: "team-research",
3501
+ * body: {
3502
+ * alias: "child-customer-1"
3503
+ * }
3504
+ * })
3505
+ */
3506
+ createCustomerUnitAliasByKey(request, requestOptions) {
3507
+ return core.HttpResponsePromise.fromPromise(this.__createCustomerUnitAliasByKey(request, requestOptions));
3508
+ }
3509
+ __createCustomerUnitAliasByKey(request, requestOptions) {
3510
+ return __awaiter(this, void 0, void 0, function* () {
3511
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3512
+ const { externalCustomerUnitId, body: _body } = request;
3513
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
3514
+ const _response = yield core.fetcher({
3515
+ 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, `customer-units/external/${core.url.encodePathParam(externalCustomerUnitId)}/aliases`),
3516
+ method: "POST",
3517
+ headers: _headers,
3518
+ contentType: "application/json",
3519
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
3520
+ requestType: "json",
3521
+ body: _body,
3522
+ 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,
3523
+ 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,
3524
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
3525
+ });
3526
+ if (_response.ok) {
3527
+ return { data: _response.body, rawResponse: _response.rawResponse };
3528
+ }
3529
+ if (_response.error.reason === "status-code") {
3530
+ switch (_response.error.statusCode) {
3531
+ case 400:
3532
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
3533
+ case 403:
3534
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
3535
+ case 404:
3536
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
3537
+ case 409:
3538
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
3539
+ case 500:
3540
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
3541
+ default:
3542
+ throw new errors.PaidError({
3543
+ statusCode: _response.error.statusCode,
3544
+ body: _response.error.body,
3545
+ rawResponse: _response.rawResponse,
3546
+ });
3547
+ }
3548
+ }
3549
+ switch (_response.error.reason) {
3550
+ case "non-json":
3551
+ throw new errors.PaidError({
3552
+ statusCode: _response.error.statusCode,
3553
+ body: _response.error.rawBody,
3554
+ rawResponse: _response.rawResponse,
3555
+ });
3556
+ case "timeout":
3557
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customer-units/external/{externalCustomerUnitId}/aliases.");
3558
+ case "unknown":
3559
+ throw new errors.PaidError({
3560
+ message: _response.error.errorMessage,
3561
+ rawResponse: _response.rawResponse,
3562
+ });
3563
+ }
3564
+ });
3565
+ }
3566
+ /**
3567
+ * Deletes an alias of this unit, without naming its customer. Signals still sent with it then resolve to nothing again. The key is looked up across the organization ignoring letter case. When more than one unit carries it in another letter case (legacy duplicates across customers, or case variants on one customer), the exact spelling decides; when that does not single one out either, the answer is `409 CUSTOMER_UNIT_AMBIGUOUS`: use the customer's unit routes, where the key is exact.
3568
+ *
3569
+ * @param {Paid.DeleteCustomerUnitAliasByKeyRequest} request
3570
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
3571
+ *
3572
+ * @throws {@link Paid.BadRequestError}
3573
+ * @throws {@link Paid.ForbiddenError}
3574
+ * @throws {@link Paid.NotFoundError}
3575
+ * @throws {@link Paid.ConflictError}
3576
+ * @throws {@link Paid.InternalServerError}
3577
+ *
3578
+ * @example
3579
+ * await client.customers.deleteCustomerUnitAliasByKey({
3580
+ * externalCustomerUnitId: "team-research",
3581
+ * alias: "tenant-7"
3582
+ * })
3583
+ */
3584
+ deleteCustomerUnitAliasByKey(request, requestOptions) {
3585
+ return core.HttpResponsePromise.fromPromise(this.__deleteCustomerUnitAliasByKey(request, requestOptions));
3586
+ }
3587
+ __deleteCustomerUnitAliasByKey(request, requestOptions) {
3588
+ return __awaiter(this, void 0, void 0, function* () {
3589
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3590
+ const { externalCustomerUnitId, alias } = request;
3591
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
3592
+ const _response = yield core.fetcher({
3593
+ 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, `customer-units/external/${core.url.encodePathParam(externalCustomerUnitId)}/aliases/${core.url.encodePathParam(alias)}`),
3594
+ method: "DELETE",
3595
+ headers: _headers,
3596
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
3597
+ 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,
3598
+ 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,
3599
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
3600
+ });
3601
+ if (_response.ok) {
3602
+ return {
3603
+ data: _response.body,
3604
+ rawResponse: _response.rawResponse,
3605
+ };
3606
+ }
3607
+ if (_response.error.reason === "status-code") {
3608
+ switch (_response.error.statusCode) {
3609
+ case 400:
3610
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
3611
+ case 403:
3612
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
3613
+ case 404:
3614
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
3615
+ case 409:
3616
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
3617
+ case 500:
3618
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
3619
+ default:
3620
+ throw new errors.PaidError({
3621
+ statusCode: _response.error.statusCode,
3622
+ body: _response.error.body,
3623
+ rawResponse: _response.rawResponse,
3624
+ });
3625
+ }
3626
+ }
3627
+ switch (_response.error.reason) {
3628
+ case "non-json":
3629
+ throw new errors.PaidError({
3630
+ statusCode: _response.error.statusCode,
3631
+ body: _response.error.rawBody,
3632
+ rawResponse: _response.rawResponse,
3633
+ });
3634
+ case "timeout":
3635
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customer-units/external/{externalCustomerUnitId}/aliases/{alias}.");
3636
+ case "unknown":
3637
+ throw new errors.PaidError({
3638
+ message: _response.error.errorMessage,
3639
+ rawResponse: _response.rawResponse,
3640
+ });
3641
+ }
3642
+ });
3643
+ }
3644
+ /**
3645
+ * Creates a unit by naming its parent alone; the customer is whoever the parent belongs to, so a caller that only knows its own ids never needs the customer routes. `parentExternalId` is looked up across the organization, ignoring letter case, among unit ids, customer external ids and aliases: a unit becomes the parent; a customer (by external id or alias) stands for the top of its tree, so the new unit goes under the root unit, or becomes the root when the customer has none. The parent is only ever named by your id, never by a Paid id, so a customer with no external id takes its units through the customer's unit routes. The answer carries the unit's `externalId` and its customer's ids, not Paid's unit id. `externalId` follows the same rules as on the customer-scoped create: required, immutable, unique within the organization ignoring letter case. `409 PARENT_NOT_FOUND` when nothing matches, `PARENT_NOT_ACTIVE` for a deleted or draft parent, `PARENT_AMBIGUOUS` when legacy rows let the id name more than one customer (use that customer's unit routes), `PARENT_CHANGED` when the reference pointed elsewhere by the time the create ran (send it again), and otherwise the customer-scoped create's 409s (`CUSTOMER_UNIT_EXISTS`, `EXTERNAL_ID_IN_USE`, `DEPTH_EXCEEDED`, `SEAT_BILLING`, and `ROOT_UNIT_ALWAYS_BILLABLE` for `billable: false` on a unit that would become the root). `403 FEATURE_NOT_ENABLED` for `billable: false` when non-billable units are not enabled for your organization.
3646
+ *
3647
+ * @param {Paid.CustomerUnitCreateUnderParent} request
3648
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
3649
+ *
3650
+ * @throws {@link Paid.BadRequestError}
3651
+ * @throws {@link Paid.ForbiddenError}
3652
+ * @throws {@link Paid.ConflictError}
3653
+ * @throws {@link Paid.InternalServerError}
3654
+ *
3655
+ * @example
3656
+ * await client.customers.createCustomerUnitUnderParent({
3657
+ * externalId: "team-research",
3658
+ * parentExternalId: "dept-rnd"
3659
+ * })
3660
+ */
3661
+ createCustomerUnitUnderParent(request, requestOptions) {
3662
+ return core.HttpResponsePromise.fromPromise(this.__createCustomerUnitUnderParent(request, requestOptions));
3663
+ }
3664
+ __createCustomerUnitUnderParent(request, requestOptions) {
3665
+ return __awaiter(this, void 0, void 0, function* () {
3666
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3667
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
3668
+ const _response = yield core.fetcher({
3669
+ 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, "customer-units/"),
3670
+ method: "POST",
3671
+ headers: _headers,
3672
+ contentType: "application/json",
3673
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
3674
+ requestType: "json",
3675
+ body: request,
3676
+ 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,
3677
+ 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,
3678
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
3679
+ });
3680
+ if (_response.ok) {
3681
+ return { data: _response.body, rawResponse: _response.rawResponse };
3682
+ }
3683
+ if (_response.error.reason === "status-code") {
3684
+ switch (_response.error.statusCode) {
3685
+ case 400:
3686
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
3687
+ case 403:
3688
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
3689
+ case 409:
3690
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
3691
+ case 500:
3692
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
3693
+ default:
3694
+ throw new errors.PaidError({
3695
+ statusCode: _response.error.statusCode,
3696
+ body: _response.error.body,
3697
+ rawResponse: _response.rawResponse,
3698
+ });
3699
+ }
3700
+ }
3701
+ switch (_response.error.reason) {
3702
+ case "non-json":
3703
+ throw new errors.PaidError({
3704
+ statusCode: _response.error.statusCode,
3705
+ body: _response.error.rawBody,
3706
+ rawResponse: _response.rawResponse,
3707
+ });
3708
+ case "timeout":
3709
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customer-units/.");
3710
+ case "unknown":
3711
+ throw new errors.PaidError({
3712
+ message: _response.error.errorMessage,
3713
+ rawResponse: _response.rawResponse,
3714
+ });
3715
+ }
3716
+ });
3717
+ }
3718
+ /**
3719
+ * Lists this customer's API keys, newest first and paginated, revoked and expired ones included. The secret is never returned; `keyPrefix` and `last4` identify each key. Addresses the customer by your external customer id.
3720
+ *
3721
+ * @param {Paid.ListCustomerApiKeysByExternalIdRequest} request
3722
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
3723
+ *
3724
+ * @throws {@link Paid.BadRequestError}
3725
+ * @throws {@link Paid.ForbiddenError}
3726
+ * @throws {@link Paid.NotFoundError}
3727
+ * @throws {@link Paid.InternalServerError}
3728
+ *
3729
+ * @example
3730
+ * await client.customers.listCustomerApiKeysByExternalId({
3731
+ * externalId: "customer_123"
3732
+ * })
3733
+ */
3734
+ listCustomerApiKeysByExternalId(request, requestOptions) {
3735
+ return core.HttpResponsePromise.fromPromise(this.__listCustomerApiKeysByExternalId(request, requestOptions));
3736
+ }
3737
+ __listCustomerApiKeysByExternalId(request, requestOptions) {
3738
+ return __awaiter(this, void 0, void 0, function* () {
3739
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3740
+ const { externalId, limit, offset } = request;
3741
+ const _queryParams = {};
3742
+ if (limit != null) {
3743
+ _queryParams.limit = limit.toString();
3744
+ }
3745
+ if (offset != null) {
3746
+ _queryParams.offset = offset.toString();
3747
+ }
3748
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
3749
+ const _response = yield core.fetcher({
3750
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/api-keys`),
3751
+ method: "GET",
3752
+ headers: _headers,
3753
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
3754
+ 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,
3755
+ 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,
3756
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
3757
+ });
3758
+ if (_response.ok) {
3759
+ return { data: _response.body, rawResponse: _response.rawResponse };
3760
+ }
3761
+ if (_response.error.reason === "status-code") {
3762
+ switch (_response.error.statusCode) {
3763
+ case 400:
3764
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
3765
+ case 403:
3766
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
3767
+ case 404:
3768
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
3769
+ case 500:
3770
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
3771
+ default:
3772
+ throw new errors.PaidError({
3773
+ statusCode: _response.error.statusCode,
3774
+ body: _response.error.body,
3775
+ rawResponse: _response.rawResponse,
3776
+ });
3777
+ }
3778
+ }
3779
+ switch (_response.error.reason) {
3780
+ case "non-json":
3781
+ throw new errors.PaidError({
3782
+ statusCode: _response.error.statusCode,
3783
+ body: _response.error.rawBody,
3784
+ rawResponse: _response.rawResponse,
3785
+ });
3786
+ case "timeout":
3787
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/api-keys.");
3788
+ case "unknown":
3789
+ throw new errors.PaidError({
3790
+ message: _response.error.errorMessage,
3791
+ rawResponse: _response.rawResponse,
3792
+ });
3793
+ }
3794
+ });
3795
+ }
3796
+ /**
3797
+ * Creates an API key bound to this customer. The response carries the secret in `key`, returned only this once: store it immediately, as Paid keeps only its hash. The key acts for this customer alone: it can send signals for this customer through `POST /api/v2/signals/bulk`, and every other route refuses it. Requires `write:api-keys`, which full-access keys hold; a restricted key needs the scope granted explicitly. Addresses the customer by your external customer id.
3798
+ *
3799
+ * @param {Paid.CreateCustomerApiKeyByExternalIdRequest} request
3800
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
3801
+ *
3802
+ * @throws {@link Paid.BadRequestError}
3803
+ * @throws {@link Paid.ForbiddenError}
3804
+ * @throws {@link Paid.NotFoundError}
3805
+ * @throws {@link Paid.InternalServerError}
3806
+ *
3807
+ * @example
3808
+ * await client.customers.createCustomerApiKeyByExternalId({
3809
+ * externalId: "customer_123",
3810
+ * body: {
3811
+ * name: "Tenant runtime (production)"
3812
+ * }
3813
+ * })
3814
+ */
3815
+ createCustomerApiKeyByExternalId(request, requestOptions) {
3816
+ return core.HttpResponsePromise.fromPromise(this.__createCustomerApiKeyByExternalId(request, requestOptions));
3817
+ }
3818
+ __createCustomerApiKeyByExternalId(request, requestOptions) {
3819
+ return __awaiter(this, void 0, void 0, function* () {
3820
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3821
+ const { externalId, body: _body } = request;
3822
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
3823
+ const _response = yield core.fetcher({
3824
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/api-keys`),
3825
+ method: "POST",
3826
+ headers: _headers,
3827
+ contentType: "application/json",
3828
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
3829
+ requestType: "json",
3830
+ body: _body,
3831
+ 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,
3832
+ 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,
3833
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
3834
+ });
3835
+ if (_response.ok) {
3836
+ return { data: _response.body, rawResponse: _response.rawResponse };
3837
+ }
3838
+ if (_response.error.reason === "status-code") {
3839
+ switch (_response.error.statusCode) {
3840
+ case 400:
3841
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
3842
+ case 403:
3843
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
3844
+ case 404:
3845
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
3846
+ case 500:
3847
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
3848
+ default:
3849
+ throw new errors.PaidError({
3850
+ statusCode: _response.error.statusCode,
3851
+ body: _response.error.body,
3852
+ rawResponse: _response.rawResponse,
3853
+ });
3854
+ }
3855
+ }
3856
+ switch (_response.error.reason) {
3857
+ case "non-json":
3858
+ throw new errors.PaidError({
3859
+ statusCode: _response.error.statusCode,
3860
+ body: _response.error.rawBody,
3861
+ rawResponse: _response.rawResponse,
3862
+ });
3863
+ case "timeout":
3864
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/external/{externalId}/api-keys.");
3865
+ case "unknown":
3866
+ throw new errors.PaidError({
3867
+ message: _response.error.errorMessage,
3868
+ rawResponse: _response.rawResponse,
3869
+ });
3870
+ }
3871
+ });
3872
+ }
3873
+ /**
3874
+ * Revokes one of this customer's keys, which then stops authenticating. Keys are never deleted: a revoked key stays listed with `revokedAt` set, and deleting the customer revokes its keys too. Revoking an already revoked key returns it unchanged. `404` when the key does not belong to this customer. Addresses the customer by your external customer id.
3875
+ *
3876
+ * @param {Paid.RevokeCustomerApiKeyByExternalIdRequest} request
3877
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
3878
+ *
3879
+ * @throws {@link Paid.BadRequestError}
3880
+ * @throws {@link Paid.ForbiddenError}
3881
+ * @throws {@link Paid.NotFoundError}
3882
+ * @throws {@link Paid.InternalServerError}
3883
+ *
3884
+ * @example
3885
+ * await client.customers.revokeCustomerApiKeyByExternalId({
3886
+ * externalId: "customer_123",
3887
+ * apiKeyId: "apiKeyId"
3888
+ * })
3889
+ */
3890
+ revokeCustomerApiKeyByExternalId(request, requestOptions) {
3891
+ return core.HttpResponsePromise.fromPromise(this.__revokeCustomerApiKeyByExternalId(request, requestOptions));
3892
+ }
3893
+ __revokeCustomerApiKeyByExternalId(request, requestOptions) {
3894
+ return __awaiter(this, void 0, void 0, function* () {
3895
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3896
+ const { externalId, apiKeyId } = request;
3897
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
3898
+ const _response = yield core.fetcher({
3899
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/api-keys/${core.url.encodePathParam(apiKeyId)}`),
3900
+ method: "DELETE",
3901
+ headers: _headers,
3902
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
3903
+ 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,
3904
+ 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,
3905
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
3906
+ });
3907
+ if (_response.ok) {
3908
+ return { data: _response.body, rawResponse: _response.rawResponse };
3909
+ }
3910
+ if (_response.error.reason === "status-code") {
3911
+ switch (_response.error.statusCode) {
3912
+ case 400:
3913
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
3914
+ case 403:
3915
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
3916
+ case 404:
3917
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
3918
+ case 500:
3919
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
3920
+ default:
3921
+ throw new errors.PaidError({
3922
+ statusCode: _response.error.statusCode,
3923
+ body: _response.error.body,
3924
+ rawResponse: _response.rawResponse,
3925
+ });
3926
+ }
3927
+ }
3928
+ switch (_response.error.reason) {
3929
+ case "non-json":
3930
+ throw new errors.PaidError({
3931
+ statusCode: _response.error.statusCode,
3932
+ body: _response.error.rawBody,
3933
+ rawResponse: _response.rawResponse,
3934
+ });
3935
+ case "timeout":
3936
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/external/{externalId}/api-keys/{apiKeyId}.");
3937
+ case "unknown":
3938
+ throw new errors.PaidError({
3939
+ message: _response.error.errorMessage,
3940
+ rawResponse: _response.rawResponse,
3941
+ });
3942
+ }
3943
+ });
3944
+ }
3945
+ /**
3946
+ * Lists this customer's API keys, newest first and paginated, revoked and expired ones included. The secret is never returned; `keyPrefix` and `last4` identify each key. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
3947
+ *
3948
+ * @param {Paid.ListCustomerApiKeysRequest} request
3949
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
3950
+ *
3951
+ * @throws {@link Paid.BadRequestError}
3952
+ * @throws {@link Paid.ForbiddenError}
3953
+ * @throws {@link Paid.NotFoundError}
3954
+ * @throws {@link Paid.InternalServerError}
3955
+ *
3956
+ * @example
3957
+ * await client.customers.listCustomerApiKeys({
3958
+ * id: "cus_abc123"
3959
+ * })
3960
+ */
3961
+ listCustomerApiKeys(request, requestOptions) {
3962
+ return core.HttpResponsePromise.fromPromise(this.__listCustomerApiKeys(request, requestOptions));
3963
+ }
3964
+ __listCustomerApiKeys(request, requestOptions) {
3965
+ return __awaiter(this, void 0, void 0, function* () {
3966
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3967
+ const { id, limit, offset } = request;
3968
+ const _queryParams = {};
3969
+ if (limit != null) {
3970
+ _queryParams.limit = limit.toString();
3971
+ }
3972
+ if (offset != null) {
3973
+ _queryParams.offset = offset.toString();
3974
+ }
3975
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
3976
+ const _response = yield core.fetcher({
3977
+ 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, `customers/${core.url.encodePathParam(id)}/api-keys`),
3978
+ method: "GET",
3979
+ headers: _headers,
3980
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
3981
+ 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,
3982
+ 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,
3983
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
3984
+ });
3985
+ if (_response.ok) {
3986
+ return { data: _response.body, rawResponse: _response.rawResponse };
3987
+ }
3988
+ if (_response.error.reason === "status-code") {
3989
+ switch (_response.error.statusCode) {
3990
+ case 400:
3991
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
3992
+ case 403:
3993
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
3994
+ case 404:
3995
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
3996
+ case 500:
3997
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
3998
+ default:
3999
+ throw new errors.PaidError({
4000
+ statusCode: _response.error.statusCode,
4001
+ body: _response.error.body,
4002
+ rawResponse: _response.rawResponse,
4003
+ });
4004
+ }
4005
+ }
4006
+ switch (_response.error.reason) {
4007
+ case "non-json":
4008
+ throw new errors.PaidError({
4009
+ statusCode: _response.error.statusCode,
4010
+ body: _response.error.rawBody,
4011
+ rawResponse: _response.rawResponse,
4012
+ });
4013
+ case "timeout":
4014
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/api-keys.");
4015
+ case "unknown":
4016
+ throw new errors.PaidError({
4017
+ message: _response.error.errorMessage,
4018
+ rawResponse: _response.rawResponse,
4019
+ });
4020
+ }
4021
+ });
4022
+ }
4023
+ /**
4024
+ * Creates an API key bound to this customer. The response carries the secret in `key`, returned only this once: store it immediately, as Paid keeps only its hash. The key acts for this customer alone: it can send signals for this customer through `POST /api/v2/signals/bulk`, and every other route refuses it. Requires `write:api-keys`, which full-access keys hold; a restricted key needs the scope granted explicitly. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
4025
+ *
4026
+ * @param {Paid.CreateCustomerApiKeyRequest} request
4027
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
4028
+ *
4029
+ * @throws {@link Paid.BadRequestError}
4030
+ * @throws {@link Paid.ForbiddenError}
4031
+ * @throws {@link Paid.NotFoundError}
4032
+ * @throws {@link Paid.InternalServerError}
4033
+ *
4034
+ * @example
4035
+ * await client.customers.createCustomerApiKey({
4036
+ * id: "cus_abc123",
4037
+ * body: {
4038
+ * name: "Tenant runtime (production)"
4039
+ * }
4040
+ * })
4041
+ */
4042
+ createCustomerApiKey(request, requestOptions) {
4043
+ return core.HttpResponsePromise.fromPromise(this.__createCustomerApiKey(request, requestOptions));
4044
+ }
4045
+ __createCustomerApiKey(request, requestOptions) {
4046
+ return __awaiter(this, void 0, void 0, function* () {
4047
+ var _a, _b, _c, _d, _e, _f, _g, _h;
4048
+ const { id, body: _body } = request;
4049
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
4050
+ const _response = yield core.fetcher({
4051
+ 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, `customers/${core.url.encodePathParam(id)}/api-keys`),
4052
+ method: "POST",
4053
+ headers: _headers,
4054
+ contentType: "application/json",
4055
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
4056
+ requestType: "json",
4057
+ body: _body,
4058
+ 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,
4059
+ 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,
4060
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
4061
+ });
4062
+ if (_response.ok) {
4063
+ return { data: _response.body, rawResponse: _response.rawResponse };
4064
+ }
4065
+ if (_response.error.reason === "status-code") {
4066
+ switch (_response.error.statusCode) {
4067
+ case 400:
4068
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
4069
+ case 403:
4070
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
4071
+ case 404:
4072
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
4073
+ case 500:
4074
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
4075
+ default:
4076
+ throw new errors.PaidError({
4077
+ statusCode: _response.error.statusCode,
4078
+ body: _response.error.body,
4079
+ rawResponse: _response.rawResponse,
4080
+ });
4081
+ }
4082
+ }
4083
+ switch (_response.error.reason) {
4084
+ case "non-json":
4085
+ throw new errors.PaidError({
4086
+ statusCode: _response.error.statusCode,
4087
+ body: _response.error.rawBody,
4088
+ rawResponse: _response.rawResponse,
4089
+ });
4090
+ case "timeout":
4091
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /customers/{id}/api-keys.");
4092
+ case "unknown":
4093
+ throw new errors.PaidError({
4094
+ message: _response.error.errorMessage,
4095
+ rawResponse: _response.rawResponse,
4096
+ });
4097
+ }
4098
+ });
4099
+ }
4100
+ /**
4101
+ * Revokes one of this customer's keys, which then stops authenticating. Keys are never deleted: a revoked key stays listed with `revokedAt` set, and deleting the customer revokes its keys too. Revoking an already revoked key returns it unchanged. `404` when the key does not belong to this customer. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
4102
+ *
4103
+ * @param {Paid.RevokeCustomerApiKeyRequest} request
4104
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
4105
+ *
4106
+ * @throws {@link Paid.BadRequestError}
4107
+ * @throws {@link Paid.ForbiddenError}
4108
+ * @throws {@link Paid.NotFoundError}
4109
+ * @throws {@link Paid.InternalServerError}
4110
+ *
4111
+ * @example
4112
+ * await client.customers.revokeCustomerApiKey({
4113
+ * id: "cus_abc123",
4114
+ * apiKeyId: "apiKeyId"
4115
+ * })
4116
+ */
4117
+ revokeCustomerApiKey(request, requestOptions) {
4118
+ return core.HttpResponsePromise.fromPromise(this.__revokeCustomerApiKey(request, requestOptions));
4119
+ }
4120
+ __revokeCustomerApiKey(request, requestOptions) {
4121
+ return __awaiter(this, void 0, void 0, function* () {
4122
+ var _a, _b, _c, _d, _e, _f, _g, _h;
4123
+ const { id, apiKeyId } = request;
4124
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
4125
+ const _response = yield core.fetcher({
4126
+ 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, `customers/${core.url.encodePathParam(id)}/api-keys/${core.url.encodePathParam(apiKeyId)}`),
4127
+ method: "DELETE",
4128
+ headers: _headers,
4129
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
4130
+ 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,
4131
+ 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,
4132
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
4133
+ });
4134
+ if (_response.ok) {
4135
+ return { data: _response.body, rawResponse: _response.rawResponse };
4136
+ }
4137
+ if (_response.error.reason === "status-code") {
4138
+ switch (_response.error.statusCode) {
4139
+ case 400:
4140
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
4141
+ case 403:
4142
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
4143
+ case 404:
4144
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
4145
+ case 500:
4146
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
4147
+ default:
4148
+ throw new errors.PaidError({
4149
+ statusCode: _response.error.statusCode,
4150
+ body: _response.error.body,
4151
+ rawResponse: _response.rawResponse,
4152
+ });
4153
+ }
4154
+ }
4155
+ switch (_response.error.reason) {
4156
+ case "non-json":
4157
+ throw new errors.PaidError({
4158
+ statusCode: _response.error.statusCode,
4159
+ body: _response.error.rawBody,
4160
+ rawResponse: _response.rawResponse,
4161
+ });
4162
+ case "timeout":
4163
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/{id}/api-keys/{apiKeyId}.");
4164
+ case "unknown":
4165
+ throw new errors.PaidError({
4166
+ message: _response.error.errorMessage,
4167
+ rawResponse: _response.rawResponse,
4168
+ });
4169
+ }
4170
+ });
4171
+ }
4172
+ /**
4173
+ * Returns the cap in force on this customer unit for one credits currency, with usage in the current period when available. Select the currency with `creditsCurrencyId`; it may be omitted only when the organization has exactly one credits currency, which is then used and echoed back. `404` when the customer or the unit does not exist, or the unit has no cap in force for that currency. The usage figures are advisory: other spend may land between this read and the next burn. Addresses the customer by your external customer id.
4174
+ *
4175
+ * @param {Paid.GetCustomerUnitCapByExternalIdRequest} request
4176
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
4177
+ *
4178
+ * @throws {@link Paid.BadRequestError}
4179
+ * @throws {@link Paid.ForbiddenError}
4180
+ * @throws {@link Paid.NotFoundError}
4181
+ * @throws {@link Paid.InternalServerError}
4182
+ *
4183
+ * @example
4184
+ * await client.customers.getCustomerUnitCapByExternalId({
4185
+ * externalId: "customer_123",
4186
+ * externalCustomerUnitId: "tenant-a",
4187
+ * creditsCurrencyId: "7f4f5d4c-55e9-4d5b-a3e7-c9eb3d2d01bf"
4188
+ * })
4189
+ */
4190
+ getCustomerUnitCapByExternalId(request, requestOptions) {
4191
+ return core.HttpResponsePromise.fromPromise(this.__getCustomerUnitCapByExternalId(request, requestOptions));
4192
+ }
4193
+ __getCustomerUnitCapByExternalId(request, requestOptions) {
4194
+ return __awaiter(this, void 0, void 0, function* () {
4195
+ var _a, _b, _c, _d, _e, _f, _g, _h;
4196
+ const { externalId, externalCustomerUnitId, creditsCurrencyId } = request;
4197
+ const _queryParams = {};
4198
+ if (creditsCurrencyId != null) {
4199
+ _queryParams.creditsCurrencyId = creditsCurrencyId;
4200
+ }
4201
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
4202
+ const _response = yield core.fetcher({
4203
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/cap`),
4204
+ method: "GET",
4205
+ headers: _headers,
4206
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
4207
+ 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,
4208
+ 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,
4209
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
4210
+ });
4211
+ if (_response.ok) {
4212
+ return { data: _response.body, rawResponse: _response.rawResponse };
4213
+ }
4214
+ if (_response.error.reason === "status-code") {
4215
+ switch (_response.error.statusCode) {
4216
+ case 400:
4217
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
4218
+ case 403:
4219
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
4220
+ case 404:
4221
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
4222
+ case 500:
4223
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
4224
+ default:
4225
+ throw new errors.PaidError({
4226
+ statusCode: _response.error.statusCode,
4227
+ body: _response.error.body,
4228
+ rawResponse: _response.rawResponse,
4229
+ });
4230
+ }
4231
+ }
4232
+ switch (_response.error.reason) {
4233
+ case "non-json":
4234
+ throw new errors.PaidError({
4235
+ statusCode: _response.error.statusCode,
4236
+ body: _response.error.rawBody,
4237
+ rawResponse: _response.rawResponse,
4238
+ });
4239
+ case "timeout":
4240
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/customer-units/{externalCustomerUnitId}/cap.");
4241
+ case "unknown":
4242
+ throw new errors.PaidError({
4243
+ message: _response.error.errorMessage,
4244
+ rawResponse: _response.rawResponse,
4245
+ });
4246
+ }
4247
+ });
4248
+ }
4249
+ /**
4250
+ * Sets the cap on this customer unit for one credits currency. Returns `changed: false` without creating a version when the effective timeline is unchanged; otherwise records a new version, preserving earlier rows. The newest version wins where they overlap. `effectiveFrom` controls applicability; `schedule` defines monthly UTC boundaries independently. Omit schedule to inherit the version covering effectiveFrom, or use the creation-time UTC day if none applies. Select the currency with `creditsCurrencyId` in the body; it may be omitted only when the organization has exactly one credits currency. A cap covers the unit and every unit beneath it, so a cap on the customer's root unit covers every unit of that customer; spend from a signal that names no unit counts toward no cap. `404` when the customer or the unit does not exist. `409` for customers on seat-based billing, a deleted unit (`CUSTOMER_UNIT_DELETED`) or a draft (`CUSTOMER_UNIT_DRAFT`). Addresses the customer by your external customer id.
4251
+ *
4252
+ * @param {Paid.SetCustomerUnitCapByExternalIdRequest} request
4253
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
4254
+ *
4255
+ * @throws {@link Paid.BadRequestError}
4256
+ * @throws {@link Paid.ForbiddenError}
4257
+ * @throws {@link Paid.NotFoundError}
4258
+ * @throws {@link Paid.ConflictError}
4259
+ * @throws {@link Paid.InternalServerError}
4260
+ *
4261
+ * @example
4262
+ * await client.customers.setCustomerUnitCapByExternalId({
4263
+ * externalId: "customer_123",
4264
+ * externalCustomerUnitId: "tenant-a",
4265
+ * body: {
4266
+ * amount: 10000
4267
+ * }
4268
+ * })
4269
+ */
4270
+ setCustomerUnitCapByExternalId(request, requestOptions) {
4271
+ return core.HttpResponsePromise.fromPromise(this.__setCustomerUnitCapByExternalId(request, requestOptions));
4272
+ }
4273
+ __setCustomerUnitCapByExternalId(request, requestOptions) {
4274
+ return __awaiter(this, void 0, void 0, function* () {
4275
+ var _a, _b, _c, _d, _e, _f, _g, _h;
4276
+ const { externalId, externalCustomerUnitId, body: _body } = request;
4277
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
4278
+ const _response = yield core.fetcher({
4279
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/cap`),
4280
+ method: "PUT",
4281
+ headers: _headers,
4282
+ contentType: "application/json",
4283
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
4284
+ requestType: "json",
4285
+ body: _body,
4286
+ 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,
4287
+ 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,
4288
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
4289
+ });
4290
+ if (_response.ok) {
4291
+ return { data: _response.body, rawResponse: _response.rawResponse };
4292
+ }
4293
+ if (_response.error.reason === "status-code") {
4294
+ switch (_response.error.statusCode) {
4295
+ case 400:
4296
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
4297
+ case 403:
4298
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
4299
+ case 404:
4300
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
4301
+ case 409:
4302
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
4303
+ case 500:
4304
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
4305
+ default:
4306
+ throw new errors.PaidError({
4307
+ statusCode: _response.error.statusCode,
4308
+ body: _response.error.body,
4309
+ rawResponse: _response.rawResponse,
4310
+ });
4311
+ }
4312
+ }
4313
+ switch (_response.error.reason) {
4314
+ case "non-json":
4315
+ throw new errors.PaidError({
4316
+ statusCode: _response.error.statusCode,
4317
+ body: _response.error.rawBody,
4318
+ rawResponse: _response.rawResponse,
4319
+ });
4320
+ case "timeout":
4321
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /customers/external/{externalId}/customer-units/{externalCustomerUnitId}/cap.");
4322
+ case "unknown":
4323
+ throw new errors.PaidError({
4324
+ message: _response.error.errorMessage,
4325
+ rawResponse: _response.rawResponse,
4326
+ });
4327
+ }
4328
+ });
4329
+ }
4330
+ /**
4331
+ * Ends the cap on this customer unit for one credits currency by setting `effectiveUntil` to now on every open version — the one in force, older overlapping versions still open, and versions scheduled to start later — so nothing can resurface or activate afterwards; nothing is deleted and history is kept. Select the currency with `creditsCurrencyId`; it may be omitted only when the organization has exactly one credits currency. `404` when the customer or the unit does not exist, or there is no open version for that currency. Addresses the customer by your external customer id.
4332
+ *
4333
+ * @param {Paid.EndCustomerUnitCapByExternalIdRequest} request
4334
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
4335
+ *
4336
+ * @throws {@link Paid.BadRequestError}
4337
+ * @throws {@link Paid.ForbiddenError}
4338
+ * @throws {@link Paid.NotFoundError}
4339
+ * @throws {@link Paid.ConflictError}
4340
+ * @throws {@link Paid.InternalServerError}
4341
+ *
4342
+ * @example
4343
+ * await client.customers.endCustomerUnitCapByExternalId({
4344
+ * externalId: "customer_123",
4345
+ * externalCustomerUnitId: "tenant-a",
4346
+ * creditsCurrencyId: "7f4f5d4c-55e9-4d5b-a3e7-c9eb3d2d01bf"
4347
+ * })
4348
+ */
4349
+ endCustomerUnitCapByExternalId(request, requestOptions) {
4350
+ return core.HttpResponsePromise.fromPromise(this.__endCustomerUnitCapByExternalId(request, requestOptions));
4351
+ }
4352
+ __endCustomerUnitCapByExternalId(request, requestOptions) {
4353
+ return __awaiter(this, void 0, void 0, function* () {
4354
+ var _a, _b, _c, _d, _e, _f, _g, _h;
4355
+ const { externalId, externalCustomerUnitId, creditsCurrencyId } = request;
4356
+ const _queryParams = {};
4357
+ if (creditsCurrencyId != null) {
4358
+ _queryParams.creditsCurrencyId = creditsCurrencyId;
4359
+ }
4360
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
4361
+ const _response = yield core.fetcher({
4362
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/cap`),
4363
+ method: "DELETE",
4364
+ headers: _headers,
4365
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
4366
+ 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,
4367
+ 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,
4368
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
4369
+ });
4370
+ if (_response.ok) {
4371
+ return { data: _response.body, rawResponse: _response.rawResponse };
4372
+ }
4373
+ if (_response.error.reason === "status-code") {
4374
+ switch (_response.error.statusCode) {
4375
+ case 400:
4376
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
4377
+ case 403:
4378
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
4379
+ case 404:
4380
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
4381
+ case 409:
4382
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
4383
+ case 500:
4384
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
4385
+ default:
4386
+ throw new errors.PaidError({
4387
+ statusCode: _response.error.statusCode,
4388
+ body: _response.error.body,
4389
+ rawResponse: _response.rawResponse,
4390
+ });
4391
+ }
4392
+ }
4393
+ switch (_response.error.reason) {
4394
+ case "non-json":
4395
+ throw new errors.PaidError({
4396
+ statusCode: _response.error.statusCode,
4397
+ body: _response.error.rawBody,
4398
+ rawResponse: _response.rawResponse,
4399
+ });
4400
+ case "timeout":
4401
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/external/{externalId}/customer-units/{externalCustomerUnitId}/cap.");
4402
+ case "unknown":
4403
+ throw new errors.PaidError({
4404
+ message: _response.error.errorMessage,
4405
+ rawResponse: _response.rawResponse,
4406
+ });
4407
+ }
4408
+ });
4409
+ }
4410
+ /**
4411
+ * Returns the credits of one credits currency spent by this customer unit and every unit beneath it during a window, whether or not the unit has a cap. The window runs from `start` (inclusive) to `end` (exclusive), at most 366 days; omit both for the current calendar month (UTC). For a capped unit over its cap's current period, `spent` equals the cap's `used`. Spend from a signal that names no unit counts toward no unit. Select the currency with `creditsCurrencyId`; it may be omitted only when the organization has exactly one credits currency, which is then used and echoed back. `404` when the customer or the unit does not exist. Addresses the customer by your external customer id.
4412
+ *
4413
+ * @param {Paid.GetCustomerUnitSpendByExternalIdRequest} request
4414
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
4415
+ *
4416
+ * @throws {@link Paid.BadRequestError}
4417
+ * @throws {@link Paid.ForbiddenError}
4418
+ * @throws {@link Paid.NotFoundError}
4419
+ * @throws {@link Paid.InternalServerError}
4420
+ *
4421
+ * @example
4422
+ * await client.customers.getCustomerUnitSpendByExternalId({
4423
+ * externalId: "customer_123",
4424
+ * externalCustomerUnitId: "tenant-a",
4425
+ * creditsCurrencyId: "7f4f5d4c-55e9-4d5b-a3e7-c9eb3d2d01bf",
4426
+ * start: "2026-10-01T00:00:00Z",
4427
+ * end: "2026-11-01T00:00:00Z"
4428
+ * })
4429
+ */
4430
+ getCustomerUnitSpendByExternalId(request, requestOptions) {
4431
+ return core.HttpResponsePromise.fromPromise(this.__getCustomerUnitSpendByExternalId(request, requestOptions));
4432
+ }
4433
+ __getCustomerUnitSpendByExternalId(request, requestOptions) {
4434
+ return __awaiter(this, void 0, void 0, function* () {
4435
+ var _a, _b, _c, _d, _e, _f, _g, _h;
4436
+ const { externalId, externalCustomerUnitId, creditsCurrencyId, start, end } = request;
4437
+ const _queryParams = {};
4438
+ if (creditsCurrencyId != null) {
4439
+ _queryParams.creditsCurrencyId = creditsCurrencyId;
4440
+ }
4441
+ if (start != null) {
4442
+ _queryParams.start = start;
4443
+ }
4444
+ if (end != null) {
4445
+ _queryParams.end = end;
4446
+ }
4447
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
4448
+ const _response = yield core.fetcher({
4449
+ 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, `customers/external/${core.url.encodePathParam(externalId)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/spend`),
4450
+ method: "GET",
4451
+ headers: _headers,
4452
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
4453
+ 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,
4454
+ 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,
4455
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
4456
+ });
4457
+ if (_response.ok) {
4458
+ return { data: _response.body, rawResponse: _response.rawResponse };
4459
+ }
4460
+ if (_response.error.reason === "status-code") {
4461
+ switch (_response.error.statusCode) {
4462
+ case 400:
4463
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
4464
+ case 403:
4465
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
4466
+ case 404:
4467
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
4468
+ case 500:
4469
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
4470
+ default:
4471
+ throw new errors.PaidError({
4472
+ statusCode: _response.error.statusCode,
4473
+ body: _response.error.body,
4474
+ rawResponse: _response.rawResponse,
4475
+ });
4476
+ }
4477
+ }
4478
+ switch (_response.error.reason) {
4479
+ case "non-json":
4480
+ throw new errors.PaidError({
4481
+ statusCode: _response.error.statusCode,
4482
+ body: _response.error.rawBody,
4483
+ rawResponse: _response.rawResponse,
4484
+ });
4485
+ case "timeout":
4486
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/customer-units/{externalCustomerUnitId}/spend.");
4487
+ case "unknown":
4488
+ throw new errors.PaidError({
4489
+ message: _response.error.errorMessage,
4490
+ rawResponse: _response.rawResponse,
4491
+ });
4492
+ }
4493
+ });
4494
+ }
4495
+ /**
4496
+ * Returns the cap in force on this customer unit for one credits currency, with usage in the current period when available. Select the currency with `creditsCurrencyId`; it may be omitted only when the organization has exactly one credits currency, which is then used and echoed back. `404` when the customer or the unit does not exist, or the unit has no cap in force for that currency. The usage figures are advisory: other spend may land between this read and the next burn. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
4497
+ *
4498
+ * @param {Paid.GetCustomerUnitCapRequest} request
4499
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
4500
+ *
4501
+ * @throws {@link Paid.BadRequestError}
4502
+ * @throws {@link Paid.ForbiddenError}
4503
+ * @throws {@link Paid.NotFoundError}
4504
+ * @throws {@link Paid.InternalServerError}
4505
+ *
4506
+ * @example
4507
+ * await client.customers.getCustomerUnitCap({
4508
+ * id: "cus_abc123",
4509
+ * externalCustomerUnitId: "tenant-a",
4510
+ * creditsCurrencyId: "7f4f5d4c-55e9-4d5b-a3e7-c9eb3d2d01bf"
4511
+ * })
4512
+ */
4513
+ getCustomerUnitCap(request, requestOptions) {
4514
+ return core.HttpResponsePromise.fromPromise(this.__getCustomerUnitCap(request, requestOptions));
4515
+ }
4516
+ __getCustomerUnitCap(request, requestOptions) {
4517
+ return __awaiter(this, void 0, void 0, function* () {
4518
+ var _a, _b, _c, _d, _e, _f, _g, _h;
4519
+ const { id, externalCustomerUnitId, creditsCurrencyId } = request;
4520
+ const _queryParams = {};
4521
+ if (creditsCurrencyId != null) {
4522
+ _queryParams.creditsCurrencyId = creditsCurrencyId;
4523
+ }
4524
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
4525
+ const _response = yield core.fetcher({
4526
+ 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, `customers/${core.url.encodePathParam(id)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/cap`),
4527
+ method: "GET",
4528
+ headers: _headers,
4529
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
4530
+ 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,
4531
+ 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,
4532
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
4533
+ });
4534
+ if (_response.ok) {
4535
+ return { data: _response.body, rawResponse: _response.rawResponse };
4536
+ }
4537
+ if (_response.error.reason === "status-code") {
4538
+ switch (_response.error.statusCode) {
4539
+ case 400:
4540
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
4541
+ case 403:
4542
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
4543
+ case 404:
4544
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
4545
+ case 500:
4546
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
4547
+ default:
4548
+ throw new errors.PaidError({
4549
+ statusCode: _response.error.statusCode,
4550
+ body: _response.error.body,
4551
+ rawResponse: _response.rawResponse,
4552
+ });
4553
+ }
4554
+ }
4555
+ switch (_response.error.reason) {
4556
+ case "non-json":
4557
+ throw new errors.PaidError({
4558
+ statusCode: _response.error.statusCode,
4559
+ body: _response.error.rawBody,
4560
+ rawResponse: _response.rawResponse,
4561
+ });
4562
+ case "timeout":
4563
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/customer-units/{externalCustomerUnitId}/cap.");
4564
+ case "unknown":
4565
+ throw new errors.PaidError({
4566
+ message: _response.error.errorMessage,
4567
+ rawResponse: _response.rawResponse,
4568
+ });
4569
+ }
4570
+ });
4571
+ }
4572
+ /**
4573
+ * Sets the cap on this customer unit for one credits currency. Returns `changed: false` without creating a version when the effective timeline is unchanged; otherwise records a new version, preserving earlier rows. The newest version wins where they overlap. `effectiveFrom` controls applicability; `schedule` defines monthly UTC boundaries independently. Omit schedule to inherit the version covering effectiveFrom, or use the creation-time UTC day if none applies. Select the currency with `creditsCurrencyId` in the body; it may be omitted only when the organization has exactly one credits currency. A cap covers the unit and every unit beneath it, so a cap on the customer's root unit covers every unit of that customer; spend from a signal that names no unit counts toward no cap. `404` when the customer or the unit does not exist. `409` for customers on seat-based billing, a deleted unit (`CUSTOMER_UNIT_DELETED`) or a draft (`CUSTOMER_UNIT_DRAFT`). Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
4574
+ *
4575
+ * @param {Paid.SetCustomerUnitCapRequest} request
4576
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
4577
+ *
4578
+ * @throws {@link Paid.BadRequestError}
4579
+ * @throws {@link Paid.ForbiddenError}
4580
+ * @throws {@link Paid.NotFoundError}
4581
+ * @throws {@link Paid.ConflictError}
4582
+ * @throws {@link Paid.InternalServerError}
4583
+ *
4584
+ * @example
4585
+ * await client.customers.setCustomerUnitCap({
4586
+ * id: "cus_abc123",
4587
+ * externalCustomerUnitId: "tenant-a",
4588
+ * body: {
4589
+ * amount: 10000
4590
+ * }
4591
+ * })
4592
+ */
4593
+ setCustomerUnitCap(request, requestOptions) {
4594
+ return core.HttpResponsePromise.fromPromise(this.__setCustomerUnitCap(request, requestOptions));
4595
+ }
4596
+ __setCustomerUnitCap(request, requestOptions) {
4597
+ return __awaiter(this, void 0, void 0, function* () {
4598
+ var _a, _b, _c, _d, _e, _f, _g, _h;
4599
+ const { id, externalCustomerUnitId, body: _body } = request;
4600
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
4601
+ const _response = yield core.fetcher({
4602
+ 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, `customers/${core.url.encodePathParam(id)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/cap`),
4603
+ method: "PUT",
4604
+ headers: _headers,
4605
+ contentType: "application/json",
4606
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
4607
+ requestType: "json",
4608
+ body: _body,
4609
+ 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,
4610
+ 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,
4611
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
4612
+ });
4613
+ if (_response.ok) {
4614
+ return { data: _response.body, rawResponse: _response.rawResponse };
4615
+ }
4616
+ if (_response.error.reason === "status-code") {
4617
+ switch (_response.error.statusCode) {
4618
+ case 400:
4619
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
4620
+ case 403:
4621
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
4622
+ case 404:
4623
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
4624
+ case 409:
4625
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
4626
+ case 500:
4627
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
4628
+ default:
4629
+ throw new errors.PaidError({
4630
+ statusCode: _response.error.statusCode,
4631
+ body: _response.error.body,
4632
+ rawResponse: _response.rawResponse,
4633
+ });
4634
+ }
4635
+ }
4636
+ switch (_response.error.reason) {
4637
+ case "non-json":
4638
+ throw new errors.PaidError({
4639
+ statusCode: _response.error.statusCode,
4640
+ body: _response.error.rawBody,
4641
+ rawResponse: _response.rawResponse,
4642
+ });
4643
+ case "timeout":
4644
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling PUT /customers/{id}/customer-units/{externalCustomerUnitId}/cap.");
4645
+ case "unknown":
4646
+ throw new errors.PaidError({
4647
+ message: _response.error.errorMessage,
4648
+ rawResponse: _response.rawResponse,
4649
+ });
4650
+ }
4651
+ });
4652
+ }
4653
+ /**
4654
+ * Ends the cap on this customer unit for one credits currency by setting `effectiveUntil` to now on every open version — the one in force, older overlapping versions still open, and versions scheduled to start later — so nothing can resurface or activate afterwards; nothing is deleted and history is kept. Select the currency with `creditsCurrencyId`; it may be omitted only when the organization has exactly one credits currency. `404` when the customer or the unit does not exist, or there is no open version for that currency. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
4655
+ *
4656
+ * @param {Paid.EndCustomerUnitCapRequest} request
4657
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
4658
+ *
4659
+ * @throws {@link Paid.BadRequestError}
4660
+ * @throws {@link Paid.ForbiddenError}
4661
+ * @throws {@link Paid.NotFoundError}
4662
+ * @throws {@link Paid.ConflictError}
4663
+ * @throws {@link Paid.InternalServerError}
4664
+ *
4665
+ * @example
4666
+ * await client.customers.endCustomerUnitCap({
4667
+ * id: "cus_abc123",
4668
+ * externalCustomerUnitId: "tenant-a",
4669
+ * creditsCurrencyId: "7f4f5d4c-55e9-4d5b-a3e7-c9eb3d2d01bf"
4670
+ * })
4671
+ */
4672
+ endCustomerUnitCap(request, requestOptions) {
4673
+ return core.HttpResponsePromise.fromPromise(this.__endCustomerUnitCap(request, requestOptions));
4674
+ }
4675
+ __endCustomerUnitCap(request, requestOptions) {
4676
+ return __awaiter(this, void 0, void 0, function* () {
4677
+ var _a, _b, _c, _d, _e, _f, _g, _h;
4678
+ const { id, externalCustomerUnitId, creditsCurrencyId } = request;
4679
+ const _queryParams = {};
4680
+ if (creditsCurrencyId != null) {
4681
+ _queryParams.creditsCurrencyId = creditsCurrencyId;
4682
+ }
4683
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
4684
+ const _response = yield core.fetcher({
4685
+ 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, `customers/${core.url.encodePathParam(id)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/cap`),
4686
+ method: "DELETE",
4687
+ headers: _headers,
4688
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
4689
+ 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,
4690
+ 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,
4691
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
4692
+ });
4693
+ if (_response.ok) {
4694
+ return { data: _response.body, rawResponse: _response.rawResponse };
4695
+ }
4696
+ if (_response.error.reason === "status-code") {
4697
+ switch (_response.error.statusCode) {
4698
+ case 400:
4699
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
4700
+ case 403:
4701
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
4702
+ case 404:
4703
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
4704
+ case 409:
4705
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
4706
+ case 500:
4707
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
4708
+ default:
4709
+ throw new errors.PaidError({
4710
+ statusCode: _response.error.statusCode,
4711
+ body: _response.error.body,
4712
+ rawResponse: _response.rawResponse,
4713
+ });
4714
+ }
4715
+ }
4716
+ switch (_response.error.reason) {
4717
+ case "non-json":
4718
+ throw new errors.PaidError({
4719
+ statusCode: _response.error.statusCode,
4720
+ body: _response.error.rawBody,
4721
+ rawResponse: _response.rawResponse,
4722
+ });
4723
+ case "timeout":
4724
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling DELETE /customers/{id}/customer-units/{externalCustomerUnitId}/cap.");
4725
+ case "unknown":
4726
+ throw new errors.PaidError({
4727
+ message: _response.error.errorMessage,
4728
+ rawResponse: _response.rawResponse,
4729
+ });
4730
+ }
4731
+ });
4732
+ }
4733
+ /**
4734
+ * Returns the credits of one credits currency spent by this customer unit and every unit beneath it during a window, whether or not the unit has a cap. The window runs from `start` (inclusive) to `end` (exclusive), at most 366 days; omit both for the current calendar month (UTC). For a capped unit over its cap's current period, `spent` equals the cap's `used`. Spend from a signal that names no unit counts toward no unit. Select the currency with `creditsCurrencyId`; it may be omitted only when the organization has exactly one credits currency, which is then used and echoed back. `404` when the customer or the unit does not exist. Use the value returned as `customer.id`, for example `cus_abc123`; if you have your own customer ID, use the `/api/v2/customers/external/{externalId}/…` twin.
4735
+ *
4736
+ * @param {Paid.GetCustomerUnitSpendRequest} request
4737
+ * @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
4738
+ *
4739
+ * @throws {@link Paid.BadRequestError}
4740
+ * @throws {@link Paid.ForbiddenError}
4741
+ * @throws {@link Paid.NotFoundError}
4742
+ * @throws {@link Paid.InternalServerError}
4743
+ *
4744
+ * @example
4745
+ * await client.customers.getCustomerUnitSpend({
4746
+ * id: "cus_abc123",
4747
+ * externalCustomerUnitId: "tenant-a",
4748
+ * creditsCurrencyId: "7f4f5d4c-55e9-4d5b-a3e7-c9eb3d2d01bf",
4749
+ * start: "2026-10-01T00:00:00Z",
4750
+ * end: "2026-11-01T00:00:00Z"
4751
+ * })
4752
+ */
4753
+ getCustomerUnitSpend(request, requestOptions) {
4754
+ return core.HttpResponsePromise.fromPromise(this.__getCustomerUnitSpend(request, requestOptions));
4755
+ }
4756
+ __getCustomerUnitSpend(request, requestOptions) {
4757
+ return __awaiter(this, void 0, void 0, function* () {
4758
+ var _a, _b, _c, _d, _e, _f, _g, _h;
4759
+ const { id, externalCustomerUnitId, creditsCurrencyId, start, end } = request;
4760
+ const _queryParams = {};
4761
+ if (creditsCurrencyId != null) {
4762
+ _queryParams.creditsCurrencyId = creditsCurrencyId;
4763
+ }
4764
+ if (start != null) {
4765
+ _queryParams.start = start;
4766
+ }
4767
+ if (end != null) {
4768
+ _queryParams.end = end;
4769
+ }
4770
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
4771
+ const _response = yield core.fetcher({
4772
+ 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, `customers/${core.url.encodePathParam(id)}/customer-units/${core.url.encodePathParam(externalCustomerUnitId)}/spend`),
4773
+ method: "GET",
4774
+ headers: _headers,
4775
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
4776
+ 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,
4777
+ 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,
4778
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
4779
+ });
4780
+ if (_response.ok) {
4781
+ return { data: _response.body, rawResponse: _response.rawResponse };
4782
+ }
4783
+ if (_response.error.reason === "status-code") {
4784
+ switch (_response.error.statusCode) {
4785
+ case 400:
4786
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
4787
+ case 403:
4788
+ throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
4789
+ case 404:
4790
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
4791
+ case 500:
4792
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
4793
+ default:
4794
+ throw new errors.PaidError({
4795
+ statusCode: _response.error.statusCode,
4796
+ body: _response.error.body,
4797
+ rawResponse: _response.rawResponse,
4798
+ });
4799
+ }
4800
+ }
4801
+ switch (_response.error.reason) {
4802
+ case "non-json":
4803
+ throw new errors.PaidError({
4804
+ statusCode: _response.error.statusCode,
4805
+ body: _response.error.rawBody,
4806
+ rawResponse: _response.rawResponse,
4807
+ });
4808
+ case "timeout":
4809
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/customer-units/{externalCustomerUnitId}/spend.");
805
4810
  case "unknown":
806
4811
  throw new errors.PaidError({
807
4812
  message: _response.error.errorMessage,