@paid-ai/paid-node 1.3.0 → 1.5.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 (254) hide show
  1. package/dist/cjs/Client.d.ts +6 -0
  2. package/dist/cjs/Client.js +30 -20
  3. package/dist/cjs/api/resources/cost/client/Client.d.ts +38 -0
  4. package/dist/cjs/api/resources/cost/client/Client.js +139 -0
  5. package/dist/cjs/api/resources/cost/client/index.d.ts +1 -0
  6. package/dist/cjs/api/resources/cost/client/index.js +17 -0
  7. package/dist/cjs/api/resources/cost/client/requests/CostIngestRequest.d.ts +17 -0
  8. package/dist/cjs/api/resources/cost/client/requests/CostIngestRequest.js +3 -0
  9. package/dist/cjs/api/resources/cost/client/requests/index.d.ts +1 -0
  10. package/dist/cjs/api/resources/cost/client/requests/index.js +2 -0
  11. package/dist/cjs/api/resources/cost/index.d.ts +1 -0
  12. package/dist/cjs/api/resources/cost/index.js +17 -0
  13. package/dist/cjs/api/resources/index.d.ts +5 -0
  14. package/dist/cjs/api/resources/index.js +6 -1
  15. package/dist/cjs/api/resources/orders/client/requests/CreateOrderRequest.d.ts +1 -0
  16. package/dist/cjs/api/resources/pricing/client/Client.d.ts +71 -0
  17. package/dist/cjs/api/resources/pricing/client/Client.js +284 -0
  18. package/dist/cjs/api/resources/pricing/client/index.d.ts +1 -0
  19. package/dist/cjs/api/resources/pricing/client/index.js +17 -0
  20. package/dist/cjs/api/resources/pricing/client/requests/GetPricingRequest.d.ts +9 -0
  21. package/dist/cjs/api/resources/pricing/client/requests/GetPricingRequest.js +3 -0
  22. package/dist/cjs/api/resources/pricing/client/requests/ListPricingRequest.d.ts +10 -0
  23. package/dist/cjs/api/resources/pricing/client/requests/ListPricingRequest.js +3 -0
  24. package/dist/cjs/api/resources/pricing/client/requests/UpdatePricingRequest.d.ts +20 -0
  25. package/dist/cjs/api/resources/pricing/client/requests/UpdatePricingRequest.js +3 -0
  26. package/dist/cjs/api/resources/pricing/client/requests/index.d.ts +3 -0
  27. package/dist/cjs/api/resources/pricing/client/requests/index.js +2 -0
  28. package/dist/cjs/api/resources/pricing/index.d.ts +1 -0
  29. package/dist/cjs/api/resources/pricing/index.js +17 -0
  30. package/dist/cjs/api/resources/valueReceipts/client/Client.d.ts +85 -0
  31. package/dist/cjs/api/resources/valueReceipts/client/Client.js +362 -1
  32. package/dist/cjs/api/resources/valueReceipts/client/requests/ArchiveValueReceiptRequest.d.ts +9 -0
  33. package/dist/cjs/api/resources/valueReceipts/client/requests/ArchiveValueReceiptRequest.js +3 -0
  34. package/dist/cjs/api/resources/valueReceipts/client/requests/ListValueReceiptsRequest.d.ts +7 -0
  35. package/dist/cjs/api/resources/valueReceipts/client/requests/RefreshValueReceiptRequest.d.ts +9 -0
  36. package/dist/cjs/api/resources/valueReceipts/client/requests/RefreshValueReceiptRequest.js +3 -0
  37. package/dist/cjs/api/resources/valueReceipts/client/requests/SealValueReceiptRequest.d.ts +9 -0
  38. package/dist/cjs/api/resources/valueReceipts/client/requests/SealValueReceiptRequest.js +3 -0
  39. package/dist/cjs/api/resources/valueReceipts/client/requests/SyncValueReceiptRequest.d.ts +28 -0
  40. package/dist/cjs/api/resources/valueReceipts/client/requests/SyncValueReceiptRequest.js +3 -0
  41. package/dist/cjs/api/resources/valueReceipts/client/requests/UnarchiveValueReceiptRequest.d.ts +9 -0
  42. package/dist/cjs/api/resources/valueReceipts/client/requests/UnarchiveValueReceiptRequest.js +3 -0
  43. package/dist/cjs/api/resources/valueReceipts/client/requests/index.d.ts +5 -0
  44. package/dist/cjs/api/resources/valueReceipts/index.d.ts +1 -0
  45. package/dist/cjs/api/resources/valueReceipts/index.js +1 -0
  46. package/dist/cjs/api/resources/valueReceipts/types/ListValueReceiptsRequestArchived.d.ts +5 -0
  47. package/dist/cjs/api/resources/valueReceipts/types/ListValueReceiptsRequestArchived.js +8 -0
  48. package/dist/cjs/api/resources/valueReceipts/types/index.d.ts +1 -0
  49. package/dist/cjs/api/resources/valueReceipts/types/index.js +17 -0
  50. package/dist/cjs/api/types/Cost.d.ts +10 -0
  51. package/dist/cjs/api/types/Cost.js +3 -0
  52. package/dist/cjs/api/types/CostIngestResponse.d.ts +6 -0
  53. package/dist/cjs/api/types/CostIngestResponse.js +3 -0
  54. package/dist/cjs/api/types/CostOverride.d.ts +8 -0
  55. package/dist/cjs/api/types/CostOverride.js +3 -0
  56. package/dist/cjs/api/types/CreateOrderLineAttributeRequest.d.ts +1 -0
  57. package/dist/cjs/api/types/CreditBalance.d.ts +6 -0
  58. package/dist/cjs/api/types/CreditBenefitInput.d.ts +30 -0
  59. package/dist/cjs/api/types/CreditBenefitInput.js +20 -0
  60. package/dist/cjs/api/types/CreditBenefitOutput.d.ts +13 -0
  61. package/dist/cjs/api/types/CreditBenefitOutput.js +3 -0
  62. package/dist/cjs/api/types/CreditGrant.d.ts +11 -0
  63. package/dist/cjs/api/types/CreditGrant.js +3 -0
  64. package/dist/cjs/api/types/OneTimePerUnitInput.d.ts +21 -0
  65. package/dist/cjs/api/types/OneTimePerUnitInput.js +18 -0
  66. package/dist/cjs/api/types/Order.d.ts +2 -0
  67. package/dist/cjs/api/types/OrderBillingFrequencyOverride.d.ts +14 -0
  68. package/dist/cjs/api/types/OrderBillingFrequencyOverride.js +14 -0
  69. package/dist/cjs/api/types/PrecomputedCost.d.ts +17 -0
  70. package/dist/cjs/api/types/PrecomputedCost.js +3 -0
  71. package/dist/cjs/api/types/PricingInput.d.ts +46 -0
  72. package/dist/cjs/api/types/PricingInput.js +3 -0
  73. package/dist/cjs/api/types/PricingListResponse.d.ts +4 -0
  74. package/dist/cjs/api/types/PricingListResponse.js +3 -0
  75. package/dist/cjs/api/types/PricingOutput.d.ts +36 -0
  76. package/dist/cjs/api/types/PricingOutput.js +23 -0
  77. package/dist/cjs/api/types/PricingPricePointOutput.d.ts +29 -0
  78. package/dist/cjs/api/types/PricingPricePointOutput.js +17 -0
  79. package/dist/cjs/api/types/PricingResponse.d.ts +7 -0
  80. package/dist/cjs/api/types/PricingResponse.js +3 -0
  81. package/dist/cjs/api/types/ProductAttribution.d.ts +2 -0
  82. package/dist/cjs/api/types/ProductAttribution.js +3 -0
  83. package/dist/cjs/api/types/RecurringGraduatedInput.d.ts +22 -0
  84. package/dist/cjs/api/types/RecurringGraduatedInput.js +18 -0
  85. package/dist/cjs/api/types/RecurringPerUnitInput.d.ts +22 -0
  86. package/dist/cjs/api/types/RecurringPerUnitInput.js +18 -0
  87. package/dist/cjs/api/types/RecurringPercentOfTotalInput.d.ts +23 -0
  88. package/dist/cjs/api/types/RecurringPercentOfTotalInput.js +18 -0
  89. package/dist/cjs/api/types/RecurringVolumeInput.d.ts +22 -0
  90. package/dist/cjs/api/types/RecurringVolumeInput.js +18 -0
  91. package/dist/cjs/api/types/SeatBasedGraduatedInput.d.ts +22 -0
  92. package/dist/cjs/api/types/SeatBasedGraduatedInput.js +18 -0
  93. package/dist/cjs/api/types/SeatBasedPerUnitInput.d.ts +22 -0
  94. package/dist/cjs/api/types/SeatBasedPerUnitInput.js +18 -0
  95. package/dist/cjs/api/types/SeatBasedPrepaidCreditsInput.d.ts +25 -0
  96. package/dist/cjs/api/types/SeatBasedPrepaidCreditsInput.js +18 -0
  97. package/dist/cjs/api/types/SeatBasedVolumeInput.d.ts +22 -0
  98. package/dist/cjs/api/types/SeatBasedVolumeInput.js +18 -0
  99. package/dist/cjs/api/types/SimplePricePoint.d.ts +29 -0
  100. package/dist/cjs/api/types/SimplePricePoint.js +17 -0
  101. package/dist/cjs/api/types/SuccessResponse.d.ts +3 -0
  102. package/dist/cjs/api/types/SuccessResponse.js +3 -0
  103. package/dist/cjs/api/types/TieredPricePoint.d.ts +29 -0
  104. package/dist/cjs/api/types/TieredPricePoint.js +17 -0
  105. package/dist/cjs/api/types/TokenUsage.d.ts +12 -0
  106. package/dist/cjs/api/types/TokenUsage.js +3 -0
  107. package/dist/cjs/api/types/UsageCost.d.ts +15 -0
  108. package/dist/cjs/api/types/UsageCost.js +3 -0
  109. package/dist/cjs/api/types/UsageCostPlusInput.d.ts +23 -0
  110. package/dist/cjs/api/types/UsageCostPlusInput.js +18 -0
  111. package/dist/cjs/api/types/UsageGraduatedInput.d.ts +23 -0
  112. package/dist/cjs/api/types/UsageGraduatedInput.js +18 -0
  113. package/dist/cjs/api/types/UsagePerUnitInput.d.ts +23 -0
  114. package/dist/cjs/api/types/UsagePerUnitInput.js +18 -0
  115. package/dist/cjs/api/types/UsagePrepaidCreditsInput.d.ts +26 -0
  116. package/dist/cjs/api/types/UsagePrepaidCreditsInput.js +18 -0
  117. package/dist/cjs/api/types/UsageVolumeInput.d.ts +23 -0
  118. package/dist/cjs/api/types/UsageVolumeInput.js +18 -0
  119. package/dist/cjs/api/types/ValueReceiptDetail.d.ts +2 -0
  120. package/dist/cjs/api/types/ValueReceiptSummary.d.ts +2 -0
  121. package/dist/cjs/api/types/ValueReceiptSyncResponse.d.ts +6 -0
  122. package/dist/cjs/api/types/ValueReceiptSyncResponse.js +3 -0
  123. package/dist/cjs/api/types/index.d.ts +34 -0
  124. package/dist/cjs/api/types/index.js +34 -0
  125. package/dist/cjs/version.d.ts +1 -1
  126. package/dist/cjs/version.js +1 -1
  127. package/dist/esm/Client.d.mts +6 -0
  128. package/dist/esm/Client.mjs +12 -2
  129. package/dist/esm/api/resources/cost/client/Client.d.mts +38 -0
  130. package/dist/esm/api/resources/cost/client/Client.mjs +102 -0
  131. package/dist/esm/api/resources/cost/client/index.d.mts +1 -0
  132. package/dist/esm/api/resources/cost/client/index.mjs +1 -0
  133. package/dist/esm/api/resources/cost/client/requests/CostIngestRequest.d.mts +17 -0
  134. package/dist/esm/api/resources/cost/client/requests/CostIngestRequest.mjs +2 -0
  135. package/dist/esm/api/resources/cost/client/requests/index.d.mts +1 -0
  136. package/dist/esm/api/resources/cost/client/requests/index.mjs +1 -0
  137. package/dist/esm/api/resources/cost/index.d.mts +1 -0
  138. package/dist/esm/api/resources/cost/index.mjs +1 -0
  139. package/dist/esm/api/resources/index.d.mts +5 -0
  140. package/dist/esm/api/resources/index.mjs +5 -0
  141. package/dist/esm/api/resources/orders/client/requests/CreateOrderRequest.d.mts +1 -0
  142. package/dist/esm/api/resources/pricing/client/Client.d.mts +71 -0
  143. package/dist/esm/api/resources/pricing/client/Client.mjs +247 -0
  144. package/dist/esm/api/resources/pricing/client/index.d.mts +1 -0
  145. package/dist/esm/api/resources/pricing/client/index.mjs +1 -0
  146. package/dist/esm/api/resources/pricing/client/requests/GetPricingRequest.d.mts +9 -0
  147. package/dist/esm/api/resources/pricing/client/requests/GetPricingRequest.mjs +2 -0
  148. package/dist/esm/api/resources/pricing/client/requests/ListPricingRequest.d.mts +10 -0
  149. package/dist/esm/api/resources/pricing/client/requests/ListPricingRequest.mjs +2 -0
  150. package/dist/esm/api/resources/pricing/client/requests/UpdatePricingRequest.d.mts +20 -0
  151. package/dist/esm/api/resources/pricing/client/requests/UpdatePricingRequest.mjs +2 -0
  152. package/dist/esm/api/resources/pricing/client/requests/index.d.mts +3 -0
  153. package/dist/esm/api/resources/pricing/client/requests/index.mjs +1 -0
  154. package/dist/esm/api/resources/pricing/index.d.mts +1 -0
  155. package/dist/esm/api/resources/pricing/index.mjs +1 -0
  156. package/dist/esm/api/resources/valueReceipts/client/Client.d.mts +85 -0
  157. package/dist/esm/api/resources/valueReceipts/client/Client.mjs +362 -1
  158. package/dist/esm/api/resources/valueReceipts/client/requests/ArchiveValueReceiptRequest.d.mts +9 -0
  159. package/dist/esm/api/resources/valueReceipts/client/requests/ArchiveValueReceiptRequest.mjs +2 -0
  160. package/dist/esm/api/resources/valueReceipts/client/requests/ListValueReceiptsRequest.d.mts +7 -0
  161. package/dist/esm/api/resources/valueReceipts/client/requests/RefreshValueReceiptRequest.d.mts +9 -0
  162. package/dist/esm/api/resources/valueReceipts/client/requests/RefreshValueReceiptRequest.mjs +2 -0
  163. package/dist/esm/api/resources/valueReceipts/client/requests/SealValueReceiptRequest.d.mts +9 -0
  164. package/dist/esm/api/resources/valueReceipts/client/requests/SealValueReceiptRequest.mjs +2 -0
  165. package/dist/esm/api/resources/valueReceipts/client/requests/SyncValueReceiptRequest.d.mts +28 -0
  166. package/dist/esm/api/resources/valueReceipts/client/requests/SyncValueReceiptRequest.mjs +2 -0
  167. package/dist/esm/api/resources/valueReceipts/client/requests/UnarchiveValueReceiptRequest.d.mts +9 -0
  168. package/dist/esm/api/resources/valueReceipts/client/requests/UnarchiveValueReceiptRequest.mjs +2 -0
  169. package/dist/esm/api/resources/valueReceipts/client/requests/index.d.mts +5 -0
  170. package/dist/esm/api/resources/valueReceipts/index.d.mts +1 -0
  171. package/dist/esm/api/resources/valueReceipts/index.mjs +1 -0
  172. package/dist/esm/api/resources/valueReceipts/types/ListValueReceiptsRequestArchived.d.mts +5 -0
  173. package/dist/esm/api/resources/valueReceipts/types/ListValueReceiptsRequestArchived.mjs +5 -0
  174. package/dist/esm/api/resources/valueReceipts/types/index.d.mts +1 -0
  175. package/dist/esm/api/resources/valueReceipts/types/index.mjs +1 -0
  176. package/dist/esm/api/types/Cost.d.mts +10 -0
  177. package/dist/esm/api/types/Cost.mjs +2 -0
  178. package/dist/esm/api/types/CostIngestResponse.d.mts +6 -0
  179. package/dist/esm/api/types/CostIngestResponse.mjs +2 -0
  180. package/dist/esm/api/types/CostOverride.d.mts +8 -0
  181. package/dist/esm/api/types/CostOverride.mjs +2 -0
  182. package/dist/esm/api/types/CreateOrderLineAttributeRequest.d.mts +1 -0
  183. package/dist/esm/api/types/CreditBalance.d.mts +6 -0
  184. package/dist/esm/api/types/CreditBenefitInput.d.mts +30 -0
  185. package/dist/esm/api/types/CreditBenefitInput.mjs +17 -0
  186. package/dist/esm/api/types/CreditBenefitOutput.d.mts +13 -0
  187. package/dist/esm/api/types/CreditBenefitOutput.mjs +2 -0
  188. package/dist/esm/api/types/CreditGrant.d.mts +11 -0
  189. package/dist/esm/api/types/CreditGrant.mjs +2 -0
  190. package/dist/esm/api/types/OneTimePerUnitInput.d.mts +21 -0
  191. package/dist/esm/api/types/OneTimePerUnitInput.mjs +15 -0
  192. package/dist/esm/api/types/Order.d.mts +2 -0
  193. package/dist/esm/api/types/OrderBillingFrequencyOverride.d.mts +14 -0
  194. package/dist/esm/api/types/OrderBillingFrequencyOverride.mjs +11 -0
  195. package/dist/esm/api/types/PrecomputedCost.d.mts +17 -0
  196. package/dist/esm/api/types/PrecomputedCost.mjs +2 -0
  197. package/dist/esm/api/types/PricingInput.d.mts +46 -0
  198. package/dist/esm/api/types/PricingInput.mjs +2 -0
  199. package/dist/esm/api/types/PricingListResponse.d.mts +4 -0
  200. package/dist/esm/api/types/PricingListResponse.mjs +2 -0
  201. package/dist/esm/api/types/PricingOutput.d.mts +36 -0
  202. package/dist/esm/api/types/PricingOutput.mjs +20 -0
  203. package/dist/esm/api/types/PricingPricePointOutput.d.mts +29 -0
  204. package/dist/esm/api/types/PricingPricePointOutput.mjs +14 -0
  205. package/dist/esm/api/types/PricingResponse.d.mts +7 -0
  206. package/dist/esm/api/types/PricingResponse.mjs +2 -0
  207. package/dist/esm/api/types/ProductAttribution.d.mts +2 -0
  208. package/dist/esm/api/types/ProductAttribution.mjs +2 -0
  209. package/dist/esm/api/types/RecurringGraduatedInput.d.mts +22 -0
  210. package/dist/esm/api/types/RecurringGraduatedInput.mjs +15 -0
  211. package/dist/esm/api/types/RecurringPerUnitInput.d.mts +22 -0
  212. package/dist/esm/api/types/RecurringPerUnitInput.mjs +15 -0
  213. package/dist/esm/api/types/RecurringPercentOfTotalInput.d.mts +23 -0
  214. package/dist/esm/api/types/RecurringPercentOfTotalInput.mjs +15 -0
  215. package/dist/esm/api/types/RecurringVolumeInput.d.mts +22 -0
  216. package/dist/esm/api/types/RecurringVolumeInput.mjs +15 -0
  217. package/dist/esm/api/types/SeatBasedGraduatedInput.d.mts +22 -0
  218. package/dist/esm/api/types/SeatBasedGraduatedInput.mjs +15 -0
  219. package/dist/esm/api/types/SeatBasedPerUnitInput.d.mts +22 -0
  220. package/dist/esm/api/types/SeatBasedPerUnitInput.mjs +15 -0
  221. package/dist/esm/api/types/SeatBasedPrepaidCreditsInput.d.mts +25 -0
  222. package/dist/esm/api/types/SeatBasedPrepaidCreditsInput.mjs +15 -0
  223. package/dist/esm/api/types/SeatBasedVolumeInput.d.mts +22 -0
  224. package/dist/esm/api/types/SeatBasedVolumeInput.mjs +15 -0
  225. package/dist/esm/api/types/SimplePricePoint.d.mts +29 -0
  226. package/dist/esm/api/types/SimplePricePoint.mjs +14 -0
  227. package/dist/esm/api/types/SuccessResponse.d.mts +3 -0
  228. package/dist/esm/api/types/SuccessResponse.mjs +2 -0
  229. package/dist/esm/api/types/TieredPricePoint.d.mts +29 -0
  230. package/dist/esm/api/types/TieredPricePoint.mjs +14 -0
  231. package/dist/esm/api/types/TokenUsage.d.mts +12 -0
  232. package/dist/esm/api/types/TokenUsage.mjs +2 -0
  233. package/dist/esm/api/types/UsageCost.d.mts +15 -0
  234. package/dist/esm/api/types/UsageCost.mjs +2 -0
  235. package/dist/esm/api/types/UsageCostPlusInput.d.mts +23 -0
  236. package/dist/esm/api/types/UsageCostPlusInput.mjs +15 -0
  237. package/dist/esm/api/types/UsageGraduatedInput.d.mts +23 -0
  238. package/dist/esm/api/types/UsageGraduatedInput.mjs +15 -0
  239. package/dist/esm/api/types/UsagePerUnitInput.d.mts +23 -0
  240. package/dist/esm/api/types/UsagePerUnitInput.mjs +15 -0
  241. package/dist/esm/api/types/UsagePrepaidCreditsInput.d.mts +26 -0
  242. package/dist/esm/api/types/UsagePrepaidCreditsInput.mjs +15 -0
  243. package/dist/esm/api/types/UsageVolumeInput.d.mts +23 -0
  244. package/dist/esm/api/types/UsageVolumeInput.mjs +15 -0
  245. package/dist/esm/api/types/ValueReceiptDetail.d.mts +2 -0
  246. package/dist/esm/api/types/ValueReceiptSummary.d.mts +2 -0
  247. package/dist/esm/api/types/ValueReceiptSyncResponse.d.mts +6 -0
  248. package/dist/esm/api/types/ValueReceiptSyncResponse.mjs +2 -0
  249. package/dist/esm/api/types/index.d.mts +34 -0
  250. package/dist/esm/api/types/index.mjs +34 -0
  251. package/dist/esm/version.d.mts +1 -1
  252. package/dist/esm/version.mjs +1 -1
  253. package/package.json +1 -1
  254. package/reference.md +610 -7
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * productAttributeId: "productAttributeId"
5
+ * }
6
+ */
7
+ export interface GetPricingRequest {
8
+ productAttributeId: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * productId: "productId"
5
+ * }
6
+ */
7
+ export interface ListPricingRequest {
8
+ /** Product display ID or UUID */
9
+ productId: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,20 @@
1
+ import type * as Paid from "../../../../index.mjs";
2
+ /**
3
+ * @example
4
+ * {
5
+ * productAttributeId: "productAttributeId",
6
+ * pricing: {
7
+ * pricingType: "RecurringPerUnit",
8
+ * billingFrequency: "Monthly",
9
+ * pricePoints: [{
10
+ * currency: "currency",
11
+ * unitPrice: 1.1
12
+ * }]
13
+ * }
14
+ * }
15
+ */
16
+ export interface UpdatePricingRequest {
17
+ productAttributeId: string;
18
+ pricing: Paid.PricingInput;
19
+ creditBenefits?: Paid.CreditBenefitInput[];
20
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,3 @@
1
+ export type { GetPricingRequest } from "./GetPricingRequest.mjs";
2
+ export type { ListPricingRequest } from "./ListPricingRequest.mjs";
3
+ export type { UpdatePricingRequest } from "./UpdatePricingRequest.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -10,6 +10,24 @@ export declare namespace ValueReceipts {
10
10
  export declare class ValueReceipts {
11
11
  protected readonly _options: ValueReceipts.Options;
12
12
  constructor(_options: ValueReceipts.Options);
13
+ /**
14
+ * Find or create a value receipt by natural key (customer + product/order + dates), then populate it with current data inline. Returns the ID, status, and public URL. Posted (sealed) VRs are returned as-is without re-populating.
15
+ *
16
+ * @param {Paid.SyncValueReceiptRequest} request
17
+ * @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
18
+ *
19
+ * @throws {@link Paid.BadRequestError}
20
+ * @throws {@link Paid.NotFoundError}
21
+ * @throws {@link Paid.InternalServerError}
22
+ *
23
+ * @example
24
+ * await client.valueReceipts.syncValueReceipt({
25
+ * startDate: "2024-01-15T09:30:00Z",
26
+ * endDate: "2024-01-15T09:30:00Z"
27
+ * })
28
+ */
29
+ syncValueReceipt(request: Paid.SyncValueReceiptRequest, requestOptions?: ValueReceipts.RequestOptions): core.HttpResponsePromise<Paid.ValueReceiptSyncResponse>;
30
+ private __syncValueReceipt;
13
31
  /**
14
32
  * List value receipts for the organization
15
33
  *
@@ -39,6 +57,73 @@ export declare class ValueReceipts {
39
57
  */
40
58
  getValueReceiptById(request: Paid.GetValueReceiptByIdRequest, requestOptions?: ValueReceipts.RequestOptions): core.HttpResponsePromise<Paid.ValueReceiptDetail>;
41
59
  private __getValueReceiptById;
60
+ /**
61
+ * Re-populate an existing draft value receipt with current data inline. Returns the slim sync response. Sealed VRs cannot be refreshed.
62
+ *
63
+ * @param {Paid.RefreshValueReceiptRequest} request
64
+ * @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
65
+ *
66
+ * @throws {@link Paid.BadRequestError}
67
+ * @throws {@link Paid.NotFoundError}
68
+ * @throws {@link Paid.ConflictError}
69
+ * @throws {@link Paid.InternalServerError}
70
+ *
71
+ * @example
72
+ * await client.valueReceipts.refreshValueReceipt({
73
+ * id: "id"
74
+ * })
75
+ */
76
+ refreshValueReceipt(request: Paid.RefreshValueReceiptRequest, requestOptions?: ValueReceipts.RequestOptions): core.HttpResponsePromise<Paid.ValueReceiptSyncResponse>;
77
+ private __refreshValueReceipt;
78
+ /**
79
+ * Transition a draft value receipt to sealed (posted) status. Sealed VRs are immutable — they cannot be updated or re-populated.
80
+ *
81
+ * @param {Paid.SealValueReceiptRequest} request
82
+ * @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
83
+ *
84
+ * @throws {@link Paid.NotFoundError}
85
+ * @throws {@link Paid.ConflictError}
86
+ * @throws {@link Paid.InternalServerError}
87
+ *
88
+ * @example
89
+ * await client.valueReceipts.sealValueReceipt({
90
+ * id: "id"
91
+ * })
92
+ */
93
+ sealValueReceipt(request: Paid.SealValueReceiptRequest, requestOptions?: ValueReceipts.RequestOptions): core.HttpResponsePromise<Paid.SuccessResponse>;
94
+ private __sealValueReceipt;
95
+ /**
96
+ * Soft-archive a value receipt. Archived VRs are hidden from list by default.
97
+ *
98
+ * @param {Paid.ArchiveValueReceiptRequest} request
99
+ * @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
100
+ *
101
+ * @throws {@link Paid.NotFoundError}
102
+ * @throws {@link Paid.InternalServerError}
103
+ *
104
+ * @example
105
+ * await client.valueReceipts.archiveValueReceipt({
106
+ * id: "id"
107
+ * })
108
+ */
109
+ archiveValueReceipt(request: Paid.ArchiveValueReceiptRequest, requestOptions?: ValueReceipts.RequestOptions): core.HttpResponsePromise<Paid.SuccessResponse>;
110
+ private __archiveValueReceipt;
111
+ /**
112
+ * Restore an archived value receipt.
113
+ *
114
+ * @param {Paid.UnarchiveValueReceiptRequest} request
115
+ * @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
116
+ *
117
+ * @throws {@link Paid.NotFoundError}
118
+ * @throws {@link Paid.InternalServerError}
119
+ *
120
+ * @example
121
+ * await client.valueReceipts.unarchiveValueReceipt({
122
+ * id: "id"
123
+ * })
124
+ */
125
+ unarchiveValueReceipt(request: Paid.UnarchiveValueReceiptRequest, requestOptions?: ValueReceipts.RequestOptions): core.HttpResponsePromise<Paid.SuccessResponse>;
126
+ private __unarchiveValueReceipt;
42
127
  /**
43
128
  * Make a value receipt publicly accessible via URL.
44
129
  *
@@ -28,6 +28,77 @@ export class ValueReceipts {
28
28
  constructor(_options) {
29
29
  this._options = _options;
30
30
  }
31
+ /**
32
+ * Find or create a value receipt by natural key (customer + product/order + dates), then populate it with current data inline. Returns the ID, status, and public URL. Posted (sealed) VRs are returned as-is without re-populating.
33
+ *
34
+ * @param {Paid.SyncValueReceiptRequest} request
35
+ * @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
36
+ *
37
+ * @throws {@link Paid.BadRequestError}
38
+ * @throws {@link Paid.NotFoundError}
39
+ * @throws {@link Paid.InternalServerError}
40
+ *
41
+ * @example
42
+ * await client.valueReceipts.syncValueReceipt({
43
+ * startDate: "2024-01-15T09:30:00Z",
44
+ * endDate: "2024-01-15T09:30:00Z"
45
+ * })
46
+ */
47
+ syncValueReceipt(request, requestOptions) {
48
+ return core.HttpResponsePromise.fromPromise(this.__syncValueReceipt(request, requestOptions));
49
+ }
50
+ __syncValueReceipt(request, requestOptions) {
51
+ return __awaiter(this, void 0, void 0, function* () {
52
+ var _a, _b, _c, _d, _e, _f, _g, _h;
53
+ 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);
54
+ const _response = yield core.fetcher({
55
+ 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, "value-receipts/sync"),
56
+ method: "POST",
57
+ headers: _headers,
58
+ contentType: "application/json",
59
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
60
+ requestType: "json",
61
+ body: request,
62
+ 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,
63
+ 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,
64
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
65
+ });
66
+ if (_response.ok) {
67
+ return { data: _response.body, rawResponse: _response.rawResponse };
68
+ }
69
+ if (_response.error.reason === "status-code") {
70
+ switch (_response.error.statusCode) {
71
+ case 400:
72
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
73
+ case 404:
74
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
75
+ case 500:
76
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
77
+ default:
78
+ throw new errors.PaidError({
79
+ statusCode: _response.error.statusCode,
80
+ body: _response.error.body,
81
+ rawResponse: _response.rawResponse,
82
+ });
83
+ }
84
+ }
85
+ switch (_response.error.reason) {
86
+ case "non-json":
87
+ throw new errors.PaidError({
88
+ statusCode: _response.error.statusCode,
89
+ body: _response.error.rawBody,
90
+ rawResponse: _response.rawResponse,
91
+ });
92
+ case "timeout":
93
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /value-receipts/sync.");
94
+ case "unknown":
95
+ throw new errors.PaidError({
96
+ message: _response.error.errorMessage,
97
+ rawResponse: _response.rawResponse,
98
+ });
99
+ }
100
+ });
101
+ }
31
102
  /**
32
103
  * List value receipts for the organization
33
104
  *
@@ -45,7 +116,7 @@ export class ValueReceipts {
45
116
  __listValueReceipts() {
46
117
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
47
118
  var _a, _b, _c, _d, _e, _f, _g, _h;
48
- const { limit, offset, customerId, orderId } = request;
119
+ const { limit, offset, customerId, externalCustomerId, orderId, productId, archived } = request;
49
120
  const _queryParams = {};
50
121
  if (limit != null) {
51
122
  _queryParams.limit = limit.toString();
@@ -56,9 +127,18 @@ export class ValueReceipts {
56
127
  if (customerId != null) {
57
128
  _queryParams.customerId = customerId;
58
129
  }
130
+ if (externalCustomerId != null) {
131
+ _queryParams.externalCustomerId = externalCustomerId;
132
+ }
59
133
  if (orderId != null) {
60
134
  _queryParams.orderId = orderId;
61
135
  }
136
+ if (productId != null) {
137
+ _queryParams.productId = productId;
138
+ }
139
+ if (archived != null) {
140
+ _queryParams.archived = archived;
141
+ }
62
142
  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);
63
143
  const _response = yield core.fetcher({
64
144
  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, "value-receipts/"),
@@ -166,6 +246,287 @@ export class ValueReceipts {
166
246
  }
167
247
  });
168
248
  }
249
+ /**
250
+ * Re-populate an existing draft value receipt with current data inline. Returns the slim sync response. Sealed VRs cannot be refreshed.
251
+ *
252
+ * @param {Paid.RefreshValueReceiptRequest} request
253
+ * @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
254
+ *
255
+ * @throws {@link Paid.BadRequestError}
256
+ * @throws {@link Paid.NotFoundError}
257
+ * @throws {@link Paid.ConflictError}
258
+ * @throws {@link Paid.InternalServerError}
259
+ *
260
+ * @example
261
+ * await client.valueReceipts.refreshValueReceipt({
262
+ * id: "id"
263
+ * })
264
+ */
265
+ refreshValueReceipt(request, requestOptions) {
266
+ return core.HttpResponsePromise.fromPromise(this.__refreshValueReceipt(request, requestOptions));
267
+ }
268
+ __refreshValueReceipt(request, requestOptions) {
269
+ return __awaiter(this, void 0, void 0, function* () {
270
+ var _a, _b, _c, _d, _e, _f, _g, _h;
271
+ const { id } = request, _body = __rest(request, ["id"]);
272
+ 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);
273
+ const _response = yield core.fetcher({
274
+ 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, `value-receipts/${core.url.encodePathParam(id)}/refresh`),
275
+ method: "POST",
276
+ headers: _headers,
277
+ contentType: "application/json",
278
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
279
+ requestType: "json",
280
+ body: _body,
281
+ 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,
282
+ 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,
283
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
284
+ });
285
+ if (_response.ok) {
286
+ return { data: _response.body, rawResponse: _response.rawResponse };
287
+ }
288
+ if (_response.error.reason === "status-code") {
289
+ switch (_response.error.statusCode) {
290
+ case 400:
291
+ throw new Paid.BadRequestError(_response.error.body, _response.rawResponse);
292
+ case 404:
293
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
294
+ case 409:
295
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
296
+ case 500:
297
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
298
+ default:
299
+ throw new errors.PaidError({
300
+ statusCode: _response.error.statusCode,
301
+ body: _response.error.body,
302
+ rawResponse: _response.rawResponse,
303
+ });
304
+ }
305
+ }
306
+ switch (_response.error.reason) {
307
+ case "non-json":
308
+ throw new errors.PaidError({
309
+ statusCode: _response.error.statusCode,
310
+ body: _response.error.rawBody,
311
+ rawResponse: _response.rawResponse,
312
+ });
313
+ case "timeout":
314
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /value-receipts/{id}/refresh.");
315
+ case "unknown":
316
+ throw new errors.PaidError({
317
+ message: _response.error.errorMessage,
318
+ rawResponse: _response.rawResponse,
319
+ });
320
+ }
321
+ });
322
+ }
323
+ /**
324
+ * Transition a draft value receipt to sealed (posted) status. Sealed VRs are immutable — they cannot be updated or re-populated.
325
+ *
326
+ * @param {Paid.SealValueReceiptRequest} request
327
+ * @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
328
+ *
329
+ * @throws {@link Paid.NotFoundError}
330
+ * @throws {@link Paid.ConflictError}
331
+ * @throws {@link Paid.InternalServerError}
332
+ *
333
+ * @example
334
+ * await client.valueReceipts.sealValueReceipt({
335
+ * id: "id"
336
+ * })
337
+ */
338
+ sealValueReceipt(request, requestOptions) {
339
+ return core.HttpResponsePromise.fromPromise(this.__sealValueReceipt(request, requestOptions));
340
+ }
341
+ __sealValueReceipt(request, requestOptions) {
342
+ return __awaiter(this, void 0, void 0, function* () {
343
+ var _a, _b, _c, _d, _e, _f, _g, _h;
344
+ const { id } = request, _body = __rest(request, ["id"]);
345
+ 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);
346
+ const _response = yield core.fetcher({
347
+ 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, `value-receipts/${core.url.encodePathParam(id)}/seal`),
348
+ method: "POST",
349
+ headers: _headers,
350
+ contentType: "application/json",
351
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
352
+ requestType: "json",
353
+ body: _body,
354
+ 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,
355
+ 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,
356
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
357
+ });
358
+ if (_response.ok) {
359
+ return { data: _response.body, rawResponse: _response.rawResponse };
360
+ }
361
+ if (_response.error.reason === "status-code") {
362
+ switch (_response.error.statusCode) {
363
+ case 404:
364
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
365
+ case 409:
366
+ throw new Paid.ConflictError(_response.error.body, _response.rawResponse);
367
+ case 500:
368
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
369
+ default:
370
+ throw new errors.PaidError({
371
+ statusCode: _response.error.statusCode,
372
+ body: _response.error.body,
373
+ rawResponse: _response.rawResponse,
374
+ });
375
+ }
376
+ }
377
+ switch (_response.error.reason) {
378
+ case "non-json":
379
+ throw new errors.PaidError({
380
+ statusCode: _response.error.statusCode,
381
+ body: _response.error.rawBody,
382
+ rawResponse: _response.rawResponse,
383
+ });
384
+ case "timeout":
385
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /value-receipts/{id}/seal.");
386
+ case "unknown":
387
+ throw new errors.PaidError({
388
+ message: _response.error.errorMessage,
389
+ rawResponse: _response.rawResponse,
390
+ });
391
+ }
392
+ });
393
+ }
394
+ /**
395
+ * Soft-archive a value receipt. Archived VRs are hidden from list by default.
396
+ *
397
+ * @param {Paid.ArchiveValueReceiptRequest} request
398
+ * @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
399
+ *
400
+ * @throws {@link Paid.NotFoundError}
401
+ * @throws {@link Paid.InternalServerError}
402
+ *
403
+ * @example
404
+ * await client.valueReceipts.archiveValueReceipt({
405
+ * id: "id"
406
+ * })
407
+ */
408
+ archiveValueReceipt(request, requestOptions) {
409
+ return core.HttpResponsePromise.fromPromise(this.__archiveValueReceipt(request, requestOptions));
410
+ }
411
+ __archiveValueReceipt(request, requestOptions) {
412
+ return __awaiter(this, void 0, void 0, function* () {
413
+ var _a, _b, _c, _d, _e, _f, _g, _h;
414
+ const { id } = request, _body = __rest(request, ["id"]);
415
+ 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);
416
+ const _response = yield core.fetcher({
417
+ 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, `value-receipts/${core.url.encodePathParam(id)}/archive`),
418
+ method: "POST",
419
+ headers: _headers,
420
+ contentType: "application/json",
421
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
422
+ requestType: "json",
423
+ body: _body,
424
+ 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,
425
+ 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,
426
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
427
+ });
428
+ if (_response.ok) {
429
+ return { data: _response.body, rawResponse: _response.rawResponse };
430
+ }
431
+ if (_response.error.reason === "status-code") {
432
+ switch (_response.error.statusCode) {
433
+ case 404:
434
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
435
+ case 500:
436
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
437
+ default:
438
+ throw new errors.PaidError({
439
+ statusCode: _response.error.statusCode,
440
+ body: _response.error.body,
441
+ rawResponse: _response.rawResponse,
442
+ });
443
+ }
444
+ }
445
+ switch (_response.error.reason) {
446
+ case "non-json":
447
+ throw new errors.PaidError({
448
+ statusCode: _response.error.statusCode,
449
+ body: _response.error.rawBody,
450
+ rawResponse: _response.rawResponse,
451
+ });
452
+ case "timeout":
453
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /value-receipts/{id}/archive.");
454
+ case "unknown":
455
+ throw new errors.PaidError({
456
+ message: _response.error.errorMessage,
457
+ rawResponse: _response.rawResponse,
458
+ });
459
+ }
460
+ });
461
+ }
462
+ /**
463
+ * Restore an archived value receipt.
464
+ *
465
+ * @param {Paid.UnarchiveValueReceiptRequest} request
466
+ * @param {ValueReceipts.RequestOptions} requestOptions - Request-specific configuration.
467
+ *
468
+ * @throws {@link Paid.NotFoundError}
469
+ * @throws {@link Paid.InternalServerError}
470
+ *
471
+ * @example
472
+ * await client.valueReceipts.unarchiveValueReceipt({
473
+ * id: "id"
474
+ * })
475
+ */
476
+ unarchiveValueReceipt(request, requestOptions) {
477
+ return core.HttpResponsePromise.fromPromise(this.__unarchiveValueReceipt(request, requestOptions));
478
+ }
479
+ __unarchiveValueReceipt(request, requestOptions) {
480
+ return __awaiter(this, void 0, void 0, function* () {
481
+ var _a, _b, _c, _d, _e, _f, _g, _h;
482
+ const { id } = request, _body = __rest(request, ["id"]);
483
+ 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);
484
+ const _response = yield core.fetcher({
485
+ 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, `value-receipts/${core.url.encodePathParam(id)}/unarchive`),
486
+ method: "POST",
487
+ headers: _headers,
488
+ contentType: "application/json",
489
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
490
+ requestType: "json",
491
+ body: _body,
492
+ 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,
493
+ 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,
494
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
495
+ });
496
+ if (_response.ok) {
497
+ return { data: _response.body, rawResponse: _response.rawResponse };
498
+ }
499
+ if (_response.error.reason === "status-code") {
500
+ switch (_response.error.statusCode) {
501
+ case 404:
502
+ throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
503
+ case 500:
504
+ throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
505
+ default:
506
+ throw new errors.PaidError({
507
+ statusCode: _response.error.statusCode,
508
+ body: _response.error.body,
509
+ rawResponse: _response.rawResponse,
510
+ });
511
+ }
512
+ }
513
+ switch (_response.error.reason) {
514
+ case "non-json":
515
+ throw new errors.PaidError({
516
+ statusCode: _response.error.statusCode,
517
+ body: _response.error.rawBody,
518
+ rawResponse: _response.rawResponse,
519
+ });
520
+ case "timeout":
521
+ throw new errors.PaidTimeoutError("Timeout exceeded when calling POST /value-receipts/{id}/unarchive.");
522
+ case "unknown":
523
+ throw new errors.PaidError({
524
+ message: _response.error.errorMessage,
525
+ rawResponse: _response.rawResponse,
526
+ });
527
+ }
528
+ });
529
+ }
169
530
  /**
170
531
  * Make a value receipt publicly accessible via URL.
171
532
  *
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id"
5
+ * }
6
+ */
7
+ export interface ArchiveValueReceiptRequest {
8
+ id: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,3 +1,4 @@
1
+ import type * as Paid from "../../../../index.mjs";
1
2
  /**
2
3
  * @example
3
4
  * {}
@@ -5,6 +6,12 @@
5
6
  export interface ListValueReceiptsRequest {
6
7
  limit?: number;
7
8
  offset?: number;
9
+ /** Filter by customer display ID. */
8
10
  customerId?: string;
11
+ /** Filter by customer external ID. */
12
+ externalCustomerId?: string;
9
13
  orderId?: string;
14
+ productId?: string;
15
+ /** Include archived value receipts. Defaults to false. */
16
+ archived?: Paid.ListValueReceiptsRequestArchived;
10
17
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id"
5
+ * }
6
+ */
7
+ export interface RefreshValueReceiptRequest {
8
+ id: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "id"
5
+ * }
6
+ */
7
+ export interface SealValueReceiptRequest {
8
+ id: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * startDate: "2024-01-15T09:30:00Z",
5
+ * endDate: "2024-01-15T09:30:00Z"
6
+ * }
7
+ */
8
+ export interface SyncValueReceiptRequest {
9
+ /** Mutually exclusive with externalCustomerId. Exactly one is required. */
10
+ customerId?: string;
11
+ /** Mutually exclusive with customerId. Exactly one is required. */
12
+ externalCustomerId?: string;
13
+ startDate: string;
14
+ endDate: string;
15
+ /** Mutually exclusive with orderId. Provide at most one. */
16
+ product?: SyncValueReceiptRequest.Product;
17
+ /** Mutually exclusive with product. Provide at most one. */
18
+ orderId?: string;
19
+ }
20
+ export declare namespace SyncValueReceiptRequest {
21
+ /**
22
+ * Mutually exclusive with orderId. Provide at most one.
23
+ */
24
+ interface Product {
25
+ productId: string;
26
+ currency?: string;
27
+ }
28
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};