candidhealth 0.15.0 → 0.16.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 (257) hide show
  1. package/Client.d.ts +3 -0
  2. package/Client.js +23 -18
  3. package/api/resources/auth/resources/v2/client/Client.js +1 -1
  4. package/api/resources/billingNotes/resources/v2/client/Client.js +1 -1
  5. package/api/resources/contracts/resources/v2/client/Client.js +5 -5
  6. package/api/resources/eligibility/resources/v2/client/Client.js +1 -1
  7. package/api/resources/encounters/resources/v4/client/Client.js +4 -4
  8. package/api/resources/expectedNetworkStatus/resources/v1/client/Client.js +1 -1
  9. package/api/resources/expectedNetworkStatus/resources/v2/client/Client.js +2 -2
  10. package/api/resources/exports/resources/v3/client/Client.js +1 -1
  11. package/api/resources/financials/types/AllocationCreate.d.ts +5 -0
  12. package/api/resources/financials/types/AllocationTarget.d.ts +8 -6
  13. package/api/resources/financials/types/AllocationTargetCreate.d.ts +5 -0
  14. package/api/resources/financials/types/BillingProviderAllocationTarget.d.ts +7 -0
  15. package/api/resources/financials/types/BillingProviderAllocationTarget.js +5 -0
  16. package/api/resources/financials/types/ClaimAllocationTarget.d.ts +8 -0
  17. package/api/resources/financials/types/ClaimAllocationTarget.js +5 -0
  18. package/api/resources/financials/types/ServiceLineAllocationTarget.d.ts +9 -0
  19. package/api/resources/financials/types/ServiceLineAllocationTarget.js +5 -0
  20. package/api/resources/financials/types/index.d.ts +3 -0
  21. package/api/resources/financials/types/index.js +3 -0
  22. package/api/resources/guarantor/resources/v1/client/Client.js +3 -3
  23. package/api/resources/index.d.ts +1 -0
  24. package/api/resources/index.js +2 -1
  25. package/api/resources/insuranceAdjudications/resources/v1/client/Client.js +3 -3
  26. package/api/resources/insurancePayments/client/Client.d.ts +18 -0
  27. package/api/resources/insurancePayments/client/Client.js +18 -0
  28. package/api/resources/insurancePayments/client/index.d.ts +1 -0
  29. package/api/resources/insurancePayments/client/index.js +2 -0
  30. package/api/resources/insurancePayments/index.d.ts +2 -0
  31. package/api/resources/insurancePayments/index.js +18 -0
  32. package/api/resources/insurancePayments/resources/index.d.ts +1 -0
  33. package/api/resources/insurancePayments/resources/index.js +27 -0
  34. package/api/resources/insurancePayments/resources/v1/client/Client.d.ts +48 -0
  35. package/api/resources/insurancePayments/resources/v1/client/Client.js +325 -0
  36. package/api/resources/insurancePayments/resources/v1/client/create.d.ts +28 -0
  37. package/api/resources/insurancePayments/resources/v1/client/create.js +58 -0
  38. package/api/resources/insurancePayments/resources/v1/client/delete.d.ts +34 -0
  39. package/api/resources/insurancePayments/resources/v1/client/delete.js +69 -0
  40. package/api/resources/insurancePayments/resources/v1/client/get.d.ts +34 -0
  41. package/api/resources/insurancePayments/resources/v1/client/get.js +69 -0
  42. package/api/resources/insurancePayments/resources/v1/client/getMulti.d.ts +34 -0
  43. package/api/resources/insurancePayments/resources/v1/client/getMulti.js +69 -0
  44. package/api/resources/insurancePayments/resources/v1/client/index.d.ts +6 -0
  45. package/api/resources/insurancePayments/resources/v1/client/index.js +35 -0
  46. package/api/resources/insurancePayments/resources/v1/client/requests/GetMultiInsurancePaymentRequest.d.ts +23 -0
  47. package/api/resources/insurancePayments/resources/v1/client/requests/GetMultiInsurancePaymentRequest.js +5 -0
  48. package/api/resources/insurancePayments/resources/v1/client/requests/InsurancePaymentUpdate.d.ts +8 -0
  49. package/api/resources/insurancePayments/resources/v1/client/requests/InsurancePaymentUpdate.js +5 -0
  50. package/api/resources/insurancePayments/resources/v1/client/requests/index.d.ts +2 -0
  51. package/api/resources/insurancePayments/resources/v1/client/requests/index.js +2 -0
  52. package/api/resources/insurancePayments/resources/v1/client/update.d.ts +34 -0
  53. package/api/resources/insurancePayments/resources/v1/client/update.js +69 -0
  54. package/api/resources/insurancePayments/resources/v1/index.d.ts +2 -0
  55. package/api/resources/insurancePayments/resources/v1/index.js +18 -0
  56. package/api/resources/insurancePayments/resources/v1/types/InsurancePayment.d.ts +12 -0
  57. package/api/resources/insurancePayments/resources/v1/types/InsurancePayment.js +5 -0
  58. package/api/resources/insurancePayments/resources/v1/types/InsurancePaymentCreate.d.ts +11 -0
  59. package/api/resources/insurancePayments/resources/v1/types/InsurancePaymentCreate.js +5 -0
  60. package/api/resources/insurancePayments/resources/v1/types/InsurancePaymentId.d.ts +8 -0
  61. package/api/resources/insurancePayments/resources/v1/types/InsurancePaymentId.js +10 -0
  62. package/api/resources/insurancePayments/resources/v1/types/InsurancePaymentSortField.d.ts +9 -0
  63. package/api/resources/insurancePayments/resources/v1/types/InsurancePaymentSortField.js +11 -0
  64. package/api/resources/insurancePayments/resources/v1/types/InsurancePaymentsPage.d.ts +7 -0
  65. package/api/resources/insurancePayments/resources/v1/types/InsurancePaymentsPage.js +5 -0
  66. package/api/resources/insurancePayments/resources/v1/types/index.d.ts +5 -0
  67. package/api/resources/insurancePayments/resources/v1/types/index.js +21 -0
  68. package/api/resources/insuranceRefunds/resources/v1/client/Client.js +5 -5
  69. package/api/resources/organizationProviders/resources/v3/client/Client.js +4 -4
  70. package/api/resources/organizationServiceFacilities/resources/v2/client/Client.js +5 -5
  71. package/api/resources/patientPayments/resources/v4/client/Client.js +9 -6
  72. package/api/resources/patientPayments/resources/v4/client/requests/GetMultiPatientPaymentsRequest.d.ts +4 -0
  73. package/api/resources/patientRefunds/resources/v1/client/Client.js +9 -6
  74. package/api/resources/patientRefunds/resources/v1/client/requests/GetMultiPatientRefundsRequest.d.ts +4 -0
  75. package/api/resources/payers/resources/v3/client/Client.js +2 -2
  76. package/api/resources/serviceFacility/client/Client.js +1 -1
  77. package/api/resources/tasks/resources/v3/client/Client.js +5 -5
  78. package/api/resources/writeOffs/resources/v1/client/Client.js +4 -4
  79. package/api/resources/x12/resources/v1/types/Carc.d.ts +2 -1
  80. package/api/resources/x12/resources/v1/types/Carc.js +1 -0
  81. package/dist/Client.d.ts +3 -0
  82. package/dist/Client.js +23 -18
  83. package/dist/api/resources/auth/resources/v2/client/Client.js +1 -1
  84. package/dist/api/resources/billingNotes/resources/v2/client/Client.js +1 -1
  85. package/dist/api/resources/contracts/resources/v2/client/Client.js +5 -5
  86. package/dist/api/resources/eligibility/resources/v2/client/Client.js +1 -1
  87. package/dist/api/resources/encounters/resources/v4/client/Client.js +4 -4
  88. package/dist/api/resources/expectedNetworkStatus/resources/v1/client/Client.js +1 -1
  89. package/dist/api/resources/expectedNetworkStatus/resources/v2/client/Client.js +2 -2
  90. package/dist/api/resources/exports/resources/v3/client/Client.js +1 -1
  91. package/dist/api/resources/financials/types/AllocationCreate.d.ts +5 -0
  92. package/dist/api/resources/financials/types/AllocationTarget.d.ts +8 -6
  93. package/dist/api/resources/financials/types/AllocationTargetCreate.d.ts +5 -0
  94. package/dist/api/resources/financials/types/BillingProviderAllocationTarget.d.ts +7 -0
  95. package/dist/api/resources/financials/types/BillingProviderAllocationTarget.js +5 -0
  96. package/dist/api/resources/financials/types/ClaimAllocationTarget.d.ts +8 -0
  97. package/dist/api/resources/financials/types/ClaimAllocationTarget.js +5 -0
  98. package/dist/api/resources/financials/types/ServiceLineAllocationTarget.d.ts +9 -0
  99. package/dist/api/resources/financials/types/ServiceLineAllocationTarget.js +5 -0
  100. package/dist/api/resources/financials/types/index.d.ts +3 -0
  101. package/dist/api/resources/financials/types/index.js +3 -0
  102. package/dist/api/resources/guarantor/resources/v1/client/Client.js +3 -3
  103. package/dist/api/resources/index.d.ts +1 -0
  104. package/dist/api/resources/index.js +2 -1
  105. package/dist/api/resources/insuranceAdjudications/resources/v1/client/Client.js +3 -3
  106. package/dist/api/resources/insurancePayments/client/Client.d.ts +18 -0
  107. package/dist/api/resources/insurancePayments/client/Client.js +18 -0
  108. package/dist/api/resources/insurancePayments/client/index.d.ts +1 -0
  109. package/dist/api/resources/insurancePayments/client/index.js +2 -0
  110. package/dist/api/resources/insurancePayments/index.d.ts +2 -0
  111. package/dist/api/resources/insurancePayments/index.js +18 -0
  112. package/dist/api/resources/insurancePayments/resources/index.d.ts +1 -0
  113. package/dist/api/resources/insurancePayments/resources/index.js +27 -0
  114. package/dist/api/resources/insurancePayments/resources/v1/client/Client.d.ts +48 -0
  115. package/dist/api/resources/insurancePayments/resources/v1/client/Client.js +325 -0
  116. package/dist/api/resources/insurancePayments/resources/v1/client/create.d.ts +28 -0
  117. package/dist/api/resources/insurancePayments/resources/v1/client/create.js +58 -0
  118. package/dist/api/resources/insurancePayments/resources/v1/client/delete.d.ts +34 -0
  119. package/dist/api/resources/insurancePayments/resources/v1/client/delete.js +69 -0
  120. package/dist/api/resources/insurancePayments/resources/v1/client/get.d.ts +34 -0
  121. package/dist/api/resources/insurancePayments/resources/v1/client/get.js +69 -0
  122. package/dist/api/resources/insurancePayments/resources/v1/client/getMulti.d.ts +34 -0
  123. package/dist/api/resources/insurancePayments/resources/v1/client/getMulti.js +69 -0
  124. package/dist/api/resources/insurancePayments/resources/v1/client/index.d.ts +6 -0
  125. package/dist/api/resources/insurancePayments/resources/v1/client/index.js +35 -0
  126. package/dist/api/resources/insurancePayments/resources/v1/client/requests/GetMultiInsurancePaymentRequest.d.ts +23 -0
  127. package/dist/api/resources/insurancePayments/resources/v1/client/requests/GetMultiInsurancePaymentRequest.js +5 -0
  128. package/dist/api/resources/insurancePayments/resources/v1/client/requests/InsurancePaymentUpdate.d.ts +8 -0
  129. package/dist/api/resources/insurancePayments/resources/v1/client/requests/InsurancePaymentUpdate.js +5 -0
  130. package/dist/api/resources/insurancePayments/resources/v1/client/requests/index.d.ts +2 -0
  131. package/dist/api/resources/insurancePayments/resources/v1/client/requests/index.js +2 -0
  132. package/dist/api/resources/insurancePayments/resources/v1/client/update.d.ts +34 -0
  133. package/dist/api/resources/insurancePayments/resources/v1/client/update.js +69 -0
  134. package/dist/api/resources/insurancePayments/resources/v1/index.d.ts +2 -0
  135. package/dist/api/resources/insurancePayments/resources/v1/index.js +18 -0
  136. package/dist/api/resources/insurancePayments/resources/v1/types/InsurancePayment.d.ts +12 -0
  137. package/dist/api/resources/insurancePayments/resources/v1/types/InsurancePayment.js +5 -0
  138. package/dist/api/resources/insurancePayments/resources/v1/types/InsurancePaymentCreate.d.ts +11 -0
  139. package/dist/api/resources/insurancePayments/resources/v1/types/InsurancePaymentCreate.js +5 -0
  140. package/dist/api/resources/insurancePayments/resources/v1/types/InsurancePaymentId.d.ts +8 -0
  141. package/dist/api/resources/insurancePayments/resources/v1/types/InsurancePaymentId.js +10 -0
  142. package/dist/api/resources/insurancePayments/resources/v1/types/InsurancePaymentSortField.d.ts +9 -0
  143. package/dist/api/resources/insurancePayments/resources/v1/types/InsurancePaymentSortField.js +11 -0
  144. package/dist/api/resources/insurancePayments/resources/v1/types/InsurancePaymentsPage.d.ts +7 -0
  145. package/dist/api/resources/insurancePayments/resources/v1/types/InsurancePaymentsPage.js +5 -0
  146. package/dist/api/resources/insurancePayments/resources/v1/types/index.d.ts +5 -0
  147. package/dist/api/resources/insurancePayments/resources/v1/types/index.js +21 -0
  148. package/dist/api/resources/insuranceRefunds/resources/v1/client/Client.js +5 -5
  149. package/dist/api/resources/organizationProviders/resources/v3/client/Client.js +4 -4
  150. package/dist/api/resources/organizationServiceFacilities/resources/v2/client/Client.js +5 -5
  151. package/dist/api/resources/patientPayments/resources/v4/client/Client.js +9 -6
  152. package/dist/api/resources/patientPayments/resources/v4/client/requests/GetMultiPatientPaymentsRequest.d.ts +4 -0
  153. package/dist/api/resources/patientRefunds/resources/v1/client/Client.js +9 -6
  154. package/dist/api/resources/patientRefunds/resources/v1/client/requests/GetMultiPatientRefundsRequest.d.ts +4 -0
  155. package/dist/api/resources/payers/resources/v3/client/Client.js +2 -2
  156. package/dist/api/resources/serviceFacility/client/Client.js +1 -1
  157. package/dist/api/resources/tasks/resources/v3/client/Client.js +5 -5
  158. package/dist/api/resources/writeOffs/resources/v1/client/Client.js +4 -4
  159. package/dist/api/resources/x12/resources/v1/types/Carc.d.ts +2 -1
  160. package/dist/api/resources/x12/resources/v1/types/Carc.js +1 -0
  161. package/dist/serialization/resources/financials/types/AllocationTarget.d.ts +3 -6
  162. package/dist/serialization/resources/financials/types/AllocationTarget.js +3 -9
  163. package/dist/serialization/resources/financials/types/BillingProviderAllocationTarget.d.ts +12 -0
  164. package/dist/serialization/resources/financials/types/BillingProviderAllocationTarget.js +33 -0
  165. package/dist/serialization/resources/financials/types/ClaimAllocationTarget.d.ts +13 -0
  166. package/dist/serialization/resources/financials/types/ClaimAllocationTarget.js +34 -0
  167. package/dist/serialization/resources/financials/types/ServiceLineAllocationTarget.d.ts +14 -0
  168. package/dist/serialization/resources/financials/types/ServiceLineAllocationTarget.js +35 -0
  169. package/dist/serialization/resources/financials/types/index.d.ts +3 -0
  170. package/dist/serialization/resources/financials/types/index.js +3 -0
  171. package/dist/serialization/resources/index.d.ts +1 -0
  172. package/dist/serialization/resources/index.js +2 -1
  173. package/dist/serialization/resources/insurancePayments/index.d.ts +1 -0
  174. package/dist/serialization/resources/insurancePayments/index.js +17 -0
  175. package/dist/serialization/resources/insurancePayments/resources/index.d.ts +1 -0
  176. package/dist/serialization/resources/insurancePayments/resources/index.js +27 -0
  177. package/dist/serialization/resources/insurancePayments/resources/v1/client/create.d.ts +14 -0
  178. package/dist/serialization/resources/insurancePayments/resources/v1/client/create.js +46 -0
  179. package/dist/serialization/resources/insurancePayments/resources/v1/client/delete.d.ts +18 -0
  180. package/dist/serialization/resources/insurancePayments/resources/v1/client/delete.js +51 -0
  181. package/dist/serialization/resources/insurancePayments/resources/v1/client/get.d.ts +18 -0
  182. package/dist/serialization/resources/insurancePayments/resources/v1/client/get.js +51 -0
  183. package/dist/serialization/resources/insurancePayments/resources/v1/client/getMulti.d.ts +18 -0
  184. package/dist/serialization/resources/insurancePayments/resources/v1/client/getMulti.js +51 -0
  185. package/dist/serialization/resources/insurancePayments/resources/v1/client/index.d.ts +6 -0
  186. package/dist/serialization/resources/insurancePayments/resources/v1/client/index.js +35 -0
  187. package/dist/serialization/resources/insurancePayments/resources/v1/client/requests/InsurancePaymentUpdate.d.ts +13 -0
  188. package/dist/serialization/resources/insurancePayments/resources/v1/client/requests/InsurancePaymentUpdate.js +34 -0
  189. package/dist/serialization/resources/insurancePayments/resources/v1/client/requests/index.d.ts +1 -0
  190. package/dist/serialization/resources/insurancePayments/resources/v1/client/requests/index.js +5 -0
  191. package/dist/serialization/resources/insurancePayments/resources/v1/client/update.d.ts +18 -0
  192. package/dist/serialization/resources/insurancePayments/resources/v1/client/update.js +51 -0
  193. package/dist/serialization/resources/insurancePayments/resources/v1/index.d.ts +2 -0
  194. package/dist/serialization/resources/insurancePayments/resources/v1/index.js +18 -0
  195. package/dist/serialization/resources/insurancePayments/resources/v1/types/InsurancePayment.d.ts +17 -0
  196. package/dist/serialization/resources/insurancePayments/resources/v1/types/InsurancePayment.js +38 -0
  197. package/dist/serialization/resources/insurancePayments/resources/v1/types/InsurancePaymentCreate.d.ts +16 -0
  198. package/dist/serialization/resources/insurancePayments/resources/v1/types/InsurancePaymentCreate.js +37 -0
  199. package/dist/serialization/resources/insurancePayments/resources/v1/types/InsurancePaymentId.d.ts +10 -0
  200. package/dist/serialization/resources/insurancePayments/resources/v1/types/InsurancePaymentId.js +35 -0
  201. package/dist/serialization/resources/insurancePayments/resources/v1/types/InsurancePaymentSortField.d.ts +10 -0
  202. package/dist/serialization/resources/insurancePayments/resources/v1/types/InsurancePaymentSortField.js +31 -0
  203. package/dist/serialization/resources/insurancePayments/resources/v1/types/InsurancePaymentsPage.d.ts +12 -0
  204. package/dist/serialization/resources/insurancePayments/resources/v1/types/InsurancePaymentsPage.js +35 -0
  205. package/dist/serialization/resources/insurancePayments/resources/v1/types/index.d.ts +5 -0
  206. package/dist/serialization/resources/insurancePayments/resources/v1/types/index.js +21 -0
  207. package/dist/serialization/resources/x12/resources/v1/types/Carc.d.ts +1 -1
  208. package/dist/serialization/resources/x12/resources/v1/types/Carc.js +1 -0
  209. package/package.json +1 -1
  210. package/serialization/resources/financials/types/AllocationTarget.d.ts +3 -6
  211. package/serialization/resources/financials/types/AllocationTarget.js +3 -9
  212. package/serialization/resources/financials/types/BillingProviderAllocationTarget.d.ts +12 -0
  213. package/serialization/resources/financials/types/BillingProviderAllocationTarget.js +33 -0
  214. package/serialization/resources/financials/types/ClaimAllocationTarget.d.ts +13 -0
  215. package/serialization/resources/financials/types/ClaimAllocationTarget.js +34 -0
  216. package/serialization/resources/financials/types/ServiceLineAllocationTarget.d.ts +14 -0
  217. package/serialization/resources/financials/types/ServiceLineAllocationTarget.js +35 -0
  218. package/serialization/resources/financials/types/index.d.ts +3 -0
  219. package/serialization/resources/financials/types/index.js +3 -0
  220. package/serialization/resources/index.d.ts +1 -0
  221. package/serialization/resources/index.js +2 -1
  222. package/serialization/resources/insurancePayments/index.d.ts +1 -0
  223. package/serialization/resources/insurancePayments/index.js +17 -0
  224. package/serialization/resources/insurancePayments/resources/index.d.ts +1 -0
  225. package/serialization/resources/insurancePayments/resources/index.js +27 -0
  226. package/serialization/resources/insurancePayments/resources/v1/client/create.d.ts +14 -0
  227. package/serialization/resources/insurancePayments/resources/v1/client/create.js +46 -0
  228. package/serialization/resources/insurancePayments/resources/v1/client/delete.d.ts +18 -0
  229. package/serialization/resources/insurancePayments/resources/v1/client/delete.js +51 -0
  230. package/serialization/resources/insurancePayments/resources/v1/client/get.d.ts +18 -0
  231. package/serialization/resources/insurancePayments/resources/v1/client/get.js +51 -0
  232. package/serialization/resources/insurancePayments/resources/v1/client/getMulti.d.ts +18 -0
  233. package/serialization/resources/insurancePayments/resources/v1/client/getMulti.js +51 -0
  234. package/serialization/resources/insurancePayments/resources/v1/client/index.d.ts +6 -0
  235. package/serialization/resources/insurancePayments/resources/v1/client/index.js +35 -0
  236. package/serialization/resources/insurancePayments/resources/v1/client/requests/InsurancePaymentUpdate.d.ts +13 -0
  237. package/serialization/resources/insurancePayments/resources/v1/client/requests/InsurancePaymentUpdate.js +34 -0
  238. package/serialization/resources/insurancePayments/resources/v1/client/requests/index.d.ts +1 -0
  239. package/serialization/resources/insurancePayments/resources/v1/client/requests/index.js +5 -0
  240. package/serialization/resources/insurancePayments/resources/v1/client/update.d.ts +18 -0
  241. package/serialization/resources/insurancePayments/resources/v1/client/update.js +51 -0
  242. package/serialization/resources/insurancePayments/resources/v1/index.d.ts +2 -0
  243. package/serialization/resources/insurancePayments/resources/v1/index.js +18 -0
  244. package/serialization/resources/insurancePayments/resources/v1/types/InsurancePayment.d.ts +17 -0
  245. package/serialization/resources/insurancePayments/resources/v1/types/InsurancePayment.js +38 -0
  246. package/serialization/resources/insurancePayments/resources/v1/types/InsurancePaymentCreate.d.ts +16 -0
  247. package/serialization/resources/insurancePayments/resources/v1/types/InsurancePaymentCreate.js +37 -0
  248. package/serialization/resources/insurancePayments/resources/v1/types/InsurancePaymentId.d.ts +10 -0
  249. package/serialization/resources/insurancePayments/resources/v1/types/InsurancePaymentId.js +35 -0
  250. package/serialization/resources/insurancePayments/resources/v1/types/InsurancePaymentSortField.d.ts +10 -0
  251. package/serialization/resources/insurancePayments/resources/v1/types/InsurancePaymentSortField.js +31 -0
  252. package/serialization/resources/insurancePayments/resources/v1/types/InsurancePaymentsPage.d.ts +12 -0
  253. package/serialization/resources/insurancePayments/resources/v1/types/InsurancePaymentsPage.js +35 -0
  254. package/serialization/resources/insurancePayments/resources/v1/types/index.d.ts +5 -0
  255. package/serialization/resources/insurancePayments/resources/v1/types/index.js +21 -0
  256. package/serialization/resources/x12/resources/v1/types/Carc.d.ts +1 -1
  257. package/serialization/resources/x12/resources/v1/types/Carc.js +1 -0
