subtain-apimatic-sdk 4.1.1 → 9.1.1

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 (711) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +28 -0
  3. data/README.md +377 -0
  4. data/lib/advanced_billing/api_helper.rb +10 -0
  5. data/lib/advanced_billing/client.rb +243 -0
  6. data/lib/advanced_billing/configuration.rb +158 -0
  7. data/lib/advanced_billing/controllers/advance_invoice_controller.rb +126 -0
  8. data/lib/advanced_billing/controllers/api_exports_controller.rb +268 -0
  9. data/lib/advanced_billing/controllers/base_controller.rb +71 -0
  10. data/lib/advanced_billing/controllers/billing_portal_controller.rb +165 -0
  11. data/lib/advanced_billing/controllers/components_controller.rb +747 -0
  12. data/lib/advanced_billing/controllers/coupons_controller.rb +691 -0
  13. data/lib/advanced_billing/controllers/custom_fields_controller.rb +465 -0
  14. data/lib/advanced_billing/controllers/customers_controller.rb +255 -0
  15. data/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +334 -0
  16. data/lib/advanced_billing/controllers/events_controller.rb +229 -0
  17. data/lib/advanced_billing/controllers/insights_controller.rb +168 -0
  18. data/lib/advanced_billing/controllers/invoices_controller.rb +953 -0
  19. data/lib/advanced_billing/controllers/offers_controller.rb +132 -0
  20. data/lib/advanced_billing/controllers/payment_profiles_controller.rb +732 -0
  21. data/lib/advanced_billing/controllers/product_families_controller.rb +187 -0
  22. data/lib/advanced_billing/controllers/product_price_points_controller.rb +422 -0
  23. data/lib/advanced_billing/controllers/products_controller.rb +220 -0
  24. data/lib/advanced_billing/controllers/proforma_invoices_controller.rb +381 -0
  25. data/lib/advanced_billing/controllers/reason_codes_controller.rb +158 -0
  26. data/lib/advanced_billing/controllers/referral_codes_controller.rb +42 -0
  27. data/lib/advanced_billing/controllers/sales_commissions_controller.rb +192 -0
  28. data/lib/advanced_billing/controllers/sites_controller.rb +96 -0
  29. data/lib/advanced_billing/controllers/subscription_components_controller.rb +992 -0
  30. data/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb +163 -0
  31. data/lib/advanced_billing/controllers/subscription_group_status_controller.rb +157 -0
  32. data/lib/advanced_billing/controllers/subscription_groups_controller.rb +300 -0
  33. data/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +226 -0
  34. data/lib/advanced_billing/controllers/subscription_notes_controller.rb +159 -0
  35. data/lib/advanced_billing/controllers/subscription_products_controller.rb +166 -0
  36. data/lib/advanced_billing/controllers/subscription_status_controller.rb +473 -0
  37. data/lib/advanced_billing/controllers/subscriptions_controller.rb +1357 -0
  38. data/lib/advanced_billing/controllers/webhooks_controller.rb +210 -0
  39. data/lib/advanced_billing/exceptions/api_exception.rb +10 -0
  40. data/lib/advanced_billing/exceptions/component_allocation_error_exception.rb +41 -0
  41. data/lib/advanced_billing/exceptions/component_price_point_error_exception.rb +41 -0
  42. data/lib/advanced_billing/exceptions/customer_error_response_exception.rb +34 -0
  43. data/lib/advanced_billing/exceptions/error_list_response_exception.rb +32 -0
  44. data/lib/advanced_billing/exceptions/error_map_response_exception.rb +32 -0
  45. data/lib/advanced_billing/exceptions/event_based_billing_list_segments_errors_exception.rb +32 -0
  46. data/lib/advanced_billing/exceptions/event_based_billing_segment_errors_exception.rb +35 -0
  47. data/lib/advanced_billing/exceptions/event_based_billing_segment_exception.rb +32 -0
  48. data/lib/advanced_billing/exceptions/nested_error_response_exception.rb +32 -0
  49. data/lib/advanced_billing/exceptions/proforma_bad_request_error_response_exception.rb +32 -0
  50. data/lib/advanced_billing/exceptions/refund_prepayment_aggregated_errors_response_exception.rb +33 -0
  51. data/lib/advanced_billing/exceptions/refund_prepayment_base_errors_response_exception.rb +32 -0
  52. data/lib/advanced_billing/exceptions/single_error_response_exception.rb +32 -0
  53. data/lib/advanced_billing/exceptions/single_string_error_response_exception.rb +32 -0
  54. data/lib/advanced_billing/exceptions/subscription_add_coupon_error_exception.rb +42 -0
  55. data/lib/advanced_billing/exceptions/subscription_component_allocation_error_exception.rb +41 -0
  56. data/lib/advanced_billing/exceptions/subscription_group_signup_error_response_exception.rb +32 -0
  57. data/lib/advanced_billing/exceptions/subscription_group_update_error_response_exception.rb +32 -0
  58. data/lib/advanced_billing/exceptions/subscription_remove_coupon_errors_exception.rb +32 -0
  59. data/lib/advanced_billing/exceptions/subscriptions_mrr_error_response_exception.rb +32 -0
  60. data/lib/advanced_billing/exceptions/too_many_management_link_requests_error_exception.rb +32 -0
  61. data/lib/advanced_billing/http/auth/basic_auth.rb +50 -0
  62. data/lib/advanced_billing/http/http_call_back.rb +10 -0
  63. data/lib/advanced_billing/http/http_method_enum.rb +10 -0
  64. data/lib/advanced_billing/http/http_request.rb +10 -0
  65. data/lib/advanced_billing/http/http_response.rb +10 -0
  66. data/lib/advanced_billing/models/account_balance.rb +51 -0
  67. data/lib/advanced_billing/models/account_balances.rb +81 -0
  68. data/lib/advanced_billing/models/ach_agreement.rb +96 -0
  69. data/lib/advanced_billing/models/activate_subscription_request.rb +57 -0
  70. data/lib/advanced_billing/models/add_coupons_request.rb +50 -0
  71. data/lib/advanced_billing/models/add_subscription_to_a_group.rb +62 -0
  72. data/lib/advanced_billing/models/agreement_acceptance.rb +125 -0
  73. data/lib/advanced_billing/models/allocate_components.rb +130 -0
  74. data/lib/advanced_billing/models/allocation.rb +231 -0
  75. data/lib/advanced_billing/models/allocation_expiration_date.rb +50 -0
  76. data/lib/advanced_billing/models/allocation_payment.rb +89 -0
  77. data/lib/advanced_billing/models/allocation_preview.rb +190 -0
  78. data/lib/advanced_billing/models/allocation_preview_item.rb +187 -0
  79. data/lib/advanced_billing/models/allocation_preview_line_item.rb +130 -0
  80. data/lib/advanced_billing/models/allocation_preview_response.rb +49 -0
  81. data/lib/advanced_billing/models/allocation_response.rb +50 -0
  82. data/lib/advanced_billing/models/allocation_settings.rb +74 -0
  83. data/lib/advanced_billing/models/applied_credit_note.rb +69 -0
  84. data/lib/advanced_billing/models/apply_credit_note_event_data.rb +174 -0
  85. data/lib/advanced_billing/models/apply_debit_note_event_data.rb +94 -0
  86. data/lib/advanced_billing/models/apply_payment_event_data.rb +130 -0
  87. data/lib/advanced_billing/models/attribute_error.rb +48 -0
  88. data/lib/advanced_billing/models/auto_invite.rb +23 -0
  89. data/lib/advanced_billing/models/auto_resume.rb +51 -0
  90. data/lib/advanced_billing/models/bank_account.rb +270 -0
  91. data/lib/advanced_billing/models/bank_account_attributes.rb +183 -0
  92. data/lib/advanced_billing/models/bank_account_payment_profile.rb +285 -0
  93. data/lib/advanced_billing/models/bank_account_response.rb +48 -0
  94. data/lib/advanced_billing/models/bank_account_type.rb +23 -0
  95. data/lib/advanced_billing/models/bank_account_vault.rb +32 -0
  96. data/lib/advanced_billing/models/bank_account_verification.rb +61 -0
  97. data/lib/advanced_billing/models/bank_account_verification_request.rb +50 -0
  98. data/lib/advanced_billing/models/base_model.rb +62 -0
  99. data/lib/advanced_billing/models/base_refund_error.rb +50 -0
  100. data/lib/advanced_billing/models/base_string_error.rb +50 -0
  101. data/lib/advanced_billing/models/basic_date_field.rb +23 -0
  102. data/lib/advanced_billing/models/batch_job.rb +91 -0
  103. data/lib/advanced_billing/models/batch_job_response.rb +48 -0
  104. data/lib/advanced_billing/models/billing_address.rb +113 -0
  105. data/lib/advanced_billing/models/billing_manifest.rb +142 -0
  106. data/lib/advanced_billing/models/billing_manifest_item.rb +182 -0
  107. data/lib/advanced_billing/models/breakouts.rb +82 -0
  108. data/lib/advanced_billing/models/bulk_component_s_price_point_assignment.rb +59 -0
  109. data/lib/advanced_billing/models/bulk_create_product_price_points_request.rb +57 -0
  110. data/lib/advanced_billing/models/bulk_create_product_price_points_response.rb +59 -0
  111. data/lib/advanced_billing/models/bulk_create_segments.rb +59 -0
  112. data/lib/advanced_billing/models/bulk_update_segments.rb +59 -0
  113. data/lib/advanced_billing/models/bulk_update_segments_item.rb +80 -0
  114. data/lib/advanced_billing/models/calendar_billing.rb +78 -0
  115. data/lib/advanced_billing/models/cancel_grouped_subscriptions_request.rb +51 -0
  116. data/lib/advanced_billing/models/cancellation_method.rb +30 -0
  117. data/lib/advanced_billing/models/cancellation_options.rb +62 -0
  118. data/lib/advanced_billing/models/cancellation_request.rb +48 -0
  119. data/lib/advanced_billing/models/card_type.rb +56 -0
  120. data/lib/advanced_billing/models/card_type1.rb +116 -0
  121. data/lib/advanced_billing/models/change_invoice_collection_method_event_data.rb +71 -0
  122. data/lib/advanced_billing/models/chargify_ebb.rb +113 -0
  123. data/lib/advanced_billing/models/cleanup_scope.rb +26 -0
  124. data/lib/advanced_billing/models/component.rb +405 -0
  125. data/lib/advanced_billing/models/component_allocation_change.rb +142 -0
  126. data/lib/advanced_billing/models/component_allocation_error_item.rb +77 -0
  127. data/lib/advanced_billing/models/component_cost_data.rb +135 -0
  128. data/lib/advanced_billing/models/component_cost_data_rate_tier.rb +101 -0
  129. data/lib/advanced_billing/models/component_custom_price.rb +81 -0
  130. data/lib/advanced_billing/models/component_kind.rb +32 -0
  131. data/lib/advanced_billing/models/component_kind_path.rb +32 -0
  132. data/lib/advanced_billing/models/component_price.rb +123 -0
  133. data/lib/advanced_billing/models/component_price_point.rb +192 -0
  134. data/lib/advanced_billing/models/component_price_point_error_item.rb +68 -0
  135. data/lib/advanced_billing/models/component_price_point_item.rb +98 -0
  136. data/lib/advanced_billing/models/component_price_point_price.rb +123 -0
  137. data/lib/advanced_billing/models/component_price_point_response.rb +48 -0
  138. data/lib/advanced_billing/models/component_price_points_response.rb +59 -0
  139. data/lib/advanced_billing/models/component_response.rb +48 -0
  140. data/lib/advanced_billing/models/component_s_price_point_assignment.rb +71 -0
  141. data/lib/advanced_billing/models/compounding_strategy.rb +23 -0
  142. data/lib/advanced_billing/models/consolidated_invoice.rb +59 -0
  143. data/lib/advanced_billing/models/count_response.rb +50 -0
  144. data/lib/advanced_billing/models/coupon.rb +367 -0
  145. data/lib/advanced_billing/models/coupon_currency.rb +77 -0
  146. data/lib/advanced_billing/models/coupon_currency_request.rb +57 -0
  147. data/lib/advanced_billing/models/coupon_response.rb +50 -0
  148. data/lib/advanced_billing/models/coupon_restriction.rb +99 -0
  149. data/lib/advanced_billing/models/coupon_subcodes.rb +50 -0
  150. data/lib/advanced_billing/models/coupon_subcodes_response.rb +70 -0
  151. data/lib/advanced_billing/models/coupon_usage.rb +114 -0
  152. data/lib/advanced_billing/models/create_allocation.rb +162 -0
  153. data/lib/advanced_billing/models/create_allocation_request.rb +48 -0
  154. data/lib/advanced_billing/models/create_component_price_point.rb +125 -0
  155. data/lib/advanced_billing/models/create_component_price_point_request.rb +64 -0
  156. data/lib/advanced_billing/models/create_component_price_points_request.rb +64 -0
  157. data/lib/advanced_billing/models/create_currency_price.rb +68 -0
  158. data/lib/advanced_billing/models/create_currency_prices_request.rb +57 -0
  159. data/lib/advanced_billing/models/create_customer.rb +209 -0
  160. data/lib/advanced_billing/models/create_customer_request.rb +48 -0
  161. data/lib/advanced_billing/models/create_ebb_component.rb +65 -0
  162. data/lib/advanced_billing/models/create_invoice.rb +163 -0
  163. data/lib/advanced_billing/models/create_invoice_address.rb +124 -0
  164. data/lib/advanced_billing/models/create_invoice_coupon.rb +115 -0
  165. data/lib/advanced_billing/models/create_invoice_item.rb +185 -0
  166. data/lib/advanced_billing/models/create_invoice_payment.rb +90 -0
  167. data/lib/advanced_billing/models/create_invoice_payment_application.rb +79 -0
  168. data/lib/advanced_billing/models/create_invoice_payment_request.rb +58 -0
  169. data/lib/advanced_billing/models/create_invoice_request.rb +48 -0
  170. data/lib/advanced_billing/models/create_metadata.rb +59 -0
  171. data/lib/advanced_billing/models/create_metadata_request.rb +57 -0
  172. data/lib/advanced_billing/models/create_metafield.rb +103 -0
  173. data/lib/advanced_billing/models/create_metafields_request.rb +64 -0
  174. data/lib/advanced_billing/models/create_metered_component.rb +65 -0
  175. data/lib/advanced_billing/models/create_multi_invoice_payment.rb +134 -0
  176. data/lib/advanced_billing/models/create_multi_invoice_payment_request.rb +48 -0
  177. data/lib/advanced_billing/models/create_offer.rb +116 -0
  178. data/lib/advanced_billing/models/create_offer_component.rb +60 -0
  179. data/lib/advanced_billing/models/create_offer_request.rb +48 -0
  180. data/lib/advanced_billing/models/create_on_off_component.rb +65 -0
  181. data/lib/advanced_billing/models/create_or_update_coupon.rb +85 -0
  182. data/lib/advanced_billing/models/create_or_update_flat_amount_coupon.rb +214 -0
  183. data/lib/advanced_billing/models/create_or_update_percentage_coupon.rb +215 -0
  184. data/lib/advanced_billing/models/create_or_update_product.rb +133 -0
  185. data/lib/advanced_billing/models/create_or_update_product_request.rb +48 -0
  186. data/lib/advanced_billing/models/create_or_update_segment_price.rb +87 -0
  187. data/lib/advanced_billing/models/create_payment.rb +75 -0
  188. data/lib/advanced_billing/models/create_payment_profile.rb +416 -0
  189. data/lib/advanced_billing/models/create_payment_profile_request.rb +49 -0
  190. data/lib/advanced_billing/models/create_payment_profile_response.rb +49 -0
  191. data/lib/advanced_billing/models/create_prepaid_component.rb +65 -0
  192. data/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb +194 -0
  193. data/lib/advanced_billing/models/create_prepayment.rb +90 -0
  194. data/lib/advanced_billing/models/create_prepayment_request.rb +48 -0
  195. data/lib/advanced_billing/models/create_prepayment_response.rb +48 -0
  196. data/lib/advanced_billing/models/create_product_currency_price.rb +64 -0
  197. data/lib/advanced_billing/models/create_product_currency_prices_request.rb +57 -0
  198. data/lib/advanced_billing/models/create_product_family.rb +61 -0
  199. data/lib/advanced_billing/models/create_product_family_request.rb +49 -0
  200. data/lib/advanced_billing/models/create_product_price_point.rb +182 -0
  201. data/lib/advanced_billing/models/create_product_price_point_request.rb +48 -0
  202. data/lib/advanced_billing/models/create_quantity_based_component.rb +66 -0
  203. data/lib/advanced_billing/models/create_reason_code.rb +66 -0
  204. data/lib/advanced_billing/models/create_reason_code_request.rb +48 -0
  205. data/lib/advanced_billing/models/create_segment.rb +143 -0
  206. data/lib/advanced_billing/models/create_segment_request.rb +48 -0
  207. data/lib/advanced_billing/models/create_subscription.rb +694 -0
  208. data/lib/advanced_billing/models/create_subscription_component.rb +122 -0
  209. data/lib/advanced_billing/models/create_subscription_group.rb +74 -0
  210. data/lib/advanced_billing/models/create_subscription_group_request.rb +49 -0
  211. data/lib/advanced_billing/models/create_subscription_request.rb +48 -0
  212. data/lib/advanced_billing/models/create_usage.rb +72 -0
  213. data/lib/advanced_billing/models/create_usage_request.rb +48 -0
  214. data/lib/advanced_billing/models/created_payment_profile.rb +327 -0
  215. data/lib/advanced_billing/models/created_prepayment.rb +114 -0
  216. data/lib/advanced_billing/models/credit_account_balance_changed.rb +120 -0
  217. data/lib/advanced_billing/models/credit_card_attributes.rb +81 -0
  218. data/lib/advanced_billing/models/credit_card_payment_profile.rb +277 -0
  219. data/lib/advanced_billing/models/credit_note.rb +403 -0
  220. data/lib/advanced_billing/models/credit_note1.rb +405 -0
  221. data/lib/advanced_billing/models/credit_note_application.rb +99 -0
  222. data/lib/advanced_billing/models/credit_note_line_item.rb +246 -0
  223. data/lib/advanced_billing/models/credit_scheme.rb +26 -0
  224. data/lib/advanced_billing/models/credit_scheme_request.rb +48 -0
  225. data/lib/advanced_billing/models/credit_type.rb +27 -0
  226. data/lib/advanced_billing/models/credit_type1.rb +28 -0
  227. data/lib/advanced_billing/models/currency_price.rb +99 -0
  228. data/lib/advanced_billing/models/currency_price_role.rb +26 -0
  229. data/lib/advanced_billing/models/current_vault.rb +99 -0
  230. data/lib/advanced_billing/models/custom_field_value_change.rb +144 -0
  231. data/lib/advanced_billing/models/custom_price_used_for_subscription_create_update.rb +197 -0
  232. data/lib/advanced_billing/models/customer.rb +352 -0
  233. data/lib/advanced_billing/models/customer1.rb +120 -0
  234. data/lib/advanced_billing/models/customer_attributes.rb +241 -0
  235. data/lib/advanced_billing/models/customer_billing_address_change.rb +59 -0
  236. data/lib/advanced_billing/models/customer_change.rb +81 -0
  237. data/lib/advanced_billing/models/customer_changes_preview_response.rb +48 -0
  238. data/lib/advanced_billing/models/customer_custom_fields_change.rb +77 -0
  239. data/lib/advanced_billing/models/customer_error.rb +60 -0
  240. data/lib/advanced_billing/models/customer_payer_change.rb +59 -0
  241. data/lib/advanced_billing/models/customer_response.rb +48 -0
  242. data/lib/advanced_billing/models/customer_shipping_address_change.rb +59 -0
  243. data/lib/advanced_billing/models/deduct_service_credit.rb +80 -0
  244. data/lib/advanced_billing/models/deduct_service_credit_request.rb +48 -0
  245. data/lib/advanced_billing/models/delayed_cancellation_response.rb +50 -0
  246. data/lib/advanced_billing/models/delete_subscription_group_response.rb +59 -0
  247. data/lib/advanced_billing/models/direction.rb +23 -0
  248. data/lib/advanced_billing/models/discount_type.rb +23 -0
  249. data/lib/advanced_billing/models/dunner_data.rb +131 -0
  250. data/lib/advanced_billing/models/dunning_step_data.rb +149 -0
  251. data/lib/advanced_billing/models/dunning_step_reached.rb +96 -0
  252. data/lib/advanced_billing/models/ebb_component.rb +271 -0
  253. data/lib/advanced_billing/models/ebb_event.rb +50 -0
  254. data/lib/advanced_billing/models/enable_webhooks_request.rb +49 -0
  255. data/lib/advanced_billing/models/enable_webhooks_response.rb +51 -0
  256. data/lib/advanced_billing/models/endpoint.rb +88 -0
  257. data/lib/advanced_billing/models/endpoint_response.rb +50 -0
  258. data/lib/advanced_billing/models/errors.rb +59 -0
  259. data/lib/advanced_billing/models/event.rb +145 -0
  260. data/lib/advanced_billing/models/event_based_billing_segment_error.rb +51 -0
  261. data/lib/advanced_billing/models/event_response.rb +48 -0
  262. data/lib/advanced_billing/models/event_type.rb +121 -0
  263. data/lib/advanced_billing/models/extended_interval_unit.rb +26 -0
  264. data/lib/advanced_billing/models/failed_payment_action.rb +37 -0
  265. data/lib/advanced_billing/models/first_charge_type.rb +26 -0
  266. data/lib/advanced_billing/models/full_subscription_group_response.rb +165 -0
  267. data/lib/advanced_billing/models/get_one_time_token_payment_profile.rb +249 -0
  268. data/lib/advanced_billing/models/get_one_time_token_request.rb +49 -0
  269. data/lib/advanced_billing/models/group_billing.rb +85 -0
  270. data/lib/advanced_billing/models/group_settings.rb +76 -0
  271. data/lib/advanced_billing/models/group_target.rb +75 -0
  272. data/lib/advanced_billing/models/group_target_type.rb +32 -0
  273. data/lib/advanced_billing/models/holder_type.rb +23 -0
  274. data/lib/advanced_billing/models/include_not_null.rb +20 -0
  275. data/lib/advanced_billing/models/include_option.rb +23 -0
  276. data/lib/advanced_billing/models/interval_unit.rb +23 -0
  277. data/lib/advanced_billing/models/invoice.rb +712 -0
  278. data/lib/advanced_billing/models/invoice_address.rb +113 -0
  279. data/lib/advanced_billing/models/invoice_balance_item.rb +79 -0
  280. data/lib/advanced_billing/models/invoice_consolidation_level.rb +34 -0
  281. data/lib/advanced_billing/models/invoice_credit.rb +121 -0
  282. data/lib/advanced_billing/models/invoice_custom_field.rb +88 -0
  283. data/lib/advanced_billing/models/invoice_customer.rb +121 -0
  284. data/lib/advanced_billing/models/invoice_date_field.rb +32 -0
  285. data/lib/advanced_billing/models/invoice_discount.rb +177 -0
  286. data/lib/advanced_billing/models/invoice_discount_breakout.rb +80 -0
  287. data/lib/advanced_billing/models/invoice_display_settings.rb +75 -0
  288. data/lib/advanced_billing/models/invoice_event.rb +102 -0
  289. data/lib/advanced_billing/models/invoice_event1.rb +374 -0
  290. data/lib/advanced_billing/models/invoice_event_type.rb +50 -0
  291. data/lib/advanced_billing/models/invoice_issued.rb +252 -0
  292. data/lib/advanced_billing/models/invoice_line_item.rb +321 -0
  293. data/lib/advanced_billing/models/invoice_line_item_component_cost_data.rb +69 -0
  294. data/lib/advanced_billing/models/invoice_line_item_event_data.rb +262 -0
  295. data/lib/advanced_billing/models/invoice_line_item_pricing_detail.rb +69 -0
  296. data/lib/advanced_billing/models/invoice_payer.rb +109 -0
  297. data/lib/advanced_billing/models/invoice_payment.rb +155 -0
  298. data/lib/advanced_billing/models/invoice_payment_application.rb +73 -0
  299. data/lib/advanced_billing/models/invoice_payment_method.rb +129 -0
  300. data/lib/advanced_billing/models/invoice_payment_method_type.rb +35 -0
  301. data/lib/advanced_billing/models/invoice_payment_type.rb +29 -0
  302. data/lib/advanced_billing/models/invoice_previous_balance.rb +78 -0
  303. data/lib/advanced_billing/models/invoice_refund.rb +113 -0
  304. data/lib/advanced_billing/models/invoice_response.rb +48 -0
  305. data/lib/advanced_billing/models/invoice_seller.rb +90 -0
  306. data/lib/advanced_billing/models/invoice_sort_field.rb +41 -0
  307. data/lib/advanced_billing/models/invoice_tax.rb +176 -0
  308. data/lib/advanced_billing/models/invoice_tax_breakout.rb +79 -0
  309. data/lib/advanced_billing/models/invoice_tax_component_breakout.rb +89 -0
  310. data/lib/advanced_billing/models/issue_advance_invoice_request.rb +50 -0
  311. data/lib/advanced_billing/models/issue_invoice_event_data.rb +115 -0
  312. data/lib/advanced_billing/models/issue_invoice_request.rb +63 -0
  313. data/lib/advanced_billing/models/issue_service_credit.rb +80 -0
  314. data/lib/advanced_billing/models/issue_service_credit_request.rb +49 -0
  315. data/lib/advanced_billing/models/item_category.rb +33 -0
  316. data/lib/advanced_billing/models/item_price_point_changed.rb +134 -0
  317. data/lib/advanced_billing/models/item_price_point_data.rb +78 -0
  318. data/lib/advanced_billing/models/list_components_price_points_include.rb +20 -0
  319. data/lib/advanced_billing/models/list_components_price_points_response.rb +57 -0
  320. data/lib/advanced_billing/models/list_credit_notes_response.rb +57 -0
  321. data/lib/advanced_billing/models/list_events_date_field.rb +20 -0
  322. data/lib/advanced_billing/models/list_invoice_events_response.rb +87 -0
  323. data/lib/advanced_billing/models/list_invoices_response.rb +57 -0
  324. data/lib/advanced_billing/models/list_metafields_response.rb +96 -0
  325. data/lib/advanced_billing/models/list_mrr_response.rb +48 -0
  326. data/lib/advanced_billing/models/list_mrr_response_result.rb +116 -0
  327. data/lib/advanced_billing/models/list_offers_response.rb +59 -0
  328. data/lib/advanced_billing/models/list_payment_profile_item.rb +274 -0
  329. data/lib/advanced_billing/models/list_payment_profiles_response.rb +51 -0
  330. data/lib/advanced_billing/models/list_product_price_points_response.rb +57 -0
  331. data/lib/advanced_billing/models/list_products_include.rb +20 -0
  332. data/lib/advanced_billing/models/list_products_price_points_include.rb +20 -0
  333. data/lib/advanced_billing/models/list_public_keys_meta.rb +78 -0
  334. data/lib/advanced_billing/models/list_public_keys_response.rb +68 -0
  335. data/lib/advanced_billing/models/list_sale_rep_item.rb +90 -0
  336. data/lib/advanced_billing/models/list_segments_response.rb +59 -0
  337. data/lib/advanced_billing/models/list_subcription_group_prepayment_item.rb +137 -0
  338. data/lib/advanced_billing/models/list_subscription_components_include.rb +20 -0
  339. data/lib/advanced_billing/models/list_subscription_components_response.rb +57 -0
  340. data/lib/advanced_billing/models/list_subscription_components_sort.rb +23 -0
  341. data/lib/advanced_billing/models/list_subscription_group_prepayment.rb +49 -0
  342. data/lib/advanced_billing/models/list_subscription_group_prepayment_date_field.rb +23 -0
  343. data/lib/advanced_billing/models/list_subscription_group_prepayment_response.rb +57 -0
  344. data/lib/advanced_billing/models/list_subscription_groups_item.rb +141 -0
  345. data/lib/advanced_billing/models/list_subscription_groups_meta.rb +59 -0
  346. data/lib/advanced_billing/models/list_subscription_groups_response.rb +68 -0
  347. data/lib/advanced_billing/models/metadata.rb +98 -0
  348. data/lib/advanced_billing/models/metafield.rb +112 -0
  349. data/lib/advanced_billing/models/metafield_input.rb +32 -0
  350. data/lib/advanced_billing/models/metafield_scope.rb +119 -0
  351. data/lib/advanced_billing/models/metafields.rb +103 -0
  352. data/lib/advanced_billing/models/metafields1.rb +103 -0
  353. data/lib/advanced_billing/models/metered_component.rb +294 -0
  354. data/lib/advanced_billing/models/metered_usage.rb +132 -0
  355. data/lib/advanced_billing/models/movement.rb +138 -0
  356. data/lib/advanced_billing/models/movement_line_item.rb +143 -0
  357. data/lib/advanced_billing/models/mrr.rb +100 -0
  358. data/lib/advanced_billing/models/mrr_movement.rb +79 -0
  359. data/lib/advanced_billing/models/mrr_response.rb +48 -0
  360. data/lib/advanced_billing/models/multi_invoice_payment.rb +90 -0
  361. data/lib/advanced_billing/models/multi_invoice_payment_response.rb +48 -0
  362. data/lib/advanced_billing/models/net_terms.rb +94 -0
  363. data/lib/advanced_billing/models/offer.rb +254 -0
  364. data/lib/advanced_billing/models/offer_discount.rb +68 -0
  365. data/lib/advanced_billing/models/offer_item.rb +130 -0
  366. data/lib/advanced_billing/models/offer_response.rb +50 -0
  367. data/lib/advanced_billing/models/offer_signup_page.rb +96 -0
  368. data/lib/advanced_billing/models/on_off_component.rb +291 -0
  369. data/lib/advanced_billing/models/organization_address.rb +123 -0
  370. data/lib/advanced_billing/models/origin_invoice.rb +69 -0
  371. data/lib/advanced_billing/models/overage_pricing.rb +87 -0
  372. data/lib/advanced_billing/models/override_subscription.rb +100 -0
  373. data/lib/advanced_billing/models/override_subscription_request.rb +48 -0
  374. data/lib/advanced_billing/models/paginated_metadata.rb +96 -0
  375. data/lib/advanced_billing/models/pause_request.rb +50 -0
  376. data/lib/advanced_billing/models/payer_attributes.rb +221 -0
  377. data/lib/advanced_billing/models/payer_error.rb +68 -0
  378. data/lib/advanced_billing/models/payment.rb +80 -0
  379. data/lib/advanced_billing/models/payment_collection_method.rb +32 -0
  380. data/lib/advanced_billing/models/payment_collection_method1.rb +30 -0
  381. data/lib/advanced_billing/models/payment_collection_method_changed.rb +79 -0
  382. data/lib/advanced_billing/models/payment_method_apple_pay_type.rb +60 -0
  383. data/lib/advanced_billing/models/payment_method_bank_account_type.rb +81 -0
  384. data/lib/advanced_billing/models/payment_method_credit_card_type.rb +101 -0
  385. data/lib/advanced_billing/models/payment_method_external_type.rb +87 -0
  386. data/lib/advanced_billing/models/payment_method_nested_data.rb +150 -0
  387. data/lib/advanced_billing/models/payment_method_paypal_type.rb +69 -0
  388. data/lib/advanced_billing/models/payment_profile.rb +287 -0
  389. data/lib/advanced_billing/models/payment_profile_attributes.rb +356 -0
  390. data/lib/advanced_billing/models/payment_profile_response.rb +49 -0
  391. data/lib/advanced_billing/models/payment_related_events.rb +79 -0
  392. data/lib/advanced_billing/models/payment_response.rb +68 -0
  393. data/lib/advanced_billing/models/payment_type.rb +26 -0
  394. data/lib/advanced_billing/models/pending_cancellation_change.rb +79 -0
  395. data/lib/advanced_billing/models/portal_management_link.rb +101 -0
  396. data/lib/advanced_billing/models/pre_payment.rb +74 -0
  397. data/lib/advanced_billing/models/prepaid_component_price_point.rb +108 -0
  398. data/lib/advanced_billing/models/prepaid_configuration.rb +103 -0
  399. data/lib/advanced_billing/models/prepaid_configuration_response.rb +49 -0
  400. data/lib/advanced_billing/models/prepaid_subscription_balance_changed.rb +110 -0
  401. data/lib/advanced_billing/models/prepaid_usage.rb +199 -0
  402. data/lib/advanced_billing/models/prepaid_usage_allocation_detail.rb +80 -0
  403. data/lib/advanced_billing/models/prepaid_usage_component.rb +350 -0
  404. data/lib/advanced_billing/models/prepayment1.rb +131 -0
  405. data/lib/advanced_billing/models/prepayment_account_balance_changed.rb +108 -0
  406. data/lib/advanced_billing/models/prepayment_aggregated_error.rb +69 -0
  407. data/lib/advanced_billing/models/prepayment_method.rb +41 -0
  408. data/lib/advanced_billing/models/prepayment_response.rb +48 -0
  409. data/lib/advanced_billing/models/prepayments_response.rb +59 -0
  410. data/lib/advanced_billing/models/preview_allocations_request.rb +69 -0
  411. data/lib/advanced_billing/models/price.rb +98 -0
  412. data/lib/advanced_billing/models/price_point.rb +172 -0
  413. data/lib/advanced_billing/models/price_point_type.rb +30 -0
  414. data/lib/advanced_billing/models/pricing_scheme.rb +31 -0
  415. data/lib/advanced_billing/models/product.rb +506 -0
  416. data/lib/advanced_billing/models/product_family.rb +120 -0
  417. data/lib/advanced_billing/models/product_family_response.rb +50 -0
  418. data/lib/advanced_billing/models/product_price_point.rb +289 -0
  419. data/lib/advanced_billing/models/product_price_point_currency_price.rb +99 -0
  420. data/lib/advanced_billing/models/product_price_point_response.rb +48 -0
  421. data/lib/advanced_billing/models/product_response.rb +48 -0
  422. data/lib/advanced_billing/models/proforma_custom_field.rb +87 -0
  423. data/lib/advanced_billing/models/proforma_error.rb +51 -0
  424. data/lib/advanced_billing/models/proforma_invoice.rb +463 -0
  425. data/lib/advanced_billing/models/proforma_invoice_credit.rb +80 -0
  426. data/lib/advanced_billing/models/proforma_invoice_discount.rb +108 -0
  427. data/lib/advanced_billing/models/proforma_invoice_discount_breakout.rb +61 -0
  428. data/lib/advanced_billing/models/proforma_invoice_issued.rb +202 -0
  429. data/lib/advanced_billing/models/proforma_invoice_payment.rb +80 -0
  430. data/lib/advanced_billing/models/proforma_invoice_preview.rb +463 -0
  431. data/lib/advanced_billing/models/proforma_invoice_tax.rb +116 -0
  432. data/lib/advanced_billing/models/proforma_invoice_tax_breakout.rb +60 -0
  433. data/lib/advanced_billing/models/proration.rb +52 -0
  434. data/lib/advanced_billing/models/public_key.rb +70 -0
  435. data/lib/advanced_billing/models/public_signup_page.rb +92 -0
  436. data/lib/advanced_billing/models/quantity_based_component.rb +303 -0
  437. data/lib/advanced_billing/models/reactivate_subscription_group_request.rb +60 -0
  438. data/lib/advanced_billing/models/reactivate_subscription_group_response.rb +130 -0
  439. data/lib/advanced_billing/models/reactivate_subscription_request.rb +122 -0
  440. data/lib/advanced_billing/models/reactivation_billing.rb +66 -0
  441. data/lib/advanced_billing/models/reactivation_charge.rb +30 -0
  442. data/lib/advanced_billing/models/read_payment_profile_response.rb +64 -0
  443. data/lib/advanced_billing/models/reason_code.rb +105 -0
  444. data/lib/advanced_billing/models/reason_code_response.rb +48 -0
  445. data/lib/advanced_billing/models/reason_codes_json_response.rb +50 -0
  446. data/lib/advanced_billing/models/record_payment_request.rb +48 -0
  447. data/lib/advanced_billing/models/recurring_scheme.rb +26 -0
  448. data/lib/advanced_billing/models/referral_code.rb +79 -0
  449. data/lib/advanced_billing/models/referral_validation_response.rb +50 -0
  450. data/lib/advanced_billing/models/refund.rb +124 -0
  451. data/lib/advanced_billing/models/refund_consolidated_invoice.rb +125 -0
  452. data/lib/advanced_billing/models/refund_invoice.rb +124 -0
  453. data/lib/advanced_billing/models/refund_invoice_event_data.rb +171 -0
  454. data/lib/advanced_billing/models/refund_invoice_request.rb +64 -0
  455. data/lib/advanced_billing/models/refund_prepayment.rb +106 -0
  456. data/lib/advanced_billing/models/refund_prepayment_aggregated_error.rb +50 -0
  457. data/lib/advanced_billing/models/refund_prepayment_base_refund_error.rb +50 -0
  458. data/lib/advanced_billing/models/refund_prepayment_request.rb +48 -0
  459. data/lib/advanced_billing/models/refund_success.rb +92 -0
  460. data/lib/advanced_billing/models/remove_payment_event_data.rb +131 -0
  461. data/lib/advanced_billing/models/renewal_preview.rb +157 -0
  462. data/lib/advanced_billing/models/renewal_preview_component.rb +91 -0
  463. data/lib/advanced_billing/models/renewal_preview_line_item.rb +161 -0
  464. data/lib/advanced_billing/models/renewal_preview_request.rb +62 -0
  465. data/lib/advanced_billing/models/renewal_preview_response.rb +49 -0
  466. data/lib/advanced_billing/models/replay_webhooks_request.rb +48 -0
  467. data/lib/advanced_billing/models/replay_webhooks_response.rb +50 -0
  468. data/lib/advanced_billing/models/resent_invitation.rb +81 -0
  469. data/lib/advanced_billing/models/resource_type.rb +23 -0
  470. data/lib/advanced_billing/models/restriction_type.rb +23 -0
  471. data/lib/advanced_billing/models/resume_options.rb +75 -0
  472. data/lib/advanced_billing/models/resumption_charge.rb +27 -0
  473. data/lib/advanced_billing/models/revoked_invitation.rb +71 -0
  474. data/lib/advanced_billing/models/sale_rep.rb +97 -0
  475. data/lib/advanced_billing/models/sale_rep_item_mrr.rb +68 -0
  476. data/lib/advanced_billing/models/sale_rep_settings.rb +109 -0
  477. data/lib/advanced_billing/models/sale_rep_subscription.rb +137 -0
  478. data/lib/advanced_billing/models/segment.rb +189 -0
  479. data/lib/advanced_billing/models/segment_price.rb +132 -0
  480. data/lib/advanced_billing/models/segment_response.rb +50 -0
  481. data/lib/advanced_billing/models/seller.rb +89 -0
  482. data/lib/advanced_billing/models/send_invoice_request.rb +72 -0
  483. data/lib/advanced_billing/models/service_credit.rb +90 -0
  484. data/lib/advanced_billing/models/service_credit_response.rb +48 -0
  485. data/lib/advanced_billing/models/service_credit_type.rb +23 -0
  486. data/lib/advanced_billing/models/shipping_address.rb +113 -0
  487. data/lib/advanced_billing/models/signup_proforma_preview.rb +62 -0
  488. data/lib/advanced_billing/models/signup_proforma_preview_response.rb +50 -0
  489. data/lib/advanced_billing/models/site.rb +212 -0
  490. data/lib/advanced_billing/models/site_response.rb +48 -0
  491. data/lib/advanced_billing/models/site_statistics.rb +171 -0
  492. data/lib/advanced_billing/models/site_summary.rb +87 -0
  493. data/lib/advanced_billing/models/snap_day.rb +21 -0
  494. data/lib/advanced_billing/models/sorting_direction.rb +23 -0
  495. data/lib/advanced_billing/models/status.rb +37 -0
  496. data/lib/advanced_billing/models/status1.rb +23 -0
  497. data/lib/advanced_billing/models/subscription.rb +776 -0
  498. data/lib/advanced_billing/models/subscription_bank_account.rb +281 -0
  499. data/lib/advanced_billing/models/subscription_component.rb +400 -0
  500. data/lib/advanced_billing/models/subscription_component_allocation_error_item.rb +59 -0
  501. data/lib/advanced_billing/models/subscription_component_response.rb +50 -0
  502. data/lib/advanced_billing/models/subscription_component_subscription.rb +70 -0
  503. data/lib/advanced_billing/models/subscription_date_field.rb +44 -0
  504. data/lib/advanced_billing/models/subscription_group.rb +94 -0
  505. data/lib/advanced_billing/models/subscription_group_balances.rb +80 -0
  506. data/lib/advanced_billing/models/subscription_group_bank_account.rb +228 -0
  507. data/lib/advanced_billing/models/subscription_group_component_custom_price.rb +105 -0
  508. data/lib/advanced_billing/models/subscription_group_credit_card.rb +266 -0
  509. data/lib/advanced_billing/models/subscription_group_customer.rb +87 -0
  510. data/lib/advanced_billing/models/subscription_group_inlined.rb +92 -0
  511. data/lib/advanced_billing/models/subscription_group_item.rb +147 -0
  512. data/lib/advanced_billing/models/subscription_group_member_error.rb +68 -0
  513. data/lib/advanced_billing/models/subscription_group_payment_profile.rb +79 -0
  514. data/lib/advanced_billing/models/subscription_group_prepayment.rb +72 -0
  515. data/lib/advanced_billing/models/subscription_group_prepayment_method.rb +35 -0
  516. data/lib/advanced_billing/models/subscription_group_prepayment_request.rb +48 -0
  517. data/lib/advanced_billing/models/subscription_group_prepayment_response.rb +90 -0
  518. data/lib/advanced_billing/models/subscription_group_response.rb +49 -0
  519. data/lib/advanced_billing/models/subscription_group_signup.rb +153 -0
  520. data/lib/advanced_billing/models/subscription_group_signup_component.rb +108 -0
  521. data/lib/advanced_billing/models/subscription_group_signup_error.rb +109 -0
  522. data/lib/advanced_billing/models/subscription_group_signup_failure.rb +84 -0
  523. data/lib/advanced_billing/models/subscription_group_signup_failure_data.rb +146 -0
  524. data/lib/advanced_billing/models/subscription_group_signup_item.rb +200 -0
  525. data/lib/advanced_billing/models/subscription_group_signup_request.rb +49 -0
  526. data/lib/advanced_billing/models/subscription_group_signup_response.rb +167 -0
  527. data/lib/advanced_billing/models/subscription_group_signup_success.rb +84 -0
  528. data/lib/advanced_billing/models/subscription_group_signup_success_data.rb +170 -0
  529. data/lib/advanced_billing/models/subscription_group_subscription_error.rb +86 -0
  530. data/lib/advanced_billing/models/subscription_group_update_error.rb +59 -0
  531. data/lib/advanced_billing/models/subscription_include.rb +23 -0
  532. data/lib/advanced_billing/models/subscription_included_coupon.rb +121 -0
  533. data/lib/advanced_billing/models/subscription_list_date_field.rb +20 -0
  534. data/lib/advanced_billing/models/subscription_migration_preview.rb +88 -0
  535. data/lib/advanced_billing/models/subscription_migration_preview_options.rb +158 -0
  536. data/lib/advanced_billing/models/subscription_migration_preview_request.rb +49 -0
  537. data/lib/advanced_billing/models/subscription_migration_preview_response.rb +48 -0
  538. data/lib/advanced_billing/models/subscription_mrr.rb +69 -0
  539. data/lib/advanced_billing/models/subscription_mrr_breakout.rb +58 -0
  540. data/lib/advanced_billing/models/subscription_mrr_response.rb +57 -0
  541. data/lib/advanced_billing/models/subscription_note.rb +97 -0
  542. data/lib/advanced_billing/models/subscription_note_response.rb +48 -0
  543. data/lib/advanced_billing/models/subscription_preview.rb +62 -0
  544. data/lib/advanced_billing/models/subscription_preview_response.rb +49 -0
  545. data/lib/advanced_billing/models/subscription_product_change.rb +80 -0
  546. data/lib/advanced_billing/models/subscription_product_migration.rb +148 -0
  547. data/lib/advanced_billing/models/subscription_product_migration_request.rb +48 -0
  548. data/lib/advanced_billing/models/subscription_purge_type.rb +23 -0
  549. data/lib/advanced_billing/models/subscription_response.rb +50 -0
  550. data/lib/advanced_billing/models/subscription_sort.rb +35 -0
  551. data/lib/advanced_billing/models/subscription_state.rb +53 -0
  552. data/lib/advanced_billing/models/subscription_state_change.rb +81 -0
  553. data/lib/advanced_billing/models/tax_configuration.rb +73 -0
  554. data/lib/advanced_billing/models/tax_configuration_kind.rb +29 -0
  555. data/lib/advanced_billing/models/tax_destination_address.rb +29 -0
  556. data/lib/advanced_billing/models/too_many_management_link_requests.rb +63 -0
  557. data/lib/advanced_billing/models/update_allocation_expiration_date.rb +50 -0
  558. data/lib/advanced_billing/models/update_component.rb +137 -0
  559. data/lib/advanced_billing/models/update_component_price_point.rb +68 -0
  560. data/lib/advanced_billing/models/update_component_price_point_request.rb +51 -0
  561. data/lib/advanced_billing/models/update_component_request.rb +48 -0
  562. data/lib/advanced_billing/models/update_coupon_currency.rb +56 -0
  563. data/lib/advanced_billing/models/update_currency_price.rb +56 -0
  564. data/lib/advanced_billing/models/update_currency_prices_request.rb +57 -0
  565. data/lib/advanced_billing/models/update_customer.rb +211 -0
  566. data/lib/advanced_billing/models/update_customer_request.rb +48 -0
  567. data/lib/advanced_billing/models/update_endpoint.rb +57 -0
  568. data/lib/advanced_billing/models/update_endpoint_request.rb +48 -0
  569. data/lib/advanced_billing/models/update_metadata.rb +68 -0
  570. data/lib/advanced_billing/models/update_metadata_request.rb +50 -0
  571. data/lib/advanced_billing/models/update_metafield.rb +103 -0
  572. data/lib/advanced_billing/models/update_metafields_request.rb +62 -0
  573. data/lib/advanced_billing/models/update_payment_profile.rb +187 -0
  574. data/lib/advanced_billing/models/update_payment_profile_request.rb +49 -0
  575. data/lib/advanced_billing/models/update_payment_profile_response.rb +49 -0
  576. data/lib/advanced_billing/models/update_price.rb +89 -0
  577. data/lib/advanced_billing/models/update_product_price_point.rb +60 -0
  578. data/lib/advanced_billing/models/update_product_price_point_request.rb +48 -0
  579. data/lib/advanced_billing/models/update_reason_code.rb +68 -0
  580. data/lib/advanced_billing/models/update_reason_code_request.rb +48 -0
  581. data/lib/advanced_billing/models/update_segment.rb +74 -0
  582. data/lib/advanced_billing/models/update_segment_request.rb +48 -0
  583. data/lib/advanced_billing/models/update_subscription.rb +270 -0
  584. data/lib/advanced_billing/models/update_subscription_component.rb +70 -0
  585. data/lib/advanced_billing/models/update_subscription_group.rb +50 -0
  586. data/lib/advanced_billing/models/update_subscription_group_request.rb +49 -0
  587. data/lib/advanced_billing/models/update_subscription_note.rb +56 -0
  588. data/lib/advanced_billing/models/update_subscription_note_request.rb +48 -0
  589. data/lib/advanced_billing/models/update_subscription_request.rb +48 -0
  590. data/lib/advanced_billing/models/updated_payment_profile.rb +255 -0
  591. data/lib/advanced_billing/models/upsert_prepaid_configuration.rb +104 -0
  592. data/lib/advanced_billing/models/upsert_prepaid_configuration_request.rb +49 -0
  593. data/lib/advanced_billing/models/usage.rb +141 -0
  594. data/lib/advanced_billing/models/usage_response.rb +48 -0
  595. data/lib/advanced_billing/models/void_invoice.rb +48 -0
  596. data/lib/advanced_billing/models/void_invoice_event_data.rb +111 -0
  597. data/lib/advanced_billing/models/void_invoice_event_data1.rb +100 -0
  598. data/lib/advanced_billing/models/void_invoice_request.rb +48 -0
  599. data/lib/advanced_billing/models/webhook.rb +165 -0
  600. data/lib/advanced_billing/models/webhook_order.rb +23 -0
  601. data/lib/advanced_billing/models/webhook_response.rb +50 -0
  602. data/lib/advanced_billing/models/webhook_status.rb +29 -0
  603. data/lib/advanced_billing/models/webhook_subscription.rb +124 -0
  604. data/lib/advanced_billing/utilities/date_time_helper.rb +11 -0
  605. data/lib/advanced_billing/utilities/file_wrapper.rb +16 -0
  606. data/lib/advanced_billing/utilities/union_type_lookup.rb +1240 -0
  607. data/lib/advanced_billing.rb +669 -0
  608. metadata +614 -111
  609. data/bin/arch +0 -1
  610. data/bin/ash +0 -1
  611. data/bin/base64 +0 -1
  612. data/bin/bbconfig +0 -1
  613. data/bin/busybox +0 -0
  614. data/bin/cat +0 -1
  615. data/bin/chattr +0 -1
  616. data/bin/chgrp +0 -1
  617. data/bin/chmod +0 -1
  618. data/bin/chown +0 -1
  619. data/bin/cp +0 -1
  620. data/bin/date +0 -1
  621. data/bin/dd +0 -1
  622. data/bin/df +0 -1
  623. data/bin/dmesg +0 -1
  624. data/bin/dnsdomainname +0 -1
  625. data/bin/dumpkmap +0 -1
  626. data/bin/echo +0 -1
  627. data/bin/ed +0 -1
  628. data/bin/egrep +0 -1
  629. data/bin/false +0 -1
  630. data/bin/fatattr +0 -1
  631. data/bin/fdflush +0 -1
  632. data/bin/fgrep +0 -1
  633. data/bin/fsync +0 -1
  634. data/bin/getopt +0 -1
  635. data/bin/grep +0 -1
  636. data/bin/gunzip +0 -1
  637. data/bin/gzip +0 -1
  638. data/bin/hostname +0 -1
  639. data/bin/ionice +0 -1
  640. data/bin/iostat +0 -1
  641. data/bin/ipcalc +0 -1
  642. data/bin/kbd_mode +0 -1
  643. data/bin/kill +0 -1
  644. data/bin/link +0 -1
  645. data/bin/linux32 +0 -1
  646. data/bin/linux64 +0 -1
  647. data/bin/ln +0 -1
  648. data/bin/login +0 -1
  649. data/bin/ls +0 -1
  650. data/bin/lsattr +0 -1
  651. data/bin/lzop +0 -1
  652. data/bin/makemime +0 -1
  653. data/bin/mkdir +0 -1
  654. data/bin/mknod +0 -1
  655. data/bin/mktemp +0 -1
  656. data/bin/more +0 -1
  657. data/bin/mount +0 -1
  658. data/bin/mountpoint +0 -1
  659. data/bin/mpstat +0 -1
  660. data/bin/mv +0 -1
  661. data/bin/netstat +0 -1
  662. data/bin/nice +0 -1
  663. data/bin/pidof +0 -0
  664. data/bin/ping +0 -1
  665. data/bin/ping6 +0 -1
  666. data/bin/pipe_progress +0 -1
  667. data/bin/printenv +0 -1
  668. data/bin/ps +0 -0
  669. data/bin/pwait +0 -0
  670. data/bin/pwd +0 -1
  671. data/bin/reformime +0 -1
  672. data/bin/rev +0 -1
  673. data/bin/rm +0 -1
  674. data/bin/rmdir +0 -1
  675. data/bin/run-parts +0 -1
  676. data/bin/sed +0 -1
  677. data/bin/setpriv +0 -1
  678. data/bin/setserial +0 -1
  679. data/bin/sh +0 -1
  680. data/bin/slabtop +0 -0
  681. data/bin/sleep +0 -1
  682. data/bin/stat +0 -1
  683. data/bin/stty +0 -1
  684. data/bin/su +0 -1
  685. data/bin/sync +0 -1
  686. data/bin/tar +0 -1
  687. data/bin/tload +0 -0
  688. data/bin/touch +0 -1
  689. data/bin/true +0 -1
  690. data/bin/umount +0 -1
  691. data/bin/uname +0 -1
  692. data/bin/usleep +0 -1
  693. data/bin/vmstat +0 -0
  694. data/bin/w +0 -0
  695. data/bin/watch +0 -0
  696. data/bin/zcat +0 -1
  697. data/lib/apk/db/installed +0 -3582
  698. data/lib/apk/db/lock +0 -0
  699. data/lib/apk/db/scripts.tar +0 -0
  700. data/lib/apk/db/triggers +0 -2
  701. data/lib/ld-musl-x86_64.so.1 +0 -0
  702. data/lib/libapk.so.3.12.0 +0 -0
  703. data/lib/libc.musl-x86_64.so.1 +0 -1
  704. data/lib/libcrypto.so.1.1 +0 -0
  705. data/lib/libprocps.so.8 +0 -1
  706. data/lib/libprocps.so.8.0.3 +0 -0
  707. data/lib/libssl.so.1.1 +0 -0
  708. data/lib/libz.so +0 -1
  709. data/lib/libz.so.1 +0 -1
  710. data/lib/libz.so.1.2.12 +0 -0
  711. data/lib/sysctl.d/00-alpine.conf +0 -40
