lib/recurly/client/operations.rb in recurly-4.1.0 vs lib/recurly/client/operations.rb in recurly-4.2.0

- old
+ new

@@ -103,11 +103,10 @@ # :email [String] Filter for accounts with this exact email address. A blank value will return accounts with both +null+ and +""+ email addresses. Note that multiple accounts can share one email address. # :subscriber [Boolean] Filter for accounts with or without a subscription in the +active+, # +canceled+, or +future+ state. # # :past_due [String] Filter for accounts with an invoice in the +past_due+ state. - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::Account>] A list of the site's accounts. # @example # params = { # limit: 200 @@ -116,21 +115,20 @@ # accounts.each do |account| # puts "Account: #{account.code}" # end # def list_accounts(**options) - path = interpolate_path("/accounts") + path = "/accounts" pager(path, **options) end # Create an account # # {https://developers.recurly.com/api/v2021-02-25#operation/create_account create_account api documenation} # # @param body [Requests::AccountCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AccountCreate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Account] An account. # @example # begin # account_create = { @@ -166,21 +164,20 @@ # # why. You can find the invalid params and reasons in e.recurly_error.params # puts "ValidationError: #{e.recurly_error.params}" # end # def create_account(body:, **options) - path = interpolate_path("/accounts") + path = "/accounts" post(path, body, Requests::AccountCreate, **options) end # Fetch an account # # {https://developers.recurly.com/api/v2021-02-25#operation/get_account get_account api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Account] An account. # @example # begin # account = @client.get_account(account_id: account_id) @@ -201,11 +198,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/update_account update_account api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param body [Requests::AccountUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AccountUpdate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Account] An account. # @example # begin # account_update = { @@ -232,11 +228,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_account deactivate_account api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Account] An account. # @example # begin # account = @client.deactivate_account(account_id: account_id) @@ -256,11 +251,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/get_account_acquisition get_account_acquisition api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::AccountAcquisition] An account's acquisition data. # @example # begin # @client.get_account_acquisition(account_id: account_id) @@ -281,11 +275,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/update_account_acquisition update_account_acquisition api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param body [Requests::AccountAcquisitionUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AccountAcquisitionUpdate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::AccountAcquisition] An account's updated acquisition data. # @example # begin # acquisition_update = { @@ -317,11 +310,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/remove_account_acquisition remove_account_acquisition api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Empty] Acquisition data was succesfully deleted. # @example # begin # acquisition = @client.remove_account_acquisition(account_id: account_id) @@ -341,11 +333,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/reactivate_account reactivate_account api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Account] An account. # @example # begin # account = @client.reactivate_account(account_id: account_id) @@ -365,11 +356,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/get_account_balance get_account_balance api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::AccountBalance] An account's balance. # @example # begin # balance = @client.get_account_balance(account_id: account_id) @@ -389,11 +379,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/get_billing_info get_billing_info api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::BillingInfo] An account's billing information. # @example # begin # billing = @client.get_billing_info(account_id: account_id) @@ -414,11 +403,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/update_billing_info update_billing_info api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param body [Requests::BillingInfoCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoCreate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::BillingInfo] Updated billing information. # @example # begin # billing_update = { @@ -445,11 +433,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/remove_billing_info remove_billing_info api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Empty] Billing information deleted # @example # begin # @client.remove_billing_info(account_id: account_id) @@ -491,11 +478,10 @@ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+. # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::BillingInfo>] A list of the the billing information for an account's # def list_billing_infos(account_id:, **options) path = interpolate_path("/accounts/{account_id}/billing_infos", account_id: account_id) @@ -507,11 +493,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/create_billing_info create_billing_info api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param body [Requests::BillingInfoCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoCreate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::BillingInfo] Updated billing information. # def create_billing_info(account_id:, body:, **options) path = interpolate_path("/accounts/{account_id}/billing_infos", account_id: account_id) @@ -523,11 +508,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/get_a_billing_info get_a_billing_info api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param billing_info_id [String] Billing Info ID. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::BillingInfo] A billing info. # def get_a_billing_info(account_id:, billing_info_id:, **options) path = interpolate_path("/accounts/{account_id}/billing_infos/{billing_info_id}", account_id: account_id, billing_info_id: billing_info_id) @@ -540,11 +524,10 @@ # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param billing_info_id [String] Billing Info ID. # @param body [Requests::BillingInfoCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::BillingInfoCreate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::BillingInfo] Updated billing information. # def update_a_billing_info(account_id:, billing_info_id:, body:, **options) path = interpolate_path("/accounts/{account_id}/billing_infos/{billing_info_id}", account_id: account_id, billing_info_id: billing_info_id) @@ -556,11 +539,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/remove_a_billing_info remove_a_billing_info api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param billing_info_id [String] Billing Info ID. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Empty] Billing information deleted # def remove_a_billing_info(account_id:, billing_info_id:, **options) path = interpolate_path("/accounts/{account_id}/billing_infos/{billing_info_id}", account_id: account_id, billing_info_id: billing_info_id) @@ -594,11 +576,10 @@ # # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+. # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :state [String] Filter by state. - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::CouponRedemption>] A list of the the coupon redemptions on an account. # @example # params = { # limit: 200 @@ -620,11 +601,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/list_active_coupon_redemptions list_active_coupon_redemptions api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::CouponRedemption>] Active coupon redemptions on an account. # @example # params = { # limit: 200 @@ -644,11 +624,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/create_coupon_redemption create_coupon_redemption api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param body [Requests::CouponRedemptionCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponRedemptionCreate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::CouponRedemption] Returns the new coupon redemption. # @example # begin # redemption_create = { @@ -675,11 +654,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/remove_coupon_redemption remove_coupon_redemption api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::CouponRedemption] Coupon redemption deleted. # @example # begin # @client.remove_coupon_redemption(account_id: account_id) @@ -711,11 +689,10 @@ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+. # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::CreditPayment>] A list of the account's credit payments. # @example # params = { # limit: 200 @@ -767,11 +744,10 @@ # - +type=charge+, only charge invoices will be returned. # - +type=credit+, only credit invoices will be returned. # - +type=non-legacy+, only charge and credit invoices will be returned. # - +type=legacy+, only legacy invoices will be returned. # - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::Invoice>] A list of the account's invoices. # @example # params = { # limit: 200 @@ -794,11 +770,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/create_invoice create_invoice api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param body [Requests::InvoiceCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceCreate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::InvoiceCollection] Returns the new invoices. # @example # begin # invoice_create = { @@ -826,11 +801,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/preview_invoice preview_invoice api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param body [Requests::InvoiceCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceCreate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::InvoiceCollection] Returns the invoice previews. # @example # begin # invoice_preview = { @@ -884,11 +858,10 @@ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :original [String] Filter by original field. # :state [String] Filter by state field. # :type [String] Filter by type field. - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::LineItem>] A list of the account's line items. # @example # params = { # limit: 200 @@ -911,11 +884,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/create_line_item create_line_item api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param body [Requests::LineItemCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::LineItemCreate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::LineItem] Returns the new line item. # @example # begin # line_item_create = { @@ -955,11 +927,10 @@ # * Invalid or unknown IDs will be ignored, so you should check that the # results correspond to your request. # * Records are returned in an arbitrary order. Since results are all # returned at once you can sort the records yourself. # - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::AccountNote>] A list of an account's notes. # @example # params = { # limit: 200 @@ -979,11 +950,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/get_account_note get_account_note api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param account_note_id [String] Account Note ID. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::AccountNote] An account note. # @example # begin # note = @client.get_account_note( @@ -1030,11 +1000,10 @@ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+. # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::ShippingAddress>] A list of an account's shipping addresses. # @example # params = { # limit: 200 @@ -1057,11 +1026,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/create_shipping_address create_shipping_address api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param body [Requests::ShippingAddressCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingAddressCreate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::ShippingAddress] Returns the new shipping address. # @example # begin # shipping_address_create = { @@ -1092,11 +1060,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/get_shipping_address get_shipping_address api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param shipping_address_id [String] Shipping Address ID. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::ShippingAddress] A shipping address. # @example # begin # address = @client.get_shipping_address( @@ -1121,11 +1088,10 @@ # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param shipping_address_id [String] Shipping Address ID. # @param body [Requests::ShippingAddressUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingAddressUpdate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::ShippingAddress] The updated shipping address. # @example # begin # address_update = { @@ -1155,11 +1121,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/remove_shipping_address remove_shipping_address api documenation} # # @param account_id [String] Account ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-bob+. # @param shipping_address_id [String] Shipping Address ID. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Empty] Shipping address deleted. # @example # begin # @client.remove_shipping_address( @@ -1212,11 +1177,10 @@ # # - When +state=active+, +state=canceled+, +state=expired+, or +state=future+, subscriptions with states that match the query and only those subscriptions will be returned. # - When +state=in_trial+, only subscriptions that have a trial_started_at date earlier than now and a trial_ends_at date later than now will be returned. # - When +state=live+, only subscriptions that are in an active, canceled, or future state or are in trial will be returned. # - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::Subscription>] A list of the account's subscriptions. # @example # params = { # limit: 200 @@ -1264,11 +1228,10 @@ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+. # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :type [String] Filter by type field. The value +payment+ will return both +purchase+ and +capture+ transactions. # :success [String] Filter by success field. - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::Transaction>] A list of the account's transactions. # @example # params = { # limit: 200 @@ -1319,11 +1282,10 @@ # :email [String] Filter for accounts with this exact email address. A blank value will return accounts with both +null+ and +""+ email addresses. Note that multiple accounts can share one email address. # :subscriber [Boolean] Filter for accounts with or without a subscription in the +active+, # +canceled+, or +future+ state. # # :past_due [String] Filter for accounts with an invoice in the +past_due+ state. - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::Account>] A list of an account's child accounts. # @example # params = { # limit: 200 @@ -1368,11 +1330,10 @@ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+. # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::AccountAcquisition>] A list of the site's account acquisition data. # @example # params = { # limit: 200 @@ -1381,11 +1342,11 @@ # acquisitions.each do |acquisition| # puts "AccountAcquisition: #{acquisition.cost}" # end # def list_account_acquisition(**options) - path = interpolate_path("/acquisitions") + path = "/acquisitions" pager(path, **options) end # List a site's coupons # @@ -1414,11 +1375,10 @@ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+. # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::Coupon>] A list of the site's coupons. # @example # params = { # limit: 200 @@ -1427,21 +1387,20 @@ # coupons.each do |coupon| # puts "coupon: #{coupon.code}" # end # def list_coupons(**options) - path = interpolate_path("/coupons") + path = "/coupons" pager(path, **options) end # Create a new coupon # # {https://developers.recurly.com/api/v2021-02-25#operation/create_coupon create_coupon api documenation} # # @param body [Requests::CouponCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponCreate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Coupon] A new coupon. # @example # begin # coupon_create = { @@ -1464,21 +1423,20 @@ # # why. You can find the invalid params and reasons in e.recurly_error.params # puts "ValidationError: #{e.recurly_error.params}" # end # def create_coupon(body:, **options) - path = interpolate_path("/coupons") + path = "/coupons" post(path, body, Requests::CouponCreate, **options) end # Fetch a coupon # # {https://developers.recurly.com/api/v2021-02-25#operation/get_coupon get_coupon api documenation} # # @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Coupon] A coupon. # @example # begin # coupon = @client.get_coupon(coupon_id: coupon_id) @@ -1499,11 +1457,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/update_coupon update_coupon api documenation} # # @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+. # @param body [Requests::CouponUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponUpdate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Coupon] The updated coupon. # @example # begin # coupon_update = { @@ -1526,11 +1483,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_coupon deactivate_coupon api documenation} # # @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Coupon] The expired Coupon # @example # begin # coupon = @client.deactivate_coupon(coupon_id: coupon_id) @@ -1551,11 +1507,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/generate_unique_coupon_codes generate_unique_coupon_codes api documenation} # # @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+. # @param body [Requests::CouponBulkCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponBulkCreate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::UniqueCouponCodeParams] A set of parameters that can be passed to the `list_unique_coupon_codes` endpoint to obtain only the newly generated `UniqueCouponCodes`. # def generate_unique_coupon_codes(coupon_id:, body:, **options) path = interpolate_path("/coupons/{coupon_id}/generate", coupon_id: coupon_id) @@ -1567,11 +1522,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/restore_coupon restore_coupon api documenation} # # @param coupon_id [String] Coupon ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-10off+. # @param body [Requests::CouponUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::CouponUpdate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Coupon] The restored coupon. # def restore_coupon(coupon_id:, body:, **options) path = interpolate_path("/coupons/{coupon_id}/restore", coupon_id: coupon_id) @@ -1606,11 +1560,10 @@ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+. # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::UniqueCouponCode>] A list of unique coupon codes that were generated # def list_unique_coupon_codes(coupon_id:, **options) path = interpolate_path("/coupons/{coupon_id}/unique_coupon_codes", coupon_id: coupon_id) @@ -1632,11 +1585,10 @@ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+. # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::CreditPayment>] A list of the site's credit payments. # @example # params = { # limit: 200 @@ -1645,21 +1597,20 @@ # payments.each do |payment| # puts "CreditPayment: #{payment.id}" # end # def list_credit_payments(**options) - path = interpolate_path("/credit_payments") + path = "/credit_payments" pager(path, **options) end # Fetch a credit payment # # {https://developers.recurly.com/api/v2021-02-25#operation/get_credit_payment get_credit_payment api documenation} # # @param credit_payment_id [String] Credit Payment ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::CreditPayment] A credit payment. # def get_credit_payment(credit_payment_id:, **options) path = interpolate_path("/credit_payments/{credit_payment_id}", credit_payment_id: credit_payment_id) @@ -1694,11 +1645,10 @@ # # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+. # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :related_type [String] Filter by related type. - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::CustomFieldDefinition>] A list of the site's custom field definitions. # @example # params = { # limit: 200 @@ -1707,21 +1657,20 @@ # custom_fields.each do |field| # puts "CustomFieldDefinition: #{field.name}" # end # def list_custom_field_definitions(**options) - path = interpolate_path("/custom_field_definitions") + path = "/custom_field_definitions" pager(path, **options) end # Fetch an custom field definition # # {https://developers.recurly.com/api/v2021-02-25#operation/get_custom_field_definition get_custom_field_definition api documenation} # # @param custom_field_definition_id [String] Custom Field Definition ID # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::CustomFieldDefinition] An custom field definition. # @example # begin # custom_field_definition = @client.get_custom_field_definition( @@ -1767,11 +1716,10 @@ # # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+. # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :state [String] Filter by state. - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::Item>] A list of the site's items. # @example # params = { # limit: 200 @@ -1780,21 +1728,20 @@ # items.each do |item| # puts "Item: #{item.code}" # end # def list_items(**options) - path = interpolate_path("/items") + path = "/items" pager(path, **options) end # Create a new item # # {https://developers.recurly.com/api/v2021-02-25#operation/create_item create_item api documenation} # # @param body [Requests::ItemCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ItemCreate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Item] A new item. # @example # begin # item_create = { @@ -1816,21 +1763,20 @@ # # why. You can find the invalid params and reasons in e.recurly_error.params # puts "ValidationError: #{e.recurly_error.params}" # end # def create_item(body:, **options) - path = interpolate_path("/items") + path = "/items" post(path, body, Requests::ItemCreate, **options) end # Fetch an item # # {https://developers.recurly.com/api/v2021-02-25#operation/get_item get_item api documenation} # # @param item_id [String] Item ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-red+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Item] An item. # @example # begin # item = @client.get_item(item_id: item_id) @@ -1851,11 +1797,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/update_item update_item api documenation} # # @param item_id [String] Item ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-red+. # @param body [Requests::ItemUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ItemUpdate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Item] The updated item. # @example # begin # item_update = { @@ -1882,11 +1827,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_item deactivate_item api documenation} # # @param item_id [String] Item ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-red+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Item] An item. # @example # begin # item = @client.deactivate_item(item_id: item_id) @@ -1906,11 +1850,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/reactivate_item reactivate_item api documenation} # # @param item_id [String] Item ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-red+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Item] An item. # @example # begin # item = @client.reactivate_item(item_id: item_id) @@ -1954,41 +1897,38 @@ # # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+. # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :state [String] Filter by state. - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::MeasuredUnit>] A list of the site's measured units. # def list_measured_unit(**options) - path = interpolate_path("/measured_units") + path = "/measured_units" pager(path, **options) end # Create a new measured unit # # {https://developers.recurly.com/api/v2021-02-25#operation/create_measured_unit create_measured_unit api documenation} # # @param body [Requests::MeasuredUnitCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::MeasuredUnitCreate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::MeasuredUnit] A new measured unit. # def create_measured_unit(body:, **options) - path = interpolate_path("/measured_units") + path = "/measured_units" post(path, body, Requests::MeasuredUnitCreate, **options) end # Fetch a measured unit # # {https://developers.recurly.com/api/v2021-02-25#operation/get_measured_unit get_measured_unit api documenation} # # @param measured_unit_id [String] Measured unit ID or name. For ID no prefix is used e.g. +e28zov4fw0v2+. For name use prefix +name-+, e.g. +name-Storage+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::MeasuredUnit] An item. # def get_measured_unit(measured_unit_id:, **options) path = interpolate_path("/measured_units/{measured_unit_id}", measured_unit_id: measured_unit_id) @@ -2000,11 +1940,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/update_measured_unit update_measured_unit api documenation} # # @param measured_unit_id [String] Measured unit ID or name. For ID no prefix is used e.g. +e28zov4fw0v2+. For name use prefix +name-+, e.g. +name-Storage+. # @param body [Requests::MeasuredUnitUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::MeasuredUnitUpdate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::MeasuredUnit] The updated measured_unit. # def update_measured_unit(measured_unit_id:, body:, **options) path = interpolate_path("/measured_units/{measured_unit_id}", measured_unit_id: measured_unit_id) @@ -2015,11 +1954,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/remove_measured_unit remove_measured_unit api documenation} # # @param measured_unit_id [String] Measured unit ID or name. For ID no prefix is used e.g. +e28zov4fw0v2+. For name use prefix +name-+, e.g. +name-Storage+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::MeasuredUnit] A measured unit. # def remove_measured_unit(measured_unit_id:, **options) path = interpolate_path("/measured_units/{measured_unit_id}", measured_unit_id: measured_unit_id) @@ -2059,11 +1997,10 @@ # - +type=charge+, only charge invoices will be returned. # - +type=credit+, only credit invoices will be returned. # - +type=non-legacy+, only charge and credit invoices will be returned. # - +type=legacy+, only legacy invoices will be returned. # - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::Invoice>] A list of the site's invoices. # @example # params = { # limit: 200 @@ -2072,21 +2009,20 @@ # invoices.each do |invoice| # puts "Invoice: #{invoice.number}" # end # def list_invoices(**options) - path = interpolate_path("/invoices") + path = "/invoices" pager(path, **options) end # Fetch an invoice # # {https://developers.recurly.com/api/v2021-02-25#operation/get_invoice get_invoice api documenation} # # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Invoice] An invoice. # @example # begin # invoice = @client.get_invoice(invoice_id: invoice_id) @@ -2107,11 +2043,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/update_invoice update_invoice api documenation} # # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+. # @param body [Requests::InvoiceUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceUpdate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Invoice] An invoice. # @example # begin # invoice_update = { @@ -2135,11 +2070,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/get_invoice_pdf get_invoice_pdf api documenation} # # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::BinaryFile] An invoice as a PDF. # @example # begin # invoice = @client.get_invoice_pdf(invoice_id: invoice_id) @@ -2163,11 +2097,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/collect_invoice collect_invoice api documenation} # # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+. # @param params [Hash] Optional query string parameters: # :body [Requests::InvoiceCollect] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceCollect} - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Invoice] The updated invoice. # @example # begin # invoice = @client.collect_invoice(invoice_id: invoice_id) @@ -2187,11 +2120,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/mark_invoice_failed mark_invoice_failed api documenation} # # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Invoice] The updated invoice. # @example # begin # invoice = @client.mark_invoice_failed(invoice_id: invoice_id) @@ -2211,11 +2143,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/mark_invoice_successful mark_invoice_successful api documenation} # # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Invoice] The updated invoice. # @example # begin # invoice = @client.mark_invoice_successful(invoice_id: invoice_id) @@ -2235,11 +2166,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/reopen_invoice reopen_invoice api documenation} # # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Invoice] The updated invoice. # @example # begin # invoice = @client.reopen_invoice(invoice_id: invoice_id) @@ -2259,11 +2189,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/void_invoice void_invoice api documenation} # # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Invoice] The updated invoice. # @example # begin # invoice = @client.void_invoice(invoice_id: invoice_id) @@ -2284,11 +2213,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/record_external_transaction record_external_transaction api documenation} # # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+. # @param body [Requests::ExternalTransaction] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ExternalTransaction} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Transaction] The recorded transaction. # def record_external_transaction(invoice_id:, body:, **options) path = interpolate_path("/invoices/{invoice_id}/transactions", invoice_id: invoice_id) @@ -2326,11 +2254,10 @@ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :original [String] Filter by original field. # :state [String] Filter by state field. # :type [String] Filter by type field. - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::LineItem>] A list of the invoice's line items. # @example # params = { # limit: 200 @@ -2374,11 +2301,10 @@ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+. # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::CouponRedemption>] A list of the the coupon redemptions associated with the invoice. # @example # params = { # limit: 200 @@ -2400,11 +2326,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/list_related_invoices list_related_invoices api documenation} # # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::Invoice>] A list of the credit or charge invoices associated with the invoice. # @example # params = { # limit: 200 @@ -2427,11 +2352,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/refund_invoice refund_invoice api documenation} # # @param invoice_id [String] Invoice ID or number. For ID no prefix is used e.g. +e28zov4fw0v2+. For number use prefix +number-+, e.g. +number-1000+. # @param body [Requests::InvoiceRefund] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::InvoiceRefund} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Invoice] Returns the new credit invoice. # @example # begin # invoice_refund = { @@ -2484,11 +2408,10 @@ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :original [String] Filter by original field. # :state [String] Filter by state field. # :type [String] Filter by type field. - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::LineItem>] A list of the site's line items. # @example # params = { # limit: 200 @@ -2499,21 +2422,20 @@ # line_items.each do |line_item| # puts "LineItem: #{line_item.id}" # end # def list_line_items(**options) - path = interpolate_path("/line_items") + path = "/line_items" pager(path, **options) end # Fetch a line item # # {https://developers.recurly.com/api/v2021-02-25#operation/get_line_item get_line_item api documenation} # # @param line_item_id [String] Line Item ID. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::LineItem] A line item. # @example # begin # line_item = @client.get_line_item(line_item_id: line_item_id) @@ -2533,11 +2455,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/remove_line_item remove_line_item api documenation} # # @param line_item_id [String] Line Item ID. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Empty] Line item deleted. # @example # begin # @client.remove_line_item( @@ -2583,11 +2504,10 @@ # # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+. # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :state [String] Filter by state. - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::Plan>] A list of plans. # @example # params = { # limit: 200 @@ -2596,21 +2516,20 @@ # plans.each do |plan| # puts "Plan: #{plan.code}" # end # def list_plans(**options) - path = interpolate_path("/plans") + path = "/plans" pager(path, **options) end # Create a plan # # {https://developers.recurly.com/api/v2021-02-25#operation/create_plan create_plan api documenation} # # @param body [Requests::PlanCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PlanCreate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Plan] A plan. # @example # begin # plan_create = { @@ -2637,21 +2556,20 @@ # # why. You can find the invalid params and reasons in e.recurly_error.params # puts "ValidationError: #{e.recurly_error.params}" # end # def create_plan(body:, **options) - path = interpolate_path("/plans") + path = "/plans" post(path, body, Requests::PlanCreate, **options) end # Fetch a plan # # {https://developers.recurly.com/api/v2021-02-25#operation/get_plan get_plan api documenation} # # @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Plan] A plan. # @example # begin # plan = @client.get_plan(plan_id: plan_id) @@ -2672,11 +2590,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/update_plan update_plan api documenation} # # @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+. # @param body [Requests::PlanUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PlanUpdate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Plan] A plan. # @example # begin # plan_update = { @@ -2699,11 +2616,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/remove_plan remove_plan api documenation} # # @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Plan] Plan deleted # @example # begin # plan = @client.remove_plan(plan_id: plan_id) @@ -2748,11 +2664,10 @@ # # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+. # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :state [String] Filter by state. - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::AddOn>] A list of add-ons. # @example # params = { # limit: 200 @@ -2775,11 +2690,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/create_plan_add_on create_plan_add_on api documenation} # # @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+. # @param body [Requests::AddOnCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AddOnCreate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::AddOn] An add-on. # @example # begin # new_add_on = { @@ -2811,11 +2725,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/get_plan_add_on get_plan_add_on api documenation} # # @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+. # @param add_on_id [String] Add-on ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::AddOn] An add-on. # @example # begin # add_on = @client.get_plan_add_on( @@ -2839,11 +2752,10 @@ # # @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+. # @param add_on_id [String] Add-on ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+. # @param body [Requests::AddOnUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::AddOnUpdate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::AddOn] An add-on. # @example # begin # add_on_update = { @@ -2871,11 +2783,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/remove_plan_add_on remove_plan_add_on api documenation} # # @param plan_id [String] Plan ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+. # @param add_on_id [String] Add-on ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::AddOn] Add-on deleted # @example # begin # add_on = @client.remove_plan_add_on( @@ -2922,11 +2833,10 @@ # # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+. # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :state [String] Filter by state. - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::AddOn>] A list of add-ons. # @example # params = { # limit: 200 @@ -2937,21 +2847,20 @@ # add_ons.each do |add_on| # puts "AddOn: #{add_on.code}" # end # def list_add_ons(**options) - path = interpolate_path("/add_ons") + path = "/add_ons" pager(path, **options) end # Fetch an add-on # # {https://developers.recurly.com/api/v2021-02-25#operation/get_add_on get_add_on api documenation} # # @param add_on_id [String] Add-on ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::AddOn] An add-on. # @example # begin # add_on = @client.get_add_on(add_on_id: add_on_id) @@ -2994,11 +2903,10 @@ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+. # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::ShippingMethod>] A list of the site's shipping methods. # @example # params = { # limit: 200 @@ -3009,36 +2917,34 @@ # shipping_methods.each do |shipping_method| # puts "Shipping Method: #{shipping_method.code}" # end # def list_shipping_methods(**options) - path = interpolate_path("/shipping_methods") + path = "/shipping_methods" pager(path, **options) end # Create a new shipping method # # {https://developers.recurly.com/api/v2021-02-25#operation/create_shipping_method create_shipping_method api documenation} # # @param body [Requests::ShippingMethodCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingMethodCreate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::ShippingMethod] A new shipping method. # def create_shipping_method(body:, **options) - path = interpolate_path("/shipping_methods") + path = "/shipping_methods" post(path, body, Requests::ShippingMethodCreate, **options) end # Fetch a shipping method # # {https://developers.recurly.com/api/v2021-02-25#operation/get_shipping_method get_shipping_method api documenation} # # @param shipping_method_id [String] Shipping Method ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-usps_2-day+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::ShippingMethod] A shipping method. # def get_shipping_method(shipping_method_id:, **options) path = interpolate_path("/shipping_methods/{shipping_method_id}", shipping_method_id: shipping_method_id) @@ -3050,11 +2956,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/update_shipping_method update_shipping_method api documenation} # # @param shipping_method_id [String] Shipping Method ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-usps_2-day+. # @param body [Requests::ShippingMethodUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::ShippingMethodUpdate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::ShippingMethod] The updated shipping method. # def update_shipping_method(shipping_method_id:, body:, **options) path = interpolate_path("/shipping_methods/{shipping_method_id}", shipping_method_id: shipping_method_id) @@ -3065,11 +2970,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_shipping_method deactivate_shipping_method api documenation} # # @param shipping_method_id [String] Shipping Method ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-usps_2-day+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::ShippingMethod] A shipping method. # def deactivate_shipping_method(shipping_method_id:, **options) path = interpolate_path("/shipping_methods/{shipping_method_id}", shipping_method_id: shipping_method_id) @@ -3109,11 +3013,10 @@ # # - When +state=active+, +state=canceled+, +state=expired+, or +state=future+, subscriptions with states that match the query and only those subscriptions will be returned. # - When +state=in_trial+, only subscriptions that have a trial_started_at date earlier than now and a trial_ends_at date later than now will be returned. # - When +state=live+, only subscriptions that are in an active, canceled, or future state or are in trial will be returned. # - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::Subscription>] A list of the site's subscriptions. # @example # params = { # limit: 200 @@ -3122,21 +3025,20 @@ # subscriptions.each do |subscription| # puts "Subscription: #{subscription.uuid}" # end # def list_subscriptions(**options) - path = interpolate_path("/subscriptions") + path = "/subscriptions" pager(path, **options) end # Create a new subscription # # {https://developers.recurly.com/api/v2021-02-25#operation/create_subscription create_subscription api documenation} # # @param body [Requests::SubscriptionCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionCreate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Subscription] A subscription. # @example # begin # subscription_create = { @@ -3156,21 +3058,20 @@ # # why. You can find the invalid params and reasons in e.recurly_error.params # puts "ValidationError: #{e.recurly_error.params}" # end # def create_subscription(body:, **options) - path = interpolate_path("/subscriptions") + path = "/subscriptions" post(path, body, Requests::SubscriptionCreate, **options) end # Fetch a subscription # # {https://developers.recurly.com/api/v2021-02-25#operation/get_subscription get_subscription api documenation} # # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Subscription] A subscription. # @example # begin # subscription = @client.get_subscription( @@ -3193,11 +3094,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/update_subscription update_subscription api documenation} # # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+. # @param body [Requests::SubscriptionUpdate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionUpdate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Subscription] A subscription. # @example # begin # subscription_update = { @@ -3235,11 +3135,10 @@ # In the event that the most recent invoice is a $0 invoice paid entirely by credit, Recurly will apply the credit back to the customer’s account. # # You may also terminate a subscription with no refund and then manually refund specific invoices. # # :charge [Boolean] Applicable only if the subscription has usage based add-ons and unbilled usage logged for the current billing cycle. If true, current billing cycle unbilled usage is billed on the final invoice. If false, Recurly will create a negative usage record for current billing cycle usage that will zero out the final invoice line items. - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Subscription] An expired subscription. # @example # begin # subscription = @client.terminate_subscription( @@ -3262,11 +3161,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/cancel_subscription cancel_subscription api documenation} # # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+. # @param params [Hash] Optional query string parameters: # :body [Requests::SubscriptionCancel] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionCancel} - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Subscription] A canceled or failed subscription. # @example # begin # subscription = @client.cancel_subscription( @@ -3288,11 +3186,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/reactivate_subscription reactivate_subscription api documenation} # # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Subscription] An active subscription. # @example # begin # subscription = @client.reactivate_subscription( @@ -3315,11 +3212,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/pause_subscription pause_subscription api documenation} # # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+. # @param body [Requests::SubscriptionPause] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionPause} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Subscription] A subscription. # @example # begin # subscription_pause = { @@ -3345,11 +3241,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/resume_subscription resume_subscription api documenation} # # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Subscription] A subscription. # @example # begin # subscription = @client.resume_subscription( @@ -3371,11 +3266,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/convert_trial convert_trial api documenation} # # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Subscription] A subscription. # def convert_trial(subscription_id:, **options) path = interpolate_path("/subscriptions/{subscription_id}/convert_trial", subscription_id: subscription_id) @@ -3386,11 +3280,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/get_subscription_change get_subscription_change api documenation} # # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::SubscriptionChange] A subscription's pending change. # @example # begin # change = @client.get_subscription_change( @@ -3413,11 +3306,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/create_subscription_change create_subscription_change api documenation} # # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+. # @param body [Requests::SubscriptionChangeCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionChangeCreate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::SubscriptionChange] A subscription change. # @example # begin # change_create = { @@ -3444,11 +3336,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/remove_subscription_change remove_subscription_change api documenation} # # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Empty] Subscription change was deleted. # @example # begin # @client.remove_subscription_change( @@ -3471,11 +3362,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/preview_subscription_change preview_subscription_change api documenation} # # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+. # @param body [Requests::SubscriptionChangeCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::SubscriptionChangeCreate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::SubscriptionChange] A subscription change. # def preview_subscription_change(subscription_id:, body:, **options) path = interpolate_path("/subscriptions/{subscription_id}/change/preview", subscription_id: subscription_id) @@ -3516,11 +3406,10 @@ # - +type=charge+, only charge invoices will be returned. # - +type=credit+, only credit invoices will be returned. # - +type=non-legacy+, only charge and credit invoices will be returned. # - +type=legacy+, only legacy invoices will be returned. # - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::Invoice>] A list of the subscription's invoices. # @example # params = { # limit: 200 @@ -3569,11 +3458,10 @@ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :original [String] Filter by original field. # :state [String] Filter by state field. # :type [String] Filter by type field. - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::LineItem>] A list of the subscription's line items. # @example # params = { # limit: 200 @@ -3617,11 +3505,10 @@ # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+. # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::CouponRedemption>] A list of the the coupon redemptions on a subscription. # @example # params = { # limit: 200 @@ -3669,11 +3556,10 @@ # # :end_time [DateTime] Inclusively filter by end_time when +sort=usage_timestamp+ or +sort=recorded_timestamp+. # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :billing_status [String] Filter by usage record's billing status - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::Usage>] A list of the subscription add-on's usage records. # def list_usage(subscription_id:, add_on_id:, **options) path = interpolate_path("/subscriptions/{subscription_id}/add_ons/{add_on_id}/usage", subscription_id: subscription_id, add_on_id: add_on_id) @@ -3686,11 +3572,10 @@ # # @param subscription_id [String] Subscription ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+. # @param add_on_id [String] Add-on ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-gold+. # @param body [Requests::UsageCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::UsageCreate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Usage] The created usage record. # def create_usage(subscription_id:, add_on_id:, body:, **options) path = interpolate_path("/subscriptions/{subscription_id}/add_ons/{add_on_id}/usage", subscription_id: subscription_id, add_on_id: add_on_id) @@ -3701,11 +3586,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/get_usage get_usage api documenation} # # @param usage_id [String] Usage Record ID. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Usage] The usage record. # def get_usage(usage_id:, **options) path = interpolate_path("/usage/{usage_id}", usage_id: usage_id) @@ -3717,11 +3601,10 @@ # {https://developers.recurly.com/api/v2021-02-25#operation/update_usage update_usage api documenation} # # @param usage_id [String] Usage Record ID. # @param body [Requests::UsageCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::UsageCreate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Usage] The updated usage record. # def update_usage(usage_id:, body:, **options) path = interpolate_path("/usage/{usage_id}", usage_id: usage_id) @@ -3732,11 +3615,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/remove_usage remove_usage api documenation} # # @param usage_id [String] Usage Record ID. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Empty] Usage was successfully deleted. # def remove_usage(usage_id:, **options) path = interpolate_path("/usage/{usage_id}", usage_id: usage_id) @@ -3772,11 +3654,10 @@ # :end_time [DateTime] Inclusively filter by end_time when +sort=created_at+ or +sort=updated_at+. # *Note:* this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC. # # :type [String] Filter by type field. The value +payment+ will return both +purchase+ and +capture+ transactions. # :success [String] Filter by success field. - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Pager<Resources::Transaction>] A list of the site's transactions. # @example # params = { # limit: 200 @@ -3785,21 +3666,20 @@ # transactions.each do |transaction| # puts "Transaction: #{transaction.uuid}" # end # def list_transactions(**options) - path = interpolate_path("/transactions") + path = "/transactions" pager(path, **options) end # Fetch a transaction # # {https://developers.recurly.com/api/v2021-02-25#operation/get_transaction get_transaction api documenation} # # @param transaction_id [String] Transaction ID or UUID. For ID no prefix is used e.g. +e28zov4fw0v2+. For UUID use prefix +uuid-+, e.g. +uuid-123457890+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::Transaction] A transaction. # @example # begin # transaction = @client.get_transaction(transaction_id: transaction_id) @@ -3819,11 +3699,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/get_unique_coupon_code get_unique_coupon_code api documenation} # # @param unique_coupon_code_id [String] Unique Coupon Code ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-abc-8dh2-def+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::UniqueCouponCode] A unique coupon code. # def get_unique_coupon_code(unique_coupon_code_id:, **options) path = interpolate_path("/unique_coupon_codes/{unique_coupon_code_id}", unique_coupon_code_id: unique_coupon_code_id) @@ -3834,11 +3713,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/deactivate_unique_coupon_code deactivate_unique_coupon_code api documenation} # # @param unique_coupon_code_id [String] Unique Coupon Code ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-abc-8dh2-def+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::UniqueCouponCode] A unique coupon code. # def deactivate_unique_coupon_code(unique_coupon_code_id:, **options) path = interpolate_path("/unique_coupon_codes/{unique_coupon_code_id}", unique_coupon_code_id: unique_coupon_code_id) @@ -3849,11 +3727,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/reactivate_unique_coupon_code reactivate_unique_coupon_code api documenation} # # @param unique_coupon_code_id [String] Unique Coupon Code ID or code. For ID no prefix is used e.g. +e28zov4fw0v2+. For code use prefix +code-+, e.g. +code-abc-8dh2-def+. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::UniqueCouponCode] A unique coupon code. # def reactivate_unique_coupon_code(unique_coupon_code_id:, **options) path = interpolate_path("/unique_coupon_codes/{unique_coupon_code_id}/restore", unique_coupon_code_id: unique_coupon_code_id) @@ -3864,11 +3741,10 @@ # # {https://developers.recurly.com/api/v2021-02-25#operation/create_purchase create_purchase api documenation} # # @param body [Requests::PurchaseCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PurchaseCreate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::InvoiceCollection] Returns the new invoices # @example # begin # purchase = { @@ -3895,21 +3771,20 @@ # # why. You can find the invalid params and reasons in e.recurly_error.params # puts "ValidationError: #{e.recurly_error.params}" # end # def create_purchase(body:, **options) - path = interpolate_path("/purchases") + path = "/purchases" post(path, body, Requests::PurchaseCreate, **options) end # Preview a new purchase # # {https://developers.recurly.com/api/v2021-02-25#operation/preview_purchase preview_purchase api documenation} # # @param body [Requests::PurchaseCreate] The Hash representing the JSON request to send to the server. It should conform to the schema of {Requests::PurchaseCreate} # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::InvoiceCollection] Returns preview of the new invoices # @example # begin # purchase = { @@ -3936,20 +3811,19 @@ # # why. You can find the invalid params and reasons in e.recurly_error.params # puts "ValidationError: #{e.recurly_error.params}" # end # def preview_purchase(body:, **options) - path = interpolate_path("/purchases/preview") + path = "/purchases/preview" post(path, body, Requests::PurchaseCreate, **options) end # List the dates that have an available export to download. # # {https://developers.recurly.com/api/v2021-02-25#operation/get_export_dates get_export_dates api documenation} # # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::ExportDates] Returns a list of dates. # @example # begin # export_dates = @client.get_export_dates() @@ -3961,20 +3835,19 @@ # # just return nil # puts "Resource Not Found" # end # def get_export_dates(**options) - path = interpolate_path("/export_dates") + path = "/export_dates" get(path, **options) end # List of the export files that are available to download. # # {https://developers.recurly.com/api/v2021-02-25#operation/get_export_files get_export_files api documenation} # # @param export_date [String] Date for which to get a list of available automated export files. Date must be in YYYY-MM-DD format. # @param params [Hash] Optional query string parameters: - # :site_id [String] Site ID or subdomain. For ID no prefix is used e.g. +e28zov4fw0v2+. For subdomain use prefix +subdomain-+, e.g. +subdomain-recurly+. # # @return [Resources::ExportFiles] Returns a list of export files to download. # @example # begin # export_files = @client.get_export_files(export_date: export_date)