@@ -52,7 +52,7 @@ class V1 {
52
52
  Authorization: await this._getAuthorizationHeader(),
53
53
  "X-Fern-Language": "JavaScript",
54
54
  "X-Fern-SDK-Name": "candidhealth",
55
- "X-Fern-SDK-Version": "0.15.0",
55
+ "X-Fern-SDK-Version": "0.16.0",
56
56
  },
57
57
  contentType: "application/json",
58
58
  body: await serializers.guarantor.v1.GuarantorCreate.jsonOrThrow(request, {
@@ -102,7 +102,7 @@ class V1 {
102
102
  Authorization: await this._getAuthorizationHeader(),
103
103
  "X-Fern-Language": "JavaScript",
104
104
  "X-Fern-SDK-Name": "candidhealth",
105
- "X-Fern-SDK-Version": "0.15.0",
105
+ "X-Fern-SDK-Version": "0.16.0",
106
106
  },
107
107
  contentType: "application/json",
108
108
  timeoutMs: 60000,
@@ -135,7 +135,7 @@ class V1 {
135
135
  Authorization: await this._getAuthorizationHeader(),
136
136
  "X-Fern-Language": "JavaScript",
137
137
  "X-Fern-SDK-Name": "candidhealth",
138
- "X-Fern-SDK-Version": "0.15.0",
138
+ "X-Fern-SDK-Version": "0.16.0",
139
139
  },
140
140
  contentType: "application/json",
141
141
  body: await serializers.guarantor.v1.GuarantorUpdate.jsonOrThrow(request, {
@@ -9,6 +9,7 @@ export * as exports from "./exports";
9
9
  export * as guarantor from "./guarantor";
10
10
  export * as insuranceAdjudications from "./insuranceAdjudications";
11
11
  export * as insuranceCards from "./insuranceCards";
12
+ export * as insurancePayments from "./insurancePayments";
12
13
  export * as insuranceRefunds from "./insuranceRefunds";
13
14
  export * as organizationServiceFacilities from "./organizationServiceFacilities";
14
15
  export * as organizationProviders from "./organizationProviders";
@@ -26,7 +26,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
26
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.eligibility = exports.tags = exports.serviceFacility = exports.invoices = exports.individual = exports.identifiers = exports.financials = exports.era = exports.eraCommons = exports.diagnoses = exports.commons = exports.claims = exports.x12 = exports.writeOffs = exports.tasks = exports.serviceLines = exports.remits = exports.payers = exports.patientRefunds = exports.patientPayments = exports.organizationProviders = exports.organizationServiceFacilities = exports.insuranceRefunds = exports.insuranceCards = exports.insuranceAdjudications = exports.guarantor = exports.exports = exports.expectedNetworkStatus = exports.encounters = exports.encounterProviders = exports.contracts = exports.claimSubmission = exports.billingNotes = exports.auth = void 0;
29
+ exports.eligibility = exports.tags = exports.serviceFacility = exports.invoices = exports.individual = exports.identifiers = exports.financials = exports.era = exports.eraCommons = exports.diagnoses = exports.commons = exports.claims = exports.x12 = exports.writeOffs = exports.tasks = exports.serviceLines = exports.remits = exports.payers = exports.patientRefunds = exports.patientPayments = exports.organizationProviders = exports.organizationServiceFacilities = exports.insuranceRefunds = exports.insurancePayments = exports.insuranceCards = exports.insuranceAdjudications = exports.guarantor = exports.exports = exports.expectedNetworkStatus = exports.encounters = exports.encounterProviders = exports.contracts = exports.claimSubmission = exports.billingNotes = exports.auth = void 0;
30
30
  exports.auth = __importStar(require("./auth"));
31
31
  exports.billingNotes = __importStar(require("./billingNotes"));
32
32
  exports.claimSubmission = __importStar(require("./claimSubmission"));
@@ -38,6 +38,7 @@ exports.exports = __importStar(require("./exports"));
38
38
  exports.guarantor = __importStar(require("./guarantor"));
39
39
  exports.insuranceAdjudications = __importStar(require("./insuranceAdjudications"));
40
40
  exports.insuranceCards = __importStar(require("./insuranceCards"));
41
+ exports.insurancePayments = __importStar(require("./insurancePayments"));
41
42
  exports.insuranceRefunds = __importStar(require("./insuranceRefunds"));
42
43
  exports.organizationServiceFacilities = __importStar(require("./organizationServiceFacilities"));
43
44
  exports.organizationProviders = __importStar(require("./organizationProviders"));
@@ -52,7 +52,7 @@ class V1 {
52
52
  Authorization: await this._getAuthorizationHeader(),
53
53
  "X-Fern-Language": "JavaScript",
54
54
  "X-Fern-SDK-Name": "candidhealth",
55
- "X-Fern-SDK-Version": "0.15.0",
55
+ "X-Fern-SDK-Version": "0.16.0",
56
56
  },
57
57
  contentType: "application/json",
58
58
  timeoutMs: 60000,
@@ -85,7 +85,7 @@ class V1 {
85
85
  Authorization: await this._getAuthorizationHeader(),
86
86
  "X-Fern-Language": "JavaScript",
87
87
  "X-Fern-SDK-Name": "candidhealth",
88
- "X-Fern-SDK-Version": "0.15.0",
88
+ "X-Fern-SDK-Version": "0.16.0",
89
89
  },
90
90
  contentType: "application/json",
91
91
  body: await serializers.insuranceAdjudications.v1.InsuranceAdjudicationCreate.jsonOrThrow(request, {
@@ -121,7 +121,7 @@ class V1 {
121
121
  Authorization: await this._getAuthorizationHeader(),
122
122
  "X-Fern-Language": "JavaScript",
123
123
  "X-Fern-SDK-Name": "candidhealth",
124
- "X-Fern-SDK-Version": "0.15.0",
124
+ "X-Fern-SDK-Version": "0.16.0",
125
125
  },
126
126
  contentType: "application/json",
127
127
  timeoutMs: 60000,
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../environments";
5
+ import * as core from "../../../../core";
6
+ import { V1 } from "../resources/v1/client/Client";
7
+ export declare namespace InsurancePayments {
8
+ interface Options {
9
+ environment?: environments.CandidApiEnvironment | string;
10
+ token?: core.Supplier<core.BearerToken | undefined>;
11
+ }
12
+ }
13
+ export declare class InsurancePayments {
14
+ protected readonly options: InsurancePayments.Options;
15
+ constructor(options: InsurancePayments.Options);
16
+ protected _v1: V1 | undefined;
17
+ get v1(): V1;
18
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.InsurancePayments = void 0;
7
+ const Client_1 = require("../resources/v1/client/Client");
8
+ class InsurancePayments {
9
+ options;
10
+ constructor(options) {
11
+ this.options = options;
12
+ }
13
+ _v1;
14
+ get v1() {
15
+ return (this._v1 ??= new Client_1.V1(this.options));
16
+ }
17
+ }
18
+ exports.InsurancePayments = InsurancePayments;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from "./resources";
2
+ export * from "./client";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./resources"), exports);
18
+ __exportStar(require("./client"), exports);
@@ -0,0 +1 @@
1
+ export * as v1 from "./v1";
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.v1 = void 0;
27
+ exports.v1 = __importStar(require("./v1"));
@@ -0,0 +1,48 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../../../environments";
5
+ import * as core from "../../../../../../core";
6
+ import * as CandidApi from "../../../../..";
7
+ export declare namespace V1 {
8
+ interface Options {
9
+ environment?: environments.CandidApiEnvironment | string;
10
+ token?: core.Supplier<core.BearerToken | undefined>;
11
+ }
12
+ }
13
+ export declare class V1 {
14
+ protected readonly options: V1.Options;
15
+ constructor(options: V1.Options);
16
+ /**
17
+ * Returns all non-ERA originated insurance payments satisfying the search criteria
18
+ *
19
+ */
20
+ getMulti(request?: CandidApi.insurancePayments.v1.GetMultiInsurancePaymentRequest): Promise<core.APIResponse<CandidApi.insurancePayments.v1.InsurancePaymentsPage, CandidApi.insurancePayments.v1.getMulti.Error>>;
21
+ /**
22
+ * Retrieves a previously created insurance payment by its `insurance_payment_id`.
23
+ * If the payment does not exist, a `403` will be thrown.
24
+ *
25
+ */
26
+ get(insurancePaymentId: CandidApi.insurancePayments.v1.InsurancePaymentId): Promise<core.APIResponse<CandidApi.insurancePayments.v1.InsurancePayment, CandidApi.insurancePayments.v1.get.Error>>;
27
+ /**
28
+ * Creates a new insurance payment record and returns the newly created `InsurancePayment` object. This endpoint
29
+ * should only be used for insurance payments that do not have a corresponding ERA (for example: a settlement check
30
+ * from a payer). If the payment is an ERA, then you should used the insurance-adjudications API.
31
+ *
32
+ */
33
+ create(request: CandidApi.insurancePayments.v1.InsurancePaymentCreate): Promise<core.APIResponse<CandidApi.insurancePayments.v1.InsurancePayment, CandidApi.insurancePayments.v1.create.Error>>;
34
+ /**
35
+ * Updates the patient payment record matching the provided insurance_payment_id. If updating the payment amount,
36
+ * then the allocations must be appropriately updated as well.
37
+ *
38
+ */
39
+ update(insurancePaymentId: CandidApi.insurancePayments.v1.InsurancePaymentId, request?: CandidApi.insurancePayments.v1.InsurancePaymentUpdate): Promise<core.APIResponse<CandidApi.insurancePayments.v1.InsurancePayment, CandidApi.insurancePayments.v1.update.Error>>;
40
+ /**
41
+ * Deletes the insurance payment record matching the provided `insurance_payment_id`.
42
+ * If the matching record's organization_id does not match the authenticated user's
43
+ * current organization_id, then a response code of `403` will be returned.
44
+ *
45
+ */
46
+ delete(insurancePaymentId: CandidApi.insurancePayments.v1.InsurancePaymentId): Promise<core.APIResponse<void, CandidApi.insurancePayments.v1.delete.Error>>;
47
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
48
+ }
@@ -0,0 +1,325 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ var __importDefault = (this && this.__importDefault) || function (mod) {
29
+ return (mod && mod.__esModule) ? mod : { "default": mod };
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ exports.V1 = void 0;
33
+ const environments = __importStar(require("../../../../../../environments"));
34
+ const core = __importStar(require("../../../../../../core"));
35
+ const CandidApi = __importStar(require("../../../../.."));
36
+ const url_search_params_1 = __importDefault(require("@ungap/url-search-params"));
37
+ const url_join_1 = __importDefault(require("url-join"));
38
+ const serializers = __importStar(require("../../../../../../serialization"));
39
+ class V1 {
40
+ options;
41
+ constructor(options) {
42
+ this.options = options;
43
+ }
44
+ /**
45
+ * Returns all non-ERA originated insurance payments satisfying the search criteria
46
+ *
47
+ */
48
+ async getMulti(request = {}) {
49
+ const { limit, payerUuid, claimId, serviceLineId, billingProviderId, sort, sortDirection, pageToken } = request;
50
+ const _queryParams = new url_search_params_1.default();
51
+ if (limit != null) {
52
+ _queryParams.append("limit", limit.toString());
53
+ }
54
+ if (payerUuid != null) {
55
+ _queryParams.append("payer_uuid", payerUuid);
56
+ }
57
+ if (claimId != null) {
58
+ _queryParams.append("claim_id", claimId);
59
+ }
60
+ if (serviceLineId != null) {
61
+ _queryParams.append("service_line_id", serviceLineId);
62
+ }
63
+ if (billingProviderId != null) {
64
+ _queryParams.append("billing_provider_id", billingProviderId);
65
+ }
66
+ if (sort != null) {
67
+ _queryParams.append("sort", sort);
68
+ }
69
+ if (sortDirection != null) {
70
+ _queryParams.append("sort_direction", sortDirection);
71
+ }
72
+ if (pageToken != null) {
73
+ _queryParams.append("page_token", pageToken);
74
+ }
75
+ const _response = await core.fetcher({
76
+ url: (0, url_join_1.default)(this.options.environment ?? environments.CandidApiEnvironment.Production, "/api/insurance-payments/v1"),
77
+ method: "GET",
78
+ headers: {
79
+ Authorization: await this._getAuthorizationHeader(),
80
+ "X-Fern-Language": "JavaScript",
81
+ "X-Fern-SDK-Name": "candidhealth",
82
+ "X-Fern-SDK-Version": "0.16.0",
83
+ },
84
+ contentType: "application/json",
85
+ queryParameters: _queryParams,
86
+ timeoutMs: 60000,
87
+ });
88
+ if (_response.ok) {
89
+ return {
90
+ ok: true,
91
+ body: await serializers.insurancePayments.v1.InsurancePaymentsPage.parseOrThrow(_response.body, {
92
+ unrecognizedObjectKeys: "passthrough",
93
+ allowUnrecognizedUnionMembers: true,
94
+ allowUnrecognizedEnumValues: true,
95
+ breadcrumbsPrefix: ["response"],
96
+ }),
97
+ };
98
+ }
99
+ if (_response.error.reason === "status-code") {
100
+ switch (_response.error.body?.errorName) {
101
+ case "UnauthorizedError":
102
+ case "UnprocessableEntityError":
103
+ return {
104
+ ok: false,
105
+ error: await serializers.insurancePayments.v1.getMulti.Error.parseOrThrow(_response.error.body, {
106
+ unrecognizedObjectKeys: "passthrough",
107
+ allowUnrecognizedUnionMembers: true,
108
+ allowUnrecognizedEnumValues: true,
109
+ breadcrumbsPrefix: ["response"],
110
+ }),
111
+ };
112
+ }
113
+ }
114
+ return {
115
+ ok: false,
116
+ error: CandidApi.insurancePayments.v1.getMulti.Error._unknown(_response.error),
117
+ };
118
+ }
119
+ /**
120
+ * Retrieves a previously created insurance payment by its `insurance_payment_id`.
121
+ * If the payment does not exist, a `403` will be thrown.
122
+ *
123
+ */
124
+ async get(insurancePaymentId) {
125
+ const _response = await core.fetcher({
126
+ url: (0, url_join_1.default)(this.options.environment ?? environments.CandidApiEnvironment.Production, `/api/insurance-payments/v1/${await serializers.insurancePayments.v1.InsurancePaymentId.jsonOrThrow(insurancePaymentId)}`),
127
+ method: "GET",
128
+ headers: {
129
+ Authorization: await this._getAuthorizationHeader(),
130
+ "X-Fern-Language": "JavaScript",
131
+ "X-Fern-SDK-Name": "candidhealth",
132
+ "X-Fern-SDK-Version": "0.16.0",
133
+ },
134
+ contentType: "application/json",
135
+ timeoutMs: 60000,
136
+ });
137
+ if (_response.ok) {
138
+ return {
139
+ ok: true,
140
+ body: await serializers.insurancePayments.v1.InsurancePayment.parseOrThrow(_response.body, {
141
+ unrecognizedObjectKeys: "passthrough",
142
+ allowUnrecognizedUnionMembers: true,
143
+ allowUnrecognizedEnumValues: true,
144
+ breadcrumbsPrefix: ["response"],
145
+ }),
146
+ };
147
+ }
148
+ if (_response.error.reason === "status-code") {
149
+ switch (_response.error.body?.errorName) {
150
+ case "EntityNotFoundError":
151
+ case "UnauthorizedError":
152
+ return {
153
+ ok: false,
154
+ error: await serializers.insurancePayments.v1.get.Error.parseOrThrow(_response.error.body, {
155
+ unrecognizedObjectKeys: "passthrough",
156
+ allowUnrecognizedUnionMembers: true,
157
+ allowUnrecognizedEnumValues: true,
158
+ breadcrumbsPrefix: ["response"],
159
+ }),
160
+ };
161
+ }
162
+ }
163
+ return {
164
+ ok: false,
165
+ error: CandidApi.insurancePayments.v1.get.Error._unknown(_response.error),
166
+ };
167
+ }
168
+ /**
169
+ * Creates a new insurance payment record and returns the newly created `InsurancePayment` object. This endpoint
170
+ * should only be used for insurance payments that do not have a corresponding ERA (for example: a settlement check
171
+ * from a payer). If the payment is an ERA, then you should used the insurance-adjudications API.
172
+ *
173
+ */
174
+ async create(request) {
175
+ const _response = await core.fetcher({
176
+ url: (0, url_join_1.default)(this.options.environment ?? environments.CandidApiEnvironment.Production, "/api/insurance-payments/v1"),
177
+ method: "POST",
178
+ headers: {
179
+ Authorization: await this._getAuthorizationHeader(),
180
+ "X-Fern-Language": "JavaScript",
181
+ "X-Fern-SDK-Name": "candidhealth",
182
+ "X-Fern-SDK-Version": "0.16.0",
183
+ },
184
+ contentType: "application/json",
185
+ body: await serializers.insurancePayments.v1.InsurancePaymentCreate.jsonOrThrow(request, {
186
+ unrecognizedObjectKeys: "strip",
187
+ }),
188
+ timeoutMs: 60000,
189
+ });
190
+ if (_response.ok) {
191
+ return {
192
+ ok: true,
193
+ body: await serializers.insurancePayments.v1.InsurancePayment.parseOrThrow(_response.body, {
194
+ unrecognizedObjectKeys: "passthrough",
195
+ allowUnrecognizedUnionMembers: true,
196
+ allowUnrecognizedEnumValues: true,
197
+ breadcrumbsPrefix: ["response"],
198
+ }),
199
+ };
200
+ }
201
+ if (_response.error.reason === "status-code") {
202
+ switch (_response.error.body?.errorName) {
203
+ case "UnauthorizedError":
204
+ return {
205
+ ok: false,
206
+ error: await serializers.insurancePayments.v1.create.Error.parseOrThrow(_response.error.body, {
207
+ unrecognizedObjectKeys: "passthrough",
208
+ allowUnrecognizedUnionMembers: true,
209
+ allowUnrecognizedEnumValues: true,
210
+ breadcrumbsPrefix: ["response"],
211
+ }),
212
+ };
213
+ }
214
+ }
215
+ return {
216
+ ok: false,
217
+ error: CandidApi.insurancePayments.v1.create.Error._unknown(_response.error),
218
+ };
219
+ }
220
+ /**
221
+ * Updates the patient payment record matching the provided insurance_payment_id. If updating the payment amount,
222
+ * then the allocations must be appropriately updated as well.
223
+ *
224
+ */
225
+ async update(insurancePaymentId, request = {}) {
226
+ const _response = await core.fetcher({
227
+ url: (0, url_join_1.default)(this.options.environment ?? environments.CandidApiEnvironment.Production, `/api/insurance-payments/v1/${await serializers.insurancePayments.v1.InsurancePaymentId.jsonOrThrow(insurancePaymentId)}`),
228
+ method: "PATCH",
229
+ headers: {
230
+ Authorization: await this._getAuthorizationHeader(),
231
+ "X-Fern-Language": "JavaScript",
232
+ "X-Fern-SDK-Name": "candidhealth",
233
+ "X-Fern-SDK-Version": "0.16.0",
234
+ },
235
+ contentType: "application/json",
236
+ body: await serializers.insurancePayments.v1.InsurancePaymentUpdate.jsonOrThrow(request, {
237
+ unrecognizedObjectKeys: "strip",
238
+ }),
239
+ timeoutMs: 60000,
240
+ });
241
+ if (_response.ok) {
242
+ return {
243
+ ok: true,
244
+ body: await serializers.insurancePayments.v1.InsurancePayment.parseOrThrow(_response.body, {
245
+ unrecognizedObjectKeys: "passthrough",
246
+ allowUnrecognizedUnionMembers: true,
247
+ allowUnrecognizedEnumValues: true,
248
+ breadcrumbsPrefix: ["response"],
249
+ }),
250
+ };
251
+ }
252
+ if (_response.error.reason === "status-code") {
253
+ switch (_response.error.body?.errorName) {
254
+ case "EntityNotFoundError":
255
+ case "UnauthorizedError":
256
+ return {
257
+ ok: false,
258
+ error: await serializers.insurancePayments.v1.update.Error.parseOrThrow(_response.error.body, {
259
+ unrecognizedObjectKeys: "passthrough",
260
+ allowUnrecognizedUnionMembers: true,
261
+ allowUnrecognizedEnumValues: true,
262
+ breadcrumbsPrefix: ["response"],
263
+ }),
264
+ };
265
+ }
266
+ }
267
+ return {
268
+ ok: false,
269
+ error: CandidApi.insurancePayments.v1.update.Error._unknown(_response.error),
270
+ };
271
+ }
272
+ /**
273
+ * Deletes the insurance payment record matching the provided `insurance_payment_id`.
274
+ * If the matching record's organization_id does not match the authenticated user's
275
+ * current organization_id, then a response code of `403` will be returned.
276
+ *
277
+ */
278
+ async delete(insurancePaymentId) {
279
+ const _response = await core.fetcher({
280
+ url: (0, url_join_1.default)(this.options.environment ?? environments.CandidApiEnvironment.Production, `/api/insurance-payments/v1/${await serializers.insurancePayments.v1.InsurancePaymentId.jsonOrThrow(insurancePaymentId)}`),
281
+ method: "DELETE",
282
+ headers: {
283
+ Authorization: await this._getAuthorizationHeader(),
284
+ "X-Fern-Language": "JavaScript",
285
+ "X-Fern-SDK-Name": "candidhealth",
286
+ "X-Fern-SDK-Version": "0.16.0",
287
+ },
288
+ contentType: "application/json",
289
+ timeoutMs: 60000,
290
+ });
291
+ if (_response.ok) {
292
+ return {
293
+ ok: true,
294
+ body: undefined,
295
+ };
296
+ }
297
+ if (_response.error.reason === "status-code") {
298
+ switch (_response.error.body?.errorName) {
299
+ case "EntityNotFoundError":
300
+ case "UnauthorizedError":
301
+ return {
302
+ ok: false,
303
+ error: await serializers.insurancePayments.v1.delete.Error.parseOrThrow(_response.error.body, {
304
+ unrecognizedObjectKeys: "passthrough",
305
+ allowUnrecognizedUnionMembers: true,
306
+ allowUnrecognizedEnumValues: true,
307
+ breadcrumbsPrefix: ["response"],
308
+ }),
309
+ };
310
+ }
311
+ }
312
+ return {
313
+ ok: false,
314
+ error: CandidApi.insurancePayments.v1.delete.Error._unknown(_response.error),
315
+ };
316
+ }
317
+ async _getAuthorizationHeader() {
318
+ const bearer = await core.Supplier.get(this.options.token);
319
+ if (bearer != null) {
320
+ return `Bearer ${bearer}`;
321
+ }
322
+ return undefined;
323
+ }
324
+ }
325
+ exports.V1 = V1;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as CandidApi from "../../../../..";
5
+ import * as core from "../../../../../../core";
6
+ export declare type Error = CandidApi.insurancePayments.v1.create.Error.UnauthorizedError | CandidApi.insurancePayments.v1.create.Error._Unknown;
7
+ export declare namespace Error {
8
+ interface UnauthorizedError extends _Utils {
9
+ errorName: "UnauthorizedError";
10
+ content: CandidApi.UnauthorizedErrorMessage;
11
+ }
12
+ interface _Unknown extends _Utils {
13
+ errorName: void;
14
+ content: core.Fetcher.Error;
15
+ }
16
+ interface _Utils {
17
+ _visit: <_Result>(visitor: CandidApi.insurancePayments.v1.create.Error._Visitor<_Result>) => _Result;
18
+ }
19
+ interface _Visitor<_Result> {
20
+ unauthorizedError: (value: CandidApi.UnauthorizedErrorMessage) => _Result;
21
+ _other: (value: core.Fetcher.Error) => _Result;
22
+ }
23
+ }
24
+ export declare const Error: {
25
+ readonly unauthorizedError: (value: CandidApi.UnauthorizedErrorMessage) => CandidApi.insurancePayments.v1.create.Error.UnauthorizedError;
26
+ readonly _unknown: (fetcherError: core.Fetcher.Error) => CandidApi.insurancePayments.v1.create.Error._Unknown;
27
+ readonly _visit: <_Result>(value: CandidApi.insurancePayments.v1.create.Error, visitor: CandidApi.insurancePayments.v1.create.Error._Visitor<_Result>) => _Result;
28
+ };
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.Error = void 0;
30
+ const CandidApi = __importStar(require("../../../../.."));
31
+ exports.Error = {
32
+ unauthorizedError: (value) => {
33
+ return {
34
+ content: value,
35
+ errorName: "UnauthorizedError",
36
+ _visit: function (visitor) {
37
+ return CandidApi.insurancePayments.v1.create.Error._visit(this, visitor);
38
+ },
39
+ };
40
+ },
41
+ _unknown: (fetcherError) => {
42
+ return {
43
+ errorName: undefined,
44
+ content: fetcherError,
45
+ _visit: function (visitor) {
46
+ return CandidApi.insurancePayments.v1.create.Error._visit(this, visitor);
47
+ },
48
+ };
49
+ },
50
+ _visit: (value, visitor) => {
51
+ switch (value.errorName) {
52
+ case "UnauthorizedError":
53
+ return visitor.unauthorizedError(value.content);
54
+ default:
55
+ return visitor._other(value);
56
+ }
57
+ },
58
+ };