@@ -0,0 +1,1357 @@
1
+ # advanced_billing
2
+ #
3
+ # This file was automatically generated by APIMATIC v2.0
4
+ # ( https://apimatic.io ).
5
+
6
+ module AdvancedBilling
7
+ # SubscriptionsController
8
+ class SubscriptionsController < BaseController
9
+ # Full documentation on how subscriptions operate within Chargify can be
10
+ # located under the following topics:
11
+ # + [Subscriptions
12
+ # Reference](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405577172
13
+ # 749-Subscription-Introduction)
14
+ # + [Subscriptions
15
+ # Actions](https://maxio-chargify.zendesk.com/hc/en-us/articles/540551055655
16
+ # 7-Actions)
17
+ # + [Subscription
18
+ # Cancellation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405510
19
+ # 556557-Actions#initiate-cancellation)
20
+ # + [Subscription
21
+ # Reactivation](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404559
22
+ # 291021-Reactivating-and-Resuming)
23
+ # + [Subscription
24
+ # Import](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404863655821
25
+ # -Imports)
26
+ # When creating a subscription, you must specify a product and a customer.
27
+ # Credit card details may be required, depending on the options for the
28
+ # Product being subscribed ([see Product
29
+ # Options](https://maxio-chargify.zendesk.com/hc/en-us/articles/540524678222
30
+ # 1#payment-method-settings)).
31
+ # The product may be specified by `product_id` or by `product_handle` (API
32
+ # Handle). In similar fashion, to pass a particular product price point, you
33
+ # may either use `product_price_point_handle` or `product_price_point_id`.
34
+ # An existing customer may be specified by a `customer_id` (ID within
35
+ # Chargify) or a `customer_reference` (unique value within your app that you
36
+ # have shared with Chargify via the reference attribute on a customer). You
37
+ # may also pass in an existing payment profile for that customer with
38
+ # `payment_profile_id`. A new customer may be created by providing
39
+ # `customer_attributes`.
40
+ # Credit card details may be required, depending on the options for the
41
+ # product being subscribed. The product can be specified by `product_id` or
42
+ # by `product_handle` (API Handle).
43
+ # If you are creating a subscription with a payment profile, the attribute
44
+ # to send will be `credit_card_attributes` or `bank_account_attributes` for
45
+ # ACH and Direct Debit. That said, when you read the subscription after
46
+ # creation, we return the profile details under `credit_card` or
47
+ # `bank_account`.
48
+ # ## Taxable Subscriptions
49
+ # If your intent is to charge your subscribers tax via [Avalara
50
+ # Taxes](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405275711885-
51
+ # Avalara-VAT-Tax) or [Custom
52
+ # Taxes](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405069041549-
53
+ # Custom-Taxes), there are a few considerations to be made regarding
54
+ # collecting subscription data.
55
+ # For subscribers to be eligible to be taxed, the following information for
56
+ # the `customer` object or `payment_profile` object must by supplied:
57
+ # + A subscription to a [taxable
58
+ # product](https://maxio-chargify.zendesk.com/hc/en-us/articles/540524678222
59
+ # 1-Product-Editing#tax-settings)
60
+ # + [Full valid billing or shipping
61
+ # address](https://maxio-chargify.zendesk.com/hc/en-us/articles/540535611431
62
+ # 7#full-address-required-for-taxable-subscriptions) to identify the tax
63
+ # locale
64
+ # + The portion of the address that houses the [state
65
+ # information](https://maxio-chargify.zendesk.com/hc/en-us/articles/54053561
66
+ # 14317#required-state-format-for-taxable-subscriptions) of either adddress
67
+ # must adhere to the ISO standard of a 2-3 character limit/format.
68
+ # + The portion of the address that houses the [country
69
+ # information](https://maxio-chargify.zendesk.com/hc/en-us/articles/54053561
70
+ # 14317#required-country-format-for-taxable-subscriptions) must adhere to
71
+ # the ISO standard of a 2 character limit/format.
72
+ # ## Subscription Request Examples
73
+ # The subscription examples below will be split into two sections.
74
+ # The first section, "Subscription Customization", will focus on passing
75
+ # different information with a subscription, such as components, calendar
76
+ # billing, and custom fields. These examples will presume you are using a
77
+ # secure `chargify_token` generated by Chargify.js.
78
+ # The second section, "Passing Payment Information", will focus on passing
79
+ # payment information into Chargify. Please be aware that <b>collecting and
80
+ # sending Chargify raw card details requires PCI compliance on your end</b>;
81
+ # these examples are provided as guidance. If your business is not PCI
82
+ # compliant, we recommend using Chargify.js to collect credit cards or bank
83
+ # accounts.
84
+ # # Subscription Customization
85
+ # ## With Components
86
+ # Different components require slightly different data. For example,
87
+ # quantity-based and on/off components accept `allocated_quantity`, while
88
+ # metered components accept `unit_balance`.
89
+ # When creating a subscription with a component, a `price_point_id` can be
90
+ # passed in along with the `component_id` to specify which price point to
91
+ # use. If not passed in, the default price point will be used.
92
+ # Note: if an invalid `price_point_id` is used, the subscription will still
93
+ # proceed but will use the component's default price point.
94
+ # Components and their price points may be added by ID or by handle. See the
95
+ # example request body labeled "Components By Handle (Quantity-Based)"; the
96
+ # format will be the same for other component types.
97
+ # ## With Coupon(s)
98
+ # Pass an array of `coupon_codes`. See the example request body "With
99
+ # Coupon".
100
+ # ## With Manual Invoice Collection
101
+ # The `invoice` collection method works only on legacy Statement
102
+ # Architecture.
103
+ # On Relationship Invoicing Architecture use the `remittance` collection
104
+ # method.
105
+ # ## Prepaid Subscription
106
+ # A prepaid subscription can be created with the usual subscription creation
107
+ # parameters, specifying `prepaid` as the `payment_collection_method` and
108
+ # including a nested `prepaid_subscription_configuration`.
109
+ # After a prepaid subscription has been created, additional funds can be
110
+ # manually added to the prepayment account through the [Create Prepayment
111
+ # Endpoint](https://developers.chargify.com/docs/api-docs/7ec482de77ba7-crea
112
+ # te-prepayment).
113
+ # Prepaid subscriptions do not work on legacy Statement Architecture.
114
+ # ## With Metafields
115
+ # Metafields can either attach to subscriptions or customers. Metafields are
116
+ # popuplated with the supplied metadata to the resource specified.
117
+ # If the metafield doesn't exist yet, it will be created on-the-fly.
118
+ # ## With Custom Pricing
119
+ # Custom pricing is pricing specific to the subscription in question.
120
+ # Create a subscription with custom pricing by passing pricing information
121
+ # instead of a price point.
122
+ # For a custom priced product, pass the custom_price object in place of
123
+ # `product_price_point_id`. For a custom priced component, pass the
124
+ # `custom_price` object within the component object.
125
+ # Custom prices and price points can exist in harmony on a subscription.
126
+ # # Passing Payment Information
127
+ # ## Subscription with Chargify.js token
128
+ # The `chargify_token` can be obtained using
129
+ # [chargify.js](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0
130
+ # NjAzNDI0-overview). The token represents payment profile attributes that
131
+ # were provided by the customer in their browser and stored at the payment
132
+ # gateway.
133
+ # The `payment_type` attribute may either be `credit_card` or
134
+ # `bank_account`, depending on the type of payment method being added. If a
135
+ # bank account is being passed, the payment attributes should be changed to
136
+ # `bank_account_attributes`.
137
+ # ```json
138
+ # {
139
+ # "subscription": {
140
+ # "product_handle": "pro-plan",
141
+ # "customer_attributes": {
142
+ # "first_name": "Joe",
143
+ # "last_name": "Smith",
144
+ # "email": "j.smith@example.com"
145
+ # },
146
+ # "credit_card_attributes": {
147
+ # "chargify_token": "tok_cwhvpfcnbtgkd8nfkzf9dnjn",
148
+ # "payment_type": "credit_card"
149
+ # }
150
+ # }
151
+ # }
152
+ # ```
153
+ # ## Subscription with vault token
154
+ # If you already have a customer and card stored in your payment gateway,
155
+ # you may create a subscription with a `vault_token`. Providing the
156
+ # last_four, card type and expiration date will allow the card to be
157
+ # displayed properly in the Chargify UI.
158
+ # ```json
159
+ # {
160
+ # "subscription": {
161
+ # "product_handle": "pro-plan",
162
+ # "customer_attributes": {
163
+ # "first_name": "Joe",
164
+ # "last_name": "Smith",
165
+ # "email": "j.smith@example.com"
166
+ # },
167
+ # "credit_card_attributes": {
168
+ # first_name: "Joe,
169
+ # last_name: "Smith",
170
+ # card_type: "visa",
171
+ # expiration_month: "05",
172
+ # expiration_year: "2025",
173
+ # last_four: "1234",
174
+ # vault_token: "12345abc",
175
+ # current_vault: "braintree_blue"
176
+ # }
177
+ # }
178
+ # ```
179
+ # ## Subscription with Credit Card
180
+ # ```json
181
+ # "subscription": {
182
+ # "product_handle": "basic",
183
+ # "customer_attributes": {
184
+ # "first_name": "Joe",
185
+ # "last_name": "Blow",
186
+ # "email": "joe@example.com",
187
+ # "zip": "02120",
188
+ # "state": "MA",
189
+ # "reference": "XYZ",
190
+ # "phone": "(617) 111 - 0000",
191
+ # "organization": "Acme",
192
+ # "country": "US",
193
+ # "city": "Boston",
194
+ # "address_2": null,
195
+ # "address": "123 Mass Ave."
196
+ # },
197
+ # "credit_card_attributes": {
198
+ # "last_name": "Smith",
199
+ # "first_name": "Joe",
200
+ # "full_number": "4111111111111111",
201
+ # "expiration_year": "2021",
202
+ # "expiration_month": "1",
203
+ # "card_type": "visa",
204
+ # "billing_zip": "02120",
205
+ # "billing_state": "MA",
206
+ # "billing_country": "US",
207
+ # "billing_city": "Boston",
208
+ # "billing_address_2": null,
209
+ # "billing_address": "123 Mass Ave."
210
+ # }
211
+ # }
212
+ # ```
213
+ # ## Subscription with ACH as Payment Profile
214
+ # ```json
215
+ # {
216
+ # "subscription": {
217
+ # "product_handle": "gold-product",
218
+ # "customer_attributes": {
219
+ # "first_name": "Joe",
220
+ # "last_name": "Blow",
221
+ # "email": "joe@example.com",
222
+ # "zip": "02120",
223
+ # "state": "MA",
224
+ # "reference": "XYZ",
225
+ # "phone": "(617) 111 - 0000",
226
+ # "organization": "Acme",
227
+ # "country": "US",
228
+ # "city": "Boston",
229
+ # "address_2": null,
230
+ # "address": "123 Mass Ave."
231
+ # },
232
+ # "bank_account_attributes": {
233
+ # "bank_name": "Best Bank",
234
+ # "bank_routing_number": "021000089",
235
+ # "bank_account_number": "111111111111",
236
+ # "bank_account_type": "checking",
237
+ # "bank_account_holder_type": "business",
238
+ # "payment_type": "bank_account"
239
+ # }
240
+ # }
241
+ # }
242
+ # ```
243
+ # ## Subscription with PayPal payment profile
244
+ # ### With the nonce from Braintree JS
245
+ # ```json
246
+ # { "subscription": {
247
+ # "product_handle":"test-product-b",
248
+ # "customer_attributes": {
249
+ # "first_name":"Amelia",
250
+ # "last_name":"Johnson",
251
+ # "email":"amelia@example.com",
252
+ # "organization":"My Awesome Company"
253
+ # },
254
+ # "payment_profile_attributes":{
255
+ # "paypal_email": "amelia@example.com",
256
+ # "current_vault": "braintree_blue",
257
+ # "payment_method_nonce":"abc123",
258
+ # "payment_type":"paypal_account"
259
+ # }
260
+ # }
261
+ # ```
262
+ # ### With the Braintree Customer ID as the vault token:
263
+ # ```json
264
+ # { "subscription": {
265
+ # "product_handle":"test-product-b",
266
+ # "customer_attributes": {
267
+ # "first_name":"Amelia",
268
+ # "last_name":"Johnson",
269
+ # "email":"amelia@example.com",
270
+ # "organization":"My Awesome Company"
271
+ # },
272
+ # "payment_profile_attributes":{
273
+ # "paypal_email": "amelia@example.com",
274
+ # "current_vault": "braintree_blue",
275
+ # "vault_token":"58271347",
276
+ # "payment_type":"paypal_account"
277
+ # }
278
+ # }
279
+ # ```
280
+ # ## Subscription using GoCardless Bank Number
281
+ # These examples creates a customer, bank account and mandate in GoCardless.
282
+ # For more information on GoCardless, please view the following two
283
+ # resources:
284
+ # + [Payment Profiles via API for
285
+ # GoCardless](https://developers.chargify.com/docs/api-docs/1f10a4f170405-cr
286
+ # eate-payment-profile#gocardless)
287
+ # + [Full documentation on
288
+ # GoCardless](https://maxio-chargify.zendesk.com/hc/en-us/articles/540450188
289
+ # 9677)
290
+ # + [Using Chargify.js with GoCardless - minimal
291
+ # example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzN
292
+ # DIy-examples#minimal-example-with-direct-debit-gocardless-gateway)
293
+ # + [Using Chargify.js with GoCardless - full
294
+ # example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzN
295
+ # DIy-examples#full-example-with-direct-debit-gocardless-gateway)
296
+ # ```json
297
+ # {
298
+ # "subscription": {
299
+ # "product_handle": "gold-product",
300
+ # "customer_attributes": {
301
+ # "first_name": "Jane",
302
+ # "last_name": "Doe",
303
+ # "email": "jd@chargify.test"
304
+ # },
305
+ # "bank_account_attributes": {
306
+ # "bank_name": "Royal Bank of France",
307
+ # "bank_account_number": "0000000",
308
+ # "bank_routing_number": "0003",
309
+ # "bank_branch_code": "00006",
310
+ # "payment_type": "bank_account",
311
+ # "billing_address": "20 Place de la Gare",
312
+ # "billing_city": "Colombes",
313
+ # "billing_state": "Île-de-France",
314
+ # "billing_zip": "92700",
315
+ # "billing_country": "FR"
316
+ # }
317
+ # }
318
+ # }
319
+ # ```
320
+ # ## Subscription using GoCardless IBAN Number
321
+ # ```json
322
+ # {
323
+ # "subscription": {
324
+ # "product_handle": "gold-product",
325
+ # "customer_attributes": {
326
+ # "first_name": "Jane",
327
+ # "last_name": "Doe",
328
+ # "email": "jd@chargify.test"
329
+ # },
330
+ # "bank_account_attributes": {
331
+ # "bank_name": "French Bank",
332
+ # "bank_iban": "FR1420041010050500013M02606",
333
+ # "payment_type": "bank_account",
334
+ # "billing_address": "20 Place de la Gare",
335
+ # "billing_city": "Colombes",
336
+ # "billing_state": "Île-de-France",
337
+ # "billing_zip": "92700",
338
+ # "billing_country": "FR"
339
+ # }
340
+ # }
341
+ # }
342
+ # ```
343
+ # ## Subscription using Stripe SEPA Direct Debit
344
+ # For more information on Stripe Direct Debit, please view the following two
345
+ # resources:
346
+ # + [Payment Profiles via API for Stripe SEPA Direct
347
+ # Debit](https://developers.chargify.com/docs/api-docs/1f10a4f170405-create-
348
+ # payment-profile#sepa-direct-debit)
349
+ # + [Full documentation on Stripe Direct
350
+ # Debit](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405050826765-
351
+ # Stripe-SEPA-and-BECS-Direct-Debit)
352
+ # + [Using Chargify.js with Stripe SEPA or BECS Direct Debit - minimal
353
+ # example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzN
354
+ # DIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway
355
+ # )
356
+ # + [Using Chargify.js with Stripe SEPA Direct Debit - full
357
+ # example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzN
358
+ # DIy-examples#full-example-with-sepa-direct-debit-stripe-gateway)
359
+ # ```json
360
+ # {
361
+ # "subscription": {
362
+ # "product_handle": "gold-product",
363
+ # "customer_attributes": {
364
+ # "first_name": "Jane",
365
+ # "last_name": "Doe",
366
+ # "email": "jd@chargify.test"
367
+ # },
368
+ # "bank_account_attributes": {
369
+ # "bank_name": "Test Bank",
370
+ # "bank_iban": "DE89370400440532013000",
371
+ # "payment_type": "bank_account"
372
+ # }
373
+ # }
374
+ # }
375
+ # ```
376
+ # ## Subscription using Stripe BECS Direct Debit
377
+ # For more information on Stripe Direct Debit, please view the following two
378
+ # resources:
379
+ # + [Payment Profiles via API for Stripe BECS Direct
380
+ # Debit](https://developers.chargify.com/docs/api-docs/1f10a4f170405-create-
381
+ # payment-profile#stripe-becs-direct-debit)
382
+ # + [Full documentation on Stripe Direct
383
+ # Debit](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405050826765-
384
+ # Stripe-SEPA-and-BECS-Direct-Debit)
385
+ # + [Using Chargify.js with Stripe SEPA or BECS Direct Debit - minimal
386
+ # example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzN
387
+ # DIy-examples#minimal-example-with-sepa-or-becs-direct-debit-stripe-gateway
388
+ # )
389
+ # + [Using Chargify.js with Stripe BECS Direct Debit - full
390
+ # example](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzN
391
+ # DIy-examples#full-example-with-becs-direct-debit-stripe-gateway)
392
+ # ```json
393
+ # {
394
+ # "subscription": {
395
+ # "product_handle": "gold-product",
396
+ # "customer_attributes": {
397
+ # "first_name": "Jane",
398
+ # "last_name": "Doe",
399
+ # "email": "jd@chargify.test"
400
+ # },
401
+ # "bank_account_attributes": {
402
+ # "bank_name": "Test Bank",
403
+ # "bank_branch_code": "000000",
404
+ # "bank_account_number": "000123456",
405
+ # "payment_type": "bank_account"
406
+ # }
407
+ # }
408
+ # }
409
+ # ```
410
+ # ## 3D Secure - Stripe
411
+ # It may happen that a payment needs 3D Secure Authentication when the
412
+ # subscription is created; this is referred to in our help docs as a
413
+ # [post-authentication
414
+ # flow](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405177432077#p
415
+ # sd2-flows-pre-authentication-and-post-authentication). The server returns
416
+ # `422 Unprocessable Entity` in this case with the following response:
417
+ # ```json
418
+ # {
419
+ # "errors": [
420
+ # "Your card was declined. This transaction requires 3D secure
421
+ # authentication."
422
+ # ],
423
+ # "gateway_payment_id": "pi_1F0aGoJ2UDb3Q4av7zU3sHPh",
424
+ # "description": "This card requires 3D secure authentication. Redirect
425
+ # the customer to the URL from the action_link attribute to authenticate.
426
+ # Attach callback_url param to this URL if you want to be notified about the
427
+ # result of 3D Secure authentication. Attach redirect_url param to this URL
428
+ # if you want to redirect a customer back to your page after 3D Secure
429
+ # authentication. Example:
430
+ # https://mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm?one_time
431
+ # _token_id=128&callback_url=https://localhost:4000&redirect_url=https://you
432
+ # rpage.com will do a POST request to https://localhost:4000 after payment
433
+ # is authenticated and will redirect a customer to https://yourpage.com
434
+ # after 3DS authentication.",
435
+ # "action_link":
436
+ # "http://acme.chargify.com/3d-secure/pi_1F0aGoJ2UDb3Q4av7zU3sHPh?one_time_t
437
+ # oken_id=242"
438
+ # }
439
+ # ```
440
+ # To let the customer go through 3D Secure Authentication, they need to be
441
+ # redirected to the URL specified in `action_link`.
442
+ # Optionally, you can specify `callback_url` parameter in the `action_link`
443
+ # URL if you’d like to be notified about the result of 3D Secure
444
+ # Authentication. The `callback_url` will return the following information:
445
+ # - whether the authentication was successful (`success`)
446
+ # - the gateway ID for the payment (`gateway_payment_id`)
447
+ # - the subscription ID (`subscription_id`)
448
+ # Lastly, you can also specify a `redirect_url` within the `action_link` URL
449
+ # if you’d like to redirect a customer back to your site.
450
+ # It is not possible to use `action_link` in an iframe inside a custom
451
+ # application. You have to redirect the customer directly to the
452
+ # `action_link`, then, to be notified about the result, use `redirect_url`
453
+ # or `callback_url`.
454
+ # The final URL that you send a customer to to complete 3D Secure may
455
+ # resemble the following, where the first half is the `action_link` and the
456
+ # second half contains a `redirect_url` and `callback_url`:
457
+ # `https://mysite.chargify.com/3d-secure/pi_1FCm4RKDeye4C0XfbqquXRYm?one_tim
458
+ # e_token_id=128&callback_url=https://localhost:4000&redirect_url=https://yo
459
+ # urpage.com`
460
+ # ## 3D Secure - Checkout
461
+ # It may happen that a payment needs 3D Secure Authentication when the
462
+ # subscription is created; this is referred to in our help docs as a
463
+ # [post-authentication
464
+ # flow](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405177432077#p
465
+ # sd2-flows-pre-authentication-and-post-authentication). The server returns
466
+ # `422 Unprocessable Entity` in this case with the following response:
467
+ # ```json
468
+ # {
469
+ # "errors": [
470
+ # "Your card was declined. This transaction requires 3D secure
471
+ # authentication."
472
+ # ],
473
+ # "gateway_payment_id": "pay_6gjofv7dlyrkpizlolsuspvtiu",
474
+ # "description": "This card requires 3D secure authentication. Redirect
475
+ # the customer to the URL from the action_link attribute to authenticate.
476
+ # Attach callback_url param to this URL if you want to be notified about the
477
+ # result of 3D Secure authentication. Attach redirect_url param to this URL
478
+ # if you want to redirect a customer back to your page after 3D Secure
479
+ # authentication. Example:
480
+ # https://mysite.chargify.com/3d-secure/pay_6gjofv7dlyrkpizlolsuspvtiu?one_t
481
+ # ime_token_id=123&callback_url=https://localhost:4000&redirect_url=https://
482
+ # yourpage.com will do a POST request to https://localhost:4000 after
483
+ # payment is authenticated and will redirect a customer to
484
+ # https://yourpage.com after 3DS authentication.",
485
+ # "action_link":
486
+ # "http://mysite.chargify.com/3d-secure/pay_6gjofv7dlyrkpizlolsuspvtiu?one_t
487
+ # ime_token_id=123"
488
+ # }
489
+ # ```
490
+ # To let the customer go through 3D Secure Authentication, they need to be
491
+ # redirected to the URL specified in `action_link`.
492
+ # Optionally, you can specify `callback_url` parameter in the `action_link`
493
+ # URL if you’d like to be notified about the result of 3D Secure
494
+ # Authentication. The `callback_url` will return the following information:
495
+ # - whether the authentication was successful (`success`)
496
+ # - the gateway ID for the payment (`gateway_payment_id`)
497
+ # - the subscription ID (`subscription_id`)
498
+ # Lastly, you can also specify a `redirect_url` parameter within the
499
+ # `action_link` URL if you’d like to redirect a customer back to your site.
500
+ # It is not possible to use `action_link` in an iframe inside a custom
501
+ # application. You have to redirect the customer directly to the
502
+ # `action_link`, then, to be notified about the result, use `redirect_url`
503
+ # or `callback_url`.
504
+ # The final URL that you send a customer to complete 3D Secure may resemble
505
+ # the following, where the first half is the `action_link` and the second
506
+ # half contains a `redirect_url` and `callback_url`:
507
+ # `https://mysite.chargify.com/3d-secure/pay_6gjofv7dlyrkpizlolsuspvtiu?one_
508
+ # time_token_id=123&callback_url=https://localhost:4000&redirect_url=https:/
509
+ # /yourpage.com`
510
+ # ### Example Redirect Flow
511
+ # You may wish to redirect customers to different pages depending on whether
512
+ # their SCA was performed successfully. Here's an example flow to use as a
513
+ # reference:
514
+ # 1. Create a subscription via API; it requires 3DS
515
+ # 2. You receive a `gateway_payment_id` in the `action_link` along other
516
+ # params in the response.
517
+ # 3. Use this `gateway_payment_id` to, for example, connect with your
518
+ # internal resources or generate a session_id
519
+ # 4. Include 1 of those attributes inside the `callback_url` and
520
+ # `redirect_url` to be aware which “session” this applies to
521
+ # 5. Redirect the customer to the `action_link` with `callback_url` and
522
+ # `redirect_url` applied
523
+ # 6. After the customer finishes 3DS authentication, we let you know the
524
+ # result by making a request to applied `callback_url`.
525
+ # 7. After that, we redirect the customer to the `redirect_url`; at this
526
+ # point the result of authentication is known
527
+ # 8. Optionally, you can use the applied "msg" param in the `redirect_url`
528
+ # to determine whether it was successful or not
529
+ # ## Subscriptions Import
530
+ # Subscriptions can be “imported” via the API to handle the following
531
+ # scenarios:
532
+ # + You already have existing subscriptions with specific start and renewal
533
+ # dates that you would like to import to Chargify
534
+ # + You already have credit cards stored in your provider’s vault and you
535
+ # would like to create subscriptions using those tokens
536
+ # Before importing, you should have already set up your products to match
537
+ # your offerings. Then, you can create Subscriptions via the API just like
538
+ # you normally would, but using a few special attributes.
539
+ # Full documentation on how import Subscriptions using the **import tool**
540
+ # in the Chargify UI can be located
541
+ # [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404863655821#
542
+ # imports-0-0).
543
+ # ### Important Notices and Disclaimers regarding Imports
544
+ # Before performing a bulk import of subscriptions via the API, we suggest
545
+ # reading the [Subscriptions
546
+ # Import](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404863655821
547
+ # #important-notices-and-disclaimers) instructions to understand the
548
+ # repurcussions of a large import.
549
+ # ### Subscription Input Attributes
550
+ # The following _additional_ attributes to the subscription input attributes
551
+ # make imports possible: `next_billing_at`, `previous_billing_at`, and
552
+ # `import_mrr`.
553
+ # ### Current Vault
554
+ # If you are using a Legacy gateway such as "eWAY Rapid (Legacy)" or "Stripe
555
+ # (Legacy)" then please contact Support for further instructions on
556
+ # subscription imports.
557
+ # ### Braintree Blue (Braintree v2) Imports
558
+ # Braintree Blue is Braintree’s newer (version 2) API. For this gateway,
559
+ # please provide the `vault_token` parameter with the value from Braintree’s
560
+ # “Customer ID” rather than the “Payment Profile Token”. At this time we do
561
+ # not use `current_vault_token` with the Braintree Blue gateway, and we only
562
+ # support a single payment profile per Braintree Customer.
563
+ # When importing PayPal type payment profiles, please set `payment_type` to
564
+ # `paypal_account`.
565
+ # ### Stripe ACH Imports
566
+ # If the bank account has already been verified, currently you will need to
567
+ # create the customer, create the payment profile in Chargify - setting
568
+ # verified=true, then create a subscription using the customer_id and
569
+ # payment_profile_id.
570
+ # ### Webhooks During Import
571
+ # If no `next_billing_at` is provided, webhooks will be fired as normal. If
572
+ # you do set a future `next_billing_at`, only a subset of the webhooks are
573
+ # fired when the subscription is created. Keep reading for more information
574
+ # as to what webhooks will be fired under which scenarios.
575
+ # #### Successful creation with Billing Date
576
+ # Scenario: If `next_billing_at` provided
577
+ # + `signup_success`
578
+ # + `billing_date_change`
579
+ # #### Successful creation without Billing Date
580
+ # Scenario: If no `next_billing_at` provided
581
+ # + `signup_success`
582
+ # + `payment_success`
583
+ # #### Unsuccessful creation
584
+ # Scenario: If card can’t be charged, and no `next_billing_at` provided
585
+ # + signup_failure
586
+ # #### Webhooks fired when next_billing_at is reached:
587
+ # + `renewal_success or renewal_failure`
588
+ # + `payment_success or payment_failure`
589
+ # ### Date and Time Formats
590
+ # We will attempt to parse any string you send as the value of
591
+ # next_billing_at in to a date or time. For best results, use a known format
592
+ # like described in “Date and Time Specification” of RFC 2822 or ISO 8601 .
593
+ # The following are all equivalent and will work as input to
594
+ # `next_billing_at`:
595
+ # ```
596
+ # Aug 06 2030 11:34:00 -0400
597
+ # Aug 06 2030 11:34 -0400
598
+ # 2030-08-06T11:34:00-04:00
599
+ # 8/6/2030 11:34:00 EDT
600
+ # 8/6/2030 8:34:00 PDT
601
+ # 2030-08-06T15:34:00Z
602
+ # ```
603
+ # You may also pass just a date, in which case we will assume the time to be
604
+ # noon
605
+ # ```
606
+ # 2010-08-06
607
+ # ```
608
+ # ## Subscription Hierarchies & WhoPays
609
+ # When subscription groups were first added to our Relationship Invoicing
610
+ # architecture, to group together invoices for related subscriptions and
611
+ # allow for complex customer hierarchies and WhoPays scenarios, they were
612
+ # designed to consist of a primary and a collection of group members. The
613
+ # primary would control many aspects of the group, such as when the
614
+ # consolidated invoice is generated. As of today, groups still function this
615
+ # way.
616
+ # In the future, the concept of a "primary" will be removed in order to
617
+ # offer more flexibility into group management and reduce confusion
618
+ # concerning what actions must be done on a primary level, rather than a
619
+ # member level.
620
+ # We have introduced a two scheme system as a bridge between these two group
621
+ # organizations. Scheme 1, which is relevant to all subscription groups
622
+ # today, marks the group as being "ruled" by a primary.
623
+ # When reading a subscription via API, they will return a top-level
624
+ # attribute called `group`, which will denote which scheme is being used. At
625
+ # this time, the `scheme` attribute will always be 1.
626
+ # ### Subscription in a Customer Hierarchy
627
+ # For sites making use of the [Relationship
628
+ # Billing](https://maxio-chargify.zendesk.com/hc/en-us/articles/540507879425
629
+ # 3-Introduction-to-Invoices) and [Customer
630
+ # Hierarchy](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404900384
631
+ # 141) features, it is possible to create subscriptions within a customer
632
+ # hierarchy. This can be achieved through the API by passing group
633
+ # parameters in the **Create Subscription** request.
634
+ # + The `group` parameters are optional and consist of the required `target`
635
+ # and optional `billing` parameters.
636
+ # When the `target` parameter specifies a customer that is already part of a
637
+ # hierarchy, the new subscription will become a member of the customer
638
+ # hierarchy as well. If the target customer is not part of a hierarchy, a
639
+ # new customer hierarchy will be created and both the target customer and
640
+ # the new subscription will become part of the hierarchy with the specified
641
+ # target customer set as the responsible payer for the hierarchy's
642
+ # subscriptions.
643
+ # Rather than specifying a customer, the `target` parameter could instead
644
+ # simply have a value of `self` which indicates the subscription will be
645
+ # paid for not by some other customer, but by the subscribing customer.
646
+ # This will be true whether the customer is being created new, is already
647
+ # part of a hierarchy, or already exists outside a hierarchy. A valid
648
+ # payment method must also be specified in the subscription parameters.
649
+ # Note that when creating subscriptions in a customer hierarchy, if the
650
+ # customer hierarchy does not already have a payment method, passing valid
651
+ # credit card attributes in the subscription parameters will also result in
652
+ # the payment method being established as the default payment method for the
653
+ # customer hierarchy irrespective of the responsible payer.
654
+ # The optional `billing` parameters specify how some aspects of the billing
655
+ # for the new subscription should be handled. Rather than capturing payment
656
+ # immediately, the `accrue` parameter can be included so that the new
657
+ # subscription charges accrue until the next assessment date. Regarding the
658
+ # date, the `align_date` parameter can be included so that the billing date
659
+ # of the new subscription matches up with the default subscription group in
660
+ # the customer hierarchy. When choosing to align the dates, the `prorate`
661
+ # parameter can also be specified so that the new subscription charges are
662
+ # prorated based on the billing period of the default subscription group in
663
+ # the customer hierarchy also.
664
+ # ### Subscription in a Subscription Group
665
+ # For sites making use of [Relationship
666
+ # Billing](https://maxio-chargify.zendesk.com/hc/en-us/articles/540507879425
667
+ # 3-Introduction-to-Invoices) it may be desireable to create a subscription
668
+ # as part of a [subscription
669
+ # group](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405577356173)
670
+ # in order to rely on [invoice
671
+ # consolidation](https://maxio-chargify.zendesk.com/hc/en-us/articles/540498
672
+ # 0119949). This can be achieved through the API by passing group parameters
673
+ # in the Create Subscription request. The `group` parameters are optional
674
+ # and consist of the required `target` and optional `billing` parameters.
675
+ # The `target` parameters specify an existing subscription with which the
676
+ # newly created subscription should be grouped. If the target subscription
677
+ # is already part of a group, the new subscription will become a member of
678
+ # the group as well. If the target subscription is not part of a group, a
679
+ # new group will be created and both the target and the new subscription
680
+ # will become part of the group with the target as the group's primary
681
+ # subscription.
682
+ # The optional `billing` parameters specify how some aspects of the billing
683
+ # for the new subscription should be handled. Rather than capturing payment
684
+ # immediately, the `accrue` parameter can be included so that the new
685
+ # subscription charges accrue until the next assessment date. Regarding the
686
+ # date, the `align_date` parameter can be included so that the billing date
687
+ # of the new subscription matches up with the target subscription. When
688
+ # choosing to align the dates, the `prorate` parameter can also be specified
689
+ # so that the new subscription charges are prorated based on the billing
690
+ # period of the target subscription also.
691
+ # ## Providing Agreement Acceptance Params
692
+ # It is possible to provide a proof of customer's acceptance of terms and
693
+ # policies.
694
+ # We will be storing this proof in case it might be required (i.e.
695
+ # chargeback).
696
+ # Currently, we already keep it for subscriptions created via Public Signup
697
+ # Pages.
698
+ # In order to create a subscription with the proof of agreement acceptance,
699
+ # you must provide additional parameters `agreement acceptance` with
700
+ # `ip_address` and at least one url to the policy that was accepted:
701
+ # `terms_url` or `privacy_policy_url`. Additional urls that can be provided:
702
+ # `return_refund_policy_url`, `delivery_policy_url` and
703
+ # `secure_checkout_policy_url`.
704
+ # ```json
705
+ # "subscription": {
706
+ # "product_handle": "gold-product",
707
+ # "customer_attributes": {
708
+ # "first_name": "Jane",
709
+ # "last_name": "Doe",
710
+ # "email": "jd@chargify.test"
711
+ # },
712
+ # "agreement_acceptance": {
713
+ # "ip_address": "1.2.3.4",
714
+ # "terms_url": "https://terms.url",
715
+ # "privacy_policy_url": "https://privacy_policy.url",
716
+ # "return_refund_policy_url": "https://return_refund_policy.url",
717
+ # "delivery_policy_url": "https://delivery_policy.url",
718
+ # "secure_checkout_policy_url": "https://secure_checkout_policy.url"
719
+ # }
720
+ # }
721
+ # }
722
+ # ```
723
+ # **For Maxio Payments subscriptions, the agreement acceptance params are
724
+ # required, with at least terms_url provided.**
725
+ # ## Providing ACH Agreement params
726
+ # It is also possible to provide a proof that a customer authorized ACH
727
+ # agreement terms.
728
+ # The proof will be stored and the email will be sent to the customer with a
729
+ # copy of the terms (if enabled).
730
+ # In order to create a subscription with the proof of authorized ACH
731
+ # agreement terms, you must provide the additional parameter `ach_agreement`
732
+ # with the following nested parameters: `agreement_terms`,
733
+ # `authorizer_first_name`, `authorizer_last_name` and `ip_address`.
734
+ # Each of them is required.
735
+ # ```json
736
+ # "subscription": {
737
+ # "product_handle": "gold-product",
738
+ # "customer_attributes": {
739
+ # "first_name": "Jane",
740
+ # "last_name": "Doe",
741
+ # "email": "jd@chargify.test"
742
+ # },
743
+ # "bank_account_attributes": {
744
+ # "bank_name": "Test Bank",
745
+ # "bank_routing_number": "021000089",
746
+ # "bank_account_number": "111111111111",
747
+ # "bank_account_type": "checking",
748
+ # "bank_account_holder_type": "business",
749
+ # "payment_type": "bank_account"
750
+ # },
751
+ # "ach_agreement": {
752
+ # "agreement_terms": "ACH agreement terms",
753
+ # "authorizer_first_name": "Jane",
754
+ # "authorizer_last_name": "Doe",
755
+ # "ip_address": "1.2.3.4"
756
+ # }
757
+ # }
758
+ # ```
759
+ # @param [CreateSubscriptionRequest] body Optional parameter: Example:
760
+ # @return [SubscriptionResponse] response from the API call.
761
+ def create_subscription(body: nil)
762
+ new_api_call_builder
763
+ .request(new_request_builder(HttpMethodEnum::POST,
764
+ '/subscriptions.json',
765
+ Server::DEFAULT)
766
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
767
+ .body_param(new_parameter(body))
768
+ .header_param(new_parameter('application/json', key: 'accept'))
769
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
770
+ .auth(Single.new('BasicAuth')))
771
+ .response(new_response_handler
772
+ .is_nullify404(true)
773
+ .deserializer(APIHelper.method(:custom_type_deserializer))
774
+ .deserialize_into(SubscriptionResponse.method(:from_hash))
775
+ .local_error('422',
776
+ 'Unprocessable Entity (WebDAV)',
777
+ ErrorListResponseException))
778
+ .execute
779
+ end
780
+
781
+ # This API endpoint allows you to set certain subscription fields that are
782
+ # usually managed for you automatically. Some of the fields can be set via
783
+ # the normal Subscriptions Update API, but others can only be set using this
784
+ # endpoint.
785
+ # This endpoint is provided for cases where you need to “align” Chargify
786
+ # data with data that happened in your system, perhaps before you started
787
+ # using Chargify. For example, you may choose to import your historical
788
+ # subscription data, and would like the activation and cancellation dates in
789
+ # Chargify to match your existing historical dates. Chargify does not
790
+ # backfill historical events (i.e. from the Events API), but some static
791
+ # data can be changed via this API.
792
+ # Why are some fields only settable from this endpoint, and not the normal
793
+ # subscription create and update endpoints? Because we want users of this
794
+ # endpoint to be aware that these fields are usually managed by Chargify,
795
+ # and using this API means **you are stepping out on your own.**
796
+ # Changing these fields will not affect any other attributes. For example,
797
+ # adding an expiration date will not affect the next assessment date on the
798
+ # subscription.
799
+ # If you regularly need to override the current_period_starts_at for new
800
+ # subscriptions, this can also be accomplished by setting both
801
+ # `previous_billing_at` and `next_billing_at` at subscription creation. See
802
+ # the documentation on [Importing
803
+ # Subscriptions](./b3A6MTQxMDgzODg-create-subscription#subscriptions-import)
804
+ # for more information.
805
+ # ## Limitations
806
+ # When passing `current_period_starts_at` some validations are made:
807
+ # 1. The subscription needs to be unbilled (no statements or invoices).
808
+ # 2. The value passed must be a valid date/time. We recommend using the iso
809
+ # 8601 format.
810
+ # 3. The value passed must be before the current date/time.
811
+ # If unpermitted parameters are sent, a 400 HTTP response is sent along with
812
+ # a string giving the reason for the problem.
813
+ # @param [String] subscription_id Required parameter: The Chargify id of the
814
+ # subscription
815
+ # @param [OverrideSubscriptionRequest] body Optional parameter: Only these
816
+ # fields are available to be set.
817
+ # @return [void] response from the API call.
818
+ def override_subscription(subscription_id,
819
+ body: nil)
820
+ new_api_call_builder
821
+ .request(new_request_builder(HttpMethodEnum::PUT,
822
+ '/subscriptions/{subscription_id}/override.json',
823
+ Server::DEFAULT)
824
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
825
+ .is_required(true)
826
+ .should_encode(true))
827
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
828
+ .body_param(new_parameter(body))
829
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
830
+ .auth(Single.new('BasicAuth')))
831
+ .response(new_response_handler
832
+ .is_nullify404(true)
833
+ .is_response_void(true)
834
+ .local_error('400',
835
+ 'Bad Request',
836
+ APIException)
837
+ .local_error('422',
838
+ 'Unprocessable Entity (WebDAV)',
839
+ APIException))
840
+ .execute
841
+ end
842
+
843
+ # Chargify offers the ability to activate awaiting signup and trialing
844
+ # subscriptions. This feature is only available on the Relationship
845
+ # Invoicing architecture. Subscriptions in a group may not be activated
846
+ # immediately.
847
+ # For details on how the activation works, and how to activate subscriptions
848
+ # through the application, see [activation](#).
849
+ # The `revert_on_failure` parameter controls the behavior upon activation
850
+ # failure.
851
+ # - If set to `true` and something goes wrong i.e. payment fails, then
852
+ # Chargify will not change the subscription's state. The subscription’s
853
+ # billing period will also remain the same.
854
+ # - If set to `false` and something goes wrong i.e. payment fails, then
855
+ # Chargify will continue through with the activation and enter an end of
856
+ # life state. For trialing subscriptions, that will either be trial ended
857
+ # (if the trial is no obligation), past due (if the trial has an
858
+ # obligation), or canceled (if the site has no dunning strategy, or has a
859
+ # strategy that says to cancel immediately). For awaiting signup
860
+ # subscriptions, that will always be canceled.
861
+ # The default activation failure behavior can be configured per activation
862
+ # attempt, or you may set a default value under Config > Settings >
863
+ # Subscription Activation Settings.
864
+ # ## Activation Scenarios
865
+ # ### Activate Awaiting Signup subscription
866
+ # - Given you have a product without trial
867
+ # - Given you have a site without dunning strategy
868
+ # ```mermaid
869
+ # flowchart LR
870
+ # AS[Awaiting Signup] --> A{Activate}
871
+ # A -->|Success| Active
872
+ # A -->|Failure| ROF{revert_on_failure}
873
+ # ROF -->|true| AS
874
+ # ROF -->|false| Canceled
875
+ # ```
876
+ # - Given you have a product with trial
877
+ # - Given you have a site with dunning strategy
878
+ # ```mermaid
879
+ # flowchart LR
880
+ # AS[Awaiting Signup] --> A{Activate}
881
+ # A -->|Success| Trialing
882
+ # A -->|Failure| ROF{revert_on_failure}
883
+ # ROF -->|true| AS
884
+ # ROF -->|false| PD[Past Due]
885
+ # ```
886
+ # ### Activate Trialing subscription
887
+ # You can read more about the behavior of trialing subscriptions
888
+ # [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404494617357#
889
+ # trialing-subscriptions-0-0).
890
+ # When the `revert_on_failure` parameter is set to `true`, the
891
+ # subscription's state will remain as Trialing, we will void the invoice
892
+ # from activation and return any prepayments and credits applied to the
893
+ # invoice back to the subscription.
894
+ # @param [String] subscription_id Required parameter: The Chargify id of the
895
+ # subscription
896
+ # @param [ActivateSubscriptionRequest] body Optional parameter: Example:
897
+ # @return [SubscriptionResponse] response from the API call.
898
+ def activate_subscription(subscription_id,
899
+ body: nil)
900
+ new_api_call_builder
901
+ .request(new_request_builder(HttpMethodEnum::PUT,
902
+ '/subscriptions/{subscription_id}/activate.json',
903
+ Server::DEFAULT)
904
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
905
+ .is_required(true)
906
+ .should_encode(true))
907
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
908
+ .body_param(new_parameter(body))
909
+ .header_param(new_parameter('application/json', key: 'accept'))
910
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
911
+ .auth(Single.new('BasicAuth')))
912
+ .response(new_response_handler
913
+ .is_nullify404(true)
914
+ .deserializer(APIHelper.method(:custom_type_deserializer))
915
+ .deserialize_into(SubscriptionResponse.method(:from_hash))
916
+ .local_error('400',
917
+ 'Bad Request',
918
+ NestedErrorResponseException))
919
+ .execute
920
+ end
921
+
922
+ # For sites in test mode, you may purge individual subscriptions.
923
+ # Provide the subscription ID in the url. To confirm, supply the customer
924
+ # ID in the query string `ack` parameter. You may also delete the customer
925
+ # record and/or payment profiles by passing `cascade` parameters. For
926
+ # example, to delete just the customer record, the query params would be:
927
+ # `?ack={customer_id}&cascade[]=customer`
928
+ # If you need to remove subscriptions from a live site, please contact
929
+ # support to discuss your use case.
930
+ # ### Delete customer and payment profile
931
+ # The query params will be:
932
+ # `?ack={customer_id}&cascade[]=customer&cascade[]=payment_profile`
933
+ # @param [String] subscription_id Required parameter: The Chargify id of the
934
+ # subscription
935
+ # @param [Integer] ack Required parameter: id of the customer.
936
+ # @param [Array[SubscriptionPurgeType]] cascade Optional parameter: Options
937
+ # are "customer" or "payment_profile". Use in query:
938
+ # `cascade[]=customer&cascade[]=payment_profile`.
939
+ # @return [void] response from the API call.
940
+ def purge_subscription(subscription_id,
941
+ ack,
942
+ cascade: nil)
943
+ new_api_call_builder
944
+ .request(new_request_builder(HttpMethodEnum::POST,
945
+ '/subscriptions/{subscription_id}/purge.json',
946
+ Server::DEFAULT)
947
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
948
+ .is_required(true)
949
+ .should_encode(true))
950
+ .query_param(new_parameter(ack, key: 'ack')
951
+ .is_required(true))
952
+ .query_param(new_parameter(cascade, key: 'cascade[]'))
953
+ .auth(Single.new('BasicAuth'))
954
+ .array_serialization_format(ArraySerializationFormat::CSV))
955
+ .response(new_response_handler
956
+ .is_nullify404(true)
957
+ .is_response_void(true)
958
+ .local_error('400',
959
+ 'Bad Request',
960
+ APIException))
961
+ .execute
962
+ end
963
+
964
+ # Use this endpoint to find subscription details.
965
+ # ## Self-Service Page token
966
+ # Self-Service Page token for the subscription is not returned by default.
967
+ # If this information is desired, the include[]=self_service_page_token
968
+ # parameter must be provided with the request.
969
+ # @param [String] subscription_id Required parameter: The Chargify id of the
970
+ # subscription
971
+ # @param [Array[SubscriptionInclude]] include Optional parameter: Allows
972
+ # including additional data in the response. Use in query:
973
+ # `include[]=coupons&include[]=self_service_page_token`.
974
+ # @return [SubscriptionResponse] response from the API call.
975
+ def read_subscription(subscription_id,
976
+ include: nil)
977
+ new_api_call_builder
978
+ .request(new_request_builder(HttpMethodEnum::GET,
979
+ '/subscriptions/{subscription_id}.json',
980
+ Server::DEFAULT)
981
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
982
+ .is_required(true)
983
+ .should_encode(true))
984
+ .query_param(new_parameter(include, key: 'include[]'))
985
+ .header_param(new_parameter('application/json', key: 'accept'))
986
+ .auth(Single.new('BasicAuth'))
987
+ .array_serialization_format(ArraySerializationFormat::UN_INDEXED))
988
+ .response(new_response_handler
989
+ .is_nullify404(true)
990
+ .deserializer(APIHelper.method(:custom_type_deserializer))
991
+ .deserialize_into(SubscriptionResponse.method(:from_hash)))
992
+ .execute
993
+ end
994
+
995
+ # The Chargify API allows you to preview a subscription by POSTing the same
996
+ # JSON or XML as for a subscription creation.
997
+ # The "Next Billing" amount and "Next Billing" date are represented in each
998
+ # Subscriber's Summary. For more information, please see our documentation
999
+ # [here](https://chargify.zendesk.com/hc/en-us/articles/4407884887835#next-b
1000
+ # illing).
1001
+ # ## Side effects
1002
+ # A subscription will not be created by sending a POST to this endpoint. It
1003
+ # is meant to serve as a prediction.
1004
+ # ## Taxable Subscriptions
1005
+ # This endpoint will preview taxes applicable to a purchase. In order for
1006
+ # taxes to be previewed, the following conditions must be met:
1007
+ # + Taxes must be configured on the subscription
1008
+ # + The preview must be for the purchase of a taxable product or component,
1009
+ # or combination of the two.
1010
+ # + The subscription payload must contain a full billing or shipping address
1011
+ # in order to calculate tax
1012
+ # For more information about creating taxable previews, please see our
1013
+ # documentation guide on how to create [taxable
1014
+ # subscriptions.](https://chargify.zendesk.com/hc/en-us/articles/44079042177
1015
+ # 55#creating-taxable-subscriptions)
1016
+ # You do **not** need to include a card number to generate tax information
1017
+ # when you are previewing a subscription. However, please note that when you
1018
+ # actually want to create the subscription, you must include the credit card
1019
+ # information if you want the billing address to be stored in Chargify. The
1020
+ # billing address and the credit card information are stored together within
1021
+ # the payment profile object. Also, you may not send a billing address to
1022
+ # Chargify without payment profile information, as the address is stored on
1023
+ # the card.
1024
+ # You can pass shipping and billing addresses and still decide not to
1025
+ # calculate taxes. To do that, pass `skip_billing_manifest_taxes: true`
1026
+ # attribute.
1027
+ # ## Non-taxable Subscriptions
1028
+ # If you'd like to calculate subscriptions that do not include tax, please
1029
+ # feel free to leave off the billing information.
1030
+ # @param [CreateSubscriptionRequest] body Optional parameter: Example:
1031
+ # @return [SubscriptionPreviewResponse] response from the API call.
1032
+ def preview_subscription(body: nil)
1033
+ new_api_call_builder
1034
+ .request(new_request_builder(HttpMethodEnum::POST,
1035
+ '/subscriptions/preview.json',
1036
+ Server::DEFAULT)
1037
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
1038
+ .body_param(new_parameter(body))
1039
+ .header_param(new_parameter('application/json', key: 'accept'))
1040
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
1041
+ .auth(Single.new('BasicAuth')))
1042
+ .response(new_response_handler
1043
+ .is_nullify404(true)
1044
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1045
+ .deserialize_into(SubscriptionPreviewResponse.method(:from_hash)))
1046
+ .execute
1047
+ end
1048
+
1049
+ # Use this endpoint to remove a coupon from an existing subscription.
1050
+ # For more information on the expected behaviour of removing a coupon from a
1051
+ # subscription, please see our documentation
1052
+ # [here.](https://chargify.zendesk.com/hc/en-us/articles/4407896488987#remov
1053
+ # ing-a-coupon)
1054
+ # @param [String] subscription_id Required parameter: The Chargify id of the
1055
+ # subscription
1056
+ # @param [String] coupon_code Optional parameter: The coupon code
1057
+ # @return [String] response from the API call.
1058
+ def delete_coupon_from_subscription(subscription_id,
1059
+ coupon_code: nil)
1060
+ new_api_call_builder
1061
+ .request(new_request_builder(HttpMethodEnum::DELETE,
1062
+ '/subscriptions/{subscription_id}/remove_coupon.json',
1063
+ Server::DEFAULT)
1064
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
1065
+ .is_required(true)
1066
+ .should_encode(true))
1067
+ .query_param(new_parameter(coupon_code, key: 'coupon_code'))
1068
+ .auth(Single.new('BasicAuth')))
1069
+ .response(new_response_handler
1070
+ .is_nullify404(true)
1071
+ .deserializer(APIHelper.method(:deserialize_primitive_types))
1072
+ .deserialize_into(proc do |response| response.to_s end)
1073
+ .is_primitive_response(true)
1074
+ .local_error('422',
1075
+ 'Unprocessable Entity (WebDAV)',
1076
+ SubscriptionRemoveCouponErrorsException))
1077
+ .execute
1078
+ end
1079
+
1080
+ # This method will return an array of subscriptions from a Site. Pay close
1081
+ # attention to query string filters and pagination in order to control
1082
+ # responses from the server.
1083
+ # ## Search for a subscription
1084
+ # Use the query strings below to search for a subscription using the
1085
+ # criteria available. The return value will be an array.
1086
+ # ## Self-Service Page token
1087
+ # Self-Service Page token for the subscriptions is not returned by default.
1088
+ # If this information is desired, the include[]=self_service_page_token
1089
+ # parameter must be provided with the request.
1090
+ # @param [Integer] page Optional parameter: Result records are organized in
1091
+ # pages. By default, the first page of results is displayed. The page
1092
+ # parameter specifies a page number of results to fetch. You can start
1093
+ # navigating through the pages to consume the results. You do this by
1094
+ # passing in a page parameter. Retrieve the next page by adding ?page=2 to
1095
+ # the query string. If there are no results to return, then an empty result
1096
+ # set will be returned. Use in query `page=1`.
1097
+ # @param [Integer] per_page Optional parameter: This parameter indicates how
1098
+ # many records to fetch in each request. Default value is 20. The maximum
1099
+ # allowed values is 200; any per_page value over 200 will be changed to 200.
1100
+ # Use in query `per_page=200`.
1101
+ # @param [SubscriptionState] state Optional parameter: The current state of
1102
+ # the subscription
1103
+ # @param [Integer] product Optional parameter: The product id of the
1104
+ # subscription. (Note that the product handle cannot be used.)
1105
+ # @param [Integer] product_price_point_id Optional parameter: The ID of the
1106
+ # product price point. If supplied, product is required
1107
+ # @param [Integer] coupon Optional parameter: The numeric id of the coupon
1108
+ # currently applied to the subscription. (This can be found in the URL when
1109
+ # editing a coupon. Note that the coupon code cannot be used.)
1110
+ # @param [SubscriptionDateField] date_field Optional parameter: The type of
1111
+ # filter you'd like to apply to your search. Allowed Values: ,
1112
+ # current_period_ends_at, current_period_starts_at, created_at,
1113
+ # activated_at, canceled_at, expires_at, trial_started_at, trial_ended_at,
1114
+ # updated_at
1115
+ # @param [Date] start_date Optional parameter: The start date (format
1116
+ # YYYY-MM-DD) with which to filter the date_field. Returns subscriptions
1117
+ # with a timestamp at or after midnight (12:00:00 AM) in your site’s time
1118
+ # zone on the date specified. Use in query `start_date=2022-07-01`.
1119
+ # @param [Date] end_date Optional parameter: The end date (format
1120
+ # YYYY-MM-DD) with which to filter the date_field. Returns subscriptions
1121
+ # with a timestamp up to and including 11:59:59PM in your site’s time zone
1122
+ # on the date specified. Use in query `end_date=2022-08-01`.
1123
+ # @param [DateTime] start_datetime Optional parameter: The start date and
1124
+ # time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field.
1125
+ # Returns subscriptions with a timestamp at or after exact time provided in
1126
+ # query. You can specify timezone in query - otherwise your site's time zone
1127
+ # will be used. If provided, this parameter will be used instead of
1128
+ # start_date. Use in query `start_datetime=2022-07-01 09:00:05`.
1129
+ # @param [DateTime] end_datetime Optional parameter: The end date and time
1130
+ # (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns
1131
+ # subscriptions with a timestamp at or before exact time provided in query.
1132
+ # You can specify timezone in query - otherwise your site's time zone will
1133
+ # be used. If provided, this parameter will be used instead of end_date. Use
1134
+ # in query `end_datetime=2022-08-01 10:00:05`.
1135
+ # @param [Hash[String, String]] metadata Optional parameter: The value of
1136
+ # the metadata field specified in the parameter. Use in query
1137
+ # `metadata[my-field]=value&metadata[other-field]=another_value`.
1138
+ # @param [SortingDirection | nil] direction Optional parameter: Controls the
1139
+ # order in which results are returned. Use in query `direction=asc`.
1140
+ # @param [SubscriptionSort] sort Optional parameter: The attribute by which
1141
+ # to sort
1142
+ # @return [Array[SubscriptionResponse]] response from the API call.
1143
+ def list_subscriptions(options = {})
1144
+ new_api_call_builder
1145
+ .request(new_request_builder(HttpMethodEnum::GET,
1146
+ '/subscriptions.json',
1147
+ Server::DEFAULT)
1148
+ .query_param(new_parameter(options['page'], key: 'page'))
1149
+ .query_param(new_parameter(options['per_page'], key: 'per_page'))
1150
+ .query_param(new_parameter(options['state'], key: 'state'))
1151
+ .query_param(new_parameter(options['product'], key: 'product'))
1152
+ .query_param(new_parameter(options['product_price_point_id'], key: 'product_price_point_id'))
1153
+ .query_param(new_parameter(options['coupon'], key: 'coupon'))
1154
+ .query_param(new_parameter(options['date_field'], key: 'date_field'))
1155
+ .query_param(new_parameter(options['start_date'], key: 'start_date'))
1156
+ .query_param(new_parameter(options['end_date'], key: 'end_date'))
1157
+ .query_param(new_parameter(options['start_datetime'], key: 'start_datetime'))
1158
+ .query_param(new_parameter(options['end_datetime'], key: 'end_datetime'))
1159
+ .query_param(new_parameter(options['metadata'], key: 'metadata'))
1160
+ .query_param(new_parameter(options['direction'], key: 'direction')
1161
+ .validator(proc do |value|
1162
+ UnionTypeLookUp.get(:ListSubscriptionsInputDirection)
1163
+ .validate(value)
1164
+ end))
1165
+ .query_param(new_parameter(options['sort'], key: 'sort'))
1166
+ .header_param(new_parameter('application/json', key: 'accept'))
1167
+ .auth(Single.new('BasicAuth'))
1168
+ .array_serialization_format(ArraySerializationFormat::UN_INDEXED))
1169
+ .response(new_response_handler
1170
+ .is_nullify404(true)
1171
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1172
+ .deserialize_into(SubscriptionResponse.method(:from_hash))
1173
+ .is_response_array(true))
1174
+ .execute
1175
+ end
1176
+
1177
+ # The subscription endpoint allows you to instantly update one or many
1178
+ # attributes about a subscription in a single call.
1179
+ # ## Update Subscription Payment Method
1180
+ # Change the card that your Subscriber uses for their subscription. You can
1181
+ # also use this method to simply change the expiration date of the card **if
1182
+ # your gateway allows**.
1183
+ # Note that partial card updates for **Authorize.Net** are not allowed via
1184
+ # this endpoint. The existing Payment Profile must be directly updated
1185
+ # instead.
1186
+ # You also use this method to change the subscription to a different product
1187
+ # by setting a new value for product_handle. A product change can be done in
1188
+ # two different ways, **product change** or **delayed product change**.
1189
+ # ## Product Change
1190
+ # This endpoint may be used to change a subscription's product. The new
1191
+ # payment amount is calculated and charged at the normal start of the next
1192
+ # period. If you desire complex product changes or prorated upgrades and
1193
+ # downgrades instead, please see the documentation on Migrating Subscription
1194
+ # Products.
1195
+ # To perform a product change, simply set either the `product_handle` or
1196
+ # `product_id` attribute to that of a different product from the same site
1197
+ # as the subscription. You can also change the price point by passing in
1198
+ # either `product_price_point_id` or `product_price_point_handle` -
1199
+ # otherwise the new product's default price point will be used.
1200
+ # ### Delayed Product Change
1201
+ # This method also changes the product and/or price point, and the new
1202
+ # payment amount is calculated and charged at the normal start of the next
1203
+ # period.
1204
+ # This method schedules the product change to happen automatically at the
1205
+ # subscription’s next renewal date. To perform a Delayed Product Change, set
1206
+ # the `product_handle` attribute as you would in a regular product change,
1207
+ # but also set the `product_change_delayed` attribute to `true`. No
1208
+ # proration applies in this case.
1209
+ # You can also perform a delayed change to the price point by passing in
1210
+ # either `product_price_point_id` or `product_price_point_handle`
1211
+ # **Note: To cancel a delayed product change, set `next_product_id` to an
1212
+ # empty string.**
1213
+ # ## Billing Date Changes
1214
+ # ### Regular Billing Date Changes
1215
+ # Send the `next_billing_at` to set the next billing date for the
1216
+ # subscription. After that date passes and the subscription is processed,
1217
+ # the following billing date will be set according to the subscription's
1218
+ # product period.
1219
+ # Note that if you pass an invalid date, we will automatically interpret and
1220
+ # set the correct date. For example, when February 30 is entered, the next
1221
+ # billing will be set to March 2nd in a non-leap year.
1222
+ # The server response will not return data under the key/value pair of
1223
+ # `next_billing`. Please view the key/value pair of `current_period_ends_at`
1224
+ # to verify that the `next_billing` date has been changed successfully.
1225
+ # ### Snap Day Changes
1226
+ # For a subscription using Calendar Billing, setting the next billing date
1227
+ # is a bit different. Send the `snap_day` attribute to change the calendar
1228
+ # billing date for **a subscription using a product eligible for calendar
1229
+ # billing**.
1230
+ # Note: If you change the product associated with a subscription that
1231
+ # contains a `snap_date` and immediately `READ/GET` the subscription data,
1232
+ # it will still contain evidence of the existing `snap_date`. This is due to
1233
+ # the fact that a product change is instantanous and only affects the
1234
+ # product associated with a subscription. After the `next_billing` date
1235
+ # arrives, the `snap_day` associated with the subscription will return to
1236
+ # `null.` Another way of looking at this is that you willl have to wait for
1237
+ # the next billing cycle to arrive before the `snap_date` will reset to
1238
+ # `null`.
1239
+ # @param [String] subscription_id Required parameter: The Chargify id of the
1240
+ # subscription
1241
+ # @param [UpdateSubscriptionRequest] body Optional parameter: Example:
1242
+ # @return [SubscriptionResponse] response from the API call.
1243
+ def update_subscription(subscription_id,
1244
+ body: nil)
1245
+ new_api_call_builder
1246
+ .request(new_request_builder(HttpMethodEnum::PUT,
1247
+ '/subscriptions/{subscription_id}.json',
1248
+ Server::DEFAULT)
1249
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
1250
+ .is_required(true)
1251
+ .should_encode(true))
1252
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
1253
+ .body_param(new_parameter(body))
1254
+ .header_param(new_parameter('application/json', key: 'accept'))
1255
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
1256
+ .auth(Single.new('BasicAuth')))
1257
+ .response(new_response_handler
1258
+ .is_nullify404(true)
1259
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1260
+ .deserialize_into(SubscriptionResponse.method(:from_hash))
1261
+ .local_error('422',
1262
+ 'Unprocessable Entity (WebDAV)',
1263
+ ErrorListResponseException))
1264
+ .execute
1265
+ end
1266
+
1267
+ # Use this endpoint to find a subscription by its reference.
1268
+ # @param [String] reference Optional parameter: Subscription reference
1269
+ # @return [SubscriptionResponse] response from the API call.
1270
+ def read_subscription_by_reference(reference: nil)
1271
+ new_api_call_builder
1272
+ .request(new_request_builder(HttpMethodEnum::GET,
1273
+ '/subscriptions/lookup.json',
1274
+ Server::DEFAULT)
1275
+ .query_param(new_parameter(reference, key: 'reference'))
1276
+ .header_param(new_parameter('application/json', key: 'accept'))
1277
+ .auth(Single.new('BasicAuth')))
1278
+ .response(new_response_handler
1279
+ .is_nullify404(true)
1280
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1281
+ .deserialize_into(SubscriptionResponse.method(:from_hash)))
1282
+ .execute
1283
+ end
1284
+
1285
+ # Use this endpoint to update a subscription's prepaid configuration.
1286
+ # @param [String] subscription_id Required parameter: The Chargify id of the
1287
+ # subscription
1288
+ # @param [UpsertPrepaidConfigurationRequest] body Optional parameter:
1289
+ # Example:
1290
+ # @return [PrepaidConfigurationResponse] response from the API call.
1291
+ def create_prepaid_subscription(subscription_id,
1292
+ body: nil)
1293
+ new_api_call_builder
1294
+ .request(new_request_builder(HttpMethodEnum::POST,
1295
+ '/subscriptions/{subscription_id}/prepaid_configurations.json',
1296
+ Server::DEFAULT)
1297
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
1298
+ .is_required(true)
1299
+ .should_encode(true))
1300
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
1301
+ .body_param(new_parameter(body))
1302
+ .header_param(new_parameter('application/json', key: 'accept'))
1303
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
1304
+ .auth(Single.new('BasicAuth')))
1305
+ .response(new_response_handler
1306
+ .is_nullify404(true)
1307
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1308
+ .deserialize_into(PrepaidConfigurationResponse.method(:from_hash)))
1309
+ .execute
1310
+ end
1311
+
1312
+ # An existing subscription can accommodate multiple discounts/coupon codes.
1313
+ # This is only applicable if each coupon is stackable. For more information
1314
+ # on stackable coupons, we recommend reviewing our [coupon
1315
+ # documentation.](https://chargify.zendesk.com/hc/en-us/articles/44077559095
1316
+ # 31#stackable-coupons)
1317
+ # ## Query Parameters vs Request Body Parameters
1318
+ # Passing in a coupon code as a query parameter will add the code to the
1319
+ # subscription, completely replacing all existing coupon codes on the
1320
+ # subscription.
1321
+ # For this reason, using this query parameter on this endpoint has been
1322
+ # deprecated in favor of using the request body parameters as described
1323
+ # below. When passing in request body parameters, the list of coupon codes
1324
+ # will simply be added to any existing list of codes on the subscription.
1325
+ # @param [String] subscription_id Required parameter: The Chargify id of the
1326
+ # subscription
1327
+ # @param [String] code Optional parameter: A code for the coupon that would
1328
+ # be applied to a subscription
1329
+ # @param [AddCouponsRequest] body Optional parameter: Example:
1330
+ # @return [SubscriptionResponse] response from the API call.
1331
+ def apply_coupon_to_subscription(subscription_id,
1332
+ code: nil,
1333
+ body: nil)
1334
+ new_api_call_builder
1335
+ .request(new_request_builder(HttpMethodEnum::POST,
1336
+ '/subscriptions/{subscription_id}/add_coupon.json',
1337
+ Server::DEFAULT)
1338
+ .template_param(new_parameter(subscription_id, key: 'subscription_id')
1339
+ .is_required(true)
1340
+ .should_encode(true))
1341
+ .header_param(new_parameter('application/json', key: 'Content-Type'))
1342
+ .query_param(new_parameter(code, key: 'code'))
1343
+ .body_param(new_parameter(body))
1344
+ .header_param(new_parameter('application/json', key: 'accept'))
1345
+ .body_serializer(proc do |param| param.to_json unless param.nil? end)
1346
+ .auth(Single.new('BasicAuth')))
1347
+ .response(new_response_handler
1348
+ .is_nullify404(true)
1349
+ .deserializer(APIHelper.method(:custom_type_deserializer))
1350
+ .deserialize_into(SubscriptionResponse.method(:from_hash))
1351
+ .local_error('422',
1352
+ 'Unprocessable Entity (WebDAV)',
1353
+ SubscriptionAddCouponErrorException))
1354
+ .execute
1355
+ end
1356
+ end
1357
+ end