From 95d868e08cd5f671ea95c279ca94fa6ba0cc68d1 Mon Sep 17 00:00:00 2001 From: maxio-sdk Date: Thu, 17 Jul 2025 11:10:12 +0000 Subject: [PATCH] Automated commit message --- README.md | 133 ++++++++------- advanced_billing.gemspec | 4 +- doc/api-helper.md | 12 ++ doc/client.md | 24 +-- doc/controllers/advance-invoice.md | 3 + doc/controllers/api-exports.md | 21 ++- doc/controllers/billing-portal.md | 4 + doc/controllers/component-price-points.md | 19 ++- doc/controllers/components.md | 32 +++- doc/controllers/coupons.md | 25 ++- doc/controllers/custom-fields.md | 23 ++- doc/controllers/customers.md | 10 +- .../events-based-billing-segments.md | 9 +- doc/controllers/events.md | 21 ++- doc/controllers/insights.md | 14 +- doc/controllers/invoices.md | 114 +++++-------- doc/controllers/offers.md | 7 +- doc/controllers/payment-profiles.md | 20 ++- doc/controllers/product-families.md | 8 +- doc/controllers/product-price-points.md | 19 ++- doc/controllers/products.md | 10 +- doc/controllers/proforma-invoices.md | 38 +++-- doc/controllers/reason-codes.md | 15 +- doc/controllers/referral-codes.md | 1 + doc/controllers/sales-commissions.md | 21 ++- doc/controllers/sites.md | 8 +- doc/controllers/subscription-components.md | 23 ++- .../subscription-group-invoice-account.md | 8 +- doc/controllers/subscription-group-status.md | 1 + doc/controllers/subscription-groups.md | 12 +- .../subscription-invoice-account.md | 88 +++++++++- doc/controllers/subscription-notes.md | 8 +- doc/controllers/subscription-products.md | 2 + doc/controllers/subscription-status.md | 12 +- doc/controllers/subscriptions.md | 68 +++----- doc/controllers/webhooks.md | 10 +- doc/date-time-helper.md | 22 +++ doc/http-request.md | 10 +- doc/http-response.md | 10 +- doc/models/apple-pay-payment-profile.md | 2 + doc/models/bank-account-payment-profile.md | 4 +- doc/models/chargify-ebb.md | 2 +- doc/models/component.md | 1 + doc/models/coupon-request.md | 4 +- doc/models/create-component-price-point.md | 2 +- doc/models/create-or-update-product.md | 2 +- ...ate-prepaid-usage-component-price-point.md | 2 +- doc/models/create-product-price-point.md | 2 +- doc/models/create-subscription-request.md | 1 + doc/models/create-subscription.md | 12 +- doc/models/credit-card-payment-profile.md | 2 + doc/models/ebb-component.md | 2 +- doc/models/group-billing.md | 6 +- doc/models/issue-invoice-request.md | 2 +- doc/models/list-components-filter.md | 2 +- doc/models/list-coupons-filter.md | 2 +- doc/models/list-mrr-filter.md | 2 +- doc/models/list-products-filter.md | 2 +- doc/models/list-service-credits-response.md | 36 ++++ .../list-subscription-components-filter.md | 2 +- ...subscription-components-for-site-filter.md | 2 +- doc/models/metered-component.md | 2 +- doc/models/on-off-component.md | 2 +- doc/models/override-subscription.md | 2 +- doc/models/paypal-payment-profile.md | 2 + .../prepaid-product-price-point-filter.md | 2 +- doc/models/prepaid-usage-component.md | 2 +- doc/models/quantity-based-component.md | 2 +- doc/models/reactivation-billing.md | 2 +- doc/models/service-credit-1.md | 32 ++++ doc/models/subscription-filter.md | 2 +- doc/models/subscription-group-credit-card.md | 15 +- .../subscription-migration-preview-options.md | 8 +- doc/models/subscription-product-migration.md | 8 +- doc/models/tax-configuration.md | 2 +- doc/models/update-subscription-request.md | 1 + doc/models/update-subscription.md | 4 + doc/utility-classes.md | 35 ---- lib/advanced_billing.rb | 4 +- lib/advanced_billing/configuration.rb | 5 +- .../controllers/advance_invoice_controller.rb | 18 +- .../controllers/api_exports_controller.rb | 36 ++-- .../controllers/base_controller.rb | 8 +- .../controllers/billing_portal_controller.rb | 16 +- .../component_price_points_controller.rb | 62 +++---- .../controllers/components_controller.rb | 69 ++++---- .../controllers/coupons_controller.rb | 77 +++++---- .../controllers/custom_fields_controller.rb | 50 +++--- .../controllers/customers_controller.rb | 34 ++-- ...vents_based_billing_segments_controller.rb | 36 ++-- .../controllers/events_controller.rb | 12 +- .../controllers/insights_controller.rb | 18 +- .../controllers/invoices_controller.rb | 147 +++++++--------- .../controllers/offers_controller.rb | 23 +-- .../payment_profiles_controller.rb | 57 ++++--- .../product_families_controller.rb | 25 +-- .../product_price_points_controller.rb | 61 +++---- .../controllers/products_controller.rb | 30 ++-- .../proforma_invoices_controller.rb | 45 ++--- .../controllers/reason_codes_controller.rb | 30 ++-- .../controllers/referral_codes_controller.rb | 4 +- .../sales_commissions_controller.rb | 12 +- .../controllers/sites_controller.rb | 12 +- .../subscription_components_controller.rb | 99 ++++++----- ...iption_group_invoice_account_controller.rb | 26 +-- .../subscription_group_status_controller.rb | 24 +-- .../subscription_groups_controller.rb | 51 +++--- ...subscription_invoice_account_controller.rb | 82 +++++++-- .../subscription_notes_controller.rb | 26 +-- .../subscription_products_controller.rb | 12 +- .../subscription_status_controller.rb | 58 ++++--- .../controllers/subscriptions_controller.rb | 112 +++++------- .../controllers/webhooks_controller.rb | 36 ++-- .../component_allocation_error_exception.rb | 8 +- .../component_price_point_error_exception.rb | 8 +- .../customer_error_response_exception.rb | 8 +- .../error_array_map_response_exception.rb | 8 +- .../error_list_response_exception.rb | 8 +- .../error_string_map_response_exception.rb | 8 +- ..._billing_list_segments_errors_exception.rb | 8 +- ..._based_billing_segment_errors_exception.rb | 8 +- .../event_based_billing_segment_exception.rb | 8 +- ...ct_price_point_error_response_exception.rb | 8 +- ...ma_bad_request_error_response_exception.rb | 8 +- ...epayment_base_errors_response_exception.rb | 8 +- .../single_error_response_exception.rb | 8 +- .../single_string_error_response_exception.rb | 8 +- ...subscription_add_coupon_error_exception.rb | 8 +- ...on_component_allocation_error_exception.rb | 8 +- ...n_group_create_error_response_exception.rb | 8 +- ...n_group_signup_error_response_exception.rb | 8 +- ...n_group_update_error_response_exception.rb | 8 +- ...cription_remove_coupon_errors_exception.rb | 8 +- .../subscription_response_error_exception.rb | 8 +- ...scriptions_mrr_error_response_exception.rb | 8 +- ...anagement_link_requests_error_exception.rb | 8 +- .../models/apple_pay_payment_profile.rb | 44 ++++- .../models/bank_account_payment_profile.rb | 43 ++++- lib/advanced_billing/models/component.rb | 33 ++-- lib/advanced_billing/models/coupon_request.rb | 10 +- .../models/create_subscription.rb | 64 ++++--- .../models/credit_card_payment_profile.rb | 44 ++++- .../models/list_service_credits_response.rb | 82 +++++++++ .../models/override_subscription.rb | 4 +- .../models/paypal_payment_profile.rb | 45 ++++- .../models/service_credit1.rb | 161 ++++++++++++++++++ .../models/subscription_group_credit_card.rb | 120 ++++++------- .../models/update_subscription.rb | 131 +++++++++++--- 148 files changed, 2199 insertions(+), 1289 deletions(-) create mode 100644 doc/api-helper.md create mode 100644 doc/date-time-helper.md create mode 100644 doc/models/list-service-credits-response.md create mode 100644 doc/models/service-credit-1.md delete mode 100644 doc/utility-classes.md create mode 100644 lib/advanced_billing/models/list_service_credits_response.rb create mode 100644 lib/advanced_billing/models/service_credit1.rb diff --git a/README.md b/README.md index add1d8a5..ac4004e5 100644 --- a/README.md +++ b/README.md @@ -4,22 +4,21 @@ ## Introduction Maxio Advanced Billing (formerly Chargify) provides an HTTP-based API that conforms to the principles of REST. -One of the many reasons to use Advanced Billing is the immense feature set and surrounding community [client libraries](page:development-tools/client-libraries). -The Maxio API returns JSON responses as the primary and recommended format, but XML is also provided as a backwards compatible option for Merchants who require it. +One of the many reasons to use Advanced Billing is the immense feature set and [client libraries](page:development-tools/client-libraries). +The Maxio API returns JSON responses as the primary and recommended format, but XML is also provided as a backwards compatible option for merchants who require it. ### Steps to make your first Maxio Advanced Billing API call 1. [Sign-up](https://app.chargify.com/signup/maxio-billing-sandbox) or [log-in](https://app.chargify.com/login.html) to your [test site](https://maxio.zendesk.com/hc/en-us/articles/24250712113165-Testing-Overview) account. -2. [Setup and configure authentication](https://maxio.zendesk.com/hc/en-us/articles/24294819360525-API-Keys) credentials. -3. Submit your API request and try it out. -4. Verify results through response. -5. Test our integrations. +2. [Setup authentication](https://maxio.zendesk.com/hc/en-us/articles/24294819360525-API-Keys) credentials. +3. [Submit an API request and verify the response](page:development-tools/client-libraries#make-your-first-maxio-advanced-billing-api-request). +4. Test the Advanced Billing [integrations](https://www.maxio.com/integrations). -We strongly suggest exploring the developer portal, our [integrations](https://www.maxio.com/integrations) and the API guide, as well as the entire set of application-based documentation to aid in your discovery of the product. +Next, you can explore [authentication methods](page:introduction/authentication), [basic concepts](page:introduction/basic-concepts/connected-sites) for interacting with Advanced Billing via the API, and the entire set of [application-based documentation](https://docs.maxio.com/hc/en-us) to aid in your discovery of the product. -#### Example +#### Request Example -The following example uses the curl command-line tool to execute API requests. +The following example uses the curl command-line tool to make an API request. **Request** @@ -30,37 +29,37 @@ curl -u :x -H Accept:application/json -H Content-Type:application/json Install the gem from the command line: ```bash -gem install maxio-advanced-billing-sdk -v 6.1.0 +gem install maxio-advanced-billing-sdk -v 7.0.0 ``` Or add the gem to your Gemfile and run `bundle`: ```ruby -gem 'maxio-advanced-billing-sdk', '6.1.0' +gem 'maxio-advanced-billing-sdk', '7.0.0' ``` -For additional gem details, see the [RubyGems page for the maxio-advanced-billing-sdk gem](https://rubygems.org/gems/maxio-advanced-billing-sdk/versions/6.1.0). +For additional gem details, see the [RubyGems page for the maxio-advanced-billing-sdk gem](https://rubygems.org/gems/maxio-advanced-billing-sdk/versions/7.0.0). ## Initialize the API Client -**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/client.md) +**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/client.md) The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | -| `site` | `String` | The subdomain for your Advanced Billing site.
*Default*: `'subdomain'` | -| `environment` | `Environment` | The API environment.
**Default: `Environment.US`** | -| `connection` | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests | -| `adapter` | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests | -| `timeout` | `Float` | The value to use for connection timeout.
**Default: 120** | -| `max_retries` | `Integer` | The number of times to retry an endpoint call if it fails.
**Default: 0** | -| `retry_interval` | `Float` | Pause in seconds between retries.
**Default: 1** | -| `backoff_factor` | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff.
**Default: 2** | -| `retry_statuses` | `Array` | A list of HTTP statuses to retry.
**Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** | -| `retry_methods` | `Array` | A list of HTTP methods to retry.
**Default: %i[get put]** | -| `http_callback` | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. | -| `basic_auth_credentials` | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/auth/basic-authentication.md) | The credential object for Basic Authentication | +| site | `String` | The subdomain for your Advanced Billing site.
*Default*: `'subdomain'` | +| environment | `Environment` | The API environment.
**Default: `Environment.US`** | +| connection | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests | +| adapter | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests | +| timeout | `Float` | The value to use for connection timeout.
**Default: 120** | +| max_retries | `Integer` | The number of times to retry an endpoint call if it fails.
**Default: 0** | +| retry_interval | `Float` | Pause in seconds between retries.
**Default: 1** | +| backoff_factor | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff.
**Default: 2** | +| retry_statuses | `Array` | A list of HTTP statuses to retry.
**Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** | +| retry_methods | `Array` | A list of HTTP methods to retry.
**Default: %i[get put]** | +| http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. | +| basic_auth_credentials | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/auth/basic-authentication.md) | The credential object for Basic Authentication | The API client can be initialized as follows: @@ -90,46 +89,52 @@ The SDK can be configured to use a different environment for making API calls. A This API uses the following authentication schemes. -* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/auth/basic-authentication.md) +* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/auth/basic-authentication.md) ## List of APIs -* [API Exports](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/api-exports.md) -* [Advance Invoice](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/advance-invoice.md) -* [Billing Portal](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/billing-portal.md) -* [Component Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/component-price-points.md) -* [Custom Fields](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/custom-fields.md) -* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/events-based-billing-segments.md) -* [Payment Profiles](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/payment-profiles.md) -* [Product Families](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/product-families.md) -* [Product Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/product-price-points.md) -* [Proforma Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/proforma-invoices.md) -* [Reason Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/reason-codes.md) -* [Referral Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/referral-codes.md) -* [Sales Commissions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/sales-commissions.md) -* [Subscription Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/subscription-components.md) -* [Subscription Groups](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/subscription-groups.md) -* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/subscription-group-invoice-account.md) -* [Subscription Group Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/subscription-group-status.md) -* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/subscription-invoice-account.md) -* [Subscription Notes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/subscription-notes.md) -* [Subscription Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/subscription-products.md) -* [Subscription Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/subscription-status.md) -* [Coupons](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/coupons.md) -* [Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/components.md) -* [Customers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/customers.md) -* [Events](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/events.md) -* [Insights](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/insights.md) -* [Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/invoices.md) -* [Offers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/offers.md) -* [Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/products.md) -* [Sites](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/sites.md) -* [Subscriptions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/subscriptions.md) -* [Webhooks](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/controllers/webhooks.md) - -## Classes Documentation - -* [Utility Classes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/utility-classes.md) -* [HttpResponse](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/http-response.md) -* [HttpRequest](https://www.github.com/maxio-com/ab-ruby-sdk/tree/6.1.0/doc/http-request.md) +* [API Exports](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/api-exports.md) +* [Advance Invoice](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/advance-invoice.md) +* [Billing Portal](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/billing-portal.md) +* [Component Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/component-price-points.md) +* [Custom Fields](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/custom-fields.md) +* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/events-based-billing-segments.md) +* [Payment Profiles](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/payment-profiles.md) +* [Product Families](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/product-families.md) +* [Product Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/product-price-points.md) +* [Proforma Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/proforma-invoices.md) +* [Reason Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/reason-codes.md) +* [Referral Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/referral-codes.md) +* [Sales Commissions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/sales-commissions.md) +* [Subscription Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/subscription-components.md) +* [Subscription Groups](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/subscription-groups.md) +* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/subscription-group-invoice-account.md) +* [Subscription Group Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/subscription-group-status.md) +* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/subscription-invoice-account.md) +* [Subscription Notes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/subscription-notes.md) +* [Subscription Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/subscription-products.md) +* [Subscription Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/subscription-status.md) +* [Coupons](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/coupons.md) +* [Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/components.md) +* [Customers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/customers.md) +* [Events](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/events.md) +* [Insights](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/insights.md) +* [Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/invoices.md) +* [Offers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/offers.md) +* [Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/products.md) +* [Sites](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/sites.md) +* [Subscriptions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/subscriptions.md) +* [Webhooks](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/controllers/webhooks.md) + +## SDK Infrastructure + +### HTTP + +* [HttpResponse](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/http-response.md) +* [HttpRequest](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/http-request.md) + +### Utilities + +* [ApiHelper](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/api-helper.md) +* [DateTimeHelper](https://www.github.com/maxio-com/ab-ruby-sdk/tree/7.0.0/doc/date-time-helper.md) diff --git a/advanced_billing.gemspec b/advanced_billing.gemspec index 1b428526..a055bd27 100644 --- a/advanced_billing.gemspec +++ b/advanced_billing.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'maxio-advanced-billing-sdk' - s.version = '6.1.0' + s.version = '7.0.0' s.summary = 'SDK for Maxio Advanced Billing' s.description = "Ultimate billing and pricing flexibility for B2B SaaS.\nMaxio integrates directly into your product, so you can seamlessly manage your product catalog, bill customers, and collect payments." s.authors = ['Maxio SDK'] @@ -11,7 +11,7 @@ Gem::Specification.new do |s| } s.add_dependency('apimatic_core_interfaces', '~> 0.2.1') - s.add_dependency('apimatic_core', '~> 0.3.11') + s.add_dependency('apimatic_core', '~> 0.3.17') s.add_dependency('apimatic_faraday_client_adapter', '~> 0.1.4') s.required_ruby_version = ['>= 2.6'] s.files = Dir['{bin,lib,man,test,spec}/**/*', 'README*', 'LICENSE*'] diff --git a/doc/api-helper.md b/doc/api-helper.md new file mode 100644 index 00000000..bf00a546 --- /dev/null +++ b/doc/api-helper.md @@ -0,0 +1,12 @@ + +# ApiHelper + +API utility class. + +## Methods + +| Name | Return Type | Description | +| --- | --- | --- | +| json_deserialize | `Hash` | Deserializes a JSON string to a Ruby Hash. | +| rfc3339 | `DateTime` | Safely converts a string into an RFC3339 DateTime object. | + diff --git a/doc/client.md b/doc/client.md index f42b6036..41e28344 100644 --- a/doc/client.md +++ b/doc/client.md @@ -5,18 +5,18 @@ The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | -| `site` | `String` | The subdomain for your Advanced Billing site.
*Default*: `'subdomain'` | -| `environment` | `Environment` | The API environment.
**Default: `Environment.US`** | -| `connection` | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests | -| `adapter` | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests | -| `timeout` | `Float` | The value to use for connection timeout.
**Default: 120** | -| `max_retries` | `Integer` | The number of times to retry an endpoint call if it fails.
**Default: 0** | -| `retry_interval` | `Float` | Pause in seconds between retries.
**Default: 1** | -| `backoff_factor` | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff.
**Default: 2** | -| `retry_statuses` | `Array` | A list of HTTP statuses to retry.
**Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** | -| `retry_methods` | `Array` | A list of HTTP methods to retry.
**Default: %i[get put]** | -| `http_callback` | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. | -| `basic_auth_credentials` | [`BasicAuthCredentials`](auth/basic-authentication.md) | The credential object for Basic Authentication | +| site | `String` | The subdomain for your Advanced Billing site.
*Default*: `'subdomain'` | +| environment | `Environment` | The API environment.
**Default: `Environment.US`** | +| connection | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests | +| adapter | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests | +| timeout | `Float` | The value to use for connection timeout.
**Default: 120** | +| max_retries | `Integer` | The number of times to retry an endpoint call if it fails.
**Default: 0** | +| retry_interval | `Float` | Pause in seconds between retries.
**Default: 1** | +| backoff_factor | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff.
**Default: 2** | +| retry_statuses | `Array` | A list of HTTP statuses to retry.
**Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** | +| retry_methods | `Array` | A list of HTTP methods to retry.
**Default: %i[get put]** | +| http_callback | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. | +| basic_auth_credentials | [`BasicAuthCredentials`](auth/basic-authentication.md) | The credential object for Basic Authentication | The API client can be initialized as follows: diff --git a/doc/controllers/advance-invoice.md b/doc/controllers/advance-invoice.md index 3477ba79..022b9755 100644 --- a/doc/controllers/advance-invoice.md +++ b/doc/controllers/advance-invoice.md @@ -51,6 +51,7 @@ result = advance_invoice_controller.issue_advance_invoice( subscription_id, body: body ) +puts result ``` ## Errors @@ -85,6 +86,7 @@ def read_advance_invoice(subscription_id) subscription_id = 222 result = advance_invoice_controller.read_advance_invoice(subscription_id) +puts result ``` ## Errors @@ -121,6 +123,7 @@ def void_advance_invoice(subscription_id, subscription_id = 222 result = advance_invoice_controller.void_advance_invoice(subscription_id) +puts result ``` ## Errors diff --git a/doc/controllers/api-exports.md b/doc/controllers/api-exports.md index 9bd8f263..d8b6db0d 100644 --- a/doc/controllers/api-exports.md +++ b/doc/controllers/api-exports.md @@ -36,8 +36,8 @@ def list_exported_proforma_invoices(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `batch_id` | `String` | Template, Required | Id of a Batch Job. | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000.
**Default**: `100`
**Constraints**: `>= 1`, `<= 10000` | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000.

**Default**: `100`

**Constraints**: `>= 1`, `<= 10000` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | ## Response Type @@ -53,6 +53,7 @@ collect = { } result = api_exports_controller.list_exported_proforma_invoices(collect) +puts result ``` ## Errors @@ -77,8 +78,8 @@ def list_exported_invoices(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `batch_id` | `String` | Template, Required | Id of a Batch Job. | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000.
**Default**: `100`
**Constraints**: `>= 1`, `<= 10000` | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000.

**Default**: `100`

**Constraints**: `>= 1`, `<= 10000` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | ## Response Type @@ -94,6 +95,7 @@ collect = { } result = api_exports_controller.list_exported_invoices(collect) +puts result ``` ## Errors @@ -118,8 +120,8 @@ def list_exported_subscriptions(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `batch_id` | `String` | Template, Required | Id of a Batch Job. | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000.
**Default**: `100`
**Constraints**: `>= 1`, `<= 10000` | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request.
Default value is 100.
The maximum allowed values is 10000; any per_page value over 10000 will be changed to 10000.

**Default**: `100`

**Constraints**: `>= 1`, `<= 10000` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | ## Response Type @@ -135,6 +137,7 @@ collect = { } result = api_exports_controller.list_exported_subscriptions(collect) +puts result ``` ## Errors @@ -162,6 +165,7 @@ def export_proforma_invoices ```ruby result = api_exports_controller.export_proforma_invoices +puts result ``` ## Errors @@ -188,6 +192,7 @@ def export_invoices ```ruby result = api_exports_controller.export_invoices +puts result ``` ## Errors @@ -214,6 +219,7 @@ def export_subscriptions ```ruby result = api_exports_controller.export_subscriptions +puts result ``` ## Errors @@ -247,6 +253,7 @@ def read_proforma_invoices_export(batch_id) batch_id = 'batch_id8' result = api_exports_controller.read_proforma_invoices_export(batch_id) +puts result ``` ## Errors @@ -280,6 +287,7 @@ def read_invoices_export(batch_id) batch_id = 'batch_id8' result = api_exports_controller.read_invoices_export(batch_id) +puts result ``` ## Errors @@ -313,6 +321,7 @@ def read_subscriptions_export(batch_id) batch_id = 'batch_id8' result = api_exports_controller.read_subscriptions_export(batch_id) +puts result ``` ## Errors diff --git a/doc/controllers/billing-portal.md b/doc/controllers/billing-portal.md index 137ca08f..a228370f 100644 --- a/doc/controllers/billing-portal.md +++ b/doc/controllers/billing-portal.md @@ -56,6 +56,7 @@ def enable_billing_portal_for_customer(customer_id, customer_id = 150 result = billing_portal_controller.enable_billing_portal_for_customer(customer_id) +puts result ``` ## Errors @@ -97,6 +98,7 @@ def read_billing_portal_link(customer_id) customer_id = 150 result = billing_portal_controller.read_billing_portal_link(customer_id) +puts result ``` ## Example Response *(as JSON)* @@ -156,6 +158,7 @@ def resend_billing_portal_invitation(customer_id) customer_id = 150 result = billing_portal_controller.resend_billing_portal_invitation(customer_id) +puts result ``` ## Example Response *(as JSON)* @@ -207,6 +210,7 @@ def revoke_billing_portal_access(customer_id) customer_id = 150 result = billing_portal_controller.revoke_billing_portal_access(customer_id) +puts result ``` ## Example Response *(as JSON)* diff --git a/doc/controllers/component-price-points.md b/doc/controllers/component-price-points.md index 0554a65b..9efc5236 100644 --- a/doc/controllers/component-price-points.md +++ b/doc/controllers/component-price-points.md @@ -58,6 +58,7 @@ result = component_price_points_controller.promote_component_price_point_to_defa component_id, price_point_id ) +puts result ``` ## Example Response *(as JSON)* @@ -143,6 +144,7 @@ result = component_price_points_controller.create_component_price_point( component_id, body: body ) +puts result ``` ## Errors @@ -172,8 +174,8 @@ def list_component_price_points(options = {}) | --- | --- | --- | --- | | `component_id` | `Integer` | Template, Required | The Advanced Billing id of the component | | `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | Include an array of currency price data | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `filter_type` | [`Array`](../../doc/models/price-point-type.md) | Query, Optional | Use in query: `filter[type]=catalog,default`. | ## Response Type @@ -190,6 +192,7 @@ Liquid error: Value cannot be null. (Parameter 'key')collect = { } result = component_price_points_controller.list_component_price_points(collect) +puts result ``` ## Example Response *(as JSON)* @@ -309,6 +312,7 @@ result = component_price_points_controller.bulk_create_component_price_points( component_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -428,6 +432,7 @@ result = component_price_points_controller.update_component_price_point( price_point_id, body: body ) +puts result ``` ## Errors @@ -470,6 +475,7 @@ result = component_price_points_controller.read_component_price_point( component_id, price_point_id ) +puts result ``` @@ -504,6 +510,7 @@ result = component_price_points_controller.archive_component_price_point( component_id, price_point_id ) +puts result ``` ## Example Response *(as JSON)* @@ -578,6 +585,7 @@ result = component_price_points_controller.unarchive_component_price_point( component_id, price_point_id ) +puts result ``` ## Example Response *(as JSON)* @@ -663,6 +671,7 @@ result = component_price_points_controller.create_currency_prices( price_point_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -733,6 +742,7 @@ result = component_price_points_controller.update_currency_prices( price_point_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -772,8 +782,8 @@ def list_all_component_price_points(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `include` | [`ListComponentsPricePointsInclude`](../../doc/models/list-components-price-points-include.md) | Query, Optional | Allows including additional data in the response. Use in query: `include=currency_prices`. | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | | `filter` | [`ListPricePointsFilter`](../../doc/models/list-price-points-filter.md) | Query, Optional | Filter to use for List PricePoints operations | @@ -807,6 +817,7 @@ collect = { } result = component_price_points_controller.list_all_component_price_points(collect) +puts result ``` ## Example Response *(as JSON)* diff --git a/doc/controllers/components.md b/doc/controllers/components.md index 73ec55b9..e0a37269 100644 --- a/doc/controllers/components.md +++ b/doc/controllers/components.md @@ -74,6 +74,7 @@ result = components_controller.create_metered_component( product_family_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -193,6 +194,7 @@ result = components_controller.create_quantity_based_component( product_family_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -299,6 +301,7 @@ result = components_controller.create_on_off_component( product_family_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -407,6 +410,7 @@ result = components_controller.create_prepaid_usage_component( product_family_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -532,6 +536,7 @@ result = components_controller.create_event_based_component( product_family_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -605,6 +610,7 @@ def find_component(handle) handle = 'handle6' result = components_controller.find_component(handle) +puts result ``` ## Example Response *(as JSON)* @@ -654,7 +660,7 @@ def read_component(product_family_id, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `product_family_id` | `Integer` | Template, Required | The Advanced Billing id of the product family to which the component belongs | -| `component_id` | `String` | Template, Required | Either the Advanced Billing id of the component or the handle for the component prefixed with `handle:`
**Constraints**: *Pattern*: `/\A(?:\d+\|handle:(?:uuid:\|[a-z])(?:\w\|-)+)\z/` | +| `component_id` | `String` | Template, Required | Either the Advanced Billing id of the component or the handle for the component prefixed with `handle:`

**Constraints**: *Pattern*: `/\A(?:\d+\|handle:(?:uuid:\|[a-z])(?:\w\|-)+)\z/` | ## Response Type @@ -671,6 +677,7 @@ result = components_controller.read_component( product_family_id, component_id ) +puts result ``` ## Example Response *(as JSON)* @@ -698,7 +705,8 @@ result = components_controller.read_component( "downgrade_credit": null, "created_at": "2019-08-02T05:54:53-04:00", "default_price_point_name": "Original", - "product_family_name": "Chargify" + "product_family_name": "Chargify", + "product_family_handle": "chargify" } } ``` @@ -721,7 +729,7 @@ def update_product_family_component(product_family_id, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `product_family_id` | `Integer` | Template, Required | The Advanced Billing id of the product family to which the component belongs | -| `component_id` | `String` | Template, Required | Either the Advanced Billing id of the component or the handle for the component prefixed with `handle:`
**Constraints**: *Pattern*: `/\A(?:\d+\|handle:(?:uuid:\|[a-z])(?:\w\|-)+)\z/` | +| `component_id` | `String` | Template, Required | Either the Advanced Billing id of the component or the handle for the component prefixed with `handle:`

**Constraints**: *Pattern*: `/\A(?:\d+\|handle:(?:uuid:\|[a-z])(?:\w\|-)+)\z/` | | `body` | [`UpdateComponentRequest`](../../doc/models/update-component-request.md) | Body, Optional | - | ## Response Type @@ -746,6 +754,7 @@ result = components_controller.update_product_family_component( component_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -799,7 +808,7 @@ def archive_component(product_family_id, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `product_family_id` | `Integer` | Template, Required | The Advanced Billing id of the product family to which the component belongs | -| `component_id` | `String` | Template, Required | Either the Advanced Billing id of the component or the handle for the component prefixed with `handle:`
**Constraints**: *Pattern*: `/\A(?:\d+\|handle:(?:uuid:\|[a-z])(?:\w\|-)+)\z/` | +| `component_id` | `String` | Template, Required | Either the Advanced Billing id of the component or the handle for the component prefixed with `handle:`

**Constraints**: *Pattern*: `/\A(?:\d+\|handle:(?:uuid:\|[a-z])(?:\w\|-)+)\z/` | ## Response Type @@ -816,6 +825,7 @@ result = components_controller.archive_component( product_family_id, component_id ) +puts result ``` ## Example Response *(as JSON)* @@ -869,8 +879,8 @@ def list_components(options = {}) | `start_datetime` | `String` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | | `end_datetime` | `String` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. optional | | `include_archived` | `TrueClass \| FalseClass` | Query, Optional | Include archived items | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `filter` | [`ListComponentsFilter`](../../doc/models/list-components-filter.md) | Query, Optional | Filter to use for List Components operations | ## Response Type @@ -894,6 +904,7 @@ collect = { } result = components_controller.list_components(collect) +puts result ``` ## Example Response *(as JSON)* @@ -934,6 +945,7 @@ result = components_controller.list_components(collect) "created_at": "2019-08-01T09:35:38-04:00", "default_price_point_name": "Original", "product_family_name": "Chargify", + "product_family_handle": "chargify", "use_site_exchange_rate": true } }, @@ -960,6 +972,7 @@ result = components_controller.list_components(collect) "created_at": "2019-08-01T09:35:37-04:00", "default_price_point_name": "Original", "product_family_name": "Chargify", + "product_family_handle": "chargify", "use_site_exchange_rate": true } }, @@ -986,6 +999,7 @@ result = components_controller.list_components(collect) "created_at": "2019-08-01T09:35:38-04:00", "default_price_point_name": "Original", "product_family_name": "Chargify", + "product_family_handle": "chargify", "use_site_exchange_rate": true } } @@ -1030,6 +1044,7 @@ result = components_controller.update_component( component_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -1083,8 +1098,8 @@ def list_components_for_product_family(options = {}) | --- | --- | --- | --- | | `product_family_id` | `Integer` | Template, Required | The Advanced Billing id of the product family | | `include_archived` | `TrueClass \| FalseClass` | Query, Optional | Include archived items. | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `filter` | [`ListComponentsFilter`](../../doc/models/list-components-filter.md) | Query, Optional | Filter to use for List Components operations | | `date_field` | [`BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query `date_field=created_at`. | | `end_date` | `String` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | @@ -1114,6 +1129,7 @@ collect = { } result = components_controller.list_components_for_product_family(collect) +puts result ``` ## Example Response *(as JSON)* diff --git a/doc/controllers/coupons.md b/doc/controllers/coupons.md index 53a5f027..57065349 100644 --- a/doc/controllers/coupons.md +++ b/doc/controllers/coupons.md @@ -92,6 +92,7 @@ result = coupons_controller.create_coupon( product_family_id, body: body ) +puts result ``` ## Errors @@ -116,8 +117,8 @@ def list_coupons_for_product_family(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `product_family_id` | `Integer` | Template, Required | The Advanced Billing id of the product family to which the coupon belongs | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `30`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `30`

**Constraints**: `<= 200` | | `filter` | [`ListCouponsFilter`](../../doc/models/list-coupons-filter.md) | Query, Optional | Filter to use for List Coupons operations | | `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | When fetching coupons, if you have defined multiple currencies at the site level, you can optionally pass the `?currency_prices=true` query param to include an array of currency price data in the response. Use in query `currency_prices=true`. | @@ -151,6 +152,7 @@ collect = { } result = coupons_controller.list_coupons_for_product_family(collect) +puts result ``` ## Example Response *(as JSON)* @@ -275,6 +277,7 @@ def find_coupon(product_family_id: nil, currency_prices = true result = coupons_controller.find_coupon(currency_prices: currency_prices) +puts result ``` @@ -319,6 +322,7 @@ result = coupons_controller.read_coupon( coupon_id, currency_prices: currency_prices ) +puts result ``` ## Example Response *(as JSON)* @@ -412,6 +416,7 @@ result = coupons_controller.update_coupon( coupon_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -483,6 +488,7 @@ result = coupons_controller.archive_coupon( product_family_id, coupon_id ) +puts result ``` ## Example Response *(as JSON)* @@ -529,8 +535,8 @@ def list_coupons(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `30`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `30`

**Constraints**: `<= 200` | | `filter` | [`ListCouponsFilter`](../../doc/models/list-coupons-filter.md) | Query, Optional | Filter to use for List Coupons operations | | `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | When fetching coupons, if you have defined multiple currencies at the site level, you can optionally pass the `?currency_prices=true` query param to include an array of currency price data in the response. Use in query `currency_prices=true`. | @@ -563,6 +569,7 @@ collect = { } result = coupons_controller.list_coupons(collect) +puts result ``` ## Example Response *(as JSON)* @@ -645,6 +652,7 @@ result = coupons_controller.read_coupon_usage( product_family_id, coupon_id ) +puts result ``` ## Example Response *(as JSON)* @@ -728,6 +736,7 @@ def validate_coupon(code, code = 'code8' result = coupons_controller.validate_coupon(code) +puts result ``` ## Example Response *(as JSON)* @@ -810,6 +819,7 @@ result = coupons_controller.create_or_update_coupon_currency_prices( coupon_id, body: body ) +puts result ``` ## Errors @@ -895,6 +905,7 @@ result = coupons_controller.create_coupon_subcodes( coupon_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -923,8 +934,8 @@ def list_coupon_subcodes(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `coupon_id` | `Integer` | Template, Required | The Advanced Billing id of the coupon | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | ## Response Type @@ -940,6 +951,7 @@ collect = { } result = coupons_controller.list_coupon_subcodes(collect) +puts result ``` ## Example Response *(as JSON)* @@ -1019,6 +1031,7 @@ result = coupons_controller.update_coupon_subcodes( coupon_id, body: body ) +puts result ``` diff --git a/doc/controllers/custom-fields.md b/doc/controllers/custom-fields.md index 99844bf8..3c4026df 100644 --- a/doc/controllers/custom-fields.md +++ b/doc/controllers/custom-fields.md @@ -42,7 +42,7 @@ Each site is limited to 100 unique Metafields (i.e. keys, or names) per resource ### Metafields "On-the-Fly" -It is possible to create Metafields “on the fly” when you create your Metadata – if a non-existant name is passed when creating Metadata, a Metafield for that key will be automatically created. The Metafield API, however, gives you more control over your “keys”. +It is possible to create Metafields “on the fly” when you create your Metadata – if a non-existent name is passed when creating Metadata, a Metafield for that key will be automatically created. The Metafield API, however, gives you more control over your “keys”. ### Metafield Scope Warning @@ -88,6 +88,7 @@ result = custom_fields_controller.create_metafields( resource_type, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -142,8 +143,8 @@ def list_metafields(options = {}) | --- | --- | --- | --- | | `resource_type` | [`ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | | `name` | `String` | Query, Optional | filter by the name of the metafield | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | ## Response Type @@ -160,6 +161,7 @@ collect = { } result = custom_fields_controller.list_metafields(collect) +puts result ``` ## Example Response *(as JSON)* @@ -217,6 +219,7 @@ def update_metafield(resource_type, resource_type = ResourceType::SUBSCRIPTIONS result = custom_fields_controller.update_metafield(resource_type) +puts result ``` ## Errors @@ -331,6 +334,7 @@ result = custom_fields_controller.create_metadata( resource_id, body: body ) +puts result ``` ## Errors @@ -358,8 +362,8 @@ def list_metadata(options = {}) | --- | --- | --- | --- | | `resource_type` | [`ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | | `resource_id` | `Integer` | Template, Required | The Advanced Billing id of the customer or the subscription for which the metadata applies | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | ## Response Type @@ -376,6 +380,7 @@ collect = { } result = custom_fields_controller.list_metadata(collect) +puts result ``` @@ -412,6 +417,7 @@ result = custom_fields_controller.update_metadata( resource_type, resource_id ) +puts result ``` ## Errors @@ -512,15 +518,15 @@ def list_metadata_for_resource_type(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `resource_type` | [`ResourceType`](../../doc/models/resource-type.md) | Template, Required | the resource type to which the metafields belong | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `date_field` | [`BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. | | `start_date` | `Date` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns metadata with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | | `end_date` | `Date` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns metadata with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | | `start_datetime` | `DateTime` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns metadata with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | | `end_datetime` | `DateTime` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns metadata with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. | | `with_deleted` | `TrueClass \| FalseClass` | Query, Optional | Allow to fetch deleted metadata. | -| `resource_ids` | `Array` | Query, Optional | Allow to fetch metadata for multiple records based on provided ids. Use in query: `resource_ids[]=122&resource_ids[]=123&resource_ids[]=124`.
**Constraints**: *Maximum Items*: `50` | +| `resource_ids` | `Array` | Query, Optional | Allow to fetch metadata for multiple records based on provided ids. Use in query: `resource_ids[]=122&resource_ids[]=123&resource_ids[]=124`.

**Constraints**: *Maximum Items*: `50` | | `direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | ## Response Type @@ -538,5 +544,6 @@ collect = { } result = custom_fields_controller.list_metadata_for_resource_type(collect) +puts result ``` diff --git a/doc/controllers/customers.md b/doc/controllers/customers.md index c2b134cd..1d0e3347 100644 --- a/doc/controllers/customers.md +++ b/doc/controllers/customers.md @@ -83,6 +83,7 @@ body = CreateCustomerRequest.new( ) result = customers_controller.create_customer(body: body) +puts result ``` ## Example Response *(as JSON)* @@ -154,8 +155,8 @@ def list_customers(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Direction to sort customers by time of creation | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 50. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `50`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 50. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `50`

**Constraints**: `<= 200` | | `date_field` | [`BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search.
Use in query: `date_field=created_at`. | | `start_date` | `String` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns subscriptions with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | | `end_date` | `String` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns subscriptions with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | @@ -177,6 +178,7 @@ collect = { } result = customers_controller.list_customers(collect) +puts result ``` ## Example Response *(as JSON)* @@ -288,6 +290,7 @@ def read_customer(id) id = 112 result = customers_controller.read_customer(id) +puts result ``` @@ -328,6 +331,7 @@ result = customers_controller.update_customer( id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -420,6 +424,7 @@ def read_customer_by_reference(reference) reference = 'reference4' result = customers_controller.read_customer_by_reference(reference) +puts result ``` @@ -447,5 +452,6 @@ def list_customer_subscriptions(customer_id) customer_id = 150 result = customers_controller.list_customer_subscriptions(customer_id) +puts result ``` diff --git a/doc/controllers/events-based-billing-segments.md b/doc/controllers/events-based-billing-segments.md index 68b27a49..baf9177b 100644 --- a/doc/controllers/events-based-billing-segments.md +++ b/doc/controllers/events-based-billing-segments.md @@ -73,6 +73,7 @@ result = events_based_billing_segments_controller.create_segment( price_point_id, body: body ) +puts result ``` ## Errors @@ -101,8 +102,8 @@ def list_segments_for_price_point(options = {}) | --- | --- | --- | --- | | `component_id` | `String` | Template, Required | ID or Handle for the Component | | `price_point_id` | `String` | Template, Required | ID or Handle for the Price Point belonging to the Component | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `30`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `30`

**Constraints**: `<= 200` | | `filter` | [`ListSegmentsFilter`](../../doc/models/list-segments-filter.md) | Query, Optional | Filter to use for List Segments for a Price Point operation | ## Response Type @@ -123,6 +124,7 @@ collect = { } result = events_based_billing_segments_controller.list_segments_for_price_point(collect) +puts result ``` ## Errors @@ -173,6 +175,7 @@ result = events_based_billing_segments_controller.update_segment( price_point_id, id ) +puts result ``` ## Errors @@ -268,6 +271,7 @@ result = events_based_billing_segments_controller.bulk_create_segments( component_id, price_point_id ) +puts result ``` ## Errors @@ -315,6 +319,7 @@ result = events_based_billing_segments_controller.bulk_update_segments( component_id, price_point_id ) +puts result ``` ## Errors diff --git a/doc/controllers/events.md b/doc/controllers/events.md index 37068d79..2144318e 100644 --- a/doc/controllers/events.md +++ b/doc/controllers/events.md @@ -94,11 +94,11 @@ def list_events(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `since_id` | `Integer` | Query, Optional | Returns events with an id greater than or equal to the one specified | | `max_id` | `Integer` | Query, Optional | Returns events with an id less than or equal to the one specified | -| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.
**Default**: `Direction::DESC` | +| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.

**Default**: `Direction::DESC` | | `filter` | [`Array`](../../doc/models/event-key.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | | `date_field` | [`ListEventsDateField`](../../doc/models/list-events-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. | | `start_date` | `String` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | @@ -125,6 +125,7 @@ collect = { } result = events_controller.list_events(collect) +puts result ``` ## Example Response *(as JSON)* @@ -213,11 +214,11 @@ def list_subscription_events(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscription_id` | `Integer` | Template, Required | The Chargify id of the subscription | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `since_id` | `Integer` | Query, Optional | Returns events with an id greater than or equal to the one specified | | `max_id` | `Integer` | Query, Optional | Returns events with an id less than or equal to the one specified | -| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.
**Default**: `Direction::DESC` | +| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.

**Default**: `Direction::DESC` | | `filter` | [`Array`](../../doc/models/event-key.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | ## Response Type @@ -239,6 +240,7 @@ collect = { } result = events_controller.list_subscription_events(collect) +puts result ``` ## Example Response *(as JSON)* @@ -297,11 +299,11 @@ def read_events_count(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `since_id` | `Integer` | Query, Optional | Returns events with an id greater than or equal to the one specified | | `max_id` | `Integer` | Query, Optional | Returns events with an id less than or equal to the one specified | -| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.
**Default**: `Direction::DESC` | +| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned events.

**Default**: `Direction::DESC` | | `filter` | [`Array`](../../doc/models/event-key.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | ## Response Type @@ -322,6 +324,7 @@ collect = { } result = events_controller.read_events_count(collect) +puts result ``` ## Example Response *(as JSON)* diff --git a/doc/controllers/insights.md b/doc/controllers/insights.md index bcd5c8d1..7f5728e7 100644 --- a/doc/controllers/insights.md +++ b/doc/controllers/insights.md @@ -22,7 +22,7 @@ The Stats API is a very basic view of some Site-level stats. This API call only ## Stats Documentation -There currently is not a complimentary matching set of documentation that compliments this endpoint. However, each Site's dashboard will reflect the summary of information provided in the Stats reposnse. +There currently is not a complimentary matching set of documentation that compliments this endpoint. However, each Site's dashboard will reflect the summary of information provided in the Stats response. ``` https://subdomain.chargify.com/dashboard @@ -40,6 +40,7 @@ def read_site_stats ```ruby result = insights_controller.read_site_stats +puts result ``` ## Example Response *(as JSON)* @@ -88,6 +89,7 @@ def read_mrr(at_time: nil, ```ruby result = insights_controller.read_mrr +puts result ``` ## Example Response *(as JSON)* @@ -149,8 +151,8 @@ def list_mrr_movements(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscription_id` | `Integer` | Query, Optional | optionally filter results by subscription | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 10. The maximum allowed values is 50; any per_page value over 50 will be changed to 50.
Use in query `per_page=20`.
**Default**: `10`
**Constraints**: `<= 50` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 10. The maximum allowed values is 50; any per_page value over 50 will be changed to 50.
Use in query `per_page=20`.

**Default**: `10`

**Constraints**: `<= 50` | | `direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | ## Response Type @@ -166,6 +168,7 @@ collect = { } result = insights_controller.list_mrr_movements(collect) +puts result ``` ## Example Response *(as JSON)* @@ -237,8 +240,8 @@ def list_mrr_per_subscription(options = {}) | --- | --- | --- | --- | | `filter` | [`ListMrrFilter`](../../doc/models/list-mrr-filter.md) | Query, Optional | Filter to use for List MRR per subscription operation | | `at_time` | `String` | Query, Optional | Submit a timestamp in ISO8601 format to request MRR for a historic time. Use in query: `at_time=2022-01-10T10:00:00-05:00`. | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | Controls the order in which results are returned. Records are ordered by subscription_id in ascending order by default. Use in query `direction=desc`. | ## Response Type @@ -263,6 +266,7 @@ collect = { } result = insights_controller.list_mrr_per_subscription(collect) +puts result ``` ## Errors diff --git a/doc/controllers/invoices.md b/doc/controllers/invoices.md index 7ad08862..52f5b7db 100644 --- a/doc/controllers/invoices.md +++ b/doc/controllers/invoices.md @@ -75,6 +75,7 @@ result = invoices_controller.refund_invoice( uid, body: body ) +puts result ``` ## Errors @@ -101,23 +102,24 @@ def list_invoices(options = {}) | `status` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Query, Optional | The current status of the invoice. Allowed Values: draft, open, paid, pending, voided | | `subscription_id` | `Integer` | Query, Optional | The subscription's ID. | | `subscription_group_uid` | `String` | Query, Optional | The UID of the subscription group you want to fetch consolidated invoices for. This will return a paginated list of consolidated invoices for the specified group. | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | -| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices.
**Default**: `Direction::DESC` | -| `line_items` | `TrueClass \| FalseClass` | Query, Optional | Include line items data
**Default**: `false` | -| `discounts` | `TrueClass \| FalseClass` | Query, Optional | Include discounts data
**Default**: `false` | -| `taxes` | `TrueClass \| FalseClass` | Query, Optional | Include taxes data
**Default**: `false` | -| `credits` | `TrueClass \| FalseClass` | Query, Optional | Include credits data
**Default**: `false` | -| `payments` | `TrueClass \| FalseClass` | Query, Optional | Include payments data
**Default**: `false` | -| `custom_fields` | `TrueClass \| FalseClass` | Query, Optional | Include custom fields data
**Default**: `false` | -| `refunds` | `TrueClass \| FalseClass` | Query, Optional | Include refunds data
**Default**: `false` | -| `date_field` | [`InvoiceDateField`](../../doc/models/invoice-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query `date_field=issue_date`.
**Default**: `InvoiceDateField::DUE_DATE` | +| `consolidation_level` | `String` | Query, Optional | The consolidation level of the invoice. Allowed Values: none, parent, child or comma-separated lists of thereof, e.g. none,parent. | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | +| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices.

**Default**: `Direction::DESC` | +| `line_items` | `TrueClass \| FalseClass` | Query, Optional | Include line items data

**Default**: `false` | +| `discounts` | `TrueClass \| FalseClass` | Query, Optional | Include discounts data

**Default**: `false` | +| `taxes` | `TrueClass \| FalseClass` | Query, Optional | Include taxes data

**Default**: `false` | +| `credits` | `TrueClass \| FalseClass` | Query, Optional | Include credits data

**Default**: `false` | +| `payments` | `TrueClass \| FalseClass` | Query, Optional | Include payments data

**Default**: `false` | +| `custom_fields` | `TrueClass \| FalseClass` | Query, Optional | Include custom fields data

**Default**: `false` | +| `refunds` | `TrueClass \| FalseClass` | Query, Optional | Include refunds data

**Default**: `false` | +| `date_field` | [`InvoiceDateField`](../../doc/models/invoice-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query `date_field=issue_date`.

**Default**: `InvoiceDateField::DUE_DATE` | | `start_datetime` | `String` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns invoices with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. Allowed to be used only along with date_field set to created_at or updated_at. | | `end_datetime` | `String` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns invoices with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Allowed to be used only along with date_field set to created_at or updated_at. | | `customer_ids` | `Array` | Query, Optional | Allows fetching invoices with matching customer id based on provided values. Use in query `customer_ids=1,2,3`. | | `number` | `Array` | Query, Optional | Allows fetching invoices with matching invoice number based on provided values. Use in query `number=1234,1235`. | | `product_ids` | `Array` | Query, Optional | Allows fetching invoices with matching line items product ids based on provided values. Use in query `product_ids=23,34`. | -| `sort` | [`InvoiceSortField`](../../doc/models/invoice-sort-field.md) | Query, Optional | Allows specification of the order of the returned list. Use in query `sort=total_amount`.
**Default**: `InvoiceSortField::NUMBER` | +| `sort` | [`InvoiceSortField`](../../doc/models/invoice-sort-field.md) | Query, Optional | Allows specification of the order of the returned list. Use in query `sort=total_amount`.

**Default**: `InvoiceSortField::NUMBER` | ## Response Type @@ -155,6 +157,7 @@ collect = { } result = invoices_controller.list_invoices(collect) +puts result ``` ## Example Response *(as JSON)* @@ -468,6 +471,7 @@ def read_invoice(uid) uid = 'uid0' result = invoices_controller.read_invoice(uid) +puts result ``` ## Example Response *(as JSON)* @@ -571,7 +575,8 @@ result = invoices_controller.read_invoice(uid) "type": "credit_card" }, "transaction_id": 253028955, - "prepayment": false + "prepayment": false, + "received_on": "2018-07-26" } ], "public_url": "https://www.chargifypay.com/invoice/inv_8jzrw74xq8kxr?token=fb6kpjz5rcr2vttyjs4rcv6y" @@ -616,8 +621,8 @@ def list_invoice_events(options = {}) | --- | --- | --- | --- | | `since_date` | `String` | Query, Optional | The timestamp in a format `YYYY-MM-DD T HH:MM:SS Z`, or `YYYY-MM-DD`(in this case, it returns data from the beginning of the day). of the event from which you want to start the search. All the events before the `since_date` timestamp are not returned in the response. | | `since_id` | `Integer` | Query, Optional | The ID of the event from which you want to start the search(ID is not included. e.g. if ID is set to 2, then all events with ID 3 and more will be shown) This parameter is not used if since_date is defined. | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
**Default**: `100` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.

**Default**: `100` | | `invoice_uid` | `String` | Query, Optional | Providing an invoice_uid allows for scoping of the invoice events to a single invoice or credit note. | | `with_change_invoice_status` | `String` | Query, Optional | Use this parameter if you want to fetch also invoice events with change_invoice_status type. | | `event_types` | [`Array`](../../doc/models/invoice-event-type.md) | Query, Optional | Filter results by event_type. Supply a comma separated list of event types (listed above). Use in query: `event_types=void_invoice,void_remainder`. | @@ -635,6 +640,7 @@ collect = { } result = invoices_controller.list_invoice_events(collect) +puts result ``` ## Example Response *(as JSON)* @@ -1023,51 +1029,7 @@ result = invoices_controller.list_invoice_events(collect) # Record Payment for Invoice -This API call should be used when you want to record a payment of a given type against a specific invoice. If you would like to apply a payment across multiple invoices, you can use the Bulk Payment endpoint. - -## Create a Payment from the existing payment profile - -In order to apply a payment to an invoice using an existing payment profile, specify `type` as `payment`, the amount less than the invoice total, and the customer's `payment_profile_id`. The ID of a payment profile might be retrieved via the Payment Profiles API endpoint. - -``` -{ - "type": "payment", - "payment": { - "amount": 10.00, - "payment_profile_id": 123 - } -} -``` - -## Create a Payment from the Subscription's Prepayment Account - -In order apply a prepayment to an invoice, specify the `type` as `prepayment`, and also the `amount`. - -``` -{ - "type": "prepayment", - "payment": { - "amount": 10.00 - } -} -``` - -Note that the `amount` must be less than or equal to the Subscription's Prepayment account balance. - -## Create a Payment from the Subscription's Service Credit Account - -In order to apply a service credit to an invoice, specify the `type` as `service_credit`, and also the `amount`: - -``` -{ - "type": "service_credit", - "payment": { - "amount": 10.00 - } -} -``` - -Note that Advanced Billing will attempt to fully pay the invoice's `due_amount` from the Subscription's Service Credit account. At this time, partial payments from a Service Credit Account are only allowed for consolidated invoices (subscription groups). Therefore, for normal invoices the Service Credit account balance must be greater than or equal to the invoice's `due_amount`. +Applies a payment of a given type against a specific invoice. If you would like to apply a payment across multiple invoices, you can use the Bulk Payment endpoint. ```ruby def record_payment_for_invoice(uid, @@ -1103,6 +1065,7 @@ result = invoices_controller.record_payment_for_invoice( uid, body: body ) +puts result ``` ## Errors @@ -1178,6 +1141,7 @@ body = CreateMultiInvoicePaymentRequest.new( ) result = invoices_controller.record_payment_for_multiple_invoices(body: body) +puts result ``` ## Example Response *(as JSON)* @@ -1226,13 +1190,13 @@ def list_credit_notes(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscription_id` | `Integer` | Query, Optional | The subscription's Advanced Billing id | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | -| `line_items` | `TrueClass \| FalseClass` | Query, Optional | Include line items data
**Default**: `false` | -| `discounts` | `TrueClass \| FalseClass` | Query, Optional | Include discounts data
**Default**: `false` | -| `taxes` | `TrueClass \| FalseClass` | Query, Optional | Include taxes data
**Default**: `false` | -| `refunds` | `TrueClass \| FalseClass` | Query, Optional | Include refunds data
**Default**: `false` | -| `applications` | `TrueClass \| FalseClass` | Query, Optional | Include applications data
**Default**: `false` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | +| `line_items` | `TrueClass \| FalseClass` | Query, Optional | Include line items data

**Default**: `false` | +| `discounts` | `TrueClass \| FalseClass` | Query, Optional | Include discounts data

**Default**: `false` | +| `taxes` | `TrueClass \| FalseClass` | Query, Optional | Include taxes data

**Default**: `false` | +| `refunds` | `TrueClass \| FalseClass` | Query, Optional | Include refunds data

**Default**: `false` | +| `applications` | `TrueClass \| FalseClass` | Query, Optional | Include applications data

**Default**: `false` | ## Response Type @@ -1252,6 +1216,7 @@ collect = { } result = invoices_controller.list_credit_notes(collect) +puts result ``` ## Example Response *(as JSON)* @@ -1580,6 +1545,7 @@ def read_credit_note(uid) uid = 'uid0' result = invoices_controller.read_credit_note(uid) +puts result ``` ## Example Response *(as JSON)* @@ -1936,6 +1902,7 @@ result = invoices_controller.record_payment_for_subscription( subscription_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -2002,6 +1969,7 @@ def reopen_invoice(uid) uid = 'uid0' result = invoices_controller.reopen_invoice(uid) +puts result ``` ## Errors @@ -2047,6 +2015,7 @@ result = invoices_controller.void_invoice( uid, body: body ) +puts result ``` ## Errors @@ -2070,9 +2039,9 @@ def list_consolidated_invoice_segments(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `invoice_uid` | `String` | Template, Required | The unique identifier of the consolidated invoice | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | -| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | Sort direction of the returned segments.
**Default**: `Direction::ASC` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | +| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | Sort direction of the returned segments.

**Default**: `Direction::ASC` | ## Response Type @@ -2089,6 +2058,7 @@ collect = { } result = invoices_controller.list_consolidated_invoice_segments(collect) +puts result ``` ## Example Response *(as JSON)* @@ -2572,6 +2542,7 @@ result = invoices_controller.create_invoice( subscription_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -2758,6 +2729,7 @@ def preview_customer_information_changes(uid) uid = 'uid0' result = invoices_controller.preview_customer_information_changes(uid) +puts result ``` ## Example Response *(as JSON)* @@ -2847,6 +2819,7 @@ def update_customer_information(uid) uid = 'uid0' result = invoices_controller.update_customer_information(uid) +puts result ``` ## Example Response *(as JSON)* @@ -3088,6 +3061,7 @@ result = invoices_controller.issue_invoice( uid, body: body ) +puts result ``` ## Errors diff --git a/doc/controllers/offers.md b/doc/controllers/offers.md index 7c377aa2..cfee1fed 100644 --- a/doc/controllers/offers.md +++ b/doc/controllers/offers.md @@ -70,6 +70,7 @@ body = CreateOfferRequest.new( ) result = offers_controller.create_offer(body: body) +puts result ``` ## Example Response *(as JSON)* @@ -133,8 +134,8 @@ def list_offers(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `include_archived` | `TrueClass \| FalseClass` | Query, Optional | Include archived products. Use in query: `include_archived=true`. | ## Response Type @@ -151,6 +152,7 @@ collect = { } result = offers_controller.list_offers(collect) +puts result ``` ## Example Response *(as JSON)* @@ -239,6 +241,7 @@ def read_offer(offer_id) offer_id = 130 result = offers_controller.read_offer(offer_id) +puts result ``` diff --git a/doc/controllers/payment-profiles.md b/doc/controllers/payment-profiles.md index 7dbefc7f..0547ed6f 100644 --- a/doc/controllers/payment-profiles.md +++ b/doc/controllers/payment-profiles.md @@ -329,6 +329,7 @@ body = CreatePaymentProfileRequest.new( ) result = payment_profiles_controller.create_payment_profile(body: body) +puts result ``` ## Example Response *(as JSON)* @@ -380,8 +381,8 @@ def list_payment_profiles(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `customer_id` | `Integer` | Query, Optional | The ID of the customer for which you wish to list payment profiles | ## Response Type @@ -397,6 +398,7 @@ collect = { } result = payment_profiles_controller.list_payment_profiles(collect) +puts result ``` ## Example Response *(as JSON)* @@ -408,6 +410,8 @@ result = payment_profiles_controller.list_payment_profiles(collect) "id": 10089892, "first_name": "Chester", "last_name": "Tester", + "created_at": "2025-01-01T00:00:00-05:00", + "updated_at": "2025-01-01T00:00:00-05:00", "customer_id": 14543792, "current_vault": "bogus", "vault_token": "0011223344", @@ -434,6 +438,8 @@ result = payment_profiles_controller.list_payment_profiles(collect) "id": 10188522, "first_name": "Frankie", "last_name": "Tester", + "created_at": "2025-01-01T00:00:00-05:00", + "updated_at": "2025-01-01T00:00:00-05:00", "customer_id": 14543712, "current_vault": "bogus", "vault_token": "123456789", @@ -475,6 +481,8 @@ Example response for Bank Account: "id": 10089892, "first_name": "Chester", "last_name": "Tester", + "created_at": "2025-01-01T00:00:00-05:00", + "updated_at": "2025-01-01T00:00:00-05:00", "customer_id": 14543792, "current_vault": "bogus", "vault_token": "0011223344", @@ -517,6 +525,7 @@ def read_payment_profile(payment_profile_id) payment_profile_id = 198 result = payment_profiles_controller.read_payment_profile(payment_profile_id) +puts result ``` ## Example Response *(as JSON)* @@ -531,6 +540,8 @@ result = payment_profiles_controller.read_payment_profile(payment_profile_id) "card_type": "bogus", "expiration_month": 1, "expiration_year": 2022, + "created_at": "2025-01-01T00:00:00-05:00", + "updated_at": "2025-01-01T00:00:00-05:00", "customer_id": 14543792, "current_vault": "bogus", "vault_token": "1", @@ -635,6 +646,7 @@ result = payment_profiles_controller.update_payment_profile( payment_profile_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -784,6 +796,7 @@ result = payment_profiles_controller.verify_bank_account( bank_account_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -891,6 +904,7 @@ result = payment_profiles_controller.change_subscription_default_payment_profile subscription_id, payment_profile_id ) +puts result ``` ## Example Response *(as JSON)* @@ -965,6 +979,7 @@ result = payment_profiles_controller.change_subscription_group_default_payment_p uid, payment_profile_id ) +puts result ``` ## Example Response *(as JSON)* @@ -1031,6 +1046,7 @@ def read_one_time_token(chargify_token) chargify_token = 'chargify_token8' result = payment_profiles_controller.read_one_time_token(chargify_token) +puts result ``` ## Errors diff --git a/doc/controllers/product-families.md b/doc/controllers/product-families.md index dfaea8bb..823b2815 100644 --- a/doc/controllers/product-families.md +++ b/doc/controllers/product-families.md @@ -29,8 +29,8 @@ def list_products_for_product_family(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `product_family_id` | `String` | Template, Required | Either the product family's id or its handle prefixed with `handle:` | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `date_field` | [`BasicDateField`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search.
Use in query: `date_field=created_at`. | | `filter` | [`ListProductsFilter`](../../doc/models/list-products-filter.md) | Query, Optional | Filter to use for List Products operations | | `start_date` | `Date` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns products with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | @@ -63,6 +63,7 @@ collect = { } result = product_families_controller.list_products_for_product_family(collect) +puts result ``` ## Example Response *(as JSON)* @@ -202,6 +203,7 @@ body = CreateProductFamilyRequest.new( ) result = product_families_controller.create_product_family(body: body) +puts result ``` ## Example Response *(as JSON)* @@ -255,6 +257,7 @@ collect = { } result = product_families_controller.list_product_families(collect) +puts result ``` ## Example Response *(as JSON)* @@ -313,6 +316,7 @@ def read_product_family(id) id = 112 result = product_families_controller.read_product_family(id) +puts result ``` ## Example Response *(as JSON)* diff --git a/doc/controllers/product-price-points.md b/doc/controllers/product-price-points.md index 203a7225..217ae5da 100644 --- a/doc/controllers/product-price-points.md +++ b/doc/controllers/product-price-points.md @@ -70,6 +70,7 @@ result = product_price_points_controller.create_product_price_point( product_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -119,8 +120,8 @@ def list_product_price_points(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `product_id` | Integer \| String | Template, Required | This is a container for one-of cases. | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 10. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
**Default**: `10`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 10. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.

**Default**: `10`

**Constraints**: `<= 200` | | `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | When fetching a product's price points, if you have defined multiple currencies at the site level, you can optionally pass the ?currency_prices=true query param to include an array of currency price data in the response. If the product price point is set to use_site_exchange_rate: true, it will return pricing based on the current exchange rate. If the flag is set to false, it will return all of the defined prices for each currency. | | `filter_type` | [`Array`](../../doc/models/price-point-type.md) | Query, Optional | Use in query: `filter[type]=catalog,default`. | | `archived` | `TrueClass \| FalseClass` | Query, Optional | Set to include archived price points in the response. | @@ -139,6 +140,7 @@ Liquid error: Value cannot be null. (Parameter 'key')collect = { } result = product_price_points_controller.list_product_price_points(collect) +puts result ``` ## Example Response *(as JSON)* @@ -214,6 +216,7 @@ result = product_price_points_controller.update_product_price_point( price_point_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -277,6 +280,7 @@ result = product_price_points_controller.read_product_price_point( product_id, price_point_id ) +puts result ``` ## Example Response *(as JSON)* @@ -338,6 +342,7 @@ result = product_price_points_controller.archive_product_price_point( product_id, price_point_id ) +puts result ``` ## Example Response *(as JSON)* @@ -405,6 +410,7 @@ result = product_price_points_controller.unarchive_product_price_point( product_id, price_point_id ) +puts result ``` ## Example Response *(as JSON)* @@ -468,6 +474,7 @@ result = product_price_points_controller.promote_product_price_point_to_default( product_id, price_point_id ) +puts result ``` ## Example Response *(as JSON)* @@ -588,6 +595,7 @@ result = product_price_points_controller.bulk_create_product_price_points( product_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -679,6 +687,7 @@ result = product_price_points_controller.create_product_currency_prices( product_price_point_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -751,6 +760,7 @@ result = product_price_points_controller.update_product_currency_prices( product_price_point_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -792,8 +802,8 @@ def list_all_product_price_points(options = {}) | `direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | | `filter` | [`ListPricePointsFilter`](../../doc/models/list-price-points-filter.md) | Query, Optional | Filter to use for List PricePoints operations | | `include` | [`ListProductsPricePointsInclude`](../../doc/models/list-products-price-points-include.md) | Query, Optional | Allows including additional data in the response. Use in query: `include=currency_prices`. | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | ## Response Type @@ -825,6 +835,7 @@ collect = { } result = product_price_points_controller.list_all_product_price_points(collect) +puts result ``` ## Example Response *(as JSON)* diff --git a/doc/controllers/products.md b/doc/controllers/products.md index affe7d5e..165c94cb 100644 --- a/doc/controllers/products.md +++ b/doc/controllers/products.md @@ -65,6 +65,7 @@ result = products_controller.create_product( product_family_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -147,6 +148,7 @@ def read_product(product_id) product_id = 202 result = products_controller.read_product(product_id) +puts result ``` ## Example Response *(as JSON)* @@ -227,6 +229,7 @@ def update_product(product_id, product_id = 202 result = products_controller.update_product(product_id) +puts result ``` ## Example Response *(as JSON)* @@ -310,6 +313,7 @@ def archive_product(product_id) product_id = 202 result = products_controller.archive_product(product_id) +puts result ``` ## Example Response *(as JSON)* @@ -386,6 +390,7 @@ def read_product_by_handle(api_handle) api_handle = 'api_handle6' result = products_controller.read_product_by_handle(api_handle) +puts result ``` ## Example Response *(as JSON)* @@ -475,8 +480,8 @@ def list_products(options = {}) | `end_datetime` | `DateTime` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns products with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of end_date. | | `start_date` | `Date` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns products with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. | | `start_datetime` | `DateTime` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns products with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of start_date. | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `include_archived` | `TrueClass \| FalseClass` | Query, Optional | Include archived products. Use in query: `include_archived=true`. | | `include` | [`ListProductsInclude`](../../doc/models/list-products-include.md) | Query, Optional | Allows including additional data in the response. Use in query `include=prepaid_product_price_point`. | @@ -503,6 +508,7 @@ collect = { } result = products_controller.list_products(collect) +puts result ``` ## Example Response *(as JSON)* diff --git a/doc/controllers/proforma-invoices.md b/doc/controllers/proforma-invoices.md index 5676e4ec..4f122cff 100644 --- a/doc/controllers/proforma-invoices.md +++ b/doc/controllers/proforma-invoices.md @@ -75,12 +75,12 @@ def list_subscription_group_proforma_invoices(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `uid` | `String` | Template, Required | The uid of the subscription group | -| `line_items` | `TrueClass \| FalseClass` | Query, Optional | Include line items data
**Default**: `false` | -| `discounts` | `TrueClass \| FalseClass` | Query, Optional | Include discounts data
**Default**: `false` | -| `taxes` | `TrueClass \| FalseClass` | Query, Optional | Include taxes data
**Default**: `false` | -| `credits` | `TrueClass \| FalseClass` | Query, Optional | Include credits data
**Default**: `false` | -| `payments` | `TrueClass \| FalseClass` | Query, Optional | Include payments data
**Default**: `false` | -| `custom_fields` | `TrueClass \| FalseClass` | Query, Optional | Include custom fields data
**Default**: `false` | +| `line_items` | `TrueClass \| FalseClass` | Query, Optional | Include line items data

**Default**: `false` | +| `discounts` | `TrueClass \| FalseClass` | Query, Optional | Include discounts data

**Default**: `false` | +| `taxes` | `TrueClass \| FalseClass` | Query, Optional | Include taxes data

**Default**: `false` | +| `credits` | `TrueClass \| FalseClass` | Query, Optional | Include credits data

**Default**: `false` | +| `payments` | `TrueClass \| FalseClass` | Query, Optional | Include payments data

**Default**: `false` | +| `custom_fields` | `TrueClass \| FalseClass` | Query, Optional | Include custom fields data

**Default**: `false` | ## Response Type @@ -100,6 +100,7 @@ collect = { } result = proforma_invoices_controller.list_subscription_group_proforma_invoices(collect) +puts result ``` ## Errors @@ -137,6 +138,7 @@ def read_proforma_invoice(proforma_invoice_uid) proforma_invoice_uid = 'proforma_invoice_uid4' result = proforma_invoices_controller.read_proforma_invoice(proforma_invoice_uid) +puts result ``` ## Errors @@ -176,6 +178,7 @@ def create_proforma_invoice(subscription_id) subscription_id = 222 result = proforma_invoices_controller.create_proforma_invoice(subscription_id) +puts result ``` ## Errors @@ -201,15 +204,15 @@ def list_proforma_invoices(options = {}) | `start_date` | `String` | Query, Optional | The beginning date range for the invoice's Due Date, in the YYYY-MM-DD format. | | `end_date` | `String` | Query, Optional | The ending date range for the invoice's Due Date, in the YYYY-MM-DD format. | | `status` | [`ProformaInvoiceStatus`](../../doc/models/proforma-invoice-status.md) | Query, Optional | The current status of the invoice. Allowed Values: draft, open, paid, pending, voided | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | -| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices.
**Default**: `Direction::DESC` | -| `line_items` | `TrueClass \| FalseClass` | Query, Optional | Include line items data
**Default**: `false` | -| `discounts` | `TrueClass \| FalseClass` | Query, Optional | Include discounts data
**Default**: `false` | -| `taxes` | `TrueClass \| FalseClass` | Query, Optional | Include taxes data
**Default**: `false` | -| `credits` | `TrueClass \| FalseClass` | Query, Optional | Include credits data
**Default**: `false` | -| `payments` | `TrueClass \| FalseClass` | Query, Optional | Include payments data
**Default**: `false` | -| `custom_fields` | `TrueClass \| FalseClass` | Query, Optional | Include custom fields data
**Default**: `false` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | +| `direction` | [`Direction`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices.

**Default**: `Direction::DESC` | +| `line_items` | `TrueClass \| FalseClass` | Query, Optional | Include line items data

**Default**: `false` | +| `discounts` | `TrueClass \| FalseClass` | Query, Optional | Include discounts data

**Default**: `false` | +| `taxes` | `TrueClass \| FalseClass` | Query, Optional | Include taxes data

**Default**: `false` | +| `credits` | `TrueClass \| FalseClass` | Query, Optional | Include credits data

**Default**: `false` | +| `payments` | `TrueClass \| FalseClass` | Query, Optional | Include payments data

**Default**: `false` | +| `custom_fields` | `TrueClass \| FalseClass` | Query, Optional | Include custom fields data

**Default**: `false` | ## Response Type @@ -232,6 +235,7 @@ collect = { } result = proforma_invoices_controller.list_proforma_invoices(collect) +puts result ``` @@ -269,6 +273,7 @@ def void_proforma_invoice(proforma_invoice_uid, proforma_invoice_uid = 'proforma_invoice_uid4' result = proforma_invoices_controller.void_proforma_invoice(proforma_invoice_uid) +puts result ``` ## Errors @@ -309,6 +314,7 @@ def preview_proforma_invoice(subscription_id) subscription_id = 222 result = proforma_invoices_controller.preview_proforma_invoice(subscription_id) +puts result ``` ## Errors @@ -358,6 +364,7 @@ body = CreateSubscriptionRequest.new( ) result = proforma_invoices_controller.create_signup_proforma_invoice(body: body) +puts result ``` ## Errors @@ -409,6 +416,7 @@ body = CreateSubscriptionRequest.new( ) result = proforma_invoices_controller.preview_signup_proforma_invoice(body: body) +puts result ``` ## Errors diff --git a/doc/controllers/reason-codes.md b/doc/controllers/reason-codes.md index 78a2251d..641e8cf0 100644 --- a/doc/controllers/reason-codes.md +++ b/doc/controllers/reason-codes.md @@ -21,7 +21,7 @@ reason_codes_controller = client.reason_codes # Reason Codes Intro -ReasonCodes are a way to gain a high level view of why your customers are cancelling the subcription to your product or service. +ReasonCodes are a way to gain a high level view of why your customers are cancelling the subscription to your product or service. Add a set of churn reason codes to be displayed in-app and/or the Maxio Billing Portal. As your subscribers decide to cancel their subscription, learn why they decided to cancel. @@ -61,6 +61,7 @@ body = CreateReasonCodeRequest.new( ) result = reason_codes_controller.create_reason_code(body: body) +puts result ``` ## Errors @@ -82,8 +83,8 @@ def list_reason_codes(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | ## Response Type @@ -98,6 +99,7 @@ collect = { } result = reason_codes_controller.list_reason_codes(collect) +puts result ``` ## Example Response *(as JSON)* @@ -120,7 +122,7 @@ result = reason_codes_controller.list_reason_codes(collect) "id": 1, "site_id": 2, "code": "CH1", - "description": "This doesnt meet my needs", + "description": "This does not meet my needs", "position": 2, "created_at": "2017-02-16T16:48:45-05:00", "updated_at": "2017-02-17T16:29:59-05:00" @@ -171,6 +173,7 @@ def read_reason_code(reason_code_id) reason_code_id = 32 result = reason_codes_controller.read_reason_code(reason_code_id) +puts result ``` ## Errors @@ -206,6 +209,7 @@ def update_reason_code(reason_code_id, reason_code_id = 32 result = reason_codes_controller.update_reason_code(reason_code_id) +puts result ``` ## Errors @@ -218,7 +222,7 @@ result = reason_codes_controller.update_reason_code(reason_code_id) # Delete Reason Code -This method gives a merchant the option to delete one reason code from the Churn Reason Codes. This code will be immediately removed. This action is not reversable. +This method gives a merchant the option to delete one reason code from the Churn Reason Codes. This code will be immediately removed. This action is not reversible. ```ruby def delete_reason_code(reason_code_id) @@ -240,6 +244,7 @@ def delete_reason_code(reason_code_id) reason_code_id = 32 result = reason_codes_controller.delete_reason_code(reason_code_id) +puts result ``` ## Example Response *(as JSON)* diff --git a/doc/controllers/referral-codes.md b/doc/controllers/referral-codes.md index d6a0dde2..b6b9b27c 100644 --- a/doc/controllers/referral-codes.md +++ b/doc/controllers/referral-codes.md @@ -41,6 +41,7 @@ def validate_referral_code(code) code = 'code8' result = referral_codes_controller.validate_referral_code(code) +puts result ``` ## Example Response *(as JSON)* diff --git a/doc/controllers/sales-commissions.md b/doc/controllers/sales-commissions.md index 38ba949e..e31db29f 100644 --- a/doc/controllers/sales-commissions.md +++ b/doc/controllers/sales-commissions.md @@ -36,10 +36,10 @@ def list_sales_commission_settings(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `seller_id` | `String` | Template, Required | The Chargify id of your seller account | -| `authorization` | `String` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication).
**Default**: `'Bearer <>'` | +| `authorization` | `String` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication).

**Default**: `'Bearer <>'` | | `live_mode` | `TrueClass \| FalseClass` | Query, Optional | This parameter indicates if records should be fetched from live mode sites. Default value is true. | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100.
**Default**: `100` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100.

**Default**: `100` | ## Response Type @@ -56,6 +56,7 @@ collect = { } result = sales_commissions_controller.list_sales_commission_settings(collect) +puts result ``` ## Example Response *(as JSON)* @@ -114,10 +115,10 @@ def list_sales_reps(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `seller_id` | `String` | Template, Required | The Chargify id of your seller account | -| `authorization` | `String` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication).
**Default**: `'Bearer <>'` | +| `authorization` | `String` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication).

**Default**: `'Bearer <>'` | | `live_mode` | `TrueClass \| FalseClass` | Query, Optional | This parameter indicates if records should be fetched from live mode sites. Default value is true. | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100.
**Default**: `100` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100.

**Default**: `100` | ## Response Type @@ -134,6 +135,7 @@ collect = { } result = sales_commissions_controller.list_sales_reps(collect) +puts result ``` ## Example Response *(as JSON)* @@ -247,10 +249,10 @@ def read_sales_rep(seller_id, | --- | --- | --- | --- | | `seller_id` | `String` | Template, Required | The Chargify id of your seller account | | `sales_rep_id` | `String` | Template, Required | The Advanced Billing id of sales rep. | -| `authorization` | `String` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication).
**Default**: `'Bearer <>'` | +| `authorization` | `String` | Header, Optional | For authorization use user API key. See details [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg0-2020-04-20-new-api-authentication).

**Default**: `'Bearer <>'` | | `live_mode` | `TrueClass \| FalseClass` | Query, Optional | This parameter indicates if records should be fetched from live mode sites. Default value is true. | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100.
**Default**: `100` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 100.

**Default**: `100` | ## Response Type @@ -276,6 +278,7 @@ result = sales_commissions_controller.read_sales_rep( page: page, per_page: per_page ) +puts result ``` ## Example Response *(as JSON)* diff --git a/doc/controllers/sites.md b/doc/controllers/sites.md index 89523fe0..08315377 100644 --- a/doc/controllers/sites.md +++ b/doc/controllers/sites.md @@ -46,6 +46,7 @@ def read_site ```ruby result = sites_controller.read_site +puts result ``` ## Example Response *(as JSON)* @@ -114,7 +115,7 @@ def clear_site(cleanup_scope: CleanupScope::ALL) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `cleanup_scope` | [`CleanupScope`](../../doc/models/cleanup-scope.md) | Query, Optional | `all`: Will clear all products, customers, and related subscriptions from the site.
`customers`: Will clear only customers and related subscriptions (leaving the products untouched) for the site.
Revenue will also be reset to 0.
Use in query `cleanup_scope=all`.
**Default**: `CleanupScope::ALL` | +| `cleanup_scope` | [`CleanupScope`](../../doc/models/cleanup-scope.md) | Query, Optional | `all`: Will clear all products, customers, and related subscriptions from the site.
`customers`: Will clear only customers and related subscriptions (leaving the products untouched) for the site.
Revenue will also be reset to 0.
Use in query `cleanup_scope=all`.

**Default**: `CleanupScope::ALL` | ## Response Type @@ -141,8 +142,8 @@ def list_chargify_js_public_keys(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | ## Response Type @@ -157,6 +158,7 @@ collect = { } result = sites_controller.list_chargify_js_public_keys(collect) +puts result ``` ## Example Response *(as JSON)* diff --git a/doc/controllers/subscription-components.md b/doc/controllers/subscription-components.md index 3ee92628..96f998c1 100644 --- a/doc/controllers/subscription-components.md +++ b/doc/controllers/subscription-components.md @@ -60,6 +60,7 @@ result = subscription_components_controller.read_subscription_component( subscription_id, component_id ) +puts result ``` ## Example Response *(as JSON)* @@ -149,6 +150,7 @@ collect = { } result = subscription_components_controller.list_subscription_components(collect) +puts result ``` ## Example Response *(as JSON)* @@ -233,6 +235,7 @@ result = subscription_components_controller.bulk_update_subscription_components_ subscription_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -285,6 +288,7 @@ def bulk_reset_subscription_components_price_points(subscription_id) subscription_id = 222 result = subscription_components_controller.bulk_reset_subscription_components_price_points(subscription_id) +puts result ``` ## Example Response *(as JSON)* @@ -477,6 +481,7 @@ result = subscription_components_controller.allocate_component( component_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -549,7 +554,7 @@ def list_allocations(subscription_id, | --- | --- | --- | --- | | `subscription_id` | `Integer` | Template, Required | The Chargify id of the subscription | | `component_id` | `Integer` | Template, Required | The Advanced Billing id of the component | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | ## Response Type @@ -569,6 +574,7 @@ result = subscription_components_controller.list_allocations( component_id, page: page ) +puts result ``` ## Example Response *(as JSON)* @@ -674,6 +680,7 @@ result = subscription_components_controller.allocate_components( subscription_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -776,6 +783,7 @@ result = subscription_components_controller.preview_allocations( subscription_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -1111,6 +1119,7 @@ result = subscription_components_controller.create_usage( component_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -1169,8 +1178,8 @@ def list_usages(options = {}) | `max_id` | `Integer` | Query, Optional | Returns usages with an id less than or equal to the one specified | | `since_date` | `Date` | Query, Optional | Returns usages with a created_at date greater than or equal to midnight (12:00 AM) on the date specified. | | `until_date` | `Date` | Query, Optional | Returns usages with a created_at date less than or equal to midnight (12:00 AM) on the date specified. | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | ## Response Type @@ -1187,6 +1196,7 @@ collect = { } result = subscription_components_controller.list_usages(collect) +puts result ``` ## Example Response *(as JSON)* @@ -1443,8 +1453,8 @@ def list_subscription_components_for_site(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `sort` | [`ListSubscriptionComponentsSort`](../../doc/models/list-subscription-components-sort.md) | Query, Optional | The attribute by which to sort. Use in query: `sort=updated_at`. | | `direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | | `filter` | [`ListSubscriptionComponentsForSiteFilter`](../../doc/models/list-subscription-components-for-site-filter.md) | Query, Optional | Filter to use for List Subscription Components For Site operation | @@ -1453,7 +1463,7 @@ def list_subscription_components_for_site(options = {}) | `start_datetime` | `String` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of start_date. Use in query `start_datetime=2022-07-01 09:00:05`. | | `end_date` | `String` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. Use in query `end_date=2011-12-16`. | | `end_datetime` | `String` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of end_date. Use in query `end_datetime=2022-07-01 09:00:05`. | -| `subscription_ids` | `Array` | Query, Optional | Allows fetching components allocation with matching subscription id based on provided ids. Use in query `subscription_ids=1,2,3`.
**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `200` | +| `subscription_ids` | `Array` | Query, Optional | Allows fetching components allocation with matching subscription id based on provided ids. Use in query `subscription_ids=1,2,3`.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `200` | | `price_point_ids` | [`IncludeNotNull`](../../doc/models/include-not-null.md) | Query, Optional | Allows fetching components allocation only if price point id is present. Use in query `price_point_ids=not_null`. | | `product_family_ids` | `Array` | Query, Optional | Allows fetching components allocation with matching product family id based on provided ids. Use in query `product_family_ids=1,2,3`. | | `include` | [`ListSubscriptionComponentsInclude`](../../doc/models/list-subscription-components-include.md) | Query, Optional | Allows including additional data in the response. Use in query `include=subscription,historic_usages`. | @@ -1491,5 +1501,6 @@ collect = { } result = subscription_components_controller.list_subscription_components_for_site(collect) +puts result ``` diff --git a/doc/controllers/subscription-group-invoice-account.md b/doc/controllers/subscription-group-invoice-account.md index 6e2fdaff..c9ce2d62 100644 --- a/doc/controllers/subscription-group-invoice-account.md +++ b/doc/controllers/subscription-group-invoice-account.md @@ -42,6 +42,7 @@ def create_subscription_group_prepayment(uid, uid = 'uid0' result = subscription_group_invoice_account_controller.create_subscription_group_prepayment(uid) +puts result ``` ## Example Response *(as JSON)* @@ -76,8 +77,8 @@ def list_prepayments_for_subscription_group(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `uid` | `String` | Template, Required | The uid of the subscription group | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `filter` | [`ListPrepaymentsFilter`](../../doc/models/list-prepayments-filter.md) | Query, Optional | Filter to use for List Prepayments operations | ## Response Type @@ -99,6 +100,7 @@ collect = { } result = subscription_group_invoice_account_controller.list_prepayments_for_subscription_group(collect) +puts result ``` ## Example Response *(as JSON)* @@ -166,6 +168,7 @@ result = subscription_group_invoice_account_controller.issue_subscription_group_ uid, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -225,6 +228,7 @@ result = subscription_group_invoice_account_controller.deduct_subscription_group uid, body: body ) +puts result ``` ## Example Response *(as JSON)* diff --git a/doc/controllers/subscription-group-status.md b/doc/controllers/subscription-group-status.md index ab9e50b5..b440eb83 100644 --- a/doc/controllers/subscription-group-status.md +++ b/doc/controllers/subscription-group-status.md @@ -179,6 +179,7 @@ result = subscription_group_status_controller.reactivate_subscription_group( uid, body: body ) +puts result ``` ## Example Response *(as JSON)* diff --git a/doc/controllers/subscription-groups.md b/doc/controllers/subscription-groups.md index 87eb6f8e..d0ca5f29 100644 --- a/doc/controllers/subscription-groups.md +++ b/doc/controllers/subscription-groups.md @@ -70,6 +70,7 @@ body = SubscriptionGroupSignupRequest.new( ) result = subscription_groups_controller.signup_with_subscription_group(body: body) +puts result ``` ## Errors @@ -112,6 +113,7 @@ body = CreateSubscriptionGroupRequest.new( ) result = subscription_groups_controller.create_subscription_group(body: body) +puts result ``` ## Example Response *(as JSON)* @@ -159,8 +161,8 @@ def list_subscription_groups(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `include` | [`Array`](../../doc/models/subscription-groups-list-include.md) | Query, Optional | A list of additional information to include in the response. The following values are supported:

- `account_balances`: Account balance information for the subscription groups. Use in query: `include[]=account_balances` | ## Response Type @@ -179,6 +181,7 @@ collect = { } result = subscription_groups_controller.list_subscription_groups(collect) +puts result ``` ## Example Response *(as JSON)* @@ -257,6 +260,7 @@ result = subscription_groups_controller.read_subscription_group( uid, include: include ) +puts result ``` ## Example Response *(as JSON)* @@ -342,6 +346,7 @@ result = subscription_groups_controller.update_subscription_group_members( uid, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -397,6 +402,7 @@ def delete_subscription_group(uid) uid = 'uid0' result = subscription_groups_controller.delete_subscription_group(uid) +puts result ``` ## Example Response *(as JSON)* @@ -441,6 +447,7 @@ def find_subscription_group(subscription_id) subscription_id = 'subscription_id0' result = subscription_groups_controller.find_subscription_group(subscription_id) +puts result ``` ## Example Response *(as JSON)* @@ -547,6 +554,7 @@ result = subscription_groups_controller.add_subscription_to_group( subscription_id, body: body ) +puts result ``` ## Example Response *(as JSON)* diff --git a/doc/controllers/subscription-invoice-account.md b/doc/controllers/subscription-invoice-account.md index 0d899903..fb18368d 100644 --- a/doc/controllers/subscription-invoice-account.md +++ b/doc/controllers/subscription-invoice-account.md @@ -15,6 +15,7 @@ subscription_invoice_account_controller = client.subscription_invoice_account * [List Prepayments](../../doc/controllers/subscription-invoice-account.md#list-prepayments) * [Issue Service Credit](../../doc/controllers/subscription-invoice-account.md#issue-service-credit) * [Deduct Service Credit](../../doc/controllers/subscription-invoice-account.md#deduct-service-credit) +* [List Service Credits](../../doc/controllers/subscription-invoice-account.md#list-service-credits) * [Refund Prepayment](../../doc/controllers/subscription-invoice-account.md#refund-prepayment) @@ -42,6 +43,7 @@ def read_account_balances(subscription_id) subscription_id = 222 result = subscription_invoice_account_controller.read_account_balances(subscription_id) +puts result ``` @@ -89,6 +91,7 @@ result = subscription_invoice_account_controller.create_prepayment( subscription_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -127,8 +130,8 @@ def list_prepayments(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscription_id` | `Integer` | Template, Required | The Chargify id of the subscription | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `filter` | [`ListPrepaymentsFilter`](../../doc/models/list-prepayments-filter.md) | Query, Optional | Filter to use for List Prepayments operations | ## Response Type @@ -150,6 +153,7 @@ collect = { } result = subscription_invoice_account_controller.list_prepayments(collect) +puts result ``` ## Example Response *(as JSON)* @@ -215,6 +219,7 @@ result = subscription_invoice_account_controller.issue_service_credit( subscription_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -281,6 +286,84 @@ subscription_invoice_account_controller.deduct_service_credit( | 422 | Unprocessable Entity (WebDAV) | `APIException` | +# List Service Credits + +This request will list a subscription's service credits. + +```ruby +def list_service_credits(subscription_id, + page: 1, + per_page: 20, + direction: nil) +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscription_id` | `Integer` | Template, Required | The Chargify id of the subscription | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | +| `direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | + +## Response Type + +[`ListServiceCreditsResponse`](../../doc/models/list-service-credits-response.md) + +## Example Usage + +```ruby +subscription_id = 222 + +page = 2 + +per_page = 50 + +result = subscription_invoice_account_controller.list_service_credits( + subscription_id, + page: page, + per_page: per_page +) +puts result +``` + +## Example Response *(as JSON)* + +```json +{ + "service_credits": [ + { + "id": 68, + "amount_in_cents": 2200, + "ending_balance_in_cents": 1100, + "entry_type": "Debit", + "memo": "Service credit memo", + "invoice_uid": "inv_brntdvmmqxc3j", + "remaining_balance_in_cents": 1100, + "created_at": "2025-04-01T09:54:49-04:00" + }, + { + "id": 67, + "amount_in_cents": 3300, + "ending_balance_in_cents": 3300, + "entry_type": "Credit", + "memo": "Service credit memo", + "invoice_uid": null, + "remaining_balance_in_cents": 1100, + "created_at": "2025-03-05T16:06:08-05:00" + } + ] +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | `APIException` | +| 422 | Unprocessable Entity | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + # Refund Prepayment This endpoint will refund, completely or partially, a particular prepayment applied to a subscription. The `prepayment_id` will be the account transaction ID of the original payment. The prepayment must have some amount remaining in order to be refunded. @@ -316,6 +399,7 @@ result = subscription_invoice_account_controller.refund_prepayment( subscription_id, prepayment_id ) +puts result ``` ## Errors diff --git a/doc/controllers/subscription-notes.md b/doc/controllers/subscription-notes.md index 798251d6..8d1e9ed1 100644 --- a/doc/controllers/subscription-notes.md +++ b/doc/controllers/subscription-notes.md @@ -61,6 +61,7 @@ result = subscription_notes_controller.create_subscription_note( subscription_id, body: body ) +puts result ``` ## Errors @@ -83,8 +84,8 @@ def list_subscription_notes(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscription_id` | `Integer` | Template, Required | The Chargify id of the subscription | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | ## Response Type @@ -100,6 +101,7 @@ collect = { } result = subscription_notes_controller.list_subscription_notes(collect) +puts result ``` ## Example Response *(as JSON)* @@ -167,6 +169,7 @@ result = subscription_notes_controller.read_subscription_note( subscription_id, note_id ) +puts result ``` ## Example Response *(as JSON)* @@ -226,6 +229,7 @@ result = subscription_notes_controller.update_subscription_note( note_id, body: body ) +puts result ``` ## Errors diff --git a/doc/controllers/subscription-products.md b/doc/controllers/subscription-products.md index 17897b02..1d789749 100644 --- a/doc/controllers/subscription-products.md +++ b/doc/controllers/subscription-products.md @@ -108,6 +108,7 @@ result = subscription_products_controller.migrate_subscription_product( subscription_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -283,6 +284,7 @@ result = subscription_products_controller.preview_subscription_product_migration subscription_id, body: body ) +puts result ``` ## Example Response *(as JSON)* diff --git a/doc/controllers/subscription-status.md b/doc/controllers/subscription-status.md index 4cfa3335..3d9f858c 100644 --- a/doc/controllers/subscription-status.md +++ b/doc/controllers/subscription-status.md @@ -54,6 +54,7 @@ def retry_subscription(subscription_id) subscription_id = 222 result = subscription_status_controller.retry_subscription(subscription_id) +puts result ``` ## Example Response *(as JSON)* @@ -225,6 +226,7 @@ def cancel_subscription(subscription_id, subscription_id = 222 result = subscription_status_controller.cancel_subscription(subscription_id) +puts result ``` ## Example Response *(as JSON)* @@ -385,7 +387,7 @@ def resume_subscription(subscription_id, | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscription_id` | `Integer` | Template, Required | The Chargify id of the subscription | -| `calendar_billing_resumption_charge` | [`ResumptionCharge`](../../doc/models/resumption-charge.md) | Query, Optional | (For calendar billing subscriptions only) The way that the resumed subscription's charge should be handled
**Default**: `ResumptionCharge::PRORATED` | +| `calendar_billing_resumption_charge` | [`ResumptionCharge`](../../doc/models/resumption-charge.md) | Query, Optional | (For calendar billing subscriptions only) The way that the resumed subscription's charge should be handled

**Default**: `ResumptionCharge::PRORATED` | ## Response Type @@ -397,6 +399,7 @@ def resume_subscription(subscription_id, subscription_id = 222 Liquid error: Value cannot be null. (Parameter 'key')Liquid error: Value cannot be null. (Parameter 'key')result = subscription_status_controller.resume_subscription(subscription_id) +puts result ``` ## Example Response *(as JSON)* @@ -554,6 +557,7 @@ result = subscription_status_controller.pause_subscription( subscription_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -713,6 +717,7 @@ result = subscription_status_controller.update_automatic_subscription_resumption subscription_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -1040,6 +1045,7 @@ result = subscription_status_controller.reactivate_subscription( subscription_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -1189,6 +1195,7 @@ def initiate_delayed_cancellation(subscription_id, subscription_id = 222 result = subscription_status_controller.initiate_delayed_cancellation(subscription_id) +puts result ``` ## Errors @@ -1225,6 +1232,7 @@ def cancel_delayed_cancellation(subscription_id) subscription_id = 222 result = subscription_status_controller.cancel_delayed_cancellation(subscription_id) +puts result ``` ## Example Response *(as JSON)* @@ -1266,6 +1274,7 @@ def cancel_dunning(subscription_id) subscription_id = 222 result = subscription_status_controller.cancel_dunning(subscription_id) +puts result ``` ## Errors @@ -1344,6 +1353,7 @@ result = subscription_status_controller.preview_renewal( subscription_id, body: body ) +puts result ``` ## Example Response *(as JSON)* diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md index a66408f7..e6bdd3c2 100644 --- a/doc/controllers/subscriptions.md +++ b/doc/controllers/subscriptions.md @@ -164,42 +164,6 @@ If you already have a customer and card stored in your payment gateway, you may } ``` -## Subscription with Credit Card - -```json -"subscription": { - "product_handle": "basic", - "customer_attributes": { - "first_name": "Joe", - "last_name": "Blow", - "email": "joe@example.com", - "zip": "02120", - "state": "MA", - "reference": "XYZ", - "phone": "(617) 111 - 0000", - "organization": "Acme", - "country": "US", - "city": "Boston", - "address_2": null, - "address": "123 Mass Ave." - }, - "credit_card_attributes": { - "last_name": "Smith", - "first_name": "Joe", - "full_number": "4111111111111111", - "expiration_year": "2021", - "expiration_month": "1", - "card_type": "visa", - "billing_zip": "02120", - "billing_state": "MA", - "billing_country": "US", - "billing_city": "Boston", - "billing_address_2": null, - "billing_address": "123 Mass Ave." - } -} -``` - ## Subscription with ACH as Payment Profile ```json @@ -720,6 +684,7 @@ body = CreateSubscriptionRequest.new( ) result = subscriptions_controller.create_subscription(body: body) +puts result ``` ## Example Response *(as JSON)* @@ -888,12 +853,13 @@ def list_subscriptions(options = {}) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `state` | [`SubscriptionStateFilter`](../../doc/models/subscription-state-filter.md) | Query, Optional | The current state of the subscription | | `product` | `Integer` | Query, Optional | The product id of the subscription. (Note that the product handle cannot be used.) | | `product_price_point_id` | `Integer` | Query, Optional | The ID of the product price point. If supplied, product is required | | `coupon` | `Integer` | Query, Optional | The numeric id of the coupon currently applied to the subscription. (This can be found in the URL when editing a coupon. Note that the coupon code cannot be used.) | +| `coupon_code` | `String` | Query, Optional | The coupon code currently applied to the subscription | | `date_field` | [`SubscriptionDateField`](../../doc/models/subscription-date-field.md) | Query, Optional | The type of filter you'd like to apply to your search. Allowed Values: , current_period_ends_at, current_period_starts_at, created_at, activated_at, canceled_at, expires_at, trial_started_at, trial_ended_at, updated_at | | `start_date` | `Date` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns subscriptions with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. Use in query `start_date=2022-07-01`. | | `end_date` | `Date` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns subscriptions with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. Use in query `end_date=2022-08-01`. | @@ -901,7 +867,7 @@ def list_subscriptions(options = {}) | `end_datetime` | `DateTime` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns subscriptions with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Use in query `end_datetime=2022-08-01 10:00:05`. | | `metadata` | `Hash[String, String]` | Query, Optional | The value of the metadata field specified in the parameter. Use in query `metadata[my-field]=value&metadata[other-field]=another_value`. | | `direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | -| `sort` | [`SubscriptionSort`](../../doc/models/subscription-sort.md) | Query, Optional | The attribute by which to sort
**Default**: `SubscriptionSort::SIGNUP_DATE` | +| `sort` | [`SubscriptionSort`](../../doc/models/subscription-sort.md) | Query, Optional | The attribute by which to sort

**Default**: `SubscriptionSort::SIGNUP_DATE` | | `include` | [`Array`](../../doc/models/subscription-list-include.md) | Query, Optional | Allows including additional data in the response. Use in query: `include[]=self_service_page_token`. | ## Response Type @@ -925,6 +891,7 @@ collect = { } result = subscriptions_controller.list_subscriptions(collect) +puts result ``` @@ -995,12 +962,8 @@ subscription_id = 222 body = UpdateSubscriptionRequest.new( subscription: UpdateSubscription.new( - credit_card_attributes: CreditCardAttributes.new( - full_number: '4111111111111111', - expiration_month: '10', - expiration_year: '2030' - ), - next_billing_at: DateTimeHelper.from_rfc3339('2010-08-06T15:34:00Z') + next_billing_at: DateTimeHelper.from_rfc3339('2010-08-06T15:34:00Z'), + payment_collection_method: 'remittance' ) ) @@ -1008,6 +971,7 @@ result = subscriptions_controller.update_subscription( subscription_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -1165,6 +1129,7 @@ result = subscriptions_controller.read_subscription( subscription_id, include: include ) +puts result ``` ## Example Response *(as JSON)* @@ -1394,6 +1359,7 @@ def find_subscription(reference: nil) ```ruby result = subscriptions_controller.find_subscription +puts result ``` ## Errors @@ -1450,6 +1416,7 @@ result = subscriptions_controller.purge_subscription( ack, cascade: cascade ) +puts result ``` ## Errors @@ -1497,6 +1464,7 @@ result = subscriptions_controller.update_prepaid_subscription_configuration( subscription_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -1524,11 +1492,11 @@ result = subscriptions_controller.update_prepaid_subscription_configuration( The Chargify API allows you to preview a subscription by POSTing the same JSON or XML as for a subscription creation. -The "Next Billing" amount and "Next Billing" date are represented in each Subscriber's Summary. For more information, please see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). +The "Next Billing" amount and "Next Billing" date are represented in each Subscriber's Summary. -## Side effects +A subscription will not be created by utilizing this endpoint; it is meant to serve as a prediction. -A subscription will not be created by sending a POST to this endpoint. It is meant to serve as a prediction. +For more information, please see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). ## Taxable Subscriptions @@ -1572,6 +1540,7 @@ body = CreateSubscriptionRequest.new( ) result = subscriptions_controller.preview_subscription(body: body) +puts result ``` ## Example Response *(as JSON)* @@ -1739,6 +1708,7 @@ result = subscriptions_controller.apply_coupons_to_subscription( subscription_id, body: body ) +puts result ``` ## Example Response *(as JSON)* @@ -1926,6 +1896,7 @@ def remove_coupon_from_subscription(subscription_id, subscription_id = 222 result = subscriptions_controller.remove_coupon_from_subscription(subscription_id) +puts result ``` ## Example Response @@ -2009,6 +1980,7 @@ def activate_subscription(subscription_id, subscription_id = 222 result = subscriptions_controller.activate_subscription(subscription_id) +puts result ``` ## Errors diff --git a/doc/controllers/webhooks.md b/doc/controllers/webhooks.md index 3ecd01b9..96c73fc3 100644 --- a/doc/controllers/webhooks.md +++ b/doc/controllers/webhooks.md @@ -46,8 +46,8 @@ def list_webhooks(options = {}) | `status` | [`WebhookStatus`](../../doc/models/webhook-status.md) | Query, Optional | Webhooks with matching status would be returned. | | `since_date` | `String` | Query, Optional | Format YYYY-MM-DD. Returns Webhooks with the created_at date greater than or equal to the one specified. | | `until_date` | `String` | Query, Optional | Format YYYY-MM-DD. Returns Webhooks with the created_at date less than or equal to the one specified. | -| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.
**Default**: `1`
**Constraints**: `>= 1` | -| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.
**Default**: `20`
**Constraints**: `<= 200` | +| `page` | `Integer` | Query, Optional | Result records are organized in pages. By default, the first page of results is displayed. The page parameter specifies a page number of results to fetch. You can start navigating through the pages to consume the results. You do this by passing in a page parameter. Retrieve the next page by adding ?page=2 to the query string. If there are no results to return, then an empty result set will be returned.
Use in query `page=1`.

**Default**: `1`

**Constraints**: `>= 1` | +| `per_page` | `Integer` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 20. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `20`

**Constraints**: `<= 200` | | `order` | [`WebhookOrder`](../../doc/models/webhook-order.md) | Query, Optional | The order in which the Webhooks are returned. | | `subscription` | `Integer` | Query, Optional | The Advanced Billing id of a subscription you'd like to filter for | @@ -64,6 +64,7 @@ collect = { } result = webhooks_controller.list_webhooks(collect) +puts result ``` ## Example Response *(as JSON)* @@ -132,6 +133,7 @@ body = EnableWebhooksRequest.new( ) result = webhooks_controller.enable_webhooks(body: body) +puts result ``` ## Example Response *(as JSON)* @@ -174,6 +176,7 @@ body = ReplayWebhooksRequest.new( ) result = webhooks_controller.replay_webhooks(body: body) +puts result ``` ## Example Response *(as JSON)* @@ -220,6 +223,7 @@ body = CreateOrUpdateEndpointRequest.new( ) result = webhooks_controller.create_endpoint(body: body) +puts result ``` ## Example Response *(as JSON)* @@ -262,6 +266,7 @@ def list_endpoints ```ruby result = webhooks_controller.list_endpoints +puts result ``` ## Example Response *(as JSON)* @@ -341,6 +346,7 @@ result = webhooks_controller.update_endpoint( endpoint_id, body: body ) +puts result ``` ## Errors diff --git a/doc/date-time-helper.md b/doc/date-time-helper.md new file mode 100644 index 00000000..8e55bc56 --- /dev/null +++ b/doc/date-time-helper.md @@ -0,0 +1,22 @@ + +# DateTimeHelper + +DateTime utility class. + +## Methods + +| Name | Return Type | Description | +| --- | --- | --- | +| from_rfc3339 | `DateTime` | Safely converts a string into an RFC3339 DateTime object. | +| from_rfc1123 | `DateTime` | Safely converts a string into an RFC1123 DateTime object. | +| from_unix | `DateTime` | Safely converts a string into an Unix DateTime object. | +| to_rfc3339 | `DateTime_String` | Safely converts a RFC3339 DateTime object into a DateTime string. | +| to_rfc1123 | `DateTime_String` | Safely converts a RFC1123 DateTime object into a DateTime string. | +| to_unix | `DateTime_String` | Safely converts a Unix DateTime object into a DateTime string. | +| to_rfc3339_map | `Map_Of_DateTime_String` | Safely converts a map of RFC3339 DateTime object into a map of RFC3339 formatted DateTime string. | +| to_rfc3339_array | `Array_Of_DateTime_String` | Safely converts an array of RFC3339 DateTime object into an array of RFC3339 formatted DateTime string. | +| to_rfc1123_map | `Map_Of_DateTime_String` | Safely converts a map of RFC1123 DateTime object into map of RFC1123 formatted DateTime string. | +| to_rfc1123_array | `Array_Of_DateTime_String` | Safely converts an array of RFC1123 DateTime object into an array of RFC1123 formatted DateTime string. | +| to_unix_map | `Map_Of_DateTime_String` | Safely converts a map of Unix DateTime object into a map of Unix formatted DateTime string. | +| to_unix_array | `Array_Of_DateTime_String` | Safely converts an array of Unix DateTime object into an array of Unix formatted DateTime string. | + diff --git a/doc/http-request.md b/doc/http-request.md index cb611109..cf9b144d 100644 --- a/doc/http-request.md +++ b/doc/http-request.md @@ -7,9 +7,9 @@ Represents a single Http Request. | Name | Type | Tag | Description | | --- | --- | --- | --- | -| http_method | HttpMethodEnum | | The HTTP method of the request. | -| query_url | String | | The endpoint URL for the API request. | -| headers | Hash | Optional | Request headers. | -| parameters | Hash | Optional | Request body. | -| context | Hash | Optional | Request context for passing meta information about the request. | +| http_method | `HttpMethodEnum` | | The HTTP method of the request. | +| query_url | `String` | | The endpoint URL for the API request. | +| headers | `Hash` | Optional | Request headers. | +| parameters | `Hash` | Optional | Request body. | +| context | `Hash` | Optional | Request context for passing meta information about the request. | diff --git a/doc/http-response.md b/doc/http-response.md index 69ab50db..cf460465 100644 --- a/doc/http-response.md +++ b/doc/http-response.md @@ -7,9 +7,9 @@ Http response received. | Name | Type | Description | | --- | --- | --- | -| status_code | Integer | The status code returned by the server. | -| reason_phrase | String | The reason phrase returned by the server. | -| headers | Hash | Response headers. | -| raw_body | String | Response body. | -| request | [`HttpRequest`](http-request.md) | The request that resulted in this response. | +| status_code | `Integer` | The status code returned by the server. | +| reason_phrase | `String` | The reason phrase returned by the server. | +| headers | `Hash` | Response headers. | +| raw_body | `String` | Response body. | +| request | [`HttpRequest`](../doc/http-request.md) | The request that resulted in this response. | diff --git a/doc/models/apple-pay-payment-profile.md b/doc/models/apple-pay-payment-profile.md index 921e0f0c..0d374a4b 100644 --- a/doc/models/apple-pay-payment-profile.md +++ b/doc/models/apple-pay-payment-profile.md @@ -25,6 +25,8 @@ | `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Required | **Default**: `PaymentType::APPLE_PAY` | | `site_gateway_setting_id` | `Integer` | Optional | - | | `gateway_handle` | `String` | Optional | - | +| `created_at` | `DateTime` | Optional | A timestamp indicating when this payment profile was created | +| `updated_at` | `DateTime` | Optional | A timestamp indicating when this payment profile was last updated | ## Example (as JSON) diff --git a/doc/models/bank-account-payment-profile.md b/doc/models/bank-account-payment-profile.md index f29d4c61..8bfa60ce 100644 --- a/doc/models/bank-account-payment-profile.md +++ b/doc/models/bank-account-payment-profile.md @@ -28,9 +28,11 @@ | `bank_account_type` | [`BankAccountType`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking | | `bank_account_holder_type` | [`BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | | `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Required | **Default**: `PaymentType::BANK_ACCOUNT` | -| `verified` | `TrueClass \| FalseClass` | Optional | denotes whether a bank account has been verified by providing the amounts of two small deposits made into the account
**Default**: `false` | +| `verified` | `TrueClass \| FalseClass` | Optional | denotes whether a bank account has been verified by providing the amounts of two small deposits made into the account

**Default**: `false` | | `site_gateway_setting_id` | `Integer` | Optional | - | | `gateway_handle` | `String` | Optional | - | +| `created_at` | `DateTime` | Optional | A timestamp indicating when this payment profile was created | +| `updated_at` | `DateTime` | Optional | A timestamp indicating when this payment profile was last updated | ## Example (as JSON) diff --git a/doc/models/chargify-ebb.md b/doc/models/chargify-ebb.md index ca486e34..4505090e 100644 --- a/doc/models/chargify-ebb.md +++ b/doc/models/chargify-ebb.md @@ -12,7 +12,7 @@ | `timestamp` | `DateTime` | Optional | This timestamp determines what billing period the event will be billed in. If your request payload does not include it, Chargify will add `chargify.timestamp` to the event payload and set the value to `now`. | | `id` | `String` | Optional | A unique ID set by Chargify. Please note that this field is reserved. If `chargify.id` is present in the request payload, it will be overwritten. | | `created_at` | `DateTime` | Optional | An ISO-8601 timestamp, set by Chargify at the time each event is recorded. Please note that this field is reserved. If `chargify.created_at` is present in the request payload, it will be overwritten. | -| `uniqueness_token` | `String` | Optional | User-defined string scoped per-stream. Duplicate events within a stream will be silently ignored. Tokens expire after 31 days.
**Constraints**: *Maximum Length*: `64` | +| `uniqueness_token` | `String` | Optional | User-defined string scoped per-stream. Duplicate events within a stream will be silently ignored. Tokens expire after 31 days.

**Constraints**: *Maximum Length*: `64` | | `subscription_id` | `Integer` | Optional | Id of Maxio Advanced Billing Subscription which is connected to this event.
Provide `subscription_id` if you configured `chargify.subscription_id` as Subscription Identifier in your Event Stream. | | `subscription_reference` | `String` | Optional | Reference of Maxio Advanced Billing Subscription which is connected to this event.
Provide `subscription_reference` if you configured `chargify.subscription_reference` as Subscription Identifier in your Event Stream. | diff --git a/doc/models/component.md b/doc/models/component.md index cd44044b..d1c4fcf5 100644 --- a/doc/models/component.md +++ b/doc/models/component.md @@ -17,6 +17,7 @@ | `unit_price` | `String` | Optional | The amount the customer will be charged per unit. This field is only populated for ‘per_unit’ pricing schemes, otherwise it may be null. | | `product_family_id` | `Integer` | Optional | The id of the Product Family to which the Component belongs | | `product_family_name` | `String` | Optional | The name of the Product Family to which the Component belongs | +| `product_family_handle` | `String` | Optional | The handle of the Product Family to which the Component belongs | | `price_per_unit_in_cents` | `Integer` | Optional | deprecated - use unit_price instead | | `kind` | [`ComponentKind`](../../doc/models/component-kind.md) | Optional | A handle for the component type | | `archived` | `TrueClass \| FalseClass` | Optional | Boolean flag describing whether a component is archived or not. | diff --git a/doc/models/coupon-request.md b/doc/models/coupon-request.md index 1db54e62..4ba4855e 100644 --- a/doc/models/coupon-request.md +++ b/doc/models/coupon-request.md @@ -10,8 +10,8 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `coupon` | [`CouponPayload`](../../doc/models/coupon-payload.md) | Optional | - | -| `restricted_products` | `Hash[String, TrueClass \| FalseClass]` | Optional | An object where the keys are product_ids and the values are booleans indicating if the coupon should be applicable to the product | -| `restricted_components` | `Hash[String, TrueClass \| FalseClass]` | Optional | An object where the keys are component_ids and the values are booleans indicating if the coupon should be applicable to the component | +| `restricted_products` | `Hash[String, TrueClass \| FalseClass]` | Optional | An object where the keys are product IDs or handles (prefixed with 'handle:'), and the values are booleans indicating if the coupon should be applicable to the product | +| `restricted_components` | `Hash[String, TrueClass \| FalseClass]` | Optional | An object where the keys are component IDs or handles (prefixed with 'handle:'), and the values are booleans indicating if the coupon should be applicable to the component | ## Example (as JSON) diff --git a/doc/models/create-component-price-point.md b/doc/models/create-component-price-point.md index 8d466410..237ea218 100644 --- a/doc/models/create-component-price-point.md +++ b/doc/models/create-component-price-point.md @@ -13,7 +13,7 @@ | `handle` | `String` | Optional | - | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `prices` | [`Array`](../../doc/models/price.md) | Required | - | -| `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site. Setting not supported when creating price points in bulk.
**Default**: `true` | +| `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site. Setting not supported when creating price points in bulk.

**Default**: `true` | | `tax_included` | `TrueClass \| FalseClass` | Optional | Whether or not the price point includes tax. Setting not supported when creating price points in bulk. | | `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this price point, either month or day. This property is only available for sites with Multifrequency enabled. | diff --git a/doc/models/create-or-update-product.md b/doc/models/create-or-update-product.md index 97e1bc8e..9d9aa3c7 100644 --- a/doc/models/create-or-update-product.md +++ b/doc/models/create-or-update-product.md @@ -24,7 +24,7 @@ | `expiration_interval` | `Integer` | Optional | The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product would expire after 30 days. | | `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | A string representing the expiration interval unit for this product, either month, day or never | | `auto_create_signup_page` | `TrueClass \| FalseClass` | Optional | - | -| `tax_code` | `String` | Optional | A string representing the tax code related to the product type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters.
**Constraints**: *Maximum Length*: `10` | +| `tax_code` | `String` | Optional | A string representing the tax code related to the product type. This is especially important when using the Avalara service to tax based on locale. This attribute has a max length of 10 characters.

**Constraints**: *Maximum Length*: `10` | ## Example (as JSON) diff --git a/doc/models/create-prepaid-usage-component-price-point.md b/doc/models/create-prepaid-usage-component-price-point.md index 8f0b9b40..378b38eb 100644 --- a/doc/models/create-prepaid-usage-component-price-point.md +++ b/doc/models/create-prepaid-usage-component-price-point.md @@ -14,7 +14,7 @@ | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `prices` | [`Array`](../../doc/models/price.md) | Required | - | | `overage_pricing` | [`OveragePricing`](../../doc/models/overage-pricing.md) | Required | - | -| `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site.
**Default**: `true` | +| `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | Whether to use the site level exchange rate or define your own prices for each currency if you have multiple currencies defined on the site.

**Default**: `true` | | `rollover_prepaid_remainder` | `TrueClass \| FalseClass` | Optional | (only for prepaid usage components) Boolean which controls whether or not remaining units should be rolled over to the next period | | `renew_prepaid_allocation` | `TrueClass \| FalseClass` | Optional | (only for prepaid usage components) Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period | | `expiration_interval` | `Float` | Optional | (only for prepaid usage components where rollover_prepaid_remainder is true) The number of `expiration_interval_unit`s after which rollover amounts should expire | diff --git a/doc/models/create-product-price-point.md b/doc/models/create-product-price-point.md index 358517b8..1bcdf3bb 100644 --- a/doc/models/create-product-price-point.md +++ b/doc/models/create-product-price-point.md @@ -22,7 +22,7 @@ | `initial_charge_after_trial` | `TrueClass \| FalseClass` | Optional | - | | `expiration_interval` | `Integer` | Optional | The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. | | `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | A string representing the expiration interval unit for this product price point, either month, day or never | -| `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | Whether or not to use the site's exchange rate or define your own pricing when your site has multiple currencies defined.
**Default**: `true` | +| `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | Whether or not to use the site's exchange rate or define your own pricing when your site has multiple currencies defined.

**Default**: `true` | ## Example (as JSON) diff --git a/doc/models/create-subscription-request.md b/doc/models/create-subscription-request.md index 32da40e5..117b150e 100644 --- a/doc/models/create-subscription-request.md +++ b/doc/models/create-subscription-request.md @@ -16,6 +16,7 @@ ```json { "subscription": { + "defer_signup": false, "metafields": { "custom_field_name_1": "custom_field_value_1", "custom_field_name_2": "custom_field_value_2" diff --git a/doc/models/create-subscription.md b/doc/models/create-subscription.md index c6130151..32cfe38a 100644 --- a/doc/models/create-subscription.md +++ b/doc/models/create-subscription.md @@ -21,11 +21,12 @@ | `net_terms` | `String` | Optional | (Optional) Default: null The number of days after renewal (on invoice billing) that a subscription is due. A value between 0 (due immediately) and 180. | | `customer_id` | `Integer` | Optional | The ID of an existing customer within Chargify. Required, unless a `customer_reference` or a set of `customer_attributes` is given. | | `next_billing_at` | `DateTime` | Optional | (Optional) Set this attribute to a future date/time to sync imported subscriptions to your existing renewal schedule. See the notes on “Date/Time Format” in our [subscription import documentation](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format). If you provide a next_billing_at timestamp that is in the future, no trial or initial charges will be applied when you create the subscription. In fact, no payment will be captured at all. The first payment will be captured, according to the prices defined by the product, near the time specified by next_billing_at. If you do not provide a value for next_billing_at, any trial and/or initial charges will be assessed and charged at the time of subscription creation. If the card cannot be successfully charged, the subscription will not be created. See further notes in the section on Importing Subscriptions. | -| `initial_billing_at` | `DateTime` | Optional | (Optional) Set this attribute to a future date/time to create a subscription in the "Awaiting Signup" state, rather than "Active" or "Trialing". See the notes on “Date/Time Format” in our [subscription import documentation](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format). In the "Awaiting Signup" state, a subscription behaves like any other. It can be canceled, allocated to, had its billing date changed. etc. When the initial_billing_at date hits, the subscription will transition to the expected state. If the product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the initial_billing_at and it fails the subscription will be immediately canceled. See further notes in the section on Delayed Signups. | +| `initial_billing_at` | `DateTime` | Optional | (Optional) Set this attribute to a future date/time to create a subscription in the Awaiting Signup state, rather than Active or Trialing. You can omit the initial_billing_at date to activate the subscription immediately. In the Awaiting Signup state, a subscription behaves like any other. It can be canceled, allocated to, or have its billing date changed. etc. When the initial_billing_at date hits, the subscription will transition to the expected state. If the product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the initial_billing_at and it fails the subscription will be immediately canceled. See the [subscription import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format) documentation for more information about Date/Time Formats. | +| `defer_signup` | `TrueClass \| FalseClass` | Optional | (Optional) Set this attribute to true to create the subscription in the Awaiting Signup Date state. Use this when you want to create a subscription that has an unknown first billing date. When the first billing date is known, update a subscription and set the `initial_billing_at` date. The subscription moves to the Awaiting Signup state with a scheduled initial billing date. You can omit the initial_billing_at date to activate the subscription immediately. See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773-Subscription-States) for more information.

**Default**: `false` | | `stored_credential_transaction_id` | `Integer` | Optional | For European sites subject to PSD2 and using 3D Secure, this can be used to reference a previous transaction for the customer. This will ensure the card will be charged successfully at renewal. | | `sales_rep_id` | `Integer` | Optional | - | | `payment_profile_id` | `Integer` | Optional | The Payment Profile ID of an existing card or bank account, which belongs to an existing customer to use for payment for this subscription. If the card, bank account, or customer does not exist already, or if you want to use a new (unstored) card or bank account for the subscription, use `payment_profile_attributes` instead to create a new payment profile along with the subscription. (This value is available on an existing subscription via the API as `credit_card` > id or `bank_account` > id) | -| `reference` | `String` | Optional | The reference value (provided by your app) for the subscription itelf. | +| `reference` | `String` | Optional | The reference value (provided by your app) for the subscription itself. | | `customer_attributes` | [`CustomerAttributes`](../../doc/models/customer-attributes.md) | Optional | - | | `payment_profile_attributes` | [`PaymentProfileAttributes`](../../doc/models/payment-profile-attributes.md) | Optional | alias to credit_card_attributes | | `credit_card_attributes` | [`PaymentProfileAttributes`](../../doc/models/payment-profile-attributes.md) | Optional | Credit Card data to create a new Subscription. Interchangeable with `payment_profile_attributes` property. | @@ -46,7 +47,7 @@ | `authorizer_last_name` | `String` | Optional | (Optional) The last name of the person authorizing the ACH agreement. | | `calendar_billing_first_charge` | `String` | Optional | (Optional) One of “prorated” (the default – the prorated product price will be charged immediately), “immediate” (the full product price will be charged immediately), or “delayed” (the full product price will be charged with the first scheduled renewal). | | `reason_code` | `String` | Optional | (Optional) Can be used when canceling a subscription (via the HTTP DELETE method) to indicate why a subscription was canceled. | -| `product_change_delayed` | `TrueClass \| FalseClass` | Optional | (Optional, used only for Delayed Product Change When set to true, indicates that a changed value for product_handle should schedule the product change to the next subscription renewal. | +| `product_change_delayed` | `TrueClass \| FalseClass` | Optional | (Optional) used only for Delayed Product Change When set to true, indicates that a changed value for product_handle should schedule the product change to the next subscription renewal. | | `offer_id` | String \| Integer \| nil | Optional | This is a container for one-of cases. | | `prepaid_configuration` | [`UpsertPrepaidConfiguration`](../../doc/models/upsert-prepaid-configuration.md) | Optional | - | | `previous_billing_at` | `DateTime` | Optional | Providing a previous_billing_at that is in the past will set the current_period_starts_at when the subscription is created. It will also set activated_at if not explicitly passed during the subscription import. Can only be used if next_billing_at is also passed. Using this option will allow you to set the period start for the subscription so mid period component allocations have the correct prorated amount. | @@ -55,14 +56,15 @@ | `activated_at` | `DateTime` | Optional | - | | `agreement_acceptance` | [`AgreementAcceptance`](../../doc/models/agreement-acceptance.md) | Optional | Required when creating a subscription with Maxio Payments. | | `ach_agreement` | [`ACHAgreement`](../../doc/models/ach-agreement.md) | Optional | (Optional) If passed, the proof of the authorized ACH agreement terms will be persisted. | -| `dunning_communication_delay_enabled` | `TrueClass \| FalseClass` | Optional | Enable Communication Delay feature, making sure no communication (email or SMS) is sent to the Customer between 9PM and 8AM in time zone set by the `dunning_communication_delay_time_zone` attribute.
**Default**: `false` | +| `dunning_communication_delay_enabled` | `TrueClass \| FalseClass` | Optional | Enable Communication Delay feature, making sure no communication (email or SMS) is sent to the Customer between 9PM and 8AM in time zone set by the `dunning_communication_delay_time_zone` attribute.

**Default**: `false` | | `dunning_communication_delay_time_zone` | `String` | Optional | Time zone for the Dunning Communication Delay feature. | -| `skip_billing_manifest_taxes` | `TrueClass \| FalseClass` | Optional | Valid only for the Subscription Preview endpoint. When set to `true` it skips calculating taxes for the current and next billing manifests.
**Default**: `false` | +| `skip_billing_manifest_taxes` | `TrueClass \| FalseClass` | Optional | Valid only for the Subscription Preview endpoint. When set to `true` it skips calculating taxes for the current and next billing manifests.

**Default**: `false` | ## Example (as JSON) ```json { + "defer_signup": false, "metafields": { "custom_field_name_1": "custom_field_value_1", "custom_field_name_2": "custom_field_value_2" diff --git a/doc/models/credit-card-payment-profile.md b/doc/models/credit-card-payment-profile.md index 63bf4900..db5948fe 100644 --- a/doc/models/credit-card-payment-profile.md +++ b/doc/models/credit-card-payment-profile.md @@ -31,6 +31,8 @@ | `chargify_token` | `String` | Optional | Token received after sending billing information using chargify.js. This token will only be received if passed as a sole attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) | | `site_gateway_setting_id` | `Integer` | Optional | - | | `gateway_handle` | `String` | Optional | An identifier of connected gateway. | +| `created_at` | `DateTime` | Optional | A timestamp indicating when this payment profile was created | +| `updated_at` | `DateTime` | Optional | A timestamp indicating when this payment profile was last updated | ## Example (as JSON) diff --git a/doc/models/ebb-component.md b/doc/models/ebb-component.md index dc8eb01b..5d3675d2 100644 --- a/doc/models/ebb-component.md +++ b/doc/models/ebb-component.md @@ -12,7 +12,7 @@ | `name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | | `unit_name` | `String` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | | `description` | `String` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | -| `handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | +| `handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | | `taxable` | `TrueClass \| FalseClass` | Optional | Boolean flag describing whether a component is taxable or not. | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `prices` | [`Array`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | diff --git a/doc/models/group-billing.md b/doc/models/group-billing.md index 9feadab6..26a4da19 100644 --- a/doc/models/group-billing.md +++ b/doc/models/group-billing.md @@ -11,9 +11,9 @@ Optional attributes related to billing date and accrual. Note: Only applicable f | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `accrue` | `TrueClass \| FalseClass` | Optional | A flag indicating whether or not to accrue charges on the new subscription.
**Default**: `false` | -| `align_date` | `TrueClass \| FalseClass` | Optional | A flag indicating whether or not to align the billing date of the new subscription with the billing date of the primary subscription of the hierarchy's default subscription group. Required to be true if prorate is also true.
**Default**: `false` | -| `prorate` | `TrueClass \| FalseClass` | Optional | A flag indicating whether or not to prorate billing of the new subscription for the current period. A value of true is ignored unless align_date is also true.
**Default**: `false` | +| `accrue` | `TrueClass \| FalseClass` | Optional | A flag indicating whether or not to accrue charges on the new subscription.

**Default**: `false` | +| `align_date` | `TrueClass \| FalseClass` | Optional | A flag indicating whether or not to align the billing date of the new subscription with the billing date of the primary subscription of the hierarchy's default subscription group. Required to be true if prorate is also true.

**Default**: `false` | +| `prorate` | `TrueClass \| FalseClass` | Optional | A flag indicating whether or not to prorate billing of the new subscription for the current period. A value of true is ignored unless align_date is also true.

**Default**: `false` | ## Example (as JSON) diff --git a/doc/models/issue-invoice-request.md b/doc/models/issue-invoice-request.md index 56a5834f..504783cc 100644 --- a/doc/models/issue-invoice-request.md +++ b/doc/models/issue-invoice-request.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `on_failed_payment` | [`FailedPaymentAction`](../../doc/models/failed-payment-action.md) | Optional | Action taken when payment for an invoice fails:

- `leave_open_invoice` - prepayments and credits applied to invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history. This is the default option.
- `rollback_to_pending` - prepayments and credits not applied; invoice remains in "pending" status; no email sent to the customer; payment failure recorded in the invoice history.
- `initiate_dunning` - prepayments and credits applied to the invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history; subscription will most likely go into "past_due" or "canceled" state (depending upon net terms and dunning settings).
**Default**: `FailedPaymentAction::LEAVE_OPEN_INVOICE` | +| `on_failed_payment` | [`FailedPaymentAction`](../../doc/models/failed-payment-action.md) | Optional | Action taken when payment for an invoice fails:

- `leave_open_invoice` - prepayments and credits applied to invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history. This is the default option.
- `rollback_to_pending` - prepayments and credits not applied; invoice remains in "pending" status; no email sent to the customer; payment failure recorded in the invoice history.
- `initiate_dunning` - prepayments and credits applied to the invoice; invoice status set to "open"; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history; subscription will most likely go into "past_due" or "canceled" state (depending upon net terms and dunning settings).

**Default**: `FailedPaymentAction::LEAVE_OPEN_INVOICE` | ## Example (as JSON) diff --git a/doc/models/list-components-filter.md b/doc/models/list-components-filter.md index ff5e4e5f..b277c73a 100644 --- a/doc/models/list-components-filter.md +++ b/doc/models/list-components-filter.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `ids` | `Array` | Optional | Allows fetching components with matching id based on provided value. Use in query `filter[ids]=1,2,3`.
**Constraints**: *Minimum Items*: `1` | +| `ids` | `Array` | Optional | Allows fetching components with matching id based on provided value. Use in query `filter[ids]=1,2,3`.

**Constraints**: *Minimum Items*: `1` | | `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | Allows fetching components with matching use_site_exchange_rate based on provided value (refers to default price point). Use in query `filter[use_site_exchange_rate]=true`. | ## Example (as JSON) diff --git a/doc/models/list-coupons-filter.md b/doc/models/list-coupons-filter.md index 469837ac..fe5b1548 100644 --- a/doc/models/list-coupons-filter.md +++ b/doc/models/list-coupons-filter.md @@ -14,7 +14,7 @@ | `end_date` | `Date` | Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns coupons with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. Use in query `filter[end_date]=2011-12-15`. | | `start_datetime` | `DateTime` | Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns coupons with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. Use in query `filter[start_datetime]=2011-12-19T10:15:30+01:00`. | | `end_datetime` | `DateTime` | Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns coupons with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Use in query `filter[end_datetime]=2011-12-1T10:15:30+01:00`. | -| `ids` | `Array` | Optional | Allows fetching coupons with matching id based on provided values. Use in query `filter[ids]=1,2,3`.
**Constraints**: *Minimum Items*: `1` | +| `ids` | `Array` | Optional | Allows fetching coupons with matching id based on provided values. Use in query `filter[ids]=1,2,3`.

**Constraints**: *Minimum Items*: `1` | | `codes` | `Array` | Optional | Allows fetching coupons with matching codes based on provided values. Use in query `filter[codes]=free,free_trial`. | | `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | Allows fetching coupons with matching use_site_exchange_rate based on provided value. Use in query `filter[use_site_exchange_rate]=true`. | diff --git a/doc/models/list-mrr-filter.md b/doc/models/list-mrr-filter.md index 4b63f1d3..a06be8a5 100644 --- a/doc/models/list-mrr-filter.md +++ b/doc/models/list-mrr-filter.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_ids` | `Array` | Optional | Submit ids in order to limit results. Use in query: `filter[subscription_ids]=1,2,3`.
**Constraints**: *Minimum Items*: `1` | +| `subscription_ids` | `Array` | Optional | Submit ids in order to limit results. Use in query: `filter[subscription_ids]=1,2,3`.

**Constraints**: *Minimum Items*: `1` | ## Example (as JSON) diff --git a/doc/models/list-products-filter.md b/doc/models/list-products-filter.md index 26b566ed..4e9b2bb2 100644 --- a/doc/models/list-products-filter.md +++ b/doc/models/list-products-filter.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `ids` | `Array` | Optional | Allows fetching products with matching id based on provided values. Use in query `filter[ids]=1,2,3`.
**Constraints**: *Minimum Items*: `1` | +| `ids` | `Array` | Optional | Allows fetching products with matching id based on provided values. Use in query `filter[ids]=1,2,3`.

**Constraints**: *Minimum Items*: `1` | | `prepaid_product_price_point` | [`PrepaidProductPricePointFilter`](../../doc/models/prepaid-product-price-point-filter.md) | Optional | Allows fetching products only if a prepaid product price point is present or not. To use this filter you also have to include the following param in the request `include=prepaid_product_price_point`. Use in query `filter[prepaid_product_price_point][product_price_point_id]=not_null`. | | `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | Allows fetching products with matching use_site_exchange_rate based on provided value (refers to default price point). Use in query `filter[use_site_exchange_rate]=true`. | diff --git a/doc/models/list-service-credits-response.md b/doc/models/list-service-credits-response.md new file mode 100644 index 00000000..56aa66ee --- /dev/null +++ b/doc/models/list-service-credits-response.md @@ -0,0 +1,36 @@ + +# List Service Credits Response + +## Structure + +`ListServiceCreditsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `service_credits` | [`Array`](../../doc/models/service-credit-1.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "service_credits": [ + { + "id": 224, + "amount_in_cents": 54, + "ending_balance_in_cents": 94, + "entry_type": "Credit", + "memo": "memo2" + }, + { + "id": 224, + "amount_in_cents": 54, + "ending_balance_in_cents": 94, + "entry_type": "Credit", + "memo": "memo2" + } + ] +} +``` + diff --git a/doc/models/list-subscription-components-filter.md b/doc/models/list-subscription-components-filter.md index 4c3e7095..5fbbb343 100644 --- a/doc/models/list-subscription-components-filter.md +++ b/doc/models/list-subscription-components-filter.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `currencies` | `Array` | Optional | Allows fetching components allocation with matching currency based on provided values. Use in query `filter[currencies]=EUR,USD`.
**Constraints**: *Minimum Items*: `1` | +| `currencies` | `Array` | Optional | Allows fetching components allocation with matching currency based on provided values. Use in query `filter[currencies]=EUR,USD`.

**Constraints**: *Minimum Items*: `1` | | `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | Allows fetching components allocation with matching use_site_exchange_rate based on provided value. Use in query `filter[use_site_exchange_rate]=true`. | ## Example (as JSON) diff --git a/doc/models/list-subscription-components-for-site-filter.md b/doc/models/list-subscription-components-for-site-filter.md index fad54a76..0340decb 100644 --- a/doc/models/list-subscription-components-for-site-filter.md +++ b/doc/models/list-subscription-components-for-site-filter.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `currencies` | `Array` | Optional | Allows fetching components allocation with matching currency based on provided values. Use in query `filter[currencies]=USD,EUR`.
**Constraints**: *Minimum Items*: `1` | +| `currencies` | `Array` | Optional | Allows fetching components allocation with matching currency based on provided values. Use in query `filter[currencies]=USD,EUR`.

**Constraints**: *Minimum Items*: `1` | | `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | Allows fetching components allocation with matching use_site_exchange_rate based on provided value. Use in query `filter[use_site_exchange_rate]=true`. | | `subscription` | [`SubscriptionFilter`](../../doc/models/subscription-filter.md) | Optional | Nested filter used for List Subscription Components For Site Filter | diff --git a/doc/models/metered-component.md b/doc/models/metered-component.md index cfc5741b..09f47a20 100644 --- a/doc/models/metered-component.md +++ b/doc/models/metered-component.md @@ -12,7 +12,7 @@ | `name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | | `unit_name` | `String` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | | `description` | `String` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | -| `handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | +| `handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | | `taxable` | `TrueClass \| FalseClass` | Optional | Boolean flag describing whether a component is taxable or not. | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `prices` | [`Array`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | diff --git a/doc/models/on-off-component.md b/doc/models/on-off-component.md index ff0ca3c6..227e3bcf 100644 --- a/doc/models/on-off-component.md +++ b/doc/models/on-off-component.md @@ -11,7 +11,7 @@ | --- | --- | --- | --- | | `name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | | `description` | `String` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | -| `handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | +| `handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | | `taxable` | `TrueClass \| FalseClass` | Optional | Boolean flag describing whether a component is taxable or not. | | `upgrade_charge` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | | `downgrade_credit` | [`CreditType`](../../doc/models/credit-type.md) | Optional | The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided.
Available values: `full`, `prorated`, `none`. | diff --git a/doc/models/override-subscription.md b/doc/models/override-subscription.md index f2d88d04..7259de2b 100644 --- a/doc/models/override-subscription.md +++ b/doc/models/override-subscription.md @@ -12,7 +12,7 @@ | `activated_at` | `DateTime` | Optional | Can be used to record an external signup date. Chargify uses this field to record when a subscription first goes active (either at signup or at trial end). Only ISO8601 format is supported. | | `canceled_at` | `DateTime` | Optional | Can be used to record an external cancellation date. Chargify sets this field automatically when a subscription is canceled, whether by request or via dunning. Only ISO8601 format is supported. | | `cancellation_message` | `String` | Optional | Can be used to record a reason for the original cancellation. | -| `expires_at` | `DateTime` | Optional | Can be used to record an external expiration date. Chargify sets this field automatically when a subscription expires (ceases billing) after a prescribed amount of time. Only ISO8601 format is supported. | +| `expires_at` | `DateTime` | Optional | Can be used to record an external expiration date. Chargify sets this field automatically when a subscription expires (ceases billing) after a prescribed amount of time. Only ISO8601 format is supported. This field is not supported when Multi-frequency is enabled for the Site. To change the Term End of a Subscription, use the Update Subscription endpoint. | | `current_period_starts_at` | `DateTime` | Optional | Can only be used when a subscription is unbilled, which happens when a future initial billing date is passed at subscription creation. The value passed must be before the current date and time. Allows you to set when the period started so mid period component allocations have the correct proration. Only ISO8601 format is supported. | ## Example (as JSON) diff --git a/doc/models/paypal-payment-profile.md b/doc/models/paypal-payment-profile.md index 1dc9b770..d9d0abdc 100644 --- a/doc/models/paypal-payment-profile.md +++ b/doc/models/paypal-payment-profile.md @@ -26,6 +26,8 @@ | `site_gateway_setting_id` | `Integer` | Optional | - | | `gateway_handle` | `String` | Optional | - | | `paypal_email` | `String` | Optional | - | +| `created_at` | `DateTime` | Optional | A timestamp indicating when this payment profile was created | +| `updated_at` | `DateTime` | Optional | A timestamp indicating when this payment profile was last updated | ## Example (as JSON) diff --git a/doc/models/prepaid-product-price-point-filter.md b/doc/models/prepaid-product-price-point-filter.md index a31a03f9..41f04c9f 100644 --- a/doc/models/prepaid-product-price-point-filter.md +++ b/doc/models/prepaid-product-price-point-filter.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `product_price_point_id` | `String` | Required, Constant | Passed as a parameter to list methods to return only non null values.
**Value**: `'not_null'` | +| `product_price_point_id` | `String` | Required, Constant | Passed as a parameter to list methods to return only non null values.

**Value**: `'not_null'` | ## Example (as JSON) diff --git a/doc/models/prepaid-usage-component.md b/doc/models/prepaid-usage-component.md index 23bac466..08d1ea67 100644 --- a/doc/models/prepaid-usage-component.md +++ b/doc/models/prepaid-usage-component.md @@ -12,7 +12,7 @@ | `name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | | `unit_name` | `String` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | | `description` | `String` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | -| `handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | +| `handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | | `taxable` | `TrueClass \| FalseClass` | Optional | Boolean flag describing whether a component is taxable or not. | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `prices` | [`Array`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | diff --git a/doc/models/quantity-based-component.md b/doc/models/quantity-based-component.md index 7069b3ae..f32093f7 100644 --- a/doc/models/quantity-based-component.md +++ b/doc/models/quantity-based-component.md @@ -12,7 +12,7 @@ | `name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | | `unit_name` | `String` | Required | The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. i.e. “message”, which may then be shown as “5 messages” on a subscription’s component line-item | | `description` | `String` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | -| `handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.
**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | +| `handle` | `String` | Optional | A unique identifier for your use that can be used to retrieve this component is subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'.

**Constraints**: *Pattern*: `^[a-z0-9][a-z0-9\-_:.]*$` | | `taxable` | `TrueClass \| FalseClass` | Optional | Boolean flag describing whether a component is taxable or not. | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `prices` | [`Array`](../../doc/models/price.md) | Optional | (Not required for ‘per_unit’ pricing schemes) One or more price brackets. See [Price Bracket Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Component-Pricing-Schemes#price-bracket-rules) for an overview of how price brackets work for different pricing schemes. | diff --git a/doc/models/reactivation-billing.md b/doc/models/reactivation-billing.md index f3dcc282..79bb07c9 100644 --- a/doc/models/reactivation-billing.md +++ b/doc/models/reactivation-billing.md @@ -11,7 +11,7 @@ These values are only applicable to subscriptions using calendar billing | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `reactivation_charge` | [`ReactivationCharge`](../../doc/models/reactivation-charge.md) | Optional | You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A prorated charge for the product price will be attempted for to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal
**Default**: `ReactivationCharge::PRORATED` | +| `reactivation_charge` | [`ReactivationCharge`](../../doc/models/reactivation-charge.md) | Optional | You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A prorated charge for the product price will be attempted for to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal

**Default**: `ReactivationCharge::PRORATED` | ## Example (as JSON) diff --git a/doc/models/service-credit-1.md b/doc/models/service-credit-1.md new file mode 100644 index 00000000..1183b1b3 --- /dev/null +++ b/doc/models/service-credit-1.md @@ -0,0 +1,32 @@ + +# Service Credit 1 + +## Structure + +`ServiceCredit1` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `Integer` | Optional | - | +| `amount_in_cents` | `Integer` | Optional | The amount in cents of the entry | +| `ending_balance_in_cents` | `Integer` | Optional | The new balance for the credit account | +| `entry_type` | [`ServiceCreditType`](../../doc/models/service-credit-type.md) | Optional | The type of entry | +| `memo` | `String` | Optional | The memo attached to the entry | +| `invoice_uid` | `String` | Optional | The invoice uid associated with the entry. Only present for debit entries | +| `remaining_balance_in_cents` | `Integer` | Optional | The remaining balance for the entry | +| `created_at` | `DateTime` | Optional | The date and time the entry was created | + +## Example (as JSON) + +```json +{ + "id": 174, + "amount_in_cents": 4, + "ending_balance_in_cents": 44, + "entry_type": "Credit", + "memo": "memo8" +} +``` + diff --git a/doc/models/subscription-filter.md b/doc/models/subscription-filter.md index 4473b278..514db97e 100644 --- a/doc/models/subscription-filter.md +++ b/doc/models/subscription-filter.md @@ -11,7 +11,7 @@ Nested filter used for List Subscription Components For Site Filter | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `states` | [`Array`](../../doc/models/subscription-state-filter.md) | Optional | Allows fetching components allocations that belong to the subscription with matching states based on provided values. To use this filter you also have to include the following param in the request `include=subscription`. Use in query `filter[subscription][states]=active,canceled&include=subscription`.
**Constraints**: *Minimum Items*: `1` | +| `states` | [`Array`](../../doc/models/subscription-state-filter.md) | Optional | Allows fetching components allocations that belong to the subscription with matching states based on provided values. To use this filter you also have to include the following param in the request `include=subscription`. Use in query `filter[subscription][states]=active,canceled&include=subscription`.

**Constraints**: *Minimum Items*: `1` | | `date_field` | [`SubscriptionListDateField`](../../doc/models/subscription-list-date-field.md) | Optional | The type of filter you'd like to apply to your search. To use this filter you also have to include the following param in the request `include=subscription`. | | `start_date` | `Date` | Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns components that belong to the subscription with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. To use this filter you also have to include the following param in the request `include=subscription`. | | `end_date` | `Date` | Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns components that belong to the subscription with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. To use this filter you also have to include the following param in the request `include=subscription`. | diff --git a/doc/models/subscription-group-credit-card.md b/doc/models/subscription-group-credit-card.md index 17d06fe6..88238180 100644 --- a/doc/models/subscription-group-credit-card.md +++ b/doc/models/subscription-group-credit-card.md @@ -9,9 +9,6 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `full_number` | String \| Integer \| nil | Optional | This is a container for one-of cases. | -| `expiration_month` | String \| Integer \| nil | Optional | This is a container for one-of cases. | -| `expiration_year` | String \| Integer \| nil | Optional | This is a container for one-of cases. | | `chargify_token` | `String` | Optional | - | | `vault_token` | `String` | Optional | - | | `current_vault` | [`CreditCardVault`](../../doc/models/credit-card-vault.md) | Optional | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | @@ -24,6 +21,9 @@ | `billing_state` | `String` | Optional | - | | `billing_zip` | `String` | Optional | - | | `billing_country` | `String` | Optional | - | +| `full_number` | String \| Integer \| nil | Optional | This is a container for one-of cases. | +| `expiration_month` | String \| Integer \| nil | Optional | This is a container for one-of cases. | +| `expiration_year` | String \| Integer \| nil | Optional | This is a container for one-of cases. | | `last_four` | `String` | Optional | - | | `card_type` | [`CardType`](../../doc/models/card-type.md) | Optional | The type of card used. | | `customer_vault_token` | `String` | Optional | - | @@ -34,11 +34,12 @@ ```json { - "full_number": 4111111111111111, "chargify_token": "tok_592nf92ng0sjd4300p", - "expiration_month": "String1", - "expiration_year": "String5", - "vault_token": "vault_token6" + "full_number": 4111111111111111, + "vault_token": "vault_token6", + "current_vault": "braintree_blue", + "gateway_handle": "gateway_handle6", + "first_name": "first_name4" } ``` diff --git a/doc/models/subscription-migration-preview-options.md b/doc/models/subscription-migration-preview-options.md index 9302869c..7fe2066a 100644 --- a/doc/models/subscription-migration-preview-options.md +++ b/doc/models/subscription-migration-preview-options.md @@ -11,10 +11,10 @@ | --- | --- | --- | --- | | `product_id` | `Integer` | Optional | The ID of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. | | `product_price_point_id` | `Integer` | Optional | The ID of the specified product's price point. This can be passed to migrate to a non-default price point. | -| `include_trial` | `TrueClass \| FalseClass` | Optional | Whether to include the trial period configured for the product price point when starting a new billing period. Note that if preserve_period is set, then include_trial will be ignored.
**Default**: `false` | -| `include_initial_charge` | `TrueClass \| FalseClass` | Optional | If `true` is sent initial charges will be assessed.
**Default**: `false` | -| `include_coupons` | `TrueClass \| FalseClass` | Optional | If `true` is sent, any coupons associated with the subscription will be applied to the migration. If `false` is sent, coupons will not be applied. Note: When migrating to a new product family, the coupon cannot migrate.
**Default**: `true` | -| `preserve_period` | `TrueClass \| FalseClass` | Optional | If `false` is sent, the subscription's billing period will be reset to today and the full price of the new product will be charged. If `true` is sent, the billing period will not change and a prorated charge will be issued for the new product.
**Default**: `false` | +| `include_trial` | `TrueClass \| FalseClass` | Optional | Whether to include the trial period configured for the product price point when starting a new billing period. Note that if preserve_period is set, then include_trial will be ignored.

**Default**: `false` | +| `include_initial_charge` | `TrueClass \| FalseClass` | Optional | If `true` is sent initial charges will be assessed.

**Default**: `false` | +| `include_coupons` | `TrueClass \| FalseClass` | Optional | If `true` is sent, any coupons associated with the subscription will be applied to the migration. If `false` is sent, coupons will not be applied. Note: When migrating to a new product family, the coupon cannot migrate.

**Default**: `true` | +| `preserve_period` | `TrueClass \| FalseClass` | Optional | If `false` is sent, the subscription's billing period will be reset to today and the full price of the new product will be charged. If `true` is sent, the billing period will not change and a prorated charge will be issued for the new product.

**Default**: `false` | | `product_handle` | `String` | Optional | The handle of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. | | `product_price_point_handle` | `String` | Optional | The ID or handle of the specified product's price point. This can be passed to migrate to a non-default price point. | | `proration` | [`Proration`](../../doc/models/proration.md) | Optional | - | diff --git a/doc/models/subscription-product-migration.md b/doc/models/subscription-product-migration.md index 88ff9e7a..1b28420e 100644 --- a/doc/models/subscription-product-migration.md +++ b/doc/models/subscription-product-migration.md @@ -11,10 +11,10 @@ | --- | --- | --- | --- | | `product_id` | `Integer` | Optional | The ID of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. | | `product_price_point_id` | `Integer` | Optional | The ID of the specified product's price point. This can be passed to migrate to a non-default price point. | -| `include_trial` | `TrueClass \| FalseClass` | Optional | Whether to include the trial period configured for the product price point when starting a new billing period. Note that if preserve_period is set, then include_trial will be ignored.
**Default**: `false` | -| `include_initial_charge` | `TrueClass \| FalseClass` | Optional | If `true` is sent initial charges will be assessed.
**Default**: `false` | -| `include_coupons` | `TrueClass \| FalseClass` | Optional | If `true` is sent, any coupons associated with the subscription will be applied to the migration. If `false` is sent, coupons will not be applied. Note: When migrating to a new product family, the coupon cannot migrate.
**Default**: `true` | -| `preserve_period` | `TrueClass \| FalseClass` | Optional | If `false` is sent, the subscription's billing period will be reset to today and the full price of the new product will be charged. If `true` is sent, the billing period will not change and a prorated charge will be issued for the new product.
**Default**: `false` | +| `include_trial` | `TrueClass \| FalseClass` | Optional | Whether to include the trial period configured for the product price point when starting a new billing period. Note that if preserve_period is set, then include_trial will be ignored.

**Default**: `false` | +| `include_initial_charge` | `TrueClass \| FalseClass` | Optional | If `true` is sent initial charges will be assessed.

**Default**: `false` | +| `include_coupons` | `TrueClass \| FalseClass` | Optional | If `true` is sent, any coupons associated with the subscription will be applied to the migration. If `false` is sent, coupons will not be applied. Note: When migrating to a new product family, the coupon cannot migrate.

**Default**: `true` | +| `preserve_period` | `TrueClass \| FalseClass` | Optional | If `false` is sent, the subscription's billing period will be reset to today and the full price of the new product will be charged. If `true` is sent, the billing period will not change and a prorated charge will be issued for the new product.

**Default**: `false` | | `product_handle` | `String` | Optional | The handle of the target Product. Either a product_id or product_handle must be present. A Subscription can be migrated to another product for both the current Product Family and another Product Family. Note: Going to another Product Family, components will not be migrated as well. | | `product_price_point_handle` | `String` | Optional | The ID or handle of the specified product's price point. This can be passed to migrate to a non-default price point. | | `proration` | [`Proration`](../../doc/models/proration.md) | Optional | - | diff --git a/doc/models/tax-configuration.md b/doc/models/tax-configuration.md index dbdb3bce..dbf1ab59 100644 --- a/doc/models/tax-configuration.md +++ b/doc/models/tax-configuration.md @@ -11,7 +11,7 @@ | --- | --- | --- | --- | | `kind` | [`TaxConfigurationKind`](../../doc/models/tax-configuration-kind.md) | Optional | **Default**: `TaxConfigurationKind::CUSTOM` | | `destination_address` | [`TaxDestinationAddress`](../../doc/models/tax-destination-address.md) | Optional | - | -| `fully_configured` | `TrueClass \| FalseClass` | Optional | Returns `true` when Chargify has been properly configured to charge tax using the specified tax system. More details about taxes: https://maxio.zendesk.com/hc/en-us/articles/24287012608909-Taxes-Overview
**Default**: `false` | +| `fully_configured` | `TrueClass \| FalseClass` | Optional | Returns `true` when Chargify has been properly configured to charge tax using the specified tax system. More details about taxes: https://maxio.zendesk.com/hc/en-us/articles/24287012608909-Taxes-Overview

**Default**: `false` | ## Example (as JSON) diff --git a/doc/models/update-subscription-request.md b/doc/models/update-subscription-request.md index eba94260..ede8dd80 100644 --- a/doc/models/update-subscription-request.md +++ b/doc/models/update-subscription-request.md @@ -16,6 +16,7 @@ ```json { "subscription": { + "defer_signup": false, "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", "credit_card_attributes": { "full_number": "full_number2", diff --git a/doc/models/update-subscription.md b/doc/models/update-subscription.md index 5b50d5c0..80763f91 100644 --- a/doc/models/update-subscription.md +++ b/doc/models/update-subscription.md @@ -16,7 +16,10 @@ | `next_product_id` | `String` | Optional | Set to an empty string to cancel a delayed product change. | | `next_product_price_point_id` | `String` | Optional | - | | `snap_day` | [SnapDay](../../doc/models/snap-day.md) \| Integer \| nil | Optional | This is a container for one-of cases. | +| `initial_billing_at` | `DateTime` | Optional | (Optional) Set this attribute to a future date/time to update a subscription in the Awaiting Signup Date state, to Awaiting Signup. In the Awaiting Signup state, a subscription behaves like any other. It can be canceled, allocated to, or have its billing date changed. etc. When the `initial_billing_at` date hits, the subscription will transition to the expected state. If the product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the initial_billing_at and it fails the subscription will be immediately canceled. You can omit the initial_billing_at date to activate the subscription immediately. See the [subscription import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format) documentation for more information about Date/Time formats. | +| `defer_signup` | `TrueClass \| FalseClass` | Optional | (Optional) Set this attribute to true to move the subscription from Awaiting Signup, to Awaiting Signup Date. Use this when you want to update a subscription that has an unknown initial billing date. When the first billing date is known, update a subscription to set the `initial_billing_at` date. The subscription moves to the awaiting signup with a scheduled initial billing date. You can omit the initial_billing_at date to activate the subscription immediately. See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773-Subscription-States) for more information.

**Default**: `false` | | `next_billing_at` | `DateTime` | Optional | - | +| `expires_at` | `DateTime` | Optional | Timestamp giving the expiration date of this subscription (if any). You may manually change the expiration date at any point during a subscription period. | | `payment_collection_method` | `String` | Optional | - | | `receives_invoice_emails` | `TrueClass \| FalseClass` | Optional | - | | `net_terms` | String \| Integer \| nil | Optional | This is a container for one-of cases. | @@ -33,6 +36,7 @@ ```json { + "defer_signup": false, "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", "credit_card_attributes": { "full_number": "full_number2", diff --git a/doc/utility-classes.md b/doc/utility-classes.md deleted file mode 100644 index 747b2d92..00000000 --- a/doc/utility-classes.md +++ /dev/null @@ -1,35 +0,0 @@ - -# Utility Classes Documentation - -## ApiHelper Class - -API utility class. - -## Methods - -| Name | Return Type | Description | -| --- | --- | --- | -| json_deserialize | Hash | Deserializes a JSON string to a Ruby Hash. | -| rfc3339 | DateTime | Safely converts a string into an RFC3339 DateTime object. | - -## DateTimeHelper Class - -DateTime utility class. - -## Methods - -| Name | Return Type | Description | -| --- | --- | --- | -| from_rfc3339 | DateTime | Safely converts a string into an RFC3339 DateTime object. | -| from_rfc1123 | DateTime | Safely converts a string into an RFC1123 DateTime object. | -| from_unix | DateTime | Safely converts a string into an Unix DateTime object. | -| to_rfc3339 | DateTime_String | Safely converts a RFC3339 DateTime object into a DateTime string. | -| to_rfc1123 | DateTime_String | Safely converts a RFC1123 DateTime object into a DateTime string. | -| to_unix | DateTime_String | Safely converts a Unix DateTime object into a DateTime string. | -| to_rfc3339_map | Map_Of_DateTime_String | Safely converts a map of RFC3339 DateTime object into a map of RFC3339 formatted DateTime string. | -| to_rfc3339_array | Array_Of_DateTime_String | Safely converts an array of RFC3339 DateTime object into an array of RFC3339 formatted DateTime string. | -| to_rfc1123_map | Map_Of_DateTime_String | Safely converts a map of RFC1123 DateTime object into map of RFC1123 formatted DateTime string. | -| to_rfc1123_array | Array_Of_DateTime_String | Safely converts an array of RFC1123 DateTime object into an array of RFC1123 formatted DateTime string. | -| to_unix_map | Map_Of_DateTime_String | Safely converts a map of Unix DateTime object into a map of Unix formatted DateTime string. | -| to_unix_array | Array_Of_DateTime_String | Safely converts an array of Unix DateTime object into an array of Unix formatted DateTime string. | - diff --git a/lib/advanced_billing.rb b/lib/advanced_billing.rb index 917df799..3efcf407 100644 --- a/lib/advanced_billing.rb +++ b/lib/advanced_billing.rb @@ -24,7 +24,7 @@ require_relative 'advanced_billing/http/http_request' require_relative 'advanced_billing/http/http_response' -# Logger + require_relative 'advanced_billing/http/auth/basic_auth' # Models @@ -301,6 +301,7 @@ require_relative 'advanced_billing/models/list_sale_rep_item' require_relative 'advanced_billing/models/list_segments_filter' require_relative 'advanced_billing/models/list_segments_response' +require_relative 'advanced_billing/models/list_service_credits_response' require_relative 'advanced_billing/models/' \ 'list_subcription_group_prepayment_item' require_relative 'advanced_billing/models/list_subscription_components_filter' @@ -422,6 +423,7 @@ require_relative 'advanced_billing/models/send_invoice_request' require_relative 'advanced_billing/models/service_credit' require_relative 'advanced_billing/models/service_credit_response' +require_relative 'advanced_billing/models/service_credit1' require_relative 'advanced_billing/models/signup_proforma_preview' require_relative 'advanced_billing/models/signup_proforma_preview_response' require_relative 'advanced_billing/models/site' diff --git a/lib/advanced_billing/configuration.rb b/lib/advanced_billing/configuration.rb index 9d996e05..c91c160e 100644 --- a/lib/advanced_billing/configuration.rb +++ b/lib/advanced_billing/configuration.rb @@ -40,7 +40,6 @@ def initialize( environment: Environment::US, site: 'subdomain', basic_auth_credentials: nil ) - super connection: connection, adapter: adapter, timeout: timeout, max_retries: max_retries, retry_interval: retry_interval, backoff_factor: backoff_factor, retry_statuses: retry_statuses, @@ -56,7 +55,7 @@ def initialize( @basic_auth_credentials = basic_auth_credentials # Initializing Basic Authentication credentials with the provided auth parameters - @basic_auth_credentials = basic_auth_credentials + @basic_auth_credentials = basic_auth_credentials # The Http Client to use for making requests. set_http_client CoreLibrary::FaradayClient.new(self) @@ -77,7 +76,7 @@ def clone_with(connection: nil, adapter: nil, timeout: nil, http_callback ||= self.http_callback environment ||= self.environment site ||= self.site - basic_auth_credentials ||= basic_auth_credentials + basic_auth_credentials ||= self.basic_auth_credentials Configuration.new(connection: connection, adapter: adapter, timeout: timeout, max_retries: max_retries, diff --git a/lib/advanced_billing/controllers/advance_invoice_controller.rb b/lib/advanced_billing/controllers/advance_invoice_controller.rb index 1686c7d9..a3b30c7c 100644 --- a/lib/advanced_billing/controllers/advance_invoice_controller.rb +++ b/lib/advanced_billing/controllers/advance_invoice_controller.rb @@ -25,11 +25,12 @@ class AdvanceInvoiceController < BaseController # generate it. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @param [IssueAdvanceInvoiceRequest] body Optional parameter: Example: - # @return [Invoice] response from the API call. + # @param [IssueAdvanceInvoiceRequest] body Optional parameter: TODO: type + # description here + # @return [Invoice] Response from the API call. def issue_advance_invoice(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/advance_invoice/issue.json', Server::PRODUCTION) @@ -59,9 +60,9 @@ def issue_advance_invoice(subscription_id, # advance invoice per subscription per billing cycle. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @return [Invoice] response from the API call. + # @return [Invoice] Response from the API call. def read_advance_invoice(subscription_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/subscriptions/{subscription_id}/advance_invoice.json', Server::PRODUCTION) @@ -87,11 +88,12 @@ def read_advance_invoice(subscription_id) # the impact of voiding, please [see our help docs]($m/Invoice). # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @param [VoidInvoiceRequest] body Optional parameter: Example: - # @return [Invoice] response from the API call. + # @param [VoidInvoiceRequest] body Optional parameter: TODO: type + # description here + # @return [Invoice] Response from the API call. def void_advance_invoice(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/advance_invoice/void.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/api_exports_controller.rb b/lib/advanced_billing/controllers/api_exports_controller.rb index 11b7e397..56d929c8 100644 --- a/lib/advanced_billing/controllers/api_exports_controller.rb +++ b/lib/advanced_billing/controllers/api_exports_controller.rb @@ -24,9 +24,9 @@ class APIExportsController < BaseController # passing in a page parameter. Retrieve the next page by adding ?page=2 to # the query string. If there are no results to return, then an empty result # set will be returned. Use in query `page=1`. - # @return [Array[ProformaInvoice]] response from the API call. + # @return [Array[ProformaInvoice]] Response from the API call. def list_exported_proforma_invoices(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/api_exports/proforma_invoices/{batch_id}/rows.json', Server::PRODUCTION) @@ -65,9 +65,9 @@ def list_exported_proforma_invoices(options = {}) # passing in a page parameter. Retrieve the next page by adding ?page=2 to # the query string. If there are no results to return, then an empty result # set will be returned. Use in query `page=1`. - # @return [Array[Invoice]] response from the API call. + # @return [Array[Invoice]] Response from the API call. def list_exported_invoices(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/api_exports/invoices/{batch_id}/rows.json', Server::PRODUCTION) @@ -106,9 +106,9 @@ def list_exported_invoices(options = {}) # passing in a page parameter. Retrieve the next page by adding ?page=2 to # the query string. If there are no results to return, then an empty result # set will be returned. Use in query `page=1`. - # @return [Array[Subscription]] response from the API call. + # @return [Array[Subscription]] Response from the API call. def list_exported_subscriptions(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/api_exports/subscriptions/{batch_id}/rows.json', Server::PRODUCTION) @@ -131,9 +131,9 @@ def list_exported_subscriptions(options = {}) # This API creates a proforma invoices export and returns a batchjob object. # It is only available for Relationship Invoicing architecture. - # @return [BatchJobResponse] response from the API call. + # @return [BatchJobResponse] Response from the API call. def export_proforma_invoices - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/api_exports/proforma_invoices.json', Server::PRODUCTION) @@ -153,9 +153,9 @@ def export_proforma_invoices end # This API creates an invoices export and returns a batchjob object. - # @return [BatchJobResponse] response from the API call. + # @return [BatchJobResponse] Response from the API call. def export_invoices - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/api_exports/invoices.json', Server::PRODUCTION) @@ -175,9 +175,9 @@ def export_invoices end # This API creates a subscriptions export and returns a batchjob object. - # @return [BatchJobResponse] response from the API call. + # @return [BatchJobResponse] Response from the API call. def export_subscriptions - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/api_exports/subscriptions.json', Server::PRODUCTION) @@ -195,9 +195,9 @@ def export_subscriptions # This API returns a batchjob object for proforma invoices export. # @param [String] batch_id Required parameter: Id of a Batch Job. - # @return [BatchJobResponse] response from the API call. + # @return [BatchJobResponse] Response from the API call. def read_proforma_invoices_export(batch_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/api_exports/proforma_invoices/{batch_id}.json', Server::PRODUCTION) @@ -217,9 +217,9 @@ def read_proforma_invoices_export(batch_id) # This API returns a batchjob object for invoices export. # @param [String] batch_id Required parameter: Id of a Batch Job. - # @return [BatchJobResponse] response from the API call. + # @return [BatchJobResponse] Response from the API call. def read_invoices_export(batch_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/api_exports/invoices/{batch_id}.json', Server::PRODUCTION) @@ -239,9 +239,9 @@ def read_invoices_export(batch_id) # This API returns a batchjob object for subscriptions export. # @param [String] batch_id Required parameter: Id of a Batch Job. - # @return [BatchJobResponse] response from the API call. + # @return [BatchJobResponse] Response from the API call. def read_subscriptions_export(batch_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/api_exports/subscriptions/{batch_id}.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/base_controller.rb b/lib/advanced_billing/controllers/base_controller.rb index 04dda883..732ca7df 100644 --- a/lib/advanced_billing/controllers/base_controller.rb +++ b/lib/advanced_billing/controllers/base_controller.rb @@ -10,7 +10,7 @@ class BaseController attr_accessor :config, :http_call_back def self.user_agent - 'AB SDK Ruby:6.1.0 on OS {os-info}' + 'AB SDK Ruby:7.0.0 on OS {os-info}' end def self.user_agent_parameters @@ -39,12 +39,6 @@ def initialize(global_configuration) @api_call = ApiCall.new(@global_configuration) end - # Creates a new builder for the Api Call instance. - # @return [ApiCall] The instance of ApiCall. - def new_api_call_builder - @api_call.new_builder - end - # Creates a new instance of the request builder. # @param [String] http_method The HTTP method to use in the request. # @param [String] path The endpoint path to use in the request. diff --git a/lib/advanced_billing/controllers/billing_portal_controller.rb b/lib/advanced_billing/controllers/billing_portal_controller.rb index 89695d2b..e08b9a0f 100644 --- a/lib/advanced_billing/controllers/billing_portal_controller.rb +++ b/lib/advanced_billing/controllers/billing_portal_controller.rb @@ -37,10 +37,10 @@ class BillingPortalController < BaseController # @param [AutoInvite] auto_invite Optional parameter: When set to 1, an # Invitation email will be sent to the Customer. When set to 0, or not sent, # an email will not be sent. Use in query: `auto_invite=1`. - # @return [CustomerResponse] response from the API call. + # @return [CustomerResponse] Response from the API call. def enable_billing_portal_for_customer(customer_id, auto_invite: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/portal/customers/{customer_id}/enable.json', Server::PRODUCTION) @@ -74,9 +74,9 @@ def enable_billing_portal_for_customer(customer_id, # further Management URL requests (with a response code `429`) # @param [Integer] customer_id Required parameter: The Chargify id of the # customer - # @return [PortalManagementLink] response from the API call. + # @return [PortalManagementLink] Response from the API call. def read_billing_portal_link(customer_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/portal/customers/{customer_id}/management_link.json', Server::PRODUCTION) @@ -112,9 +112,9 @@ def read_billing_portal_link(customer_id) # This endpoint will only return a JSON response. # @param [Integer] customer_id Required parameter: The Chargify id of the # customer - # @return [ResentInvitation] response from the API call. + # @return [ResentInvitation] Response from the API call. def resend_billing_portal_invitation(customer_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/portal/customers/{customer_id}/invitations/invite.json', Server::PRODUCTION) @@ -143,9 +143,9 @@ def resend_billing_portal_invitation(customer_id) # This endpoint will only return a JSON response. # @param [Integer] customer_id Required parameter: The Chargify id of the # customer - # @return [RevokedInvitation] response from the API call. + # @return [RevokedInvitation] Response from the API call. def revoke_billing_portal_access(customer_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/portal/customers/{customer_id}/invitations/revoke.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/component_price_points_controller.rb b/lib/advanced_billing/controllers/component_price_points_controller.rb index 8f5aa0c0..87bd7232 100644 --- a/lib/advanced_billing/controllers/component_price_points_controller.rb +++ b/lib/advanced_billing/controllers/component_price_points_controller.rb @@ -19,10 +19,10 @@ class ComponentPricePointsController < BaseController # of the component to which the price point belongs # @param [Integer] price_point_id Required parameter: The Advanced Billing # id of the price point - # @return [ComponentResponse] response from the API call. + # @return [ComponentResponse] Response from the API call. def promote_component_price_point_to_default(component_id, price_point_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/components/{component_id}/price_points/{price_point_id}/default.json', Server::PRODUCTION) @@ -44,12 +44,12 @@ def promote_component_price_point_to_default(component_id, # component. # @param [Integer] component_id Required parameter: The Advanced Billing id # of the component - # @param [CreateComponentPricePointRequest] body Optional parameter: - # Example: - # @return [ComponentPricePointResponse] response from the API call. + # @param [CreateComponentPricePointRequest] body Optional parameter: TODO: + # type description here + # @return [ComponentPricePointResponse] Response from the API call. def create_component_price_point(component_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/components/{component_id}/price_points.json', Server::PRODUCTION) @@ -99,9 +99,9 @@ def create_component_price_point(component_id, # Use in query `per_page=200`. # @param [Array[PricePointType]] filter_type Optional parameter: Use in # query: `filter[type]=catalog,default`. - # @return [ComponentPricePointsResponse] response from the API call. + # @return [ComponentPricePointsResponse] Response from the API call. def list_component_price_points(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/components/{component_id}/price_points.json', Server::PRODUCTION) @@ -125,12 +125,12 @@ def list_component_price_points(options = {}) # request. # @param [String] component_id Required parameter: The Advanced Billing id # of the component for which you want to fetch price points. - # @param [CreateComponentPricePointsRequest] body Optional parameter: - # Example: - # @return [ComponentPricePointsResponse] response from the API call. + # @param [CreateComponentPricePointsRequest] body Optional parameter: TODO: + # type description here + # @return [ComponentPricePointsResponse] Response from the API call. def bulk_create_component_price_points(component_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/components/{component_id}/price_points/bulk.json', Server::PRODUCTION) @@ -168,13 +168,13 @@ def bulk_create_component_price_points(component_id, # handle of the price point. When using the handle, it must be prefixed with # `handle:`. Example: `123` for an integer ID, or # `handle:example-price_point-handle` for a string handle. - # @param [UpdateComponentPricePointRequest] body Optional parameter: - # Example: - # @return [ComponentPricePointResponse] response from the API call. + # @param [UpdateComponentPricePointRequest] body Optional parameter: TODO: + # type description here + # @return [ComponentPricePointResponse] Response from the API call. def update_component_price_point(component_id, price_point_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/components/{component_id}/price_points/{price_point_id}.json', Server::PRODUCTION) @@ -220,11 +220,11 @@ def update_component_price_point(component_id, # `handle:example-price_point-handle` for a string handle. # @param [TrueClass | FalseClass] currency_prices Optional parameter: # Include an array of currency price data - # @return [ComponentPricePointResponse] response from the API call. + # @return [ComponentPricePointResponse] Response from the API call. def read_component_price_point(component_id, price_point_id, currency_prices: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/components/{component_id}/price_points/{price_point_id}.json', Server::PRODUCTION) @@ -262,10 +262,10 @@ def read_component_price_point(component_id, # handle of the price point. When using the handle, it must be prefixed with # `handle:`. Example: `123` for an integer ID, or # `handle:example-price_point-handle` for a string handle. - # @return [ComponentPricePointResponse] response from the API call. + # @return [ComponentPricePointResponse] Response from the API call. def archive_component_price_point(component_id, price_point_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/components/{component_id}/price_points/{price_point_id}.json', Server::PRODUCTION) @@ -300,10 +300,10 @@ def archive_component_price_point(component_id, # of the component to which the price point belongs # @param [Integer] price_point_id Required parameter: The Advanced Billing # id of the price point - # @return [ComponentPricePointResponse] response from the API call. + # @return [ComponentPricePointResponse] Response from the API call. def unarchive_component_price_point(component_id, price_point_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/components/{component_id}/price_points/{price_point_id}/unarchive.json', Server::PRODUCTION) @@ -330,11 +330,12 @@ def unarchive_component_price_point(component_id, # Note: Currency Prices are not able to be created for custom price points. # @param [Integer] price_point_id Required parameter: The Advanced Billing # id of the price point - # @param [CreateCurrencyPricesRequest] body Optional parameter: Example: - # @return [ComponentCurrencyPricesResponse] response from the API call. + # @param [CreateCurrencyPricesRequest] body Optional parameter: TODO: type + # description here + # @return [ComponentCurrencyPricesResponse] Response from the API call. def create_currency_prices(price_point_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/price_points/{price_point_id}/currency_prices.json', Server::PRODUCTION) @@ -361,11 +362,12 @@ def create_currency_prices(price_point_id, # Note: Currency Prices are not able to be updated for custom price points. # @param [Integer] price_point_id Required parameter: The Advanced Billing # id of the price point - # @param [UpdateCurrencyPricesRequest] body Optional parameter: Example: - # @return [ComponentCurrencyPricesResponse] response from the API call. + # @param [UpdateCurrencyPricesRequest] body Optional parameter: TODO: type + # description here + # @return [ComponentCurrencyPricesResponse] Response from the API call. def update_currency_prices(price_point_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/price_points/{price_point_id}/currency_prices.json', Server::PRODUCTION) @@ -407,9 +409,9 @@ def update_currency_prices(price_point_id, # in which results are returned. Use in query `direction=asc`. # @param [ListPricePointsFilter] filter Optional parameter: Filter to use # for List PricePoints operations - # @return [ListComponentsPricePointsResponse] response from the API call. + # @return [ListComponentsPricePointsResponse] Response from the API call. def list_all_component_price_points(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/components_price_points.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/components_controller.rb b/lib/advanced_billing/controllers/components_controller.rb index 4c38aa22..d59e3eda 100644 --- a/lib/advanced_billing/controllers/components_controller.rb +++ b/lib/advanced_billing/controllers/components_controller.rb @@ -22,11 +22,12 @@ class ComponentsController < BaseController # ts-Overview). # @param [String] product_family_id Required parameter: Either the product # family's id or its handle prefixed with `handle:` - # @param [CreateMeteredComponent] body Optional parameter: Example: - # @return [ComponentResponse] response from the API call. + # @param [CreateMeteredComponent] body Optional parameter: TODO: type + # description here + # @return [ComponentResponse] Response from the API call. def create_metered_component(product_family_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/product_families/{product_family_id}/metered_components.json', Server::PRODUCTION) @@ -71,11 +72,12 @@ def create_metered_component(product_family_id, # ts-Overview). # @param [String] product_family_id Required parameter: Either the product # family's id or its handle prefixed with `handle:` - # @param [CreateQuantityBasedComponent] body Optional parameter: Example: - # @return [ComponentResponse] response from the API call. + # @param [CreateQuantityBasedComponent] body Optional parameter: TODO: type + # description here + # @return [ComponentResponse] Response from the API call. def create_quantity_based_component(product_family_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/product_families/{product_family_id}/quantity_based_components.json', Server::PRODUCTION) @@ -110,11 +112,12 @@ def create_quantity_based_component(product_family_id, # ts-Overview). # @param [String] product_family_id Required parameter: Either the product # family's id or its handle prefixed with `handle:` - # @param [CreateOnOffComponent] body Optional parameter: Example: - # @return [ComponentResponse] response from the API call. + # @param [CreateOnOffComponent] body Optional parameter: TODO: type + # description here + # @return [ComponentResponse] Response from the API call. def create_on_off_component(product_family_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/product_families/{product_family_id}/on_off_components.json', Server::PRODUCTION) @@ -153,11 +156,12 @@ def create_on_off_component(product_family_id, # ts-Overview). # @param [String] product_family_id Required parameter: Either the product # family's id or its handle prefixed with `handle:` - # @param [CreatePrepaidComponent] body Optional parameter: Example: - # @return [ComponentResponse] response from the API call. + # @param [CreatePrepaidComponent] body Optional parameter: TODO: type + # description here + # @return [ComponentResponse] Response from the API call. def create_prepaid_usage_component(product_family_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/product_families/{product_family_id}/prepaid_usage_components.json', Server::PRODUCTION) @@ -199,11 +203,12 @@ def create_prepaid_usage_component(product_family_id, # ts-Overview). # @param [String] product_family_id Required parameter: Either the product # family's id or its handle prefixed with `handle:` - # @param [CreateEBBComponent] body Optional parameter: Example: - # @return [ComponentResponse] response from the API call. + # @param [CreateEBBComponent] body Optional parameter: TODO: type + # description here + # @return [ComponentResponse] Response from the API call. def create_event_based_component(product_family_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/product_families/{product_family_id}/event_based_components.json', Server::PRODUCTION) @@ -233,9 +238,9 @@ def create_event_based_component(product_family_id, # don't have to save or reference the IDs we generate. # @param [String] handle Required parameter: The handle of the component to # find - # @return [ComponentResponse] response from the API call. + # @return [ComponentResponse] Response from the API call. def find_component(handle) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/components/lookup.json', Server::PRODUCTION) @@ -258,10 +263,10 @@ def find_component(handle) # @param [String] component_id Required parameter: Either the Advanced # Billing id of the component or the handle for the component prefixed with # `handle:` - # @return [ComponentResponse] response from the API call. + # @return [ComponentResponse] Response from the API call. def read_component(product_family_id, component_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/product_families/{product_family_id}/components/{component_id}.json', Server::PRODUCTION) @@ -287,12 +292,13 @@ def read_component(product_family_id, # @param [String] component_id Required parameter: Either the Advanced # Billing id of the component or the handle for the component prefixed with # `handle:` - # @param [UpdateComponentRequest] body Optional parameter: Example: - # @return [ComponentResponse] response from the API call. + # @param [UpdateComponentRequest] body Optional parameter: TODO: type + # description here + # @return [ComponentResponse] Response from the API call. def update_product_family_component(product_family_id, component_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/product_families/{product_family_id}/components/{component_id}.json', Server::PRODUCTION) @@ -325,10 +331,10 @@ def update_product_family_component(product_family_id, # @param [String] component_id Required parameter: Either the Advanced # Billing id of the component or the handle for the component prefixed with # `handle:` - # @return [Component] response from the API call. + # @return [Component] Response from the API call. def archive_component(product_family_id, component_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/product_families/{product_family_id}/components/{component_id}.json', Server::PRODUCTION) @@ -387,9 +393,9 @@ def archive_component(product_family_id, # Use in query `per_page=200`. # @param [ListComponentsFilter] filter Optional parameter: Filter to use for # List Components operations - # @return [Array[ComponentResponse]] response from the API call. + # @return [Array[ComponentResponse]] Response from the API call. def list_components(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/components.json', Server::PRODUCTION) @@ -417,11 +423,12 @@ def list_components(options = {}) # using the handle, it must be prefixed with `handle:`. # @param [String] component_id Required parameter: The id or handle of the # component - # @param [UpdateComponentRequest] body Optional parameter: Example: - # @return [ComponentResponse] response from the API call. + # @param [UpdateComponentRequest] body Optional parameter: TODO: type + # description here + # @return [ComponentResponse] Response from the API call. def update_component(component_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/components/{component_id}.json', Server::PRODUCTION) @@ -484,9 +491,9 @@ def update_component(component_id, # components with a timestamp at or after exact time provided in query. You # can specify timezone in query - otherwise your site's time zone will be # used. If provided, this parameter will be used instead of start_date. - # @return [Array[ComponentResponse]] response from the API call. + # @return [Array[ComponentResponse]] Response from the API call. def list_components_for_product_family(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/product_families/{product_family_id}/components.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/coupons_controller.rb b/lib/advanced_billing/controllers/coupons_controller.rb index 42fd355e..bb2f3084 100644 --- a/lib/advanced_billing/controllers/coupons_controller.rb +++ b/lib/advanced_billing/controllers/coupons_controller.rb @@ -25,11 +25,12 @@ class CouponsController < BaseController # `{ "": boolean_value }` # @param [Integer] product_family_id Required parameter: The Advanced # Billing id of the product family to which the coupon belongs - # @param [CouponRequest] body Optional parameter: Example: - # @return [CouponResponse] response from the API call. + # @param [CouponRequest] body Optional parameter: TODO: type description + # here + # @return [CouponResponse] Response from the API call. def create_coupon(product_family_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/product_families/{product_family_id}/coupons.json', Server::PRODUCTION) @@ -75,9 +76,9 @@ def create_coupon(product_family_id, # level, you can optionally pass the `?currency_prices=true` query param to # include an array of currency price data in the response. Use in query # `currency_prices=true`. - # @return [Array[CouponResponse]] response from the API call. + # @return [Array[CouponResponse]] Response from the API call. def list_coupons_for_product_family(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/product_families/{product_family_id}/coupons.json', Server::PRODUCTION) @@ -112,11 +113,11 @@ def list_coupons_for_product_family(options = {}) # fetching coupons, if you have defined multiple currencies at the site # level, you can optionally pass the `?currency_prices=true` query param to # include an array of currency price data in the response. - # @return [CouponResponse] response from the API call. + # @return [CouponResponse] Response from the API call. def find_coupon(product_family_id: nil, code: nil, currency_prices: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/coupons/find.json', Server::PRODUCTION) @@ -150,11 +151,11 @@ def find_coupon(product_family_id: nil, # fetching coupons, if you have defined multiple currencies at the site # level, you can optionally pass the `?currency_prices=true` query param to # include an array of currency price data in the response. - # @return [CouponResponse] response from the API call. + # @return [CouponResponse] Response from the API call. def read_coupon(product_family_id, coupon_id, currency_prices: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/product_families/{product_family_id}/coupons/{coupon_id}.json', Server::PRODUCTION) @@ -184,12 +185,13 @@ def read_coupon(product_family_id, # Billing id of the product family to which the coupon belongs # @param [Integer] coupon_id Required parameter: The Advanced Billing id of # the coupon - # @param [CouponRequest] body Optional parameter: Example: - # @return [CouponResponse] response from the API call. + # @param [CouponRequest] body Optional parameter: TODO: type description + # here + # @return [CouponResponse] Response from the API call. def update_coupon(product_family_id, coupon_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/product_families/{product_family_id}/coupons/{coupon_id}.json', Server::PRODUCTION) @@ -223,10 +225,10 @@ def update_coupon(product_family_id, # Billing id of the product family to which the coupon belongs # @param [Integer] coupon_id Required parameter: The Advanced Billing id of # the coupon - # @return [CouponResponse] response from the API call. + # @return [CouponResponse] Response from the API call. def archive_coupon(product_family_id, coupon_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/product_families/{product_family_id}/coupons/{coupon_id}.json', Server::PRODUCTION) @@ -266,9 +268,9 @@ def archive_coupon(product_family_id, # level, you can optionally pass the `?currency_prices=true` query param to # include an array of currency price data in the response. Use in query # `currency_prices=true`. - # @return [Array[CouponResponse]] response from the API call. + # @return [Array[CouponResponse]] Response from the API call. def list_coupons(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/coupons.json', Server::PRODUCTION) @@ -292,10 +294,10 @@ def list_coupons(options = {}) # Billing id of the product family to which the coupon belongs # @param [Integer] coupon_id Required parameter: The Advanced Billing id of # the coupon - # @return [Array[CouponUsage]] response from the API call. + # @return [Array[CouponUsage]] Response from the API call. def read_coupon_usage(product_family_id, coupon_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/product_families/{product_family_id}/coupons/{coupon_id}/usage.json', Server::PRODUCTION) @@ -343,10 +345,10 @@ def read_coupon_usage(product_family_id, # @param [String] code Required parameter: The code of the coupon # @param [Integer] product_family_id Optional parameter: The Advanced # Billing id of the product family to which the coupon belongs - # @return [CouponResponse] response from the API call. + # @return [CouponResponse] Response from the API call. def validate_coupon(code, product_family_id: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/coupons/validate.json', Server::PRODUCTION) @@ -358,9 +360,9 @@ def validate_coupon(code, .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(CouponResponse.method(:from_hash)) - .local_error('404', - 'Not Found', - SingleStringErrorResponseException)) + .local_error_template('404', + 'Not Found: \'{$response.body}\'', + SingleStringErrorResponseException)) .execute end @@ -373,11 +375,12 @@ def validate_coupon(code, # to define pricing in non-primary currencies. # @param [Integer] coupon_id Required parameter: The Advanced Billing id of # the coupon - # @param [CouponCurrencyRequest] body Optional parameter: Example: - # @return [CouponCurrencyResponse] response from the API call. + # @param [CouponCurrencyRequest] body Optional parameter: TODO: type + # description here + # @return [CouponCurrencyResponse] Response from the API call. def create_or_update_coupon_currency_prices(coupon_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/coupons/{coupon_id}/currency_prices.json', Server::PRODUCTION) @@ -439,11 +442,12 @@ def create_or_update_coupon_currency_prices(coupon_id, # `https://.chargify.com/coupons/567/codes/20%25OFF.` # @param [Integer] coupon_id Required parameter: The Advanced Billing id of # the coupon - # @param [CouponSubcodes] body Optional parameter: Example: - # @return [CouponSubcodesResponse] response from the API call. + # @param [CouponSubcodes] body Optional parameter: TODO: type description + # here + # @return [CouponSubcodesResponse] Response from the API call. def create_coupon_subcodes(coupon_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/coupons/{coupon_id}/codes.json', Server::PRODUCTION) @@ -476,9 +480,9 @@ def create_coupon_subcodes(coupon_id, # many records to fetch in each request. Default value is 20. The maximum # allowed values is 200; any per_page value over 200 will be changed to 200. # Use in query `per_page=200`. - # @return [CouponSubcodes] response from the API call. + # @return [CouponSubcodes] Response from the API call. def list_coupon_subcodes(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/coupons/{coupon_id}/codes.json', Server::PRODUCTION) @@ -506,11 +510,12 @@ def list_coupon_subcodes(options = {}) # + Any subcodes not created because they are invalid. # @param [Integer] coupon_id Required parameter: The Advanced Billing id of # the coupon - # @param [CouponSubcodes] body Optional parameter: Example: - # @return [CouponSubcodesResponse] response from the API call. + # @param [CouponSubcodes] body Optional parameter: TODO: type description + # here + # @return [CouponSubcodesResponse] Response from the API call. def update_coupon_subcodes(coupon_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/coupons/{coupon_id}/codes.json', Server::PRODUCTION) @@ -551,10 +556,10 @@ def update_coupon_subcodes(coupon_id, # @param [Integer] coupon_id Required parameter: The Advanced Billing id of # the coupon to which the subcode belongs # @param [String] subcode Required parameter: The subcode of the coupon - # @return [void] response from the API call. + # @return [void] Response from the API call. def delete_coupon_subcode(coupon_id, subcode) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/coupons/{coupon_id}/codes/{subcode}.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/custom_fields_controller.rb b/lib/advanced_billing/controllers/custom_fields_controller.rb index 37e7efcf..3c2ff594 100644 --- a/lib/advanced_billing/controllers/custom_fields_controller.rb +++ b/lib/advanced_billing/controllers/custom_fields_controller.rb @@ -34,7 +34,7 @@ class CustomFieldsController < BaseController # another 100 for Customer. # ### Metafields "On-the-Fly" # It is possible to create Metafields “on the fly” when you create your - # Metadata – if a non-existant name is passed when creating Metadata, a + # Metadata – if a non-existent name is passed when creating Metadata, a # Metafield for that key will be automatically created. The Metafield API, # however, gives you more control over your “keys”. # ### Metafield Scope Warning @@ -43,11 +43,12 @@ class CustomFieldsController < BaseController # update is sent it will overwrite the current configuration**. # @param [ResourceType] resource_type Required parameter: the resource type # to which the metafields belong - # @param [CreateMetafieldsRequest] body Optional parameter: Example: - # @return [Array[Metafield]] response from the API call. + # @param [CreateMetafieldsRequest] body Optional parameter: TODO: type + # description here + # @return [Array[Metafield]] Response from the API call. def create_metafields(resource_type, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/{resource_type}/metafields.json', Server::PRODUCTION) @@ -89,9 +90,9 @@ def create_metafields(resource_type, # Use in query `per_page=200`. # @param [SortingDirection] direction Optional parameter: Controls the order # in which results are returned. Use in query `direction=asc`. - # @return [ListMetafieldsResponse] response from the API call. + # @return [ListMetafieldsResponse] Response from the API call. def list_metafields(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/{resource_type}/metafields.json', Server::PRODUCTION) @@ -114,11 +115,12 @@ def list_metafields(options = {}) # can be populated with metadata after the fact. # @param [ResourceType] resource_type Required parameter: the resource type # to which the metafields belong - # @param [UpdateMetafieldsRequest] body Optional parameter: Example: - # @return [Array[Metafield]] response from the API call. + # @param [UpdateMetafieldsRequest] body Optional parameter: TODO: type + # description here + # @return [Array[Metafield]] Response from the API call. def update_metafield(resource_type, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/{resource_type}/metafields.json', Server::PRODUCTION) @@ -149,10 +151,10 @@ def update_metafield(resource_type, # to which the metafields belong # @param [String] name Optional parameter: The name of the metafield to be # deleted - # @return [void] response from the API call. + # @return [void] Response from the API call. def delete_metafield(resource_type, name: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/{resource_type}/metafields.json', Server::PRODUCTION) @@ -201,12 +203,13 @@ def delete_metafield(resource_type, # to which the metafields belong # @param [Integer] resource_id Required parameter: The Advanced Billing id # of the customer or the subscription for which the metadata applies - # @param [CreateMetadataRequest] body Optional parameter: Example: - # @return [Array[Metadata]] response from the API call. + # @param [CreateMetadataRequest] body Optional parameter: TODO: type + # description here + # @return [Array[Metadata]] Response from the API call. def create_metadata(resource_type, resource_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/{resource_type}/{resource_id}/metadata.json', Server::PRODUCTION) @@ -252,9 +255,9 @@ def create_metadata(resource_type, # many records to fetch in each request. Default value is 20. The maximum # allowed values is 200; any per_page value over 200 will be changed to 200. # Use in query `per_page=200`. - # @return [PaginatedMetadata] response from the API call. + # @return [PaginatedMetadata] Response from the API call. def list_metadata(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/{resource_type}/{resource_id}/metadata.json', Server::PRODUCTION) @@ -280,12 +283,13 @@ def list_metadata(options = {}) # to which the metafields belong # @param [Integer] resource_id Required parameter: The Advanced Billing id # of the customer or the subscription for which the metadata applies - # @param [UpdateMetadataRequest] body Optional parameter: Example: - # @return [Array[Metadata]] response from the API call. + # @param [UpdateMetadataRequest] body Optional parameter: TODO: type + # description here + # @return [Array[Metadata]] Response from the API call. def update_metadata(resource_type, resource_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/{resource_type}/{resource_id}/metadata.json', Server::PRODUCTION) @@ -338,12 +342,12 @@ def update_metadata(resource_type, # @param [Array[String]] names Optional parameter: Names of fields to be # removed. Use in query: # `names[]=field1&names[]=my-field&names[]=another-field`. - # @return [void] response from the API call. + # @return [void] Response from the API call. def delete_metadata(resource_type, resource_id, name: nil, names: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/{resource_type}/{resource_id}/metadata.json', Server::PRODUCTION) @@ -417,9 +421,9 @@ def delete_metadata(resource_type, # `resource_ids[]=122&resource_ids[]=123&resource_ids[]=124`. # @param [SortingDirection] direction Optional parameter: Controls the order # in which results are returned. Use in query `direction=asc`. - # @return [PaginatedMetadata] response from the API call. + # @return [PaginatedMetadata] Response from the API call. def list_metadata_for_resource_type(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/{resource_type}/metadata.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/customers_controller.rb b/lib/advanced_billing/controllers/customers_controller.rb index 16652228..137c4cf2 100644 --- a/lib/advanced_billing/controllers/customers_controller.rb +++ b/lib/advanced_billing/controllers/customers_controller.rb @@ -41,10 +41,11 @@ class CustomersController < BaseController # For more: [Customer # Locale](https://maxio.zendesk.com/hc/en-us/articles/24286672013709-Custome # r-Locale) - # @param [CreateCustomerRequest] body Optional parameter: Example: - # @return [CustomerResponse] response from the API call. + # @param [CreateCustomerRequest] body Optional parameter: TODO: type + # description here + # @return [CustomerResponse] Response from the API call. def create_customer(body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/customers.json', Server::PRODUCTION) @@ -112,9 +113,9 @@ def create_customer(body: nil) # be used. If provided, this parameter will be used instead of end_date. # @param [String] q Optional parameter: A search query by which to filter # customers (can be an email, an ID, a reference, organization) - # @return [Array[CustomerResponse]] response from the API call. + # @return [Array[CustomerResponse]] Response from the API call. def list_customers(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/customers.json', Server::PRODUCTION) @@ -140,9 +141,9 @@ def list_customers(options = {}) # Billing-generated Customer ID. # @param [Integer] id Required parameter: The Advanced Billing id of the # customer - # @return [CustomerResponse] response from the API call. + # @return [CustomerResponse] Response from the API call. def read_customer(id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/customers/{id}.json', Server::PRODUCTION) @@ -160,11 +161,12 @@ def read_customer(id) # This method allows to update the Customer. # @param [Integer] id Required parameter: The Advanced Billing id of the # customer - # @param [UpdateCustomerRequest] body Optional parameter: Example: - # @return [CustomerResponse] response from the API call. + # @param [UpdateCustomerRequest] body Optional parameter: TODO: type + # description here + # @return [CustomerResponse] Response from the API call. def update_customer(id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/customers/{id}.json', Server::PRODUCTION) @@ -192,9 +194,9 @@ def update_customer(id, # This method allows you to delete the Customer. # @param [Integer] id Required parameter: The Advanced Billing id of the # customer - # @return [void] response from the API call. + # @return [void] Response from the API call. def delete_customer(id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/customers/{id}.json', Server::PRODUCTION) @@ -210,9 +212,9 @@ def delete_customer(id) # Use this method to return the customer object if you have the unique # **Reference ID (Your App)** value handy. It will return a single match. # @param [String] reference Required parameter: Customer reference - # @return [CustomerResponse] response from the API call. + # @return [CustomerResponse] Response from the API call. def read_customer_by_reference(reference) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/customers/lookup.json', Server::PRODUCTION) @@ -229,9 +231,9 @@ def read_customer_by_reference(reference) # This method lists all subscriptions that belong to a customer. # @param [Integer] customer_id Required parameter: The Chargify id of the # customer - # @return [Array[SubscriptionResponse]] response from the API call. + # @return [Array[SubscriptionResponse]] Response from the API call. def list_customer_subscriptions(customer_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/customers/{customer_id}/subscriptions.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb b/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb index 8f1ca0f3..38333cf1 100644 --- a/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +++ b/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb @@ -16,12 +16,13 @@ class EventsBasedBillingSegmentsController < BaseController # Component # @param [String] price_point_id Required parameter: ID or Handle for the # Price Point belonging to the Component - # @param [CreateSegmentRequest] body Optional parameter: Example: - # @return [SegmentResponse] response from the API call. + # @param [CreateSegmentRequest] body Optional parameter: TODO: type + # description here + # @return [SegmentResponse] Response from the API call. def create_segment(component_id, price_point_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/components/{component_id}/price_points/{price_point_id}/segments.json', Server::PRODUCTION) @@ -73,9 +74,9 @@ def create_segment(component_id, # Use in query `per_page=200`. # @param [ListSegmentsFilter] filter Optional parameter: Filter to use for # List Segments for a Price Point operation - # @return [ListSegmentsResponse] response from the API call. + # @return [ListSegmentsResponse] Response from the API call. def list_segments_for_price_point(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/components/{component_id}/price_points/{price_point_id}/segments.json', Server::PRODUCTION) @@ -113,13 +114,14 @@ def list_segments_for_price_point(options = {}) # @param [String] price_point_id Required parameter: ID or Handle of the # Price Point belonging to the Component # @param [Float] id Required parameter: The ID of the Segment - # @param [UpdateSegmentRequest] body Optional parameter: Example: - # @return [SegmentResponse] response from the API call. + # @param [UpdateSegmentRequest] body Optional parameter: TODO: type + # description here + # @return [SegmentResponse] Response from the API call. def update_segment(component_id, price_point_id, id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/components/{component_id}/price_points/{price_point_id}/segments/{id}.json', Server::PRODUCTION) @@ -158,11 +160,11 @@ def update_segment(component_id, # @param [String] price_point_id Required parameter: ID or Handle of the # Price Point belonging to the Component # @param [Float] id Required parameter: The ID of the Segment - # @return [void] response from the API call. + # @return [void] Response from the API call. def delete_segment(component_id, price_point_id, id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/components/{component_id}/price_points/{price_point_id}/segments/{id}.json', Server::PRODUCTION) @@ -200,12 +202,13 @@ def delete_segment(component_id, # Component # @param [String] price_point_id Required parameter: ID or Handle for the # Price Point belonging to the Component - # @param [BulkCreateSegments] body Optional parameter: Example: - # @return [ListSegmentsResponse] response from the API call. + # @param [BulkCreateSegments] body Optional parameter: TODO: type + # description here + # @return [ListSegmentsResponse] Response from the API call. def bulk_create_segments(component_id, price_point_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/components/{component_id}/price_points/{price_point_id}/segments/bulk.json', Server::PRODUCTION) @@ -245,12 +248,13 @@ def bulk_create_segments(component_id, # Component # @param [String] price_point_id Required parameter: ID or Handle for the # Price Point belonging to the Component - # @param [BulkUpdateSegments] body Optional parameter: Example: - # @return [ListSegmentsResponse] response from the API call. + # @param [BulkUpdateSegments] body Optional parameter: TODO: type + # description here + # @return [ListSegmentsResponse] Response from the API call. def bulk_update_segments(component_id, price_point_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/components/{component_id}/price_points/{price_point_id}/segments/bulk.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/events_controller.rb b/lib/advanced_billing/controllers/events_controller.rb index 6a3bf895..73a5b5b8 100644 --- a/lib/advanced_billing/controllers/events_controller.rb +++ b/lib/advanced_billing/controllers/events_controller.rb @@ -114,9 +114,9 @@ class EventsController < BaseController # components with a timestamp at or before exact time provided in query. You # can specify timezone in query - otherwise your site's time zone will be # used. If provided, this parameter will be used instead of end_date. - # @return [Array[EventResponse]] response from the API call. + # @return [Array[EventResponse]] Response from the API call. def list_events(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/events.json', Server::PRODUCTION) @@ -174,9 +174,9 @@ def list_events(options = {}) # @param [Array[EventKey]] filter Optional parameter: You can pass multiple # event keys after comma. Use in query # `filter=signup_success,payment_success`. - # @return [Array[EventResponse]] response from the API call. + # @return [Array[EventResponse]] Response from the API call. def list_subscription_events(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/subscriptions/{subscription_id}/events.json', Server::PRODUCTION) @@ -220,9 +220,9 @@ def list_subscription_events(options = {}) # @param [Array[EventKey]] filter Optional parameter: You can pass multiple # event keys after comma. Use in query # `filter=signup_success,payment_success`. - # @return [CountResponse] response from the API call. + # @return [CountResponse] Response from the API call. def read_events_count(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/events/count.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/insights_controller.rb b/lib/advanced_billing/controllers/insights_controller.rb index 8635f8c2..e85282bd 100644 --- a/lib/advanced_billing/controllers/insights_controller.rb +++ b/lib/advanced_billing/controllers/insights_controller.rb @@ -11,13 +11,13 @@ class InsightsController < BaseController # ## Stats Documentation # There currently is not a complimentary matching set of documentation that # compliments this endpoint. However, each Site's dashboard will reflect the - # summary of information provided in the Stats reposnse. + # summary of information provided in the Stats response. # ``` # https://subdomain.chargify.com/dashboard # ``` - # @return [SiteSummary] response from the API call. + # @return [SiteSummary] Response from the API call. def read_site_stats - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/stats.json', Server::PRODUCTION) @@ -35,11 +35,11 @@ def read_site_stats # ISO8601 format to request MRR for a historic time # @param [Integer] subscription_id Optional parameter: submit the id of a # subscription in order to limit results - # @return [MRRResponse] response from the API call. + # @return [MRRResponse] Response from the API call. def read_mrr(at_time: nil, subscription_id: nil) warn 'Endpoint read_mrr in InsightsController is deprecated' - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/mrr.json', Server::PRODUCTION) @@ -91,10 +91,10 @@ def read_mrr(at_time: nil, # Use in query `per_page=20`. # @param [SortingDirection] direction Optional parameter: Controls the order # in which results are returned. Use in query `direction=asc`. - # @return [ListMRRResponse] response from the API call. + # @return [ListMRRResponse] Response from the API call. def list_mrr_movements(options = {}) warn 'Endpoint list_mrr_movements in InsightsController is deprecated' - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/mrr_movements.json', Server::PRODUCTION) @@ -131,11 +131,11 @@ def list_mrr_movements(options = {}) # @param [Direction] direction Optional parameter: Controls the order in # which results are returned. Records are ordered by subscription_id in # ascending order by default. Use in query `direction=desc`. - # @return [SubscriptionMRRResponse] response from the API call. + # @return [SubscriptionMRRResponse] Response from the API call. def list_mrr_per_subscription(options = {}) warn 'Endpoint list_mrr_per_subscription in InsightsController is deprec'\ 'ated' - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/subscriptions_mrr.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/invoices_controller.rb b/lib/advanced_billing/controllers/invoices_controller.rb index 4ff9c2dc..dd159874 100644 --- a/lib/advanced_billing/controllers/invoices_controller.rb +++ b/lib/advanced_billing/controllers/invoices_controller.rb @@ -15,11 +15,12 @@ class InvoicesController < BaseController # and $20.00 respectively). # @param [String] uid Required parameter: The unique identifier for the # invoice, this does not refer to the public facing invoice number. - # @param [RefundInvoiceRequest] body Optional parameter: Example: - # @return [Invoice] response from the API call. + # @param [RefundInvoiceRequest] body Optional parameter: TODO: type + # description here + # @return [Invoice] Response from the API call. def refund_invoice(uid, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/invoices/{uid}/refunds.json', Server::PRODUCTION) @@ -61,6 +62,9 @@ def refund_invoice(uid, # subscription group you want to fetch consolidated invoices for. This will # return a paginated list of consolidated invoices for the specified # group. + # @param [String] consolidation_level Optional parameter: The consolidation + # level of the invoice. Allowed Values: none, parent, child or + # comma-separated lists of thereof, e.g. none,parent. # @param [Integer] page Optional parameter: Result records are organized in # pages. By default, the first page of results is displayed. The page # parameter specifies a page number of results to fetch. You can start @@ -116,9 +120,9 @@ def refund_invoice(uid, # Use in query `product_ids=23,34`. # @param [InvoiceSortField] sort Optional parameter: Allows specification of # the order of the returned list. Use in query `sort=total_amount`. - # @return [ListInvoicesResponse] response from the API call. + # @return [ListInvoicesResponse] Response from the API call. def list_invoices(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/invoices.json', Server::PRODUCTION) @@ -127,6 +131,7 @@ def list_invoices(options = {}) .query_param(new_parameter(options['status'], key: 'status')) .query_param(new_parameter(options['subscription_id'], key: 'subscription_id')) .query_param(new_parameter(options['subscription_group_uid'], key: 'subscription_group_uid')) + .query_param(new_parameter(options['consolidation_level'], key: 'consolidation_level')) .query_param(new_parameter(options['page'], key: 'page')) .query_param(new_parameter(options['per_page'], key: 'per_page')) .query_param(new_parameter(options['direction'], key: 'direction')) @@ -167,9 +172,9 @@ def list_invoices(options = {}) # ``` # @param [String] uid Required parameter: The unique identifier for the # invoice, this does not refer to the public facing invoice number. - # @return [Invoice] response from the API call. + # @return [Invoice] Response from the API call. def read_invoice(uid) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/invoices/{uid}.json', Server::PRODUCTION) @@ -236,9 +241,9 @@ def read_invoice(uid) # @param [Array[InvoiceEventType]] event_types Optional parameter: Filter # results by event_type. Supply a comma separated list of event types # (listed above). Use in query: `event_types=void_invoice,void_remainder`. - # @return [ListInvoiceEventsResponse] response from the API call. + # @return [ListInvoiceEventsResponse] Response from the API call. def list_invoice_events(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/invoices/events.json', Server::PRODUCTION) @@ -258,60 +263,17 @@ def list_invoice_events(options = {}) .execute end - # This API call should be used when you want to record a payment of a given - # type against a specific invoice. If you would like to apply a payment - # across multiple invoices, you can use the Bulk Payment endpoint. - # ## Create a Payment from the existing payment profile - # In order to apply a payment to an invoice using an existing payment - # profile, specify `type` as `payment`, the amount less than the invoice - # total, and the customer's `payment_profile_id`. The ID of a payment - # profile might be retrieved via the Payment Profiles API endpoint. - # ``` - # { - # "type": "payment", - # "payment": { - # "amount": 10.00, - # "payment_profile_id": 123 - # } - # } - # ``` - # ## Create a Payment from the Subscription's Prepayment Account - # In order apply a prepayment to an invoice, specify the `type` as - # `prepayment`, and also the `amount`. - # ``` - # { - # "type": "prepayment", - # "payment": { - # "amount": 10.00 - # } - # } - # ``` - # Note that the `amount` must be less than or equal to the Subscription's - # Prepayment account balance. - # ## Create a Payment from the Subscription's Service Credit Account - # In order to apply a service credit to an invoice, specify the `type` as - # `service_credit`, and also the `amount`: - # ``` - # { - # "type": "service_credit", - # "payment": { - # "amount": 10.00 - # } - # } - # ``` - # Note that Advanced Billing will attempt to fully pay the invoice's - # `due_amount` from the Subscription's Service Credit account. At this time, - # partial payments from a Service Credit Account are only allowed for - # consolidated invoices (subscription groups). Therefore, for normal - # invoices the Service Credit account balance must be greater than or equal - # to the invoice's `due_amount`. + # Applies a payment of a given type against a specific invoice. If you would + # like to apply a payment across multiple invoices, you can use the Bulk + # Payment endpoint. # @param [String] uid Required parameter: The unique identifier for the # invoice, this does not refer to the public facing invoice number. - # @param [CreateInvoicePaymentRequest] body Optional parameter: Example: - # @return [Invoice] response from the API call. + # @param [CreateInvoicePaymentRequest] body Optional parameter: TODO: type + # description here + # @return [Invoice] Response from the API call. def record_payment_for_invoice(uid, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/invoices/{uid}/payments.json', Server::PRODUCTION) @@ -359,11 +321,11 @@ def record_payment_for_invoice(uid, # ``` # Note that the invoice payment amounts must be greater than 0. Total amount # must be greater or equal to invoices payment amount sum. - # @param [CreateMultiInvoicePaymentRequest] body Optional parameter: - # Example: - # @return [MultiInvoicePaymentResponse] response from the API call. + # @param [CreateMultiInvoicePaymentRequest] body Optional parameter: TODO: + # type description here + # @return [MultiInvoicePaymentResponse] Response from the API call. def record_payment_for_multiple_invoices(body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/invoices/payments.json', Server::PRODUCTION) @@ -411,9 +373,9 @@ def record_payment_for_multiple_invoices(body: nil) # refunds data # @param [TrueClass | FalseClass] applications Optional parameter: Include # applications data - # @return [ListCreditNotesResponse] response from the API call. + # @return [ListCreditNotesResponse] Response from the API call. def list_credit_notes(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/credit_notes.json', Server::PRODUCTION) @@ -436,9 +398,9 @@ def list_credit_notes(options = {}) # Use this endpoint to retrieve the details for a credit note. # @param [String] uid Required parameter: The unique identifier of the # credit note - # @return [CreditNote] response from the API call. + # @return [CreditNote] Response from the API call. def read_credit_note(uid) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/credit_notes/{uid}.json', Server::PRODUCTION) @@ -463,11 +425,12 @@ def read_credit_note(uid) # payment request. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @param [RecordPaymentRequest] body Optional parameter: Example: - # @return [RecordPaymentResponse] response from the API call. + # @param [RecordPaymentRequest] body Optional parameter: TODO: type + # description here + # @return [RecordPaymentResponse] Response from the API call. def record_payment_for_subscription(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/payments.json', Server::PRODUCTION) @@ -509,9 +472,9 @@ def record_payment_for_subscription(subscription_id, # also be reopened. # @param [String] uid Required parameter: The unique identifier for the # invoice, this does not refer to the public facing invoice number. - # @return [Invoice] response from the API call. + # @return [Invoice] Response from the API call. def reopen_invoice(uid) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/invoices/{uid}/reopen.json', Server::PRODUCTION) @@ -538,11 +501,12 @@ def reopen_invoice(uid) # status if it is not a consolidated invoice. # @param [String] uid Required parameter: The unique identifier for the # invoice, this does not refer to the public facing invoice number. - # @param [VoidInvoiceRequest] body Optional parameter: Example: - # @return [Invoice] response from the API call. + # @param [VoidInvoiceRequest] body Optional parameter: TODO: type + # description here + # @return [Invoice] Response from the API call. def void_invoice(uid, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/invoices/{uid}/void.json', Server::PRODUCTION) @@ -585,9 +549,9 @@ def void_invoice(uid, # Use in query `per_page=200`. # @param [Direction] direction Optional parameter: Sort direction of the # returned segments. - # @return [ConsolidatedInvoice] response from the API call. + # @return [ConsolidatedInvoice] Response from the API call. def list_consolidated_invoice_segments(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/invoices/{invoice_uid}/segments.json', Server::PRODUCTION) @@ -771,11 +735,12 @@ def list_consolidated_invoice_segments(options = {}) # alternative is `draft`. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @param [CreateInvoiceRequest] body Optional parameter: Example: - # @return [InvoiceResponse] response from the API call. + # @param [CreateInvoiceRequest] body Optional parameter: TODO: type + # description here + # @return [InvoiceResponse] Response from the API call. def create_invoice(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/invoices.json', Server::PRODUCTION) @@ -813,11 +778,12 @@ def create_invoice(subscription_id, # entire request will be rejected and a 422 response will be returned. # @param [String] uid Required parameter: The unique identifier for the # invoice, this does not refer to the public facing invoice number. - # @param [SendInvoiceRequest] body Optional parameter: Example: - # @return [void] response from the API call. + # @param [SendInvoiceRequest] body Optional parameter: TODO: type + # description here + # @return [void] Response from the API call. def send_invoice(uid, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/invoices/{uid}/deliveries.json', Server::PRODUCTION) @@ -845,9 +811,9 @@ def send_invoice(uid, # differences are calculated on the application side. # @param [String] uid Required parameter: The unique identifier for the # invoice, this does not refer to the public facing invoice number. - # @return [CustomerChangesPreviewResponse] response from the API call. + # @return [CustomerChangesPreviewResponse] Response from the API call. def preview_customer_information_changes(uid) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/invoices/{uid}/customer_information/preview.json', Server::PRODUCTION) @@ -877,9 +843,9 @@ def preview_customer_information_changes(uid) # differences are calculated on the application side. # @param [String] uid Required parameter: The unique identifier for the # invoice, this does not refer to the public facing invoice number. - # @return [Invoice] response from the API call. + # @return [Invoice] Response from the API call. def update_customer_information(uid) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/invoices/{uid}/customer_information.json', Server::PRODUCTION) @@ -930,11 +896,12 @@ def update_customer_information(uid) # state (depending upon net terms and dunning settings). # @param [String] uid Required parameter: The unique identifier for the # invoice, this does not refer to the public facing invoice number. - # @param [IssueInvoiceRequest] body Optional parameter: Example: - # @return [Invoice] response from the API call. + # @param [IssueInvoiceRequest] body Optional parameter: TODO: type + # description here + # @return [Invoice] Response from the API call. def issue_invoice(uid, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/invoices/{uid}/issue.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/offers_controller.rb b/lib/advanced_billing/controllers/offers_controller.rb index 29ef317a..ef77f16f 100644 --- a/lib/advanced_billing/controllers/offers_controller.rb +++ b/lib/advanced_billing/controllers/offers_controller.rb @@ -23,10 +23,11 @@ class OffersController < BaseController # with the `product_id` and the offer will use that price point. If a # `product_price_point_id` is not passed in, the product's default price # point will be used. - # @param [CreateOfferRequest] body Optional parameter: Example: - # @return [OfferResponse] response from the API call. + # @param [CreateOfferRequest] body Optional parameter: TODO: type + # description here + # @return [OfferResponse] Response from the API call. def create_offer(body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/offers.json', Server::PRODUCTION) @@ -59,9 +60,9 @@ def create_offer(body: nil) # Use in query `per_page=200`. # @param [TrueClass | FalseClass] include_archived Optional parameter: # Include archived products. Use in query: `include_archived=true`. - # @return [ListOffersResponse] response from the API call. + # @return [ListOffersResponse] Response from the API call. def list_offers(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/offers.json', Server::PRODUCTION) @@ -84,9 +85,9 @@ def list_offers(options = {}) # different than list all offers for a site, as it requires an `offer_id`. # @param [Integer] offer_id Required parameter: The Chargify id of the # offer - # @return [OfferResponse] response from the API call. + # @return [OfferResponse] Response from the API call. def read_offer(offer_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/offers/{offer_id}.json', Server::PRODUCTION) @@ -105,9 +106,9 @@ def read_offer(offer_id) # archive the correct item. # @param [Integer] offer_id Required parameter: The Chargify id of the # offer - # @return [void] response from the API call. + # @return [void] Response from the API call. def archive_offer(offer_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/offers/{offer_id}/archive.json', Server::PRODUCTION) @@ -124,9 +125,9 @@ def archive_offer(offer_id) # order to un-archive the correct item. # @param [Integer] offer_id Required parameter: The Chargify id of the # offer - # @return [void] response from the API call. + # @return [void] Response from the API call. def unarchive_offer(offer_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/offers/{offer_id}/unarchive.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/payment_profiles_controller.rb b/lib/advanced_billing/controllers/payment_profiles_controller.rb index c8b84efd..a9671c96 100644 --- a/lib/advanced_billing/controllers/payment_profiles_controller.rb +++ b/lib/advanced_billing/controllers/payment_profiles_controller.rb @@ -325,9 +325,9 @@ class PaymentProfilesController < BaseController # account and mandate will be created in your current vault. If the # customer, bank account, and mandate already exist in your vault, follow # the Import example to link the payment profile into Advanced Billing. - # @return [PaymentProfileResponse] response from the API call. + # @return [PaymentProfileResponse] Response from the API call. def create_payment_profile(body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/payment_profiles.json', Server::PRODUCTION) @@ -365,9 +365,9 @@ def create_payment_profile(body: nil) # Use in query `per_page=200`. # @param [Integer] customer_id Optional parameter: The ID of the customer # for which you wish to list payment profiles - # @return [Array[PaymentProfileResponse]] response from the API call. + # @return [Array[PaymentProfileResponse]] Response from the API call. def list_payment_profiles(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/payment_profiles.json', Server::PRODUCTION) @@ -395,6 +395,8 @@ def list_payment_profiles(options = {}) # "id": 10089892, # "first_name": "Chester", # "last_name": "Tester", + # "created_at": "2025-01-01T00:00:00-05:00", + # "updated_at": "2025-01-01T00:00:00-05:00", # "customer_id": 14543792, # "current_vault": "bogus", # "vault_token": "0011223344", @@ -418,9 +420,9 @@ def list_payment_profiles(options = {}) # ``` # @param [Integer] payment_profile_id Required parameter: The Chargify id of # the payment profile - # @return [PaymentProfileResponse] response from the API call. + # @return [PaymentProfileResponse] Response from the API call. def read_payment_profile(payment_profile_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/payment_profiles/{payment_profile_id}.json', Server::PRODUCTION) @@ -482,11 +484,12 @@ def read_payment_profile(payment_profile_id) # trigger a retry for a past due subscription after a partial update. # @param [Integer] payment_profile_id Required parameter: The Chargify id of # the payment profile - # @param [UpdatePaymentProfileRequest] body Optional parameter: Example: - # @return [PaymentProfileResponse] response from the API call. + # @param [UpdatePaymentProfileRequest] body Optional parameter: TODO: type + # description here + # @return [PaymentProfileResponse] Response from the API call. def update_payment_profile(payment_profile_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/payment_profiles/{payment_profile_id}.json', Server::PRODUCTION) @@ -516,9 +519,9 @@ def update_payment_profile(payment_profile_id, # 422 and error message will be returned. # @param [Integer] payment_profile_id Required parameter: The Chargify id of # the payment profile - # @return [void] response from the API call. + # @return [void] Response from the API call. def delete_unused_payment_profile(payment_profile_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/payment_profiles/{payment_profile_id}.json', Server::PRODUCTION) @@ -552,10 +555,10 @@ def delete_unused_payment_profile(payment_profile_id) # the subscription # @param [Integer] payment_profile_id Required parameter: The Chargify id of # the payment profile - # @return [void] response from the API call. + # @return [void] Response from the API call. def delete_subscriptions_payment_profile(subscription_id, payment_profile_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/subscriptions/{subscription_id}/payment_profiles/{payment_profile_id}.json', Server::PRODUCTION) @@ -575,12 +578,12 @@ def delete_subscriptions_payment_profile(subscription_id, # account in order to verify the bank account. (Stripe only) # @param [Integer] bank_account_id Required parameter: Identifier of the # bank account in the system. - # @param [BankAccountVerificationRequest] body Optional parameter: - # Example: - # @return [BankAccountResponse] response from the API call. + # @param [BankAccountVerificationRequest] body Optional parameter: TODO: + # type description here + # @return [BankAccountResponse] Response from the API call. def verify_bank_account(bank_account_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/bank_accounts/{bank_account_id}/verification.json', Server::PRODUCTION) @@ -612,10 +615,10 @@ def verify_bank_account(bank_account_id, # group # @param [Integer] payment_profile_id Required parameter: The Chargify id of # the payment profile - # @return [void] response from the API call. + # @return [void] Response from the API call. def delete_subscription_group_payment_profile(uid, payment_profile_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/subscription_groups/{uid}/payment_profiles/{payment_profile_id}.json', Server::PRODUCTION) @@ -639,10 +642,10 @@ def delete_subscription_group_payment_profile(uid, # the subscription # @param [Integer] payment_profile_id Required parameter: The Chargify id of # the payment profile - # @return [PaymentProfileResponse] response from the API call. + # @return [PaymentProfileResponse] Response from the API call. def change_subscription_default_payment_profile(subscription_id, payment_profile_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/payment_profiles/{payment_profile_id}/change_payment_profile.json', Server::PRODUCTION) @@ -677,10 +680,10 @@ def change_subscription_default_payment_profile(subscription_id, # group # @param [Integer] payment_profile_id Required parameter: The Chargify id of # the payment profile - # @return [PaymentProfileResponse] response from the API call. + # @return [PaymentProfileResponse] Response from the API call. def change_subscription_group_default_payment_profile(uid, payment_profile_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscription_groups/{uid}/payment_profiles/{payment_profile_id}/change_payment_profile.json', Server::PRODUCTION) @@ -712,9 +715,9 @@ def change_subscription_group_default_payment_profile(uid, # NjAzNDI0-overview). # @param [String] chargify_token Required parameter: Advanced Billing # Token - # @return [GetOneTimeTokenRequest] response from the API call. + # @return [GetOneTimeTokenRequest] Response from the API call. def read_one_time_token(chargify_token) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/one_time_tokens/{chargify_token}.json', Server::PRODUCTION) @@ -749,9 +752,9 @@ def read_one_time_token(chargify_token) # encounter errors during the request process. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @return [void] response from the API call. + # @return [void] Response from the API call. def send_request_update_payment_email(subscription_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/request_payment_profiles_update.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/product_families_controller.rb b/lib/advanced_billing/controllers/product_families_controller.rb index b1059b99..d647c6a8 100644 --- a/lib/advanced_billing/controllers/product_families_controller.rb +++ b/lib/advanced_billing/controllers/product_families_controller.rb @@ -50,9 +50,9 @@ class ProductFamiliesController < BaseController # @param [ListProductsInclude] include Optional parameter: Allows including # additional data in the response. Use in query # `include=prepaid_product_price_point`. - # @return [Array[ProductResponse]] response from the API call. + # @return [Array[ProductResponse]] Response from the API call. def list_products_for_product_family(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/product_families/{product_family_id}/products.json', Server::PRODUCTION) @@ -76,9 +76,9 @@ def list_products_for_product_family(options = {}) .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(ProductResponse.method(:from_hash)) .is_response_array(true) - .local_error('404', - 'Not Found', - APIException)) + .local_error_template('404', + 'Not Found:\'{$response.body}\'', + APIException)) .execute end @@ -89,10 +89,11 @@ def list_products_for_product_family(options = {}) # Billing UI can be located # [here](https://maxio.zendesk.com/hc/en-us/articles/24261098936205-Product- # Families). - # @param [CreateProductFamilyRequest] body Optional parameter: Example: - # @return [ProductFamilyResponse] response from the API call. + # @param [CreateProductFamilyRequest] body Optional parameter: TODO: type + # description here + # @return [ProductFamilyResponse] Response from the API call. def create_product_family(body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/product_families.json', Server::PRODUCTION) @@ -134,9 +135,9 @@ def create_product_family(body: nil) # products with a timestamp at or before exact time provided in query. You # can specify timezone in query - otherwise your site's time zone will be # used. If provided, this parameter will be used instead of end_date. - # @return [Array[ProductFamilyResponse]] response from the API call. + # @return [Array[ProductFamilyResponse]] Response from the API call. def list_product_families(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/product_families.json', Server::PRODUCTION) @@ -160,9 +161,9 @@ def list_product_families(options = {}) # `handle:my-family` format. # @param [Integer] id Required parameter: The Advanced Billing id of the # product family - # @return [ProductFamilyResponse] response from the API call. + # @return [ProductFamilyResponse] Response from the API call. def read_product_family(id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/product_families/{id}.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/product_price_points_controller.rb b/lib/advanced_billing/controllers/product_price_points_controller.rb index df586995..6c4f8de5 100644 --- a/lib/advanced_billing/controllers/product_price_points_controller.rb +++ b/lib/advanced_billing/controllers/product_price_points_controller.rb @@ -12,12 +12,12 @@ class ProductPricePointsController < BaseController # @param [Integer | String] product_id Required parameter: The id or handle # of the product. When using the handle, it must be prefixed with # `handle:` - # @param [CreateProductPricePointRequest] body Optional parameter: - # Example: - # @return [ProductPricePointResponse] response from the API call. + # @param [CreateProductPricePointRequest] body Optional parameter: TODO: + # type description here + # @return [ProductPricePointResponse] Response from the API call. def create_product_price_point(product_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/products/{product_id}/price_points.json', Server::PRODUCTION) @@ -69,9 +69,9 @@ def create_product_price_point(product_id, # query: `filter[type]=catalog,default`. # @param [TrueClass | FalseClass] archived Optional parameter: Set to # include archived price points in the response. - # @return [ListProductPricePointsResponse] response from the API call. + # @return [ListProductPricePointsResponse] Response from the API call. def list_product_price_points(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/products/{product_id}/price_points.json', Server::PRODUCTION) @@ -106,13 +106,13 @@ def list_product_price_points(options = {}) # handle of the price point. When using the handle, it must be prefixed with # `handle:`. Example: `123` for an integer ID, or # `handle:example-product-price-point-handle` for a string handle. - # @param [UpdateProductPricePointRequest] body Optional parameter: - # Example: - # @return [ProductPricePointResponse] response from the API call. + # @param [UpdateProductPricePointRequest] body Optional parameter: TODO: + # type description here + # @return [ProductPricePointResponse] Response from the API call. def update_product_price_point(product_id, price_point_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/products/{product_id}/price_points/{price_point_id}.json', Server::PRODUCTION) @@ -158,11 +158,11 @@ def update_product_price_point(product_id, # product price point is set to use_site_exchange_rate: true, it will return # pricing based on the current exchange rate. If the flag is set to false, # it will return all of the defined prices for each currency. - # @return [ProductPricePointResponse] response from the API call. + # @return [ProductPricePointResponse] Response from the API call. def read_product_price_point(product_id, price_point_id, currency_prices: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/products/{product_id}/price_points/{price_point_id}.json', Server::PRODUCTION) @@ -198,10 +198,10 @@ def read_product_price_point(product_id, # handle of the price point. When using the handle, it must be prefixed with # `handle:`. Example: `123` for an integer ID, or # `handle:example-product-price-point-handle` for a string handle. - # @return [ProductPricePointResponse] response from the API call. + # @return [ProductPricePointResponse] Response from the API call. def archive_product_price_point(product_id, price_point_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/products/{product_id}/price_points/{price_point_id}.json', Server::PRODUCTION) @@ -236,10 +236,10 @@ def archive_product_price_point(product_id, # the product to which the price point belongs # @param [Integer] price_point_id Required parameter: The Advanced Billing # id of the product price point - # @return [ProductPricePointResponse] response from the API call. + # @return [ProductPricePointResponse] Response from the API call. def unarchive_product_price_point(product_id, price_point_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PATCH, '/products/{product_id}/price_points/{price_point_id}/unarchive.json', Server::PRODUCTION) @@ -265,10 +265,10 @@ def unarchive_product_price_point(product_id, # the product to which the price point belongs # @param [Integer] price_point_id Required parameter: The Advanced Billing # id of the product price point - # @return [ProductResponse] response from the API call. + # @return [ProductResponse] Response from the API call. def promote_product_price_point_to_default(product_id, price_point_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PATCH, '/products/{product_id}/price_points/{price_point_id}/default.json', Server::PRODUCTION) @@ -290,11 +290,11 @@ def promote_product_price_point_to_default(product_id, # @param [Integer] product_id Required parameter: The Advanced Billing id of # the product to which the price points belong # @param [BulkCreateProductPricePointsRequest] body Optional parameter: - # Example: - # @return [BulkCreateProductPricePointsResponse] response from the API call. + # TODO: type description here + # @return [BulkCreateProductPricePointsResponse] Response from the API call. def bulk_create_product_price_points(product_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/products/{product_id}/price_points/bulk.json', Server::PRODUCTION) @@ -325,12 +325,12 @@ def bulk_create_product_price_points(product_id, # points. # @param [Integer] product_price_point_id Required parameter: The Advanced # Billing id of the product price point - # @param [CreateProductCurrencyPricesRequest] body Optional parameter: - # Example: - # @return [CurrencyPricesResponse] response from the API call. + # @param [CreateProductCurrencyPricesRequest] body Optional parameter: TODO: + # type description here + # @return [CurrencyPricesResponse] Response from the API call. def create_product_currency_prices(product_price_point_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/product_price_points/{product_price_point_id}/currency_prices.json', Server::PRODUCTION) @@ -361,11 +361,12 @@ def create_product_currency_prices(product_price_point_id, # points. # @param [Integer] product_price_point_id Required parameter: The Advanced # Billing id of the product price point - # @param [UpdateCurrencyPricesRequest] body Optional parameter: Example: - # @return [CurrencyPricesResponse] response from the API call. + # @param [UpdateCurrencyPricesRequest] body Optional parameter: TODO: type + # description here + # @return [CurrencyPricesResponse] Response from the API call. def update_product_currency_prices(product_price_point_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/product_price_points/{product_price_point_id}/currency_prices.json', Server::PRODUCTION) @@ -407,9 +408,9 @@ def update_product_currency_prices(product_price_point_id, # many records to fetch in each request. Default value is 20. The maximum # allowed values is 200; any per_page value over 200 will be changed to 200. # Use in query `per_page=200`. - # @return [ListProductPricePointsResponse] response from the API call. + # @return [ListProductPricePointsResponse] Response from the API call. def list_all_product_price_points(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/products_price_points.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/products_controller.rb b/lib/advanced_billing/controllers/products_controller.rb index 1f778803..0df90969 100644 --- a/lib/advanced_billing/controllers/products_controller.rb +++ b/lib/advanced_billing/controllers/products_controller.rb @@ -15,11 +15,12 @@ class ProductsController < BaseController # t-Changes-and-Migrations) # @param [String] product_family_id Required parameter: Either the product # family's id or its handle prefixed with `handle:` - # @param [CreateOrUpdateProductRequest] body Optional parameter: Example: - # @return [ProductResponse] response from the API call. + # @param [CreateOrUpdateProductRequest] body Optional parameter: TODO: type + # description here + # @return [ProductResponse] Response from the API call. def create_product(product_family_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/product_families/{product_family_id}/products.json', Server::PRODUCTION) @@ -45,9 +46,9 @@ def create_product(product_family_id, # you've created in Advanced Billing. # @param [Integer] product_id Required parameter: The Advanced Billing id of # the product - # @return [ProductResponse] response from the API call. + # @return [ProductResponse] Response from the API call. def read_product(product_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/products/{product_id}.json', Server::PRODUCTION) @@ -72,11 +73,12 @@ def read_product(product_id) # update an existing product price point, that must be done separately. # @param [Integer] product_id Required parameter: The Advanced Billing id of # the product - # @param [CreateOrUpdateProductRequest] body Optional parameter: Example: - # @return [ProductResponse] response from the API call. + # @param [CreateOrUpdateProductRequest] body Optional parameter: TODO: type + # description here + # @return [ProductResponse] Response from the API call. def update_product(product_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/products/{product_id}.json', Server::PRODUCTION) @@ -105,9 +107,9 @@ def update_product(product_id, # Billing Portal, as well as disable Public Signup Pages for the product. # @param [Integer] product_id Required parameter: The Advanced Billing id of # the product - # @return [ProductResponse] response from the API call. + # @return [ProductResponse] Response from the API call. def archive_product(product_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/products/{product_id}.json', Server::PRODUCTION) @@ -128,9 +130,9 @@ def archive_product(product_id) # This method allows to retrieve a Product object by its `api_handle`. # @param [String] api_handle Required parameter: The handle of the product - # @return [ProductResponse] response from the API call. + # @return [ProductResponse] Response from the API call. def read_product_by_handle(api_handle) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/products/handle/{api_handle}.json', Server::PRODUCTION) @@ -186,9 +188,9 @@ def read_product_by_handle(api_handle) # @param [ListProductsInclude] include Optional parameter: Allows including # additional data in the response. Use in query # `include=prepaid_product_price_point`. - # @return [Array[ProductResponse]] response from the API call. + # @return [Array[ProductResponse]] Response from the API call. def list_products(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/products.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/proforma_invoices_controller.rb b/lib/advanced_billing/controllers/proforma_invoices_controller.rb index 0f1fb8dc..3747b64c 100644 --- a/lib/advanced_billing/controllers/proforma_invoices_controller.rb +++ b/lib/advanced_billing/controllers/proforma_invoices_controller.rb @@ -19,9 +19,9 @@ class ProformaInvoicesController < BaseController # be in a live state. # @param [String] uid Required parameter: The uid of the subscription # group - # @return [void] response from the API call. + # @return [void] Response from the API call. def create_consolidated_proforma_invoice(uid) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscription_groups/{uid}/proforma_invoices.json', Server::PRODUCTION) @@ -58,9 +58,9 @@ def create_consolidated_proforma_invoice(uid) # payments data # @param [TrueClass | FalseClass] custom_fields Optional parameter: Include # custom fields data - # @return [ListProformaInvoicesResponse] response from the API call. + # @return [ListProformaInvoicesResponse] Response from the API call. def list_subscription_group_proforma_invoices(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/subscription_groups/{uid}/proforma_invoices.json', Server::PRODUCTION) @@ -89,9 +89,9 @@ def list_subscription_group_proforma_invoices(options = {}) # Proforma invoices are only available on Relationship Invoicing sites. # @param [String] proforma_invoice_uid Required parameter: The uid of the # proforma invoice - # @return [ProformaInvoice] response from the API call. + # @return [ProformaInvoice] Response from the API call. def read_proforma_invoice(proforma_invoice_uid) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/proforma_invoices/{proforma_invoice_uid}.json', Server::PRODUCTION) @@ -120,9 +120,9 @@ def read_proforma_invoice(proforma_invoice_uid) # not be prepaid, and must be in a live state. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @return [ProformaInvoice] response from the API call. + # @return [ProformaInvoice] Response from the API call. def create_proforma_invoice(subscription_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/proforma_invoices.json', Server::PRODUCTION) @@ -179,9 +179,9 @@ def create_proforma_invoice(subscription_id) # payments data # @param [TrueClass | FalseClass] custom_fields Optional parameter: Include # custom fields data - # @return [ListProformaInvoicesResponse] response from the API call. + # @return [ListProformaInvoicesResponse] Response from the API call. def list_proforma_invoices(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/subscriptions/{subscription_id}/proforma_invoices.json', Server::PRODUCTION) @@ -219,11 +219,12 @@ def list_proforma_invoices(options = {}) # and an error message. # @param [String] proforma_invoice_uid Required parameter: The uid of the # proforma invoice - # @param [VoidInvoiceRequest] body Optional parameter: Example: - # @return [ProformaInvoice] response from the API call. + # @param [VoidInvoiceRequest] body Optional parameter: TODO: type + # description here + # @return [ProformaInvoice] Response from the API call. def void_proforma_invoice(proforma_invoice_uid, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/proforma_invoices/{proforma_invoice_uid}/void.json', Server::PRODUCTION) @@ -267,9 +268,9 @@ def void_proforma_invoice(proforma_invoice_uid, # subscription's upcoming renewal has changed. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @return [ProformaInvoice] response from the API call. + # @return [ProformaInvoice] Response from the API call. def preview_proforma_invoice(subscription_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/proforma_invoices/preview.json', Server::PRODUCTION) @@ -305,10 +306,11 @@ def preview_proforma_invoice(subscription_id) # requirements. We recommend associating the proforma invoice with a # customer_id to easily find their proforma invoices, since the # subscription_id will always be blank. - # @param [CreateSubscriptionRequest] body Optional parameter: Example: - # @return [ProformaInvoice] response from the API call. + # @param [CreateSubscriptionRequest] body Optional parameter: TODO: type + # description here + # @return [ProformaInvoice] Response from the API call. def create_signup_proforma_invoice(body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/proforma_invoices.json', Server::PRODUCTION) @@ -347,11 +349,12 @@ def create_signup_proforma_invoice(body: nil) # @param [CreateSignupProformaPreviewInclude] include Optional parameter: # Choose to include a proforma invoice preview for the first renewal. Use in # query `include=next_proforma_invoice`. - # @param [CreateSubscriptionRequest] body Optional parameter: Example: - # @return [SignupProformaPreviewResponse] response from the API call. + # @param [CreateSubscriptionRequest] body Optional parameter: TODO: type + # description here + # @return [SignupProformaPreviewResponse] Response from the API call. def preview_signup_proforma_invoice(include: nil, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/proforma_invoices/preview.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/reason_codes_controller.rb b/lib/advanced_billing/controllers/reason_codes_controller.rb index 09b1c530..fd14b006 100644 --- a/lib/advanced_billing/controllers/reason_codes_controller.rb +++ b/lib/advanced_billing/controllers/reason_codes_controller.rb @@ -8,7 +8,7 @@ module AdvancedBilling class ReasonCodesController < BaseController # # Reason Codes Intro # ReasonCodes are a way to gain a high level view of why your customers are - # cancelling the subcription to your product or service. + # cancelling the subscription to your product or service. # Add a set of churn reason codes to be displayed in-app and/or the Maxio # Billing Portal. As your subscribers decide to cancel their subscription, # learn why they decided to cancel. @@ -21,10 +21,11 @@ class ReasonCodesController < BaseController # ## Create Reason Code # This method gives a merchant the option to create a reason codes for a # given Site. - # @param [CreateReasonCodeRequest] body Optional parameter: Example: - # @return [ReasonCodeResponse] response from the API call. + # @param [CreateReasonCodeRequest] body Optional parameter: TODO: type + # description here + # @return [ReasonCodeResponse] Response from the API call. def create_reason_code(body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/reason_codes.json', Server::PRODUCTION) @@ -56,9 +57,9 @@ def create_reason_code(body: nil) # many records to fetch in each request. Default value is 20. The maximum # allowed values is 200; any per_page value over 200 will be changed to 200. # Use in query `per_page=200`. - # @return [Array[ReasonCodeResponse]] response from the API call. + # @return [Array[ReasonCodeResponse]] Response from the API call. def list_reason_codes(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/reason_codes.json', Server::PRODUCTION) @@ -81,9 +82,9 @@ def list_reason_codes(options = {}) # code for a given Site by providing the unique numerical ID of the code. # @param [Integer] reason_code_id Required parameter: The Advanced Billing # id of the reason code - # @return [ReasonCodeResponse] response from the API call. + # @return [ReasonCodeResponse] Response from the API call. def read_reason_code(reason_code_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/reason_codes/{reason_code_id}.json', Server::PRODUCTION) @@ -105,11 +106,12 @@ def read_reason_code(reason_code_id) # for a given site. # @param [Integer] reason_code_id Required parameter: The Advanced Billing # id of the reason code - # @param [UpdateReasonCodeRequest] body Optional parameter: Example: - # @return [ReasonCodeResponse] response from the API call. + # @param [UpdateReasonCodeRequest] body Optional parameter: TODO: type + # description here + # @return [ReasonCodeResponse] Response from the API call. def update_reason_code(reason_code_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/reason_codes/{reason_code_id}.json', Server::PRODUCTION) @@ -136,12 +138,12 @@ def update_reason_code(reason_code_id, # This method gives a merchant the option to delete one reason code from the # Churn Reason Codes. This code will be immediately removed. This action is - # not reversable. + # not reversible. # @param [Integer] reason_code_id Required parameter: The Advanced Billing # id of the reason code - # @return [OkResponse] response from the API call. + # @return [OkResponse] Response from the API call. def delete_reason_code(reason_code_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/reason_codes/{reason_code_id}.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/referral_codes_controller.rb b/lib/advanced_billing/controllers/referral_codes_controller.rb index 1dec90d7..a1029c9d 100644 --- a/lib/advanced_billing/controllers/referral_codes_controller.rb +++ b/lib/advanced_billing/controllers/referral_codes_controller.rb @@ -20,9 +20,9 @@ class ReferralCodesController < BaseController # response will be returned. # @param [String] code Required parameter: The referral code you are trying # to validate - # @return [ReferralValidationResponse] response from the API call. + # @return [ReferralValidationResponse] Response from the API call. def validate_referral_code(code) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/referral_codes/validate.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/sales_commissions_controller.rb b/lib/advanced_billing/controllers/sales_commissions_controller.rb index ff638f14..671b6aa0 100644 --- a/lib/advanced_billing/controllers/sales_commissions_controller.rb +++ b/lib/advanced_billing/controllers/sales_commissions_controller.rb @@ -41,9 +41,9 @@ class SalesCommissionsController < BaseController # set will be returned. Use in query `page=1`. # @param [Integer] per_page Optional parameter: This parameter indicates how # many records to fetch in each request. Default value is 100. - # @return [Array[SaleRepSettings]] response from the API call. + # @return [Array[SaleRepSettings]] Response from the API call. def list_sales_commission_settings(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/sellers/{seller_id}/sales_commission_settings.json', Server::PRODUCTION) @@ -98,9 +98,9 @@ def list_sales_commission_settings(options = {}) # set will be returned. Use in query `page=1`. # @param [Integer] per_page Optional parameter: This parameter indicates how # many records to fetch in each request. Default value is 100. - # @return [Array[ListSaleRepItem]] response from the API call. + # @return [Array[ListSaleRepItem]] Response from the API call. def list_sales_reps(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/sellers/{seller_id}/sales_reps.json', Server::PRODUCTION) @@ -157,14 +157,14 @@ def list_sales_reps(options = {}) # set will be returned. Use in query `page=1`. # @param [Integer] per_page Optional parameter: This parameter indicates how # many records to fetch in each request. Default value is 100. - # @return [SaleRep] response from the API call. + # @return [SaleRep] Response from the API call. def read_sales_rep(seller_id, sales_rep_id, authorization: 'Bearer <>', live_mode: nil, page: 1, per_page: 100) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/sellers/{seller_id}/sales_reps/{sales_rep_id}.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/sites_controller.rb b/lib/advanced_billing/controllers/sites_controller.rb index 461dfb22..3fc836de 100644 --- a/lib/advanced_billing/controllers/sites_controller.rb +++ b/lib/advanced_billing/controllers/sites_controller.rb @@ -21,9 +21,9 @@ class SitesController < BaseController # [Who Pays & Customer # Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Cust # omer-Hierarchies-WhoPays) - # @return [SiteResponse] response from the API call. + # @return [SiteResponse] Response from the API call. def read_site - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/site.json', Server::PRODUCTION) @@ -47,9 +47,9 @@ def read_site # `customers`: Will clear only customers and related subscriptions (leaving # the products untouched) for the site. Revenue will also be reset to 0. # Use in query `cleanup_scope=all`. - # @return [void] response from the API call. + # @return [void] Response from the API call. def clear_site(cleanup_scope: CleanupScope::ALL) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/sites/clear_data.json', Server::PRODUCTION) @@ -72,9 +72,9 @@ def clear_site(cleanup_scope: CleanupScope::ALL) # many records to fetch in each request. Default value is 20. The maximum # allowed values is 200; any per_page value over 200 will be changed to 200. # Use in query `per_page=200`. - # @return [ListPublicKeysResponse] response from the API call. + # @return [ListPublicKeysResponse] Response from the API call. def list_chargify_js_public_keys(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/chargify_js_keys.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/subscription_components_controller.rb b/lib/advanced_billing/controllers/subscription_components_controller.rb index 5e5d60b6..4905f07c 100644 --- a/lib/advanced_billing/controllers/subscription_components_controller.rb +++ b/lib/advanced_billing/controllers/subscription_components_controller.rb @@ -13,10 +13,10 @@ class SubscriptionComponentsController < BaseController # @param [Integer] component_id Required parameter: The Advanced Billing id # of the component. Alternatively, the component's handle prefixed by # `handle:` - # @return [SubscriptionComponentResponse] response from the API call. + # @return [SubscriptionComponentResponse] Response from the API call. def read_subscription_component(subscription_id, component_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/subscriptions/{subscription_id}/components/{component_id}.json', Server::PRODUCTION) @@ -84,9 +84,9 @@ def read_subscription_component(subscription_id, # set to true, it returns only components that are currently in use. # However, if it's set to false or not provided, it returns all components # connected with the subscription. - # @return [Array[SubscriptionComponentResponse]] response from the API call. + # @return [Array[SubscriptionComponentResponse]] Response from the API call. def list_subscription_components(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/subscriptions/{subscription_id}/components.json', Server::PRODUCTION) @@ -123,12 +123,12 @@ def list_subscription_components(options = {}) # component's current default price point. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @param [BulkComponentsPricePointAssignment] body Optional parameter: - # Example: - # @return [BulkComponentsPricePointAssignment] response from the API call. + # @param [BulkComponentsPricePointAssignment] body Optional parameter: TODO: + # type description here + # @return [BulkComponentsPricePointAssignment] Response from the API call. def bulk_update_subscription_components_price_points(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/price_points.json', Server::PRODUCTION) @@ -155,9 +155,9 @@ def bulk_update_subscription_components_price_points(subscription_id, # components, even ones that have not been allocated yet. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @return [SubscriptionResponse] response from the API call. + # @return [SubscriptionResponse] Response from the API call. def bulk_reset_subscription_components_price_points(subscription_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/price_points/reset.json', Server::PRODUCTION) @@ -243,12 +243,13 @@ def bulk_reset_subscription_components_price_points(subscription_id) # the subscription # @param [Integer] component_id Required parameter: The Advanced Billing id # of the component - # @param [CreateAllocationRequest] body Optional parameter: Example: - # @return [AllocationResponse] response from the API call. + # @param [CreateAllocationRequest] body Optional parameter: TODO: type + # description here + # @return [AllocationResponse] Response from the API call. def allocate_component(subscription_id, component_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/components/{component_id}/allocations.json', Server::PRODUCTION) @@ -302,11 +303,11 @@ def allocate_component(subscription_id, # passing in a page parameter. Retrieve the next page by adding ?page=2 to # the query string. If there are no results to return, then an empty result # set will be returned. Use in query `page=1`. - # @return [Array[AllocationResponse]] response from the API call. + # @return [Array[AllocationResponse]] Response from the API call. def list_allocations(subscription_id, component_id, page: 1) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/subscriptions/{subscription_id}/components/{component_id}/allocations.json', Server::PRODUCTION) @@ -342,11 +343,12 @@ def list_allocations(subscription_id, # This endpoint only responds to JSON. It is not available for XML. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @param [AllocateComponents] body Optional parameter: Example: - # @return [Array[AllocationResponse]] response from the API call. + # @param [AllocateComponents] body Optional parameter: TODO: type + # description here + # @return [Array[AllocationResponse]] Response from the API call. def allocate_components(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/allocations.json', Server::PRODUCTION) @@ -386,11 +388,12 @@ def allocate_components(subscription_id, # See example below for Fine-Grained Component Control response. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @param [PreviewAllocationsRequest] body Optional parameter: Example: - # @return [AllocationPreviewResponse] response from the API call. + # @param [PreviewAllocationsRequest] body Optional parameter: TODO: type + # description here + # @return [AllocationPreviewResponse] Response from the API call. def preview_allocations(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/allocations/preview.json', Server::PRODUCTION) @@ -432,14 +435,14 @@ def preview_allocations(subscription_id, # of the component # @param [Integer] allocation_id Required parameter: The Advanced Billing id # of the allocation - # @param [UpdateAllocationExpirationDate] body Optional parameter: - # Example: - # @return [void] response from the API call. + # @param [UpdateAllocationExpirationDate] body Optional parameter: TODO: + # type description here + # @return [void] Response from the API call. def update_prepaid_usage_allocation_expiration_date(subscription_id, component_id, allocation_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/subscriptions/{subscription_id}/components/{component_id}/allocations/{allocation_id}.json', Server::PRODUCTION) @@ -489,13 +492,14 @@ def update_prepaid_usage_allocation_expiration_date(subscription_id, # of the component # @param [Integer] allocation_id Required parameter: The Advanced Billing id # of the allocation - # @param [CreditSchemeRequest] body Optional parameter: Example: - # @return [void] response from the API call. + # @param [CreditSchemeRequest] body Optional parameter: TODO: type + # description here + # @return [void] Response from the API call. def delete_prepaid_usage_allocation(subscription_id, component_id, allocation_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/subscriptions/{subscription_id}/components/{component_id}/allocations/{allocation_id}.json', Server::PRODUCTION) @@ -598,12 +602,13 @@ def delete_prepaid_usage_allocation(subscription_id, # @param [Integer | String] component_id Required parameter: Either the # Advanced Billing id for the component or the component's handle prefixed # by `handle:` - # @param [CreateUsageRequest] body Optional parameter: Example: - # @return [UsageResponse] response from the API call. + # @param [CreateUsageRequest] body Optional parameter: TODO: type + # description here + # @return [UsageResponse] Response from the API call. def create_usage(subscription_id, component_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/components/{component_id}/usages.json', Server::PRODUCTION) @@ -674,9 +679,9 @@ def create_usage(subscription_id, # many records to fetch in each request. Default value is 20. The maximum # allowed values is 200; any per_page value over 200 will be changed to 200. # Use in query `per_page=200`. - # @return [Array[UsageResponse]] response from the API call. + # @return [Array[UsageResponse]] Response from the API call. def list_usages(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/subscriptions/{subscription_id}/components/{component_id}/usages.json', Server::PRODUCTION) @@ -722,12 +727,13 @@ def list_usages(options = {}) # id of the subscription # @param [Integer] component_id Required parameter: The Advanced Billing id # of the component - # @param [ActivateEventBasedComponent] body Optional parameter: Example: - # @return [void] response from the API call. + # @param [ActivateEventBasedComponent] body Optional parameter: TODO: type + # description here + # @return [void] Response from the API call. def activate_event_based_component(subscription_id, component_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/event_based_billing/subscriptions/{subscription_id}/components/{component_id}/activate.json', Server::PRODUCTION) @@ -753,10 +759,10 @@ def activate_event_based_component(subscription_id, # id of the subscription # @param [Integer] component_id Required parameter: The Advanced Billing id # of the component - # @return [void] response from the API call. + # @return [void] Response from the API call. def deactivate_event_based_component(subscription_id, component_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/event_based_billing/subscriptions/{subscription_id}/components/{component_id}/deactivate.json', Server::PRODUCTION) @@ -796,12 +802,12 @@ def deactivate_event_based_component(subscription_id, # @param [String] store_uid Optional parameter: If you've attached your own # Keen project as an Advanced Billing event data-store, use this parameter # to indicate the data-store. - # @param [EBBEvent] body Optional parameter: Example: - # @return [void] response from the API call. + # @param [EBBEvent] body Optional parameter: TODO: type description here + # @return [void] Response from the API call. def record_event(api_handle, store_uid: nil, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/events/{api_handle}.json', Server::EBB) @@ -829,12 +835,13 @@ def record_event(api_handle, # @param [String] store_uid Optional parameter: If you've attached your own # Keen project as an Advanced Billing event data-store, use this parameter # to indicate the data-store. - # @param [Array[EBBEvent]] body Optional parameter: Example: - # @return [void] response from the API call. + # @param [Array[EBBEvent]] body Optional parameter: TODO: type description + # here + # @return [void] Response from the API call. def bulk_record_events(api_handle, store_uid: nil, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/events/{api_handle}/bulk.json', Server::EBB) @@ -905,9 +912,9 @@ def bulk_record_events(api_handle, # @param [ListSubscriptionComponentsInclude] include Optional parameter: # Allows including additional data in the response. Use in query # `include=subscription,historic_usages`. - # @return [ListSubscriptionComponentsResponse] response from the API call. + # @return [ListSubscriptionComponentsResponse] Response from the API call. def list_subscription_components_for_site(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/subscriptions_components.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb b/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb index ebe64ee8..c237332a 100644 --- a/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb +++ b/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb @@ -12,12 +12,12 @@ class SubscriptionGroupInvoiceAccountController < BaseController # balance. # @param [String] uid Required parameter: The uid of the subscription # group - # @param [SubscriptionGroupPrepaymentRequest] body Optional parameter: - # Example: - # @return [SubscriptionGroupPrepaymentResponse] response from the API call. + # @param [SubscriptionGroupPrepaymentRequest] body Optional parameter: TODO: + # type description here + # @return [SubscriptionGroupPrepaymentResponse] Response from the API call. def create_subscription_group_prepayment(uid, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscription_groups/{uid}/prepayments.json', Server::PRODUCTION) @@ -55,9 +55,9 @@ def create_subscription_group_prepayment(uid, # Use in query `per_page=200`. # @param [ListPrepaymentsFilter] filter Optional parameter: Filter to use # for List Prepayments operations - # @return [ListSubscriptionGroupPrepaymentResponse] response from the API call. + # @return [ListSubscriptionGroupPrepaymentResponse] Response from the API call. def list_prepayments_for_subscription_group(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/subscription_groups/{uid}/prepayments.json', Server::PRODUCTION) @@ -85,11 +85,12 @@ def list_prepayments_for_subscription_group(options = {}) # are generated. # @param [String] uid Required parameter: The uid of the subscription # group - # @param [IssueServiceCreditRequest] body Optional parameter: Example: - # @return [ServiceCreditResponse] response from the API call. + # @param [IssueServiceCreditRequest] body Optional parameter: TODO: type + # description here + # @return [ServiceCreditResponse] Response from the API call. def issue_subscription_group_service_credit(uid, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscription_groups/{uid}/service_credits.json', Server::PRODUCTION) @@ -116,11 +117,12 @@ def issue_subscription_group_service_credit(uid, # the request body. # @param [String] uid Required parameter: The uid of the subscription # group - # @param [DeductServiceCreditRequest] body Optional parameter: Example: - # @return [ServiceCredit] response from the API call. + # @param [DeductServiceCreditRequest] body Optional parameter: TODO: type + # description here + # @return [ServiceCredit] Response from the API call. def deduct_subscription_group_service_credit(uid, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscription_groups/{uid}/service_credit_deductions.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/subscription_group_status_controller.rb b/lib/advanced_billing/controllers/subscription_group_status_controller.rb index da59638c..ecb277a1 100644 --- a/lib/advanced_billing/controllers/subscription_group_status_controller.rb +++ b/lib/advanced_billing/controllers/subscription_group_status_controller.rb @@ -16,12 +16,12 @@ class SubscriptionGroupStatusController < BaseController # `charge_unbilled_usage=true` parameter must be included in the request. # @param [String] uid Required parameter: The uid of the subscription # group - # @param [CancelGroupedSubscriptionsRequest] body Optional parameter: - # Example: - # @return [void] response from the API call. + # @param [CancelGroupedSubscriptionsRequest] body Optional parameter: TODO: + # type description here + # @return [void] Response from the API call. def cancel_subscriptions_in_group(uid, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscription_groups/{uid}/cancel.json', Server::PRODUCTION) @@ -48,9 +48,9 @@ def cancel_subscriptions_in_group(uid, # successfully cancel them, and the group must not be in a "past_due" state. # @param [String] uid Required parameter: The uid of the subscription # group - # @return [void] response from the API call. + # @return [void] Response from the API call. def initiate_delayed_cancellation_for_group(uid) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscription_groups/{uid}/delayed_cancel.json', Server::PRODUCTION) @@ -73,9 +73,9 @@ def initiate_delayed_cancellation_for_group(uid) # member in the group. # @param [String] uid Required parameter: The uid of the subscription # group - # @return [void] response from the API call. + # @return [void] Response from the API call. def cancel_delayed_cancellation_for_group(uid) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/subscription_groups/{uid}/delayed_cancel.json', Server::PRODUCTION) @@ -127,12 +127,12 @@ def cancel_delayed_cancellation_for_group(uid) # corresponding calendar renewal date. # @param [String] uid Required parameter: The uid of the subscription # group - # @param [ReactivateSubscriptionGroupRequest] body Optional parameter: - # Example: - # @return [ReactivateSubscriptionGroupResponse] response from the API call. + # @param [ReactivateSubscriptionGroupRequest] body Optional parameter: TODO: + # type description here + # @return [ReactivateSubscriptionGroupResponse] Response from the API call. def reactivate_subscription_group(uid, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscription_groups/{uid}/reactivate.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/subscription_groups_controller.rb b/lib/advanced_billing/controllers/subscription_groups_controller.rb index beb39366..c35fb31d 100644 --- a/lib/advanced_billing/controllers/subscription_groups_controller.rb +++ b/lib/advanced_billing/controllers/subscription_groups_controller.rb @@ -17,11 +17,11 @@ class SubscriptionGroupsController < BaseController # Only one of the `subscriptions` can have `"primary": true` attribute set. # When passing product to a subscription you can use either `product_id` or # `product_handle` or `offer_id`. You can also use `custom_price` instead. - # @param [SubscriptionGroupSignupRequest] body Optional parameter: - # Example: - # @return [SubscriptionGroupSignupResponse] response from the API call. + # @param [SubscriptionGroupSignupRequest] body Optional parameter: TODO: + # type description here + # @return [SubscriptionGroupSignupResponse] Response from the API call. def signup_with_subscription_group(body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscription_groups/signup.json', Server::PRODUCTION) @@ -41,11 +41,11 @@ def signup_with_subscription_group(body: nil) end # Creates a subscription group with given members. - # @param [CreateSubscriptionGroupRequest] body Optional parameter: - # Example: - # @return [SubscriptionGroupResponse] response from the API call. + # @param [CreateSubscriptionGroupRequest] body Optional parameter: TODO: + # type description here + # @return [SubscriptionGroupResponse] Response from the API call. def create_subscription_group(body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscription_groups.json', Server::PRODUCTION) @@ -85,9 +85,9 @@ def create_subscription_group(body: nil) # A list of additional information to include in the response. The following # values are supported: - `account_balances`: Account balance information # for the subscription groups. Use in query: `include[]=account_balances` - # @return [ListSubscriptionGroupsResponse] response from the API call. + # @return [ListSubscriptionGroupsResponse] Response from the API call. def list_subscription_groups(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/subscription_groups.json', Server::PRODUCTION) @@ -114,10 +114,10 @@ def list_subscription_groups(options = {}) # @param [Array[SubscriptionGroupInclude]] include Optional parameter: # Allows including additional data in the response. Use in query: # `include[]=current_billing_amount_in_cents`. - # @return [FullSubscriptionGroupResponse] response from the API call. + # @return [FullSubscriptionGroupResponse] Response from the API call. def read_subscription_group(uid, include: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/subscription_groups/{uid}.json', Server::PRODUCTION) @@ -141,12 +141,12 @@ def read_subscription_group(uid, # clean up members, just leave the array empty. # @param [String] uid Required parameter: The uid of the subscription # group - # @param [UpdateSubscriptionGroupRequest] body Optional parameter: - # Example: - # @return [SubscriptionGroupResponse] response from the API call. + # @param [UpdateSubscriptionGroupRequest] body Optional parameter: TODO: + # type description here + # @return [SubscriptionGroupResponse] Response from the API call. def update_subscription_group_members(uid, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/subscription_groups/{uid}.json', Server::PRODUCTION) @@ -172,9 +172,9 @@ def update_subscription_group_members(uid, # Only groups without members can be deleted # @param [String] uid Required parameter: The uid of the subscription # group - # @return [DeleteSubscriptionGroupResponse] response from the API call. + # @return [DeleteSubscriptionGroupResponse] Response from the API call. def delete_subscription_group(uid) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/subscription_groups/{uid}.json', Server::PRODUCTION) @@ -196,9 +196,9 @@ def delete_subscription_group(uid) # If the subscription is not in a group endpoint will return 404 code. # @param [String] subscription_id Required parameter: The Advanced Billing # id of the subscription associated with the subscription group - # @return [FullSubscriptionGroupResponse] response from the API call. + # @return [FullSubscriptionGroupResponse] Response from the API call. def find_subscription_group(subscription_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/subscription_groups/lookup.json', Server::PRODUCTION) @@ -247,11 +247,12 @@ def find_subscription_group(subscription_id) # subscription#subscription-in-a-subscription-group) # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @param [AddSubscriptionToAGroup] body Optional parameter: Example: - # @return [SubscriptionGroupResponse] response from the API call. + # @param [AddSubscriptionToAGroup] body Optional parameter: TODO: type + # description here + # @return [SubscriptionGroupResponse] Response from the API call. def add_subscription_to_group(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/group.json', Server::PRODUCTION) @@ -277,9 +278,9 @@ def add_subscription_to_group(subscription_id, # remove existing subscription from subscription group. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @return [void] response from the API call. + # @return [void] Response from the API call. def remove_subscription_from_group(subscription_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/subscriptions/{subscription_id}/group.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb b/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb index 509c937c..ff5e0ef7 100644 --- a/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +++ b/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb @@ -11,9 +11,9 @@ class SubscriptionInvoiceAccountController < BaseController # Subscription's open, payable invoices. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @return [AccountBalances] response from the API call. + # @return [AccountBalances] Response from the API call. def read_account_balances(subscription_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/subscriptions/{subscription_id}/account_balances.json', Server::PRODUCTION) @@ -38,11 +38,12 @@ def read_account_balances(subscription_id) # Please note that you **can't** pass `amount_in_cents`. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @param [CreatePrepaymentRequest] body Optional parameter: Example: - # @return [CreatePrepaymentResponse] response from the API call. + # @param [CreatePrepaymentRequest] body Optional parameter: TODO: type + # description here + # @return [CreatePrepaymentResponse] Response from the API call. def create_prepayment(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/prepayments.json', Server::PRODUCTION) @@ -80,9 +81,9 @@ def create_prepayment(subscription_id, # Use in query `per_page=200`. # @param [ListPrepaymentsFilter] filter Optional parameter: Filter to use # for List Prepayments operations - # @return [PrepaymentsResponse] response from the API call. + # @return [PrepaymentsResponse] Response from the API call. def list_prepayments(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/subscriptions/{subscription_id}/prepayments.json', Server::PRODUCTION) @@ -109,11 +110,12 @@ def list_prepayments(options = {}) # invoice. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @param [IssueServiceCreditRequest] body Optional parameter: Example: - # @return [ServiceCredit] response from the API call. + # @param [IssueServiceCreditRequest] body Optional parameter: TODO: type + # description here + # @return [ServiceCredit] Response from the API call. def issue_service_credit(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/service_credits.json', Server::PRODUCTION) @@ -140,11 +142,12 @@ def issue_service_credit(subscription_id, # less than the current credit balance. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @param [DeductServiceCreditRequest] body Optional parameter: Example: - # @return [void] response from the API call. + # @param [DeductServiceCreditRequest] body Optional parameter: TODO: type + # description here + # @return [void] Response from the API call. def deduct_service_credit(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/service_credit_deductions.json', Server::PRODUCTION) @@ -164,6 +167,52 @@ def deduct_service_credit(subscription_id, .execute end + # This request will list a subscription's service credits. + # @param [Integer] subscription_id Required parameter: The Chargify id of + # the subscription + # @param [Integer] page Optional parameter: Result records are organized in + # pages. By default, the first page of results is displayed. The page + # parameter specifies a page number of results to fetch. You can start + # navigating through the pages to consume the results. You do this by + # passing in a page parameter. Retrieve the next page by adding ?page=2 to + # the query string. If there are no results to return, then an empty result + # set will be returned. Use in query `page=1`. + # @param [Integer] per_page Optional parameter: This parameter indicates how + # many records to fetch in each request. Default value is 20. The maximum + # allowed values is 200; any per_page value over 200 will be changed to 200. + # Use in query `per_page=200`. + # @param [SortingDirection] direction Optional parameter: Controls the order + # in which results are returned. Use in query `direction=asc`. + # @return [ListServiceCreditsResponse] Response from the API call. + def list_service_credits(subscription_id, + page: 1, + per_page: 20, + direction: nil) + @api_call + .request(new_request_builder(HttpMethodEnum::GET, + '/subscriptions/{subscription_id}/service_credits/list.json', + Server::PRODUCTION) + .template_param(new_parameter(subscription_id, key: 'subscription_id') + .is_required(true) + .should_encode(true)) + .query_param(new_parameter(page, key: 'page')) + .query_param(new_parameter(per_page, key: 'per_page')) + .query_param(new_parameter(direction, key: 'direction')) + .header_param(new_parameter('application/json', key: 'accept')) + .auth(Single.new('BasicAuth'))) + .response(new_response_handler + .deserializer(APIHelper.method(:custom_type_deserializer)) + .deserialize_into(ListServiceCreditsResponse.method(:from_hash)) + .local_error_template('404', + 'Not Found:\'{$response.body}\'', + APIException) + .local_error_template('422', + 'HTTP Response Not OK. Status code: {$statusCode}.'\ + ' Response: \'{$response.body}\'.', + ErrorListResponseException)) + .execute + end + # This endpoint will refund, completely or partially, a particular # prepayment applied to a subscription. The `prepayment_id` will be the # account transaction ID of the original payment. The prepayment must have @@ -173,12 +222,13 @@ def deduct_service_credit(subscription_id, # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription # @param [Integer] prepayment_id Required parameter: id of prepayment - # @param [RefundPrepaymentRequest] body Optional parameter: Example: - # @return [PrepaymentResponse] response from the API call. + # @param [RefundPrepaymentRequest] body Optional parameter: TODO: type + # description here + # @return [PrepaymentResponse] Response from the API call. def refund_prepayment(subscription_id, prepayment_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/prepayments/{prepayment_id}/refunds.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/subscription_notes_controller.rb b/lib/advanced_billing/controllers/subscription_notes_controller.rb index eaab28a4..18ac7759 100644 --- a/lib/advanced_billing/controllers/subscription_notes_controller.rb +++ b/lib/advanced_billing/controllers/subscription_notes_controller.rb @@ -18,11 +18,12 @@ class SubscriptionNotesController < BaseController # tion-Summary-Overview). # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @param [UpdateSubscriptionNoteRequest] body Optional parameter: Example: - # @return [SubscriptionNoteResponse] response from the API call. + # @param [UpdateSubscriptionNoteRequest] body Optional parameter: TODO: type + # description here + # @return [SubscriptionNoteResponse] Response from the API call. def create_subscription_note(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/notes.json', Server::PRODUCTION) @@ -59,9 +60,9 @@ def create_subscription_note(subscription_id, # many records to fetch in each request. Default value is 20. The maximum # allowed values is 200; any per_page value over 200 will be changed to 200. # Use in query `per_page=200`. - # @return [Array[SubscriptionNoteResponse]] response from the API call. + # @return [Array[SubscriptionNoteResponse]] Response from the API call. def list_subscription_notes(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/subscriptions/{subscription_id}/notes.json', Server::PRODUCTION) @@ -89,10 +90,10 @@ def list_subscription_notes(options = {}) # the subscription # @param [Integer] note_id Required parameter: The Advanced Billing id of # the note - # @return [SubscriptionNoteResponse] response from the API call. + # @return [SubscriptionNoteResponse] Response from the API call. def read_subscription_note(subscription_id, note_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/subscriptions/{subscription_id}/notes/{note_id}.json', Server::PRODUCTION) @@ -115,12 +116,13 @@ def read_subscription_note(subscription_id, # the subscription # @param [Integer] note_id Required parameter: The Advanced Billing id of # the note - # @param [UpdateSubscriptionNoteRequest] body Optional parameter: Example: - # @return [SubscriptionNoteResponse] response from the API call. + # @param [UpdateSubscriptionNoteRequest] body Optional parameter: TODO: type + # description here + # @return [SubscriptionNoteResponse] Response from the API call. def update_subscription_note(subscription_id, note_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/subscriptions/{subscription_id}/notes/{note_id}.json', Server::PRODUCTION) @@ -150,10 +152,10 @@ def update_subscription_note(subscription_id, # the subscription # @param [Integer] note_id Required parameter: The Advanced Billing id of # the note - # @return [void] response from the API call. + # @return [void] Response from the API call. def delete_subscription_note(subscription_id, note_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/subscriptions/{subscription_id}/notes/{note_id}.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/subscription_products_controller.rb b/lib/advanced_billing/controllers/subscription_products_controller.rb index 4d2e2df8..36e29976 100644 --- a/lib/advanced_billing/controllers/subscription_products_controller.rb +++ b/lib/advanced_billing/controllers/subscription_products_controller.rb @@ -102,11 +102,11 @@ class SubscriptionProductsController < BaseController # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription # @param [SubscriptionProductMigrationRequest] body Optional parameter: - # Example: - # @return [SubscriptionResponse] response from the API call. + # TODO: type description here + # @return [SubscriptionResponse] Response from the API call. def migrate_subscription_product(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/migrations.json', Server::PRODUCTION) @@ -139,11 +139,11 @@ def migrate_subscription_product(subscription_id, # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription # @param [SubscriptionMigrationPreviewRequest] body Optional parameter: - # Example: - # @return [SubscriptionMigrationPreviewResponse] response from the API call. + # TODO: type description here + # @return [SubscriptionMigrationPreviewResponse] Response from the API call. def preview_subscription_product_migration(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/migrations/preview.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/subscription_status_controller.rb b/lib/advanced_billing/controllers/subscription_status_controller.rb index b449310e..b4d3b064 100644 --- a/lib/advanced_billing/controllers/subscription_status_controller.rb +++ b/lib/advanced_billing/controllers/subscription_status_controller.rb @@ -14,9 +14,9 @@ class SubscriptionStatusController < BaseController # The response will be `422 "Unprocessable Entity`. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @return [SubscriptionResponse] response from the API call. + # @return [SubscriptionResponse] Response from the API call. def retry_subscription(subscription_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/subscriptions/{subscription_id}/retry.json', Server::PRODUCTION) @@ -39,11 +39,12 @@ def retry_subscription(subscription_id) # the method sets the Subscription state to "canceled". # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @param [CancellationRequest] body Optional parameter: Example: - # @return [SubscriptionResponse] response from the API call. + # @param [CancellationRequest] body Optional parameter: TODO: type + # description here + # @return [SubscriptionResponse] Response from the API call. def cancel_subscription(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/subscriptions/{subscription_id}.json', Server::PRODUCTION) @@ -77,10 +78,10 @@ def cancel_subscription(subscription_id, # @param [ResumptionCharge] calendar_billing_resumption_charge Optional # parameter: (For calendar billing subscriptions only) The way that the # resumed subscription's charge should be handled - # @return [SubscriptionResponse] response from the API call. + # @return [SubscriptionResponse] Response from the API call. def resume_subscription(subscription_id, calendar_billing_resumption_charge: ResumptionCharge::PRORATED) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/resume.json', Server::PRODUCTION) @@ -107,11 +108,12 @@ def resume_subscription(subscription_id, # within 24 hours. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @param [PauseRequest] body Optional parameter: Example: - # @return [SubscriptionResponse] response from the API call. + # @param [PauseRequest] body Optional parameter: TODO: type description + # here + # @return [SubscriptionResponse] Response from the API call. def pause_subscription(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/hold.json', Server::PRODUCTION) @@ -142,11 +144,12 @@ def pause_subscription(subscription_id, # would like the subscription to not have a resume date. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @param [PauseRequest] body Optional parameter: Example: - # @return [SubscriptionResponse] response from the API call. + # @param [PauseRequest] body Optional parameter: TODO: type description + # here + # @return [SubscriptionResponse] Response from the API call. def update_automatic_subscription_resumption(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/subscriptions/{subscription_id}/hold.json', Server::PRODUCTION) @@ -308,11 +311,12 @@ def update_automatic_subscription_resumption(subscription_id, # + Any product-related charges should have been collected # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @param [ReactivateSubscriptionRequest] body Optional parameter: Example: - # @return [SubscriptionResponse] response from the API call. + # @param [ReactivateSubscriptionRequest] body Optional parameter: TODO: type + # description here + # @return [SubscriptionResponse] Response from the API call. def reactivate_subscription(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/subscriptions/{subscription_id}/reactivate.json', Server::PRODUCTION) @@ -342,11 +346,12 @@ def reactivate_subscription(subscription_id, # creation, or if the subscription is past due. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @param [CancellationRequest] body Optional parameter: Example: - # @return [DelayedCancellationResponse] response from the API call. + # @param [CancellationRequest] body Optional parameter: TODO: type + # description here + # @return [DelayedCancellationResponse] Response from the API call. def initiate_delayed_cancellation(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/delayed_cancel.json', Server::PRODUCTION) @@ -379,9 +384,9 @@ def initiate_delayed_cancellation(subscription_id, # will be successful. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @return [DelayedCancellationResponse] response from the API call. + # @return [DelayedCancellationResponse] Response from the API call. def cancel_delayed_cancellation(subscription_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/subscriptions/{subscription_id}/delayed_cancel.json', Server::PRODUCTION) @@ -403,9 +408,9 @@ def cancel_delayed_cancellation(subscription_id) # active and the active Dunner will be resolved. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @return [SubscriptionResponse] response from the API call. + # @return [SubscriptionResponse] Response from the API call. def cancel_dunning(subscription_id) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/cancel_dunning.json', Server::PRODUCTION) @@ -458,11 +463,12 @@ def cancel_dunning(subscription_id) # changes against a subscription. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @param [RenewalPreviewRequest] body Optional parameter: Example: - # @return [RenewalPreviewResponse] response from the API call. + # @param [RenewalPreviewRequest] body Optional parameter: TODO: type + # description here + # @return [RenewalPreviewResponse] Response from the API call. def preview_renewal(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/renewals/preview.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/subscriptions_controller.rb b/lib/advanced_billing/controllers/subscriptions_controller.rb index d10c2249..c2eb3ada 100644 --- a/lib/advanced_billing/controllers/subscriptions_controller.rb +++ b/lib/advanced_billing/controllers/subscriptions_controller.rb @@ -187,40 +187,6 @@ class SubscriptionsController < BaseController # } # } # ``` - # ## Subscription with Credit Card - # ```json - # "subscription": { - # "product_handle": "basic", - # "customer_attributes": { - # "first_name": "Joe", - # "last_name": "Blow", - # "email": "joe@example.com", - # "zip": "02120", - # "state": "MA", - # "reference": "XYZ", - # "phone": "(617) 111 - 0000", - # "organization": "Acme", - # "country": "US", - # "city": "Boston", - # "address_2": null, - # "address": "123 Mass Ave." - # }, - # "credit_card_attributes": { - # "last_name": "Smith", - # "first_name": "Joe", - # "full_number": "4111111111111111", - # "expiration_year": "2021", - # "expiration_month": "1", - # "card_type": "visa", - # "billing_zip": "02120", - # "billing_state": "MA", - # "billing_country": "US", - # "billing_city": "Boston", - # "billing_address_2": null, - # "billing_address": "123 Mass Ave." - # } - # } - # ``` # ## Subscription with ACH as Payment Profile # ```json # { @@ -804,10 +770,11 @@ class SubscriptionsController < BaseController # } # } # ``` - # @param [CreateSubscriptionRequest] body Optional parameter: Example: - # @return [SubscriptionResponse] response from the API call. + # @param [CreateSubscriptionRequest] body Optional parameter: TODO: type + # description here + # @return [SubscriptionResponse] Response from the API call. def create_subscription(body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions.json', Server::PRODUCTION) @@ -856,6 +823,8 @@ def create_subscription(body: nil) # @param [Integer] coupon Optional parameter: The numeric id of the coupon # currently applied to the subscription. (This can be found in the URL when # editing a coupon. Note that the coupon code cannot be used.) + # @param [String] coupon_code Optional parameter: The coupon code currently + # applied to the subscription # @param [SubscriptionDateField] date_field Optional parameter: The type of # filter you'd like to apply to your search. Allowed Values: , # current_period_ends_at, current_period_starts_at, created_at, @@ -891,9 +860,9 @@ def create_subscription(body: nil) # @param [Array[SubscriptionListInclude]] include Optional parameter: Allows # including additional data in the response. Use in query: # `include[]=self_service_page_token`. - # @return [Array[SubscriptionResponse]] response from the API call. + # @return [Array[SubscriptionResponse]] Response from the API call. def list_subscriptions(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/subscriptions.json', Server::PRODUCTION) @@ -903,6 +872,7 @@ def list_subscriptions(options = {}) .query_param(new_parameter(options['product'], key: 'product')) .query_param(new_parameter(options['product_price_point_id'], key: 'product_price_point_id')) .query_param(new_parameter(options['coupon'], key: 'coupon')) + .query_param(new_parameter(options['coupon_code'], key: 'coupon_code')) .query_param(new_parameter(options['date_field'], key: 'date_field')) .query_param(new_parameter(options['start_date'], key: 'start_date')) .query_param(new_parameter(options['end_date'], key: 'end_date')) @@ -986,11 +956,12 @@ def list_subscriptions(options = {}) # `null`. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @param [UpdateSubscriptionRequest] body Optional parameter: Example: - # @return [SubscriptionResponse] response from the API call. + # @param [UpdateSubscriptionRequest] body Optional parameter: TODO: type + # description here + # @return [SubscriptionResponse] Response from the API call. def update_subscription(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/subscriptions/{subscription_id}.json', Server::PRODUCTION) @@ -1022,10 +993,10 @@ def update_subscription(subscription_id, # @param [Array[SubscriptionInclude]] include Optional parameter: Allows # including additional data in the response. Use in query: # `include[]=coupons&include[]=self_service_page_token`. - # @return [SubscriptionResponse] response from the API call. + # @return [SubscriptionResponse] Response from the API call. def read_subscription(subscription_id, include: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/subscriptions/{subscription_id}.json', Server::PRODUCTION) @@ -1078,10 +1049,10 @@ def read_subscription(subscription_id, # the subscription # @param [OverrideSubscriptionRequest] body Optional parameter: Only these # fields are available to be set. - # @return [void] response from the API call. + # @return [void] Response from the API call. def override_subscription(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/subscriptions/{subscription_id}/override.json', Server::PRODUCTION) @@ -1103,9 +1074,9 @@ def override_subscription(subscription_id, # Use this endpoint to find a subscription by its reference. # @param [String] reference Optional parameter: Subscription reference - # @return [SubscriptionResponse] response from the API call. + # @return [SubscriptionResponse] Response from the API call. def find_subscription(reference: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/subscriptions/lookup.json', Server::PRODUCTION) @@ -1138,11 +1109,11 @@ def find_subscription(reference: nil) # @param [Array[SubscriptionPurgeType]] cascade Optional parameter: Options # are "customer" or "payment_profile". Use in query: # `cascade[]=customer&cascade[]=payment_profile`. - # @return [SubscriptionResponse] response from the API call. + # @return [SubscriptionResponse] Response from the API call. def purge_subscription(subscription_id, ack, cascade: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/purge.json', Server::PRODUCTION) @@ -1168,12 +1139,12 @@ def purge_subscription(subscription_id, # Use this endpoint to update a subscription's prepaid configuration. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @param [UpsertPrepaidConfigurationRequest] body Optional parameter: - # Example: - # @return [PrepaidConfigurationResponse] response from the API call. + # @param [UpsertPrepaidConfigurationRequest] body Optional parameter: TODO: + # type description here + # @return [PrepaidConfigurationResponse] Response from the API call. def update_prepaid_subscription_configuration(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/prepaid_configurations.json', Server::PRODUCTION) @@ -1198,12 +1169,12 @@ def update_prepaid_subscription_configuration(subscription_id, # The Chargify API allows you to preview a subscription by POSTing the same # JSON or XML as for a subscription creation. # The "Next Billing" amount and "Next Billing" date are represented in each - # Subscriber's Summary. For more information, please see our documentation + # Subscriber's Summary. + # A subscription will not be created by utilizing this endpoint; it is meant + # to serve as a prediction. + # For more information, please see our documentation # [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscrib # er-Interface-Overview). - # ## Side effects - # A subscription will not be created by sending a POST to this endpoint. It - # is meant to serve as a prediction. # ## Taxable Subscriptions # This endpoint will preview taxes applicable to a purchase. In order for # taxes to be previewed, the following conditions must be met: @@ -1230,10 +1201,11 @@ def update_prepaid_subscription_configuration(subscription_id, # ## Non-taxable Subscriptions # If you'd like to calculate subscriptions that do not include tax, please # feel free to leave off the billing information. - # @param [CreateSubscriptionRequest] body Optional parameter: Example: - # @return [SubscriptionPreviewResponse] response from the API call. + # @param [CreateSubscriptionRequest] body Optional parameter: TODO: type + # description here + # @return [SubscriptionPreviewResponse] Response from the API call. def preview_subscription(body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/preview.json', Server::PRODUCTION) @@ -1265,12 +1237,13 @@ def preview_subscription(body: nil) # the subscription # @param [String] code Optional parameter: A code for the coupon that would # be applied to a subscription - # @param [AddCouponsRequest] body Optional parameter: Example: - # @return [SubscriptionResponse] response from the API call. + # @param [AddCouponsRequest] body Optional parameter: TODO: type description + # here + # @return [SubscriptionResponse] Response from the API call. def apply_coupons_to_subscription(subscription_id, code: nil, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/subscriptions/{subscription_id}/add_coupon.json', Server::PRODUCTION) @@ -1301,10 +1274,10 @@ def apply_coupons_to_subscription(subscription_id, # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription # @param [String] coupon_code Optional parameter: The coupon code - # @return [String] response from the API call. + # @return [String] Response from the API call. def remove_coupon_from_subscription(subscription_id, coupon_code: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::DELETE, '/subscriptions/{subscription_id}/remove_coupon.json', Server::PRODUCTION) @@ -1377,11 +1350,12 @@ def remove_coupon_from_subscription(subscription_id, # invoice back to the subscription. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription - # @param [ActivateSubscriptionRequest] body Optional parameter: Example: - # @return [SubscriptionResponse] response from the API call. + # @param [ActivateSubscriptionRequest] body Optional parameter: TODO: type + # description here + # @return [SubscriptionResponse] Response from the API call. def activate_subscription(subscription_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/subscriptions/{subscription_id}/activate.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/controllers/webhooks_controller.rb b/lib/advanced_billing/controllers/webhooks_controller.rb index def1fb23..18c6eda1 100644 --- a/lib/advanced_billing/controllers/webhooks_controller.rb +++ b/lib/advanced_billing/controllers/webhooks_controller.rb @@ -53,9 +53,9 @@ class WebhooksController < BaseController # Webhooks are returned. # @param [Integer] subscription Optional parameter: The Advanced Billing id # of a subscription you'd like to filter for - # @return [Array[WebhookResponse]] response from the API call. + # @return [Array[WebhookResponse]] Response from the API call. def list_webhooks(options = {}) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/webhooks.json', Server::PRODUCTION) @@ -76,10 +76,11 @@ def list_webhooks(options = {}) end # This method allows you to enable webhooks via API for your site - # @param [EnableWebhooksRequest] body Optional parameter: Example: - # @return [EnableWebhooksResponse] response from the API call. + # @param [EnableWebhooksRequest] body Optional parameter: TODO: type + # description here + # @return [EnableWebhooksResponse] Response from the API call. def enable_webhooks(body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/webhooks/settings.json', Server::PRODUCTION) @@ -99,10 +100,11 @@ def enable_webhooks(body: nil) # on available system resources. # You may submit an array of up to 1000 webhook IDs to replay in the # request. - # @param [ReplayWebhooksRequest] body Optional parameter: Example: - # @return [ReplayWebhooksResponse] response from the API call. + # @param [ReplayWebhooksRequest] body Optional parameter: TODO: type + # description here + # @return [ReplayWebhooksResponse] Response from the API call. def replay_webhooks(body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/webhooks/replay.json', Server::PRODUCTION) @@ -123,10 +125,11 @@ def replay_webhooks(body: nil) # [Event # keys](https://maxio.zendesk.com/hc/en-us/articles/24266136649869-Webhooks- # Reference#events) - # @param [CreateOrUpdateEndpointRequest] body Optional parameter: Example: - # @return [EndpointResponse] response from the API call. + # @param [CreateOrUpdateEndpointRequest] body Optional parameter: TODO: type + # description here + # @return [EndpointResponse] Response from the API call. def create_endpoint(body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::POST, '/endpoints.json', Server::PRODUCTION) @@ -146,9 +149,9 @@ def create_endpoint(body: nil) end # This method returns created endpoints for site. - # @return [Array[Endpoint]] response from the API call. + # @return [Array[Endpoint]] Response from the API call. def list_endpoints - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::GET, '/endpoints.json', Server::PRODUCTION) @@ -175,11 +178,12 @@ def list_endpoints # `webhook_subscriptions` without the specific event key. # @param [Integer] endpoint_id Required parameter: The Advanced Billing id # for the endpoint that should be updated - # @param [CreateOrUpdateEndpointRequest] body Optional parameter: Example: - # @return [EndpointResponse] response from the API call. + # @param [CreateOrUpdateEndpointRequest] body Optional parameter: TODO: type + # description here + # @return [EndpointResponse] Response from the API call. def update_endpoint(endpoint_id, body: nil) - new_api_call_builder + @api_call .request(new_request_builder(HttpMethodEnum::PUT, '/endpoints/{endpoint_id}.json', Server::PRODUCTION) diff --git a/lib/advanced_billing/exceptions/component_allocation_error_exception.rb b/lib/advanced_billing/exceptions/component_allocation_error_exception.rb index 7364e517..2cba0dc1 100644 --- a/lib/advanced_billing/exceptions/component_allocation_error_exception.rb +++ b/lib/advanced_billing/exceptions/component_allocation_error_exception.rb @@ -14,8 +14,8 @@ class ComponentAllocationErrorException < APIException attr_accessor :errors # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) @@ -23,9 +23,11 @@ def initialize(reason, response) end # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the + # @param [Hash] hash The deserialized response sent by the server in the # response body. def unbox(hash) + return nil unless hash + # Parameter is an array, so we need to iterate through it @errors = nil unless hash['errors'].nil? diff --git a/lib/advanced_billing/exceptions/component_price_point_error_exception.rb b/lib/advanced_billing/exceptions/component_price_point_error_exception.rb index e41f5ad7..e3b63824 100644 --- a/lib/advanced_billing/exceptions/component_price_point_error_exception.rb +++ b/lib/advanced_billing/exceptions/component_price_point_error_exception.rb @@ -14,8 +14,8 @@ class ComponentPricePointErrorException < APIException attr_accessor :errors # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) @@ -23,9 +23,11 @@ def initialize(reason, response) end # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the + # @param [Hash] hash The deserialized response sent by the server in the # response body. def unbox(hash) + return nil unless hash + # Parameter is an array, so we need to iterate through it @errors = nil unless hash['errors'].nil? diff --git a/lib/advanced_billing/exceptions/customer_error_response_exception.rb b/lib/advanced_billing/exceptions/customer_error_response_exception.rb index 9e34c77b..5ab3832e 100644 --- a/lib/advanced_billing/exceptions/customer_error_response_exception.rb +++ b/lib/advanced_billing/exceptions/customer_error_response_exception.rb @@ -14,8 +14,8 @@ class CustomerErrorResponseException < APIException attr_accessor :errors # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) @@ -23,9 +23,11 @@ def initialize(reason, response) end # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the + # @param [Hash] hash The deserialized response sent by the server in the # response body. def unbox(hash) + return nil unless hash + @errors = hash.key?('errors') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:CustomerErrorResponseErrors), hash['errors'] ) : SKIP diff --git a/lib/advanced_billing/exceptions/error_array_map_response_exception.rb b/lib/advanced_billing/exceptions/error_array_map_response_exception.rb index 84c575af..2d080b20 100644 --- a/lib/advanced_billing/exceptions/error_array_map_response_exception.rb +++ b/lib/advanced_billing/exceptions/error_array_map_response_exception.rb @@ -14,8 +14,8 @@ class ErrorArrayMapResponseException < APIException attr_accessor :errors # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) @@ -23,9 +23,11 @@ def initialize(reason, response) end # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the + # @param [Hash] hash The deserialized response sent by the server in the # response body. def unbox(hash) + return nil unless hash + @errors = hash.key?('errors') ? hash['errors'] : SKIP end diff --git a/lib/advanced_billing/exceptions/error_list_response_exception.rb b/lib/advanced_billing/exceptions/error_list_response_exception.rb index 83525bb3..48433cd0 100644 --- a/lib/advanced_billing/exceptions/error_list_response_exception.rb +++ b/lib/advanced_billing/exceptions/error_list_response_exception.rb @@ -14,8 +14,8 @@ class ErrorListResponseException < APIException attr_accessor :errors # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) @@ -23,9 +23,11 @@ def initialize(reason, response) end # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the + # @param [Hash] hash The deserialized response sent by the server in the # response body. def unbox(hash) + return nil unless hash + @errors = hash.key?('errors') ? hash['errors'] : nil end diff --git a/lib/advanced_billing/exceptions/error_string_map_response_exception.rb b/lib/advanced_billing/exceptions/error_string_map_response_exception.rb index d2e843f1..be3293e8 100644 --- a/lib/advanced_billing/exceptions/error_string_map_response_exception.rb +++ b/lib/advanced_billing/exceptions/error_string_map_response_exception.rb @@ -14,8 +14,8 @@ class ErrorStringMapResponseException < APIException attr_accessor :errors # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) @@ -23,9 +23,11 @@ def initialize(reason, response) end # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the + # @param [Hash] hash The deserialized response sent by the server in the # response body. def unbox(hash) + return nil unless hash + @errors = hash.key?('errors') ? hash['errors'] : SKIP end diff --git a/lib/advanced_billing/exceptions/event_based_billing_list_segments_errors_exception.rb b/lib/advanced_billing/exceptions/event_based_billing_list_segments_errors_exception.rb index 79bdda66..42a96463 100644 --- a/lib/advanced_billing/exceptions/event_based_billing_list_segments_errors_exception.rb +++ b/lib/advanced_billing/exceptions/event_based_billing_list_segments_errors_exception.rb @@ -14,8 +14,8 @@ class EventBasedBillingListSegmentsErrorsException < APIException attr_accessor :errors # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) @@ -23,9 +23,11 @@ def initialize(reason, response) end # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the + # @param [Hash] hash The deserialized response sent by the server in the # response body. def unbox(hash) + return nil unless hash + @errors = Errors.from_hash(hash['errors']) if hash['errors'] end diff --git a/lib/advanced_billing/exceptions/event_based_billing_segment_errors_exception.rb b/lib/advanced_billing/exceptions/event_based_billing_segment_errors_exception.rb index 613cd2e8..d451d22d 100644 --- a/lib/advanced_billing/exceptions/event_based_billing_segment_errors_exception.rb +++ b/lib/advanced_billing/exceptions/event_based_billing_segment_errors_exception.rb @@ -17,8 +17,8 @@ class EventBasedBillingSegmentErrorsException < APIException attr_accessor :errors # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) @@ -26,9 +26,11 @@ def initialize(reason, response) end # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the + # @param [Hash] hash The deserialized response sent by the server in the # response body. def unbox(hash) + return nil unless hash + @errors = hash.key?('errors') ? hash['errors'] : SKIP end diff --git a/lib/advanced_billing/exceptions/event_based_billing_segment_exception.rb b/lib/advanced_billing/exceptions/event_based_billing_segment_exception.rb index ce10a5cb..5c9833c9 100644 --- a/lib/advanced_billing/exceptions/event_based_billing_segment_exception.rb +++ b/lib/advanced_billing/exceptions/event_based_billing_segment_exception.rb @@ -14,8 +14,8 @@ class EventBasedBillingSegmentException < APIException attr_accessor :errors # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) @@ -23,9 +23,11 @@ def initialize(reason, response) end # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the + # @param [Hash] hash The deserialized response sent by the server in the # response body. def unbox(hash) + return nil unless hash + @errors = EventBasedBillingSegmentError.from_hash(hash['errors']) if hash['errors'] end diff --git a/lib/advanced_billing/exceptions/product_price_point_error_response_exception.rb b/lib/advanced_billing/exceptions/product_price_point_error_response_exception.rb index a2c072dc..8317becc 100644 --- a/lib/advanced_billing/exceptions/product_price_point_error_response_exception.rb +++ b/lib/advanced_billing/exceptions/product_price_point_error_response_exception.rb @@ -14,8 +14,8 @@ class ProductPricePointErrorResponseException < APIException attr_accessor :errors # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) @@ -23,9 +23,11 @@ def initialize(reason, response) end # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the + # @param [Hash] hash The deserialized response sent by the server in the # response body. def unbox(hash) + return nil unless hash + @errors = ProductPricePointErrors.from_hash(hash['errors']) if hash['errors'] end diff --git a/lib/advanced_billing/exceptions/proforma_bad_request_error_response_exception.rb b/lib/advanced_billing/exceptions/proforma_bad_request_error_response_exception.rb index 8fe2a013..fac0c558 100644 --- a/lib/advanced_billing/exceptions/proforma_bad_request_error_response_exception.rb +++ b/lib/advanced_billing/exceptions/proforma_bad_request_error_response_exception.rb @@ -14,8 +14,8 @@ class ProformaBadRequestErrorResponseException < APIException attr_accessor :errors # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) @@ -23,9 +23,11 @@ def initialize(reason, response) end # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the + # @param [Hash] hash The deserialized response sent by the server in the # response body. def unbox(hash) + return nil unless hash + @errors = ProformaError.from_hash(hash['errors']) if hash['errors'] end diff --git a/lib/advanced_billing/exceptions/refund_prepayment_base_errors_response_exception.rb b/lib/advanced_billing/exceptions/refund_prepayment_base_errors_response_exception.rb index a8e984e5..0f019bc4 100644 --- a/lib/advanced_billing/exceptions/refund_prepayment_base_errors_response_exception.rb +++ b/lib/advanced_billing/exceptions/refund_prepayment_base_errors_response_exception.rb @@ -14,8 +14,8 @@ class RefundPrepaymentBaseErrorsResponseException < APIException attr_accessor :errors # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) @@ -23,9 +23,11 @@ def initialize(reason, response) end # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the + # @param [Hash] hash The deserialized response sent by the server in the # response body. def unbox(hash) + return nil unless hash + @errors = RefundPrepaymentBaseRefundError.from_hash(hash['errors']) if hash['errors'] end diff --git a/lib/advanced_billing/exceptions/single_error_response_exception.rb b/lib/advanced_billing/exceptions/single_error_response_exception.rb index 045a2962..21ab1372 100644 --- a/lib/advanced_billing/exceptions/single_error_response_exception.rb +++ b/lib/advanced_billing/exceptions/single_error_response_exception.rb @@ -14,8 +14,8 @@ class SingleErrorResponseException < APIException attr_accessor :error # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) @@ -23,9 +23,11 @@ def initialize(reason, response) end # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the + # @param [Hash] hash The deserialized response sent by the server in the # response body. def unbox(hash) + return nil unless hash + @error = hash.key?('error') ? hash['error'] : nil end diff --git a/lib/advanced_billing/exceptions/single_string_error_response_exception.rb b/lib/advanced_billing/exceptions/single_string_error_response_exception.rb index f4ab3271..ce78e200 100644 --- a/lib/advanced_billing/exceptions/single_string_error_response_exception.rb +++ b/lib/advanced_billing/exceptions/single_string_error_response_exception.rb @@ -14,8 +14,8 @@ class SingleStringErrorResponseException < APIException attr_accessor :errors # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) @@ -23,9 +23,11 @@ def initialize(reason, response) end # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the + # @param [Hash] hash The deserialized response sent by the server in the # response body. def unbox(hash) + return nil unless hash + @errors = hash.key?('errors') ? hash['errors'] : SKIP end diff --git a/lib/advanced_billing/exceptions/subscription_add_coupon_error_exception.rb b/lib/advanced_billing/exceptions/subscription_add_coupon_error_exception.rb index a04a95ea..947820f6 100644 --- a/lib/advanced_billing/exceptions/subscription_add_coupon_error_exception.rb +++ b/lib/advanced_billing/exceptions/subscription_add_coupon_error_exception.rb @@ -26,8 +26,8 @@ class SubscriptionAddCouponErrorException < APIException attr_accessor :subscription # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) @@ -35,9 +35,11 @@ def initialize(reason, response) end # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the + # @param [Hash] hash The deserialized response sent by the server in the # response body. def unbox(hash) + return nil unless hash + @codes = hash.key?('codes') ? hash['codes'] : SKIP @coupon_code = hash.key?('coupon_code') ? hash['coupon_code'] : SKIP @coupon_codes = hash.key?('coupon_codes') ? hash['coupon_codes'] : SKIP diff --git a/lib/advanced_billing/exceptions/subscription_component_allocation_error_exception.rb b/lib/advanced_billing/exceptions/subscription_component_allocation_error_exception.rb index 4c96bf4f..dd4c6871 100644 --- a/lib/advanced_billing/exceptions/subscription_component_allocation_error_exception.rb +++ b/lib/advanced_billing/exceptions/subscription_component_allocation_error_exception.rb @@ -14,8 +14,8 @@ class SubscriptionComponentAllocationErrorException < APIException attr_accessor :errors # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) @@ -23,9 +23,11 @@ def initialize(reason, response) end # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the + # @param [Hash] hash The deserialized response sent by the server in the # response body. def unbox(hash) + return nil unless hash + # Parameter is an array, so we need to iterate through it @errors = nil unless hash['errors'].nil? diff --git a/lib/advanced_billing/exceptions/subscription_group_create_error_response_exception.rb b/lib/advanced_billing/exceptions/subscription_group_create_error_response_exception.rb index f7772a4c..cf636781 100644 --- a/lib/advanced_billing/exceptions/subscription_group_create_error_response_exception.rb +++ b/lib/advanced_billing/exceptions/subscription_group_create_error_response_exception.rb @@ -14,8 +14,8 @@ class SubscriptionGroupCreateErrorResponseException < APIException attr_accessor :errors # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) @@ -23,9 +23,11 @@ def initialize(reason, response) end # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the + # @param [Hash] hash The deserialized response sent by the server in the # response body. def unbox(hash) + return nil unless hash + @errors = hash.key?('errors') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:SubscriptionGroupCreateErrorResponseErrors), hash['errors'] ) : nil diff --git a/lib/advanced_billing/exceptions/subscription_group_signup_error_response_exception.rb b/lib/advanced_billing/exceptions/subscription_group_signup_error_response_exception.rb index a8beeaa9..aaf18810 100644 --- a/lib/advanced_billing/exceptions/subscription_group_signup_error_response_exception.rb +++ b/lib/advanced_billing/exceptions/subscription_group_signup_error_response_exception.rb @@ -14,8 +14,8 @@ class SubscriptionGroupSignupErrorResponseException < APIException attr_accessor :errors # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) @@ -23,9 +23,11 @@ def initialize(reason, response) end # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the + # @param [Hash] hash The deserialized response sent by the server in the # response body. def unbox(hash) + return nil unless hash + @errors = SubscriptionGroupSignupError.from_hash(hash['errors']) if hash['errors'] end diff --git a/lib/advanced_billing/exceptions/subscription_group_update_error_response_exception.rb b/lib/advanced_billing/exceptions/subscription_group_update_error_response_exception.rb index cf8ba7f6..3acb60ea 100644 --- a/lib/advanced_billing/exceptions/subscription_group_update_error_response_exception.rb +++ b/lib/advanced_billing/exceptions/subscription_group_update_error_response_exception.rb @@ -14,8 +14,8 @@ class SubscriptionGroupUpdateErrorResponseException < APIException attr_accessor :errors # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) @@ -23,9 +23,11 @@ def initialize(reason, response) end # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the + # @param [Hash] hash The deserialized response sent by the server in the # response body. def unbox(hash) + return nil unless hash + @errors = SubscriptionGroupUpdateError.from_hash(hash['errors']) if hash['errors'] end diff --git a/lib/advanced_billing/exceptions/subscription_remove_coupon_errors_exception.rb b/lib/advanced_billing/exceptions/subscription_remove_coupon_errors_exception.rb index aa3faf74..b08a61dc 100644 --- a/lib/advanced_billing/exceptions/subscription_remove_coupon_errors_exception.rb +++ b/lib/advanced_billing/exceptions/subscription_remove_coupon_errors_exception.rb @@ -14,8 +14,8 @@ class SubscriptionRemoveCouponErrorsException < APIException attr_accessor :subscription # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) @@ -23,9 +23,11 @@ def initialize(reason, response) end # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the + # @param [Hash] hash The deserialized response sent by the server in the # response body. def unbox(hash) + return nil unless hash + @subscription = hash.key?('subscription') ? hash['subscription'] : nil end diff --git a/lib/advanced_billing/exceptions/subscription_response_error_exception.rb b/lib/advanced_billing/exceptions/subscription_response_error_exception.rb index 85176332..24f4c48f 100644 --- a/lib/advanced_billing/exceptions/subscription_response_error_exception.rb +++ b/lib/advanced_billing/exceptions/subscription_response_error_exception.rb @@ -14,8 +14,8 @@ class SubscriptionResponseErrorException < APIException attr_accessor :subscription # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) @@ -23,9 +23,11 @@ def initialize(reason, response) end # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the + # @param [Hash] hash The deserialized response sent by the server in the # response body. def unbox(hash) + return nil unless hash + @subscription = Subscription.from_hash(hash['subscription']) if hash['subscription'] end diff --git a/lib/advanced_billing/exceptions/subscriptions_mrr_error_response_exception.rb b/lib/advanced_billing/exceptions/subscriptions_mrr_error_response_exception.rb index b65126ed..ab206ec7 100644 --- a/lib/advanced_billing/exceptions/subscriptions_mrr_error_response_exception.rb +++ b/lib/advanced_billing/exceptions/subscriptions_mrr_error_response_exception.rb @@ -14,8 +14,8 @@ class SubscriptionsMrrErrorResponseException < APIException attr_accessor :errors # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) @@ -23,9 +23,11 @@ def initialize(reason, response) end # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the + # @param [Hash] hash The deserialized response sent by the server in the # response body. def unbox(hash) + return nil unless hash + @errors = AttributeError.from_hash(hash['errors']) if hash['errors'] end diff --git a/lib/advanced_billing/exceptions/too_many_management_link_requests_error_exception.rb b/lib/advanced_billing/exceptions/too_many_management_link_requests_error_exception.rb index 5e35ac1a..efbb61e3 100644 --- a/lib/advanced_billing/exceptions/too_many_management_link_requests_error_exception.rb +++ b/lib/advanced_billing/exceptions/too_many_management_link_requests_error_exception.rb @@ -14,8 +14,8 @@ class TooManyManagementLinkRequestsErrorException < APIException attr_accessor :errors # The constructor. - # @param [String] The reason for raising an exception. - # @param [HttpResponse] The HttpReponse of the API call. + # @param [String] reason The reason for raising an exception. + # @param [HttpResponse] response The HttpReponse of the API call. def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) @@ -23,9 +23,11 @@ def initialize(reason, response) end # Populates this object by extracting properties from a hash. - # @param [Hash] The deserialized response sent by the server in the + # @param [Hash] hash The deserialized response sent by the server in the # response body. def unbox(hash) + return nil unless hash + @errors = TooManyManagementLinkRequests.from_hash(hash['errors']) if hash['errors'] end diff --git a/lib/advanced_billing/models/apple_pay_payment_profile.rb b/lib/advanced_billing/models/apple_pay_payment_profile.rb index a588a631..c087f2cf 100644 --- a/lib/advanced_billing/models/apple_pay_payment_profile.rb +++ b/lib/advanced_billing/models/apple_pay_payment_profile.rb @@ -3,6 +3,7 @@ # This file was automatically generated by APIMATIC v2.0 # ( https://apimatic.io ). +require 'date' module AdvancedBilling # ApplePayPaymentProfile Model. class ApplePayPaymentProfile < BaseModel @@ -75,6 +76,14 @@ class ApplePayPaymentProfile < BaseModel # @return [String] attr_accessor :gateway_handle + # A timestamp indicating when this payment profile was created + # @return [DateTime] + attr_accessor :created_at + + # A timestamp indicating when this payment profile was last updated + # @return [DateTime] + attr_accessor :updated_at + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -94,6 +103,8 @@ def self.names @_hash['payment_type'] = 'payment_type' @_hash['site_gateway_setting_id'] = 'site_gateway_setting_id' @_hash['gateway_handle'] = 'gateway_handle' + @_hash['created_at'] = 'created_at' + @_hash['updated_at'] = 'updated_at' @_hash end @@ -115,6 +126,8 @@ def self.optionals billing_address_2 site_gateway_setting_id gateway_handle + created_at + updated_at ] end @@ -140,7 +153,8 @@ def initialize(payment_type: PaymentType::APPLE_PAY, id: SKIP, billing_state: SKIP, billing_zip: SKIP, billing_country: SKIP, customer_vault_token: SKIP, billing_address_2: SKIP, site_gateway_setting_id: SKIP, - gateway_handle: SKIP, additional_properties: {}) + gateway_handle: SKIP, created_at: SKIP, updated_at: SKIP, + additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -162,6 +176,8 @@ def initialize(payment_type: PaymentType::APPLE_PAY, id: SKIP, @payment_type = payment_type @site_gateway_setting_id = site_gateway_setting_id unless site_gateway_setting_id == SKIP @gateway_handle = gateway_handle unless gateway_handle == SKIP + @created_at = created_at unless created_at == SKIP + @updated_at = updated_at unless updated_at == SKIP end # Creates an instance of the object from a hash. @@ -191,6 +207,16 @@ def self.from_hash(hash) hash.key?('site_gateway_setting_id') ? hash['site_gateway_setting_id'] : SKIP gateway_handle = hash.key?('gateway_handle') ? hash['gateway_handle'] : SKIP + created_at = if hash.key?('created_at') + (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at']) + else + SKIP + end + updated_at = if hash.key?('updated_at') + (DateTimeHelper.from_rfc3339(hash['updated_at']) if hash['updated_at']) + else + SKIP + end # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -212,9 +238,19 @@ def self.from_hash(hash) billing_address_2: billing_address_2, site_gateway_setting_id: site_gateway_setting_id, gateway_handle: gateway_handle, + created_at: created_at, + updated_at: updated_at, additional_properties: additional_properties) end + def to_custom_created_at + DateTimeHelper.to_rfc3339(created_at) + end + + def to_custom_updated_at + DateTimeHelper.to_rfc3339(updated_at) + end + # Validates an instance of the object from a given value. # @param [ApplePayPaymentProfile | Hash] The value against the validation is performed. def self.validate(value) @@ -238,7 +274,8 @@ def to_s " billing_state: #{@billing_state}, billing_zip: #{@billing_zip}, billing_country:"\ " #{@billing_country}, customer_vault_token: #{@customer_vault_token}, billing_address_2:"\ " #{@billing_address_2}, payment_type: #{@payment_type}, site_gateway_setting_id:"\ - " #{@site_gateway_setting_id}, gateway_handle: #{@gateway_handle}, additional_properties:"\ + " #{@site_gateway_setting_id}, gateway_handle: #{@gateway_handle}, created_at:"\ + " #{@created_at}, updated_at: #{@updated_at}, additional_properties:"\ " #{get_additional_properties}>" end @@ -253,7 +290,8 @@ def inspect " #{@billing_country.inspect}, customer_vault_token: #{@customer_vault_token.inspect},"\ " billing_address_2: #{@billing_address_2.inspect}, payment_type: #{@payment_type.inspect},"\ " site_gateway_setting_id: #{@site_gateway_setting_id.inspect}, gateway_handle:"\ - " #{@gateway_handle.inspect}, additional_properties: #{get_additional_properties}>" + " #{@gateway_handle.inspect}, created_at: #{@created_at.inspect}, updated_at:"\ + " #{@updated_at.inspect}, additional_properties: #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/bank_account_payment_profile.rb b/lib/advanced_billing/models/bank_account_payment_profile.rb index 9ee3e4d6..6330071a 100644 --- a/lib/advanced_billing/models/bank_account_payment_profile.rb +++ b/lib/advanced_billing/models/bank_account_payment_profile.rb @@ -3,6 +3,7 @@ # This file was automatically generated by APIMATIC v2.0 # ( https://apimatic.io ). +require 'date' module AdvancedBilling # BankAccountPaymentProfile Model. class BankAccountPaymentProfile < BaseModel @@ -109,6 +110,14 @@ class BankAccountPaymentProfile < BaseModel # @return [String] attr_accessor :gateway_handle + # A timestamp indicating when this payment profile was created + # @return [DateTime] + attr_accessor :created_at + + # A timestamp indicating when this payment profile was last updated + # @return [DateTime] + attr_accessor :updated_at + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -134,6 +143,8 @@ def self.names @_hash['verified'] = 'verified' @_hash['site_gateway_setting_id'] = 'site_gateway_setting_id' @_hash['gateway_handle'] = 'gateway_handle' + @_hash['created_at'] = 'created_at' + @_hash['updated_at'] = 'updated_at' @_hash end @@ -160,6 +171,8 @@ def self.optionals verified site_gateway_setting_id gateway_handle + created_at + updated_at ] end @@ -189,6 +202,7 @@ def initialize(masked_bank_account_number:, masked_bank_routing_number: SKIP, bank_account_type: SKIP, bank_account_holder_type: SKIP, verified: false, site_gateway_setting_id: SKIP, gateway_handle: SKIP, + created_at: SKIP, updated_at: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| @@ -220,6 +234,8 @@ def initialize(masked_bank_account_number:, @verified = verified unless verified == SKIP @site_gateway_setting_id = site_gateway_setting_id unless site_gateway_setting_id == SKIP @gateway_handle = gateway_handle unless gateway_handle == SKIP + @created_at = created_at unless created_at == SKIP + @updated_at = updated_at unless updated_at == SKIP end # Creates an instance of the object from a hash. @@ -259,6 +275,16 @@ def self.from_hash(hash) hash.key?('site_gateway_setting_id') ? hash['site_gateway_setting_id'] : SKIP gateway_handle = hash.key?('gateway_handle') ? hash['gateway_handle'] : SKIP + created_at = if hash.key?('created_at') + (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at']) + else + SKIP + end + updated_at = if hash.key?('updated_at') + (DateTimeHelper.from_rfc3339(hash['updated_at']) if hash['updated_at']) + else + SKIP + end # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -286,9 +312,19 @@ def self.from_hash(hash) verified: verified, site_gateway_setting_id: site_gateway_setting_id, gateway_handle: gateway_handle, + created_at: created_at, + updated_at: updated_at, additional_properties: additional_properties) end + def to_custom_created_at + DateTimeHelper.to_rfc3339(created_at) + end + + def to_custom_updated_at + DateTimeHelper.to_rfc3339(updated_at) + end + # Validates an instance of the object from a given value. # @param [BankAccountPaymentProfile | Hash] The value against the validation is performed. def self.validate(value) @@ -324,7 +360,8 @@ def to_s " #{@masked_bank_account_number}, bank_account_type: #{@bank_account_type},"\ " bank_account_holder_type: #{@bank_account_holder_type}, payment_type: #{@payment_type},"\ " verified: #{@verified}, site_gateway_setting_id: #{@site_gateway_setting_id},"\ - " gateway_handle: #{@gateway_handle}, additional_properties: #{get_additional_properties}>" + " gateway_handle: #{@gateway_handle}, created_at: #{@created_at}, updated_at:"\ + " #{@updated_at}, additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -342,8 +379,8 @@ def inspect " #{@bank_account_type.inspect}, bank_account_holder_type:"\ " #{@bank_account_holder_type.inspect}, payment_type: #{@payment_type.inspect}, verified:"\ " #{@verified.inspect}, site_gateway_setting_id: #{@site_gateway_setting_id.inspect},"\ - " gateway_handle: #{@gateway_handle.inspect}, additional_properties:"\ - " #{get_additional_properties}>" + " gateway_handle: #{@gateway_handle.inspect}, created_at: #{@created_at.inspect},"\ + " updated_at: #{@updated_at.inspect}, additional_properties: #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/component.rb b/lib/advanced_billing/models/component.rb index 7bc66f56..6dbb3d51 100644 --- a/lib/advanced_billing/models/component.rb +++ b/lib/advanced_billing/models/component.rb @@ -46,6 +46,10 @@ class Component < BaseModel # @return [String] attr_accessor :product_family_name + # The handle of the Product Family to which the Component belongs + # @return [String] + attr_accessor :product_family_handle + # deprecated - use unit_price instead # @return [Integer] attr_accessor :price_per_unit_in_cents @@ -185,6 +189,7 @@ def self.names @_hash['unit_price'] = 'unit_price' @_hash['product_family_id'] = 'product_family_id' @_hash['product_family_name'] = 'product_family_name' + @_hash['product_family_handle'] = 'product_family_handle' @_hash['price_per_unit_in_cents'] = 'price_per_unit_in_cents' @_hash['kind'] = 'kind' @_hash['archived'] = 'archived' @@ -226,6 +231,7 @@ def self.optionals unit_price product_family_id product_family_name + product_family_handle price_per_unit_in_cents kind archived @@ -280,8 +286,9 @@ def self.nullables def initialize(id: SKIP, name: SKIP, handle: SKIP, pricing_scheme: SKIP, unit_name: SKIP, unit_price: SKIP, product_family_id: SKIP, - product_family_name: SKIP, price_per_unit_in_cents: SKIP, - kind: SKIP, archived: SKIP, taxable: SKIP, description: SKIP, + product_family_name: SKIP, product_family_handle: SKIP, + price_per_unit_in_cents: SKIP, kind: SKIP, archived: SKIP, + taxable: SKIP, description: SKIP, default_price_point_id: SKIP, overage_prices: SKIP, prices: SKIP, price_point_count: SKIP, price_points_url: SKIP, default_price_point_name: SKIP, @@ -305,6 +312,7 @@ def initialize(id: SKIP, name: SKIP, handle: SKIP, pricing_scheme: SKIP, @unit_price = unit_price unless unit_price == SKIP @product_family_id = product_family_id unless product_family_id == SKIP @product_family_name = product_family_name unless product_family_name == SKIP + @product_family_handle = product_family_handle unless product_family_handle == SKIP @price_per_unit_in_cents = price_per_unit_in_cents unless price_per_unit_in_cents == SKIP @kind = kind unless kind == SKIP @archived = archived unless archived == SKIP @@ -358,6 +366,8 @@ def self.from_hash(hash) hash.key?('product_family_id') ? hash['product_family_id'] : SKIP product_family_name = hash.key?('product_family_name') ? hash['product_family_name'] : SKIP + product_family_handle = + hash.key?('product_family_handle') ? hash['product_family_handle'] : SKIP price_per_unit_in_cents = hash.key?('price_per_unit_in_cents') ? hash['price_per_unit_in_cents'] : SKIP kind = hash.key?('kind') ? hash['kind'] : SKIP @@ -439,6 +449,7 @@ def self.from_hash(hash) unit_price: unit_price, product_family_id: product_family_id, product_family_name: product_family_name, + product_family_handle: product_family_handle, price_per_unit_in_cents: price_per_unit_in_cents, kind: kind, archived: archived, @@ -486,13 +497,14 @@ def to_s "<#{class_name} id: #{@id}, name: #{@name}, handle: #{@handle}, pricing_scheme:"\ " #{@pricing_scheme}, unit_name: #{@unit_name}, unit_price: #{@unit_price},"\ " product_family_id: #{@product_family_id}, product_family_name: #{@product_family_name},"\ - " price_per_unit_in_cents: #{@price_per_unit_in_cents}, kind: #{@kind}, archived:"\ - " #{@archived}, taxable: #{@taxable}, description: #{@description}, default_price_point_id:"\ - " #{@default_price_point_id}, overage_prices: #{@overage_prices}, prices: #{@prices},"\ - " price_point_count: #{@price_point_count}, price_points_url: #{@price_points_url},"\ - " default_price_point_name: #{@default_price_point_name}, tax_code: #{@tax_code}, recurring:"\ - " #{@recurring}, upgrade_charge: #{@upgrade_charge}, downgrade_credit: #{@downgrade_credit},"\ - " created_at: #{@created_at}, updated_at: #{@updated_at}, archived_at: #{@archived_at},"\ + " product_family_handle: #{@product_family_handle}, price_per_unit_in_cents:"\ + " #{@price_per_unit_in_cents}, kind: #{@kind}, archived: #{@archived}, taxable: #{@taxable},"\ + " description: #{@description}, default_price_point_id: #{@default_price_point_id},"\ + " overage_prices: #{@overage_prices}, prices: #{@prices}, price_point_count:"\ + " #{@price_point_count}, price_points_url: #{@price_points_url}, default_price_point_name:"\ + " #{@default_price_point_name}, tax_code: #{@tax_code}, recurring: #{@recurring},"\ + " upgrade_charge: #{@upgrade_charge}, downgrade_credit: #{@downgrade_credit}, created_at:"\ + " #{@created_at}, updated_at: #{@updated_at}, archived_at: #{@archived_at},"\ " hide_date_range_on_invoice: #{@hide_date_range_on_invoice}, allow_fractional_quantities:"\ " #{@allow_fractional_quantities}, item_category: #{@item_category}, use_site_exchange_rate:"\ " #{@use_site_exchange_rate}, accounting_code: #{@accounting_code},"\ @@ -506,7 +518,8 @@ def inspect "<#{class_name} id: #{@id.inspect}, name: #{@name.inspect}, handle: #{@handle.inspect},"\ " pricing_scheme: #{@pricing_scheme.inspect}, unit_name: #{@unit_name.inspect}, unit_price:"\ " #{@unit_price.inspect}, product_family_id: #{@product_family_id.inspect},"\ - " product_family_name: #{@product_family_name.inspect}, price_per_unit_in_cents:"\ + " product_family_name: #{@product_family_name.inspect}, product_family_handle:"\ + " #{@product_family_handle.inspect}, price_per_unit_in_cents:"\ " #{@price_per_unit_in_cents.inspect}, kind: #{@kind.inspect}, archived:"\ " #{@archived.inspect}, taxable: #{@taxable.inspect}, description: #{@description.inspect},"\ " default_price_point_id: #{@default_price_point_id.inspect}, overage_prices:"\ diff --git a/lib/advanced_billing/models/coupon_request.rb b/lib/advanced_billing/models/coupon_request.rb index 15106290..842b0372 100644 --- a/lib/advanced_billing/models/coupon_request.rb +++ b/lib/advanced_billing/models/coupon_request.rb @@ -13,13 +13,15 @@ class CouponRequest < BaseModel # @return [CouponPayload] attr_accessor :coupon - # An object where the keys are product_ids and the values are booleans - # indicating if the coupon should be applicable to the product + # An object where the keys are product IDs or handles (prefixed with + # 'handle:'), and the values are booleans indicating if the coupon should be + # applicable to the product # @return [Hash[String, TrueClass | FalseClass]] attr_accessor :restricted_products - # An object where the keys are component_ids and the values are booleans - # indicating if the coupon should be applicable to the component + # An object where the keys are component IDs or handles (prefixed with + # 'handle:'), and the values are booleans indicating if the coupon should be + # applicable to the component # @return [Hash[String, TrueClass | FalseClass]] attr_accessor :restricted_components diff --git a/lib/advanced_billing/models/create_subscription.rb b/lib/advanced_billing/models/create_subscription.rb index ea1b9437..775958d1 100644 --- a/lib/advanced_billing/models/create_subscription.rb +++ b/lib/advanced_billing/models/create_subscription.rb @@ -85,23 +85,35 @@ class CreateSubscription < BaseModel attr_accessor :next_billing_at # (Optional) Set this attribute to a future date/time to create a - # subscription in the "Awaiting Signup" state, rather than "Active" or - # "Trialing". See the notes on “Date/Time Format” in our [subscription - # import - # documentation](https://maxio.zendesk.com/hc/en-us/articles/24251489107213- - # Advanced-Billing-Subscription-Imports#date-format). In the "Awaiting - # Signup" state, a subscription behaves like any other. It can be canceled, - # allocated to, had its billing date changed. etc. When the - # initial_billing_at date hits, the subscription will transition to the - # expected state. If the product has a trial, the subscription will enter a - # trial, otherwise it will go active. Setup fees will be respected either - # before or after the trial, as configured on the price point. If the - # payment is due at the initial_billing_at and it fails the subscription - # will be immediately canceled. See further notes in the section on Delayed - # Signups. + # subscription in the Awaiting Signup state, rather than Active or Trialing. + # You can omit the initial_billing_at date to activate the subscription + # immediately. In the Awaiting Signup state, a subscription behaves like any + # other. It can be canceled, allocated to, or have its billing date changed. + # etc. When the initial_billing_at date hits, the subscription will + # transition to the expected state. If the product has a trial, the + # subscription will enter a trial, otherwise it will go active. Setup fees + # will be respected either before or after the trial, as configured on the + # price point. If the payment is due at the initial_billing_at and it fails + # the subscription will be immediately canceled. See the [subscription + # import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advance + # d-Billing-Subscription-Imports#date-format) documentation for more + # information about Date/Time Formats. # @return [DateTime] attr_accessor :initial_billing_at + # (Optional) Set this attribute to true to create the subscription in the + # Awaiting Signup Date state. Use this when you want to create a + # subscription that has an unknown first billing date. When the first + # billing date is known, update a subscription and set the + # `initial_billing_at` date. The subscription moves to the Awaiting Signup + # state with a scheduled initial billing date. You can omit the + # initial_billing_at date to activate the subscription immediately. See + # [Subscription + # States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773 + # -Subscription-States) for more information. + # @return [TrueClass | FalseClass] + attr_accessor :defer_signup + # For European sites subject to PSD2 and using 3D Secure, this can be used # to reference a previous transaction for the customer. This will ensure the # card will be charged successfully at renewal. @@ -124,11 +136,11 @@ class CreateSubscription < BaseModel # @return [Integer] attr_accessor :payment_profile_id - # The reference value (provided by your app) for the subscription itelf. + # The reference value (provided by your app) for the subscription itself. # @return [String] attr_accessor :reference - # The reference value (provided by your app) for the subscription itelf. + # The reference value (provided by your app) for the subscription itself. # @return [CustomerAttributes] attr_accessor :customer_attributes @@ -237,7 +249,7 @@ class CreateSubscription < BaseModel # @return [String] attr_accessor :reason_code - # (Optional, used only for Delayed Product Change When set to true, + # (Optional) used only for Delayed Product Change When set to true, # indicates that a changed value for product_handle should schedule the # product change to the next subscription renewal. # @return [TrueClass | FalseClass] @@ -325,6 +337,7 @@ def self.names @_hash['customer_id'] = 'customer_id' @_hash['next_billing_at'] = 'next_billing_at' @_hash['initial_billing_at'] = 'initial_billing_at' + @_hash['defer_signup'] = 'defer_signup' @_hash['stored_credential_transaction_id'] = 'stored_credential_transaction_id' @_hash['sales_rep_id'] = 'sales_rep_id' @@ -385,6 +398,7 @@ def self.optionals customer_id next_billing_at initial_billing_at + defer_signup stored_credential_transaction_id sales_rep_id payment_profile_id @@ -438,7 +452,7 @@ def initialize(product_handle: SKIP, product_id: SKIP, payment_collection_method: SKIP, receives_invoice_emails: SKIP, net_terms: SKIP, customer_id: SKIP, next_billing_at: SKIP, - initial_billing_at: SKIP, + initial_billing_at: SKIP, defer_signup: false, stored_credential_transaction_id: SKIP, sales_rep_id: SKIP, payment_profile_id: SKIP, reference: SKIP, customer_attributes: SKIP, payment_profile_attributes: SKIP, @@ -483,6 +497,7 @@ def initialize(product_handle: SKIP, product_id: SKIP, @customer_id = customer_id unless customer_id == SKIP @next_billing_at = next_billing_at unless next_billing_at == SKIP @initial_billing_at = initial_billing_at unless initial_billing_at == SKIP + @defer_signup = defer_signup unless defer_signup == SKIP unless stored_credential_transaction_id == SKIP @stored_credential_transaction_id = stored_credential_transaction_id @@ -574,6 +589,7 @@ def self.from_hash(hash) else SKIP end + defer_signup = hash['defer_signup'] ||= false stored_credential_transaction_id = hash.key?('stored_credential_transaction_id') ? hash['stored_credential_transaction_id'] : SKIP sales_rep_id = hash.key?('sales_rep_id') ? hash['sales_rep_id'] : SKIP @@ -677,6 +693,7 @@ def self.from_hash(hash) customer_id: customer_id, next_billing_at: next_billing_at, initial_billing_at: initial_billing_at, + defer_signup: defer_signup, stored_credential_transaction_id: stored_credential_transaction_id, sales_rep_id: sales_rep_id, payment_profile_id: payment_profile_id, @@ -759,7 +776,7 @@ def to_s " coupon_codes: #{@coupon_codes}, payment_collection_method: #{@payment_collection_method},"\ " receives_invoice_emails: #{@receives_invoice_emails}, net_terms: #{@net_terms},"\ " customer_id: #{@customer_id}, next_billing_at: #{@next_billing_at}, initial_billing_at:"\ - " #{@initial_billing_at}, stored_credential_transaction_id:"\ + " #{@initial_billing_at}, defer_signup: #{@defer_signup}, stored_credential_transaction_id:"\ " #{@stored_credential_transaction_id}, sales_rep_id: #{@sales_rep_id}, payment_profile_id:"\ " #{@payment_profile_id}, reference: #{@reference}, customer_attributes:"\ " #{@customer_attributes}, payment_profile_attributes: #{@payment_profile_attributes},"\ @@ -794,10 +811,11 @@ def inspect " payment_collection_method: #{@payment_collection_method.inspect}, receives_invoice_emails:"\ " #{@receives_invoice_emails.inspect}, net_terms: #{@net_terms.inspect}, customer_id:"\ " #{@customer_id.inspect}, next_billing_at: #{@next_billing_at.inspect}, initial_billing_at:"\ - " #{@initial_billing_at.inspect}, stored_credential_transaction_id:"\ - " #{@stored_credential_transaction_id.inspect}, sales_rep_id: #{@sales_rep_id.inspect},"\ - " payment_profile_id: #{@payment_profile_id.inspect}, reference: #{@reference.inspect},"\ - " customer_attributes: #{@customer_attributes.inspect}, payment_profile_attributes:"\ + " #{@initial_billing_at.inspect}, defer_signup: #{@defer_signup.inspect},"\ + " stored_credential_transaction_id: #{@stored_credential_transaction_id.inspect},"\ + " sales_rep_id: #{@sales_rep_id.inspect}, payment_profile_id:"\ + " #{@payment_profile_id.inspect}, reference: #{@reference.inspect}, customer_attributes:"\ + " #{@customer_attributes.inspect}, payment_profile_attributes:"\ " #{@payment_profile_attributes.inspect}, credit_card_attributes:"\ " #{@credit_card_attributes.inspect}, bank_account_attributes:"\ " #{@bank_account_attributes.inspect}, components: #{@components.inspect}, calendar_billing:"\ diff --git a/lib/advanced_billing/models/credit_card_payment_profile.rb b/lib/advanced_billing/models/credit_card_payment_profile.rb index 478b479d..97ffaeab 100644 --- a/lib/advanced_billing/models/credit_card_payment_profile.rb +++ b/lib/advanced_billing/models/credit_card_payment_profile.rb @@ -3,6 +3,7 @@ # This file was automatically generated by APIMATIC v2.0 # ( https://apimatic.io ). +require 'date' module AdvancedBilling # CreditCardPaymentProfile Model. class CreditCardPaymentProfile < BaseModel @@ -109,6 +110,14 @@ class CreditCardPaymentProfile < BaseModel # @return [String] attr_accessor :gateway_handle + # A timestamp indicating when this payment profile was created + # @return [DateTime] + attr_accessor :created_at + + # A timestamp indicating when this payment profile was last updated + # @return [DateTime] + attr_accessor :updated_at + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -134,6 +143,8 @@ def self.names @_hash['chargify_token'] = 'chargify_token' @_hash['site_gateway_setting_id'] = 'site_gateway_setting_id' @_hash['gateway_handle'] = 'gateway_handle' + @_hash['created_at'] = 'created_at' + @_hash['updated_at'] = 'updated_at' @_hash end @@ -161,6 +172,8 @@ def self.optionals chargify_token site_gateway_setting_id gateway_handle + created_at + updated_at ] end @@ -190,7 +203,8 @@ def initialize(payment_type: PaymentType::CREDIT_CARD, id: SKIP, billing_country: SKIP, customer_vault_token: SKIP, billing_address_2: SKIP, disabled: SKIP, chargify_token: SKIP, site_gateway_setting_id: SKIP, - gateway_handle: SKIP, additional_properties: {}) + gateway_handle: SKIP, created_at: SKIP, updated_at: SKIP, + additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -218,6 +232,8 @@ def initialize(payment_type: PaymentType::CREDIT_CARD, id: SKIP, @chargify_token = chargify_token unless chargify_token == SKIP @site_gateway_setting_id = site_gateway_setting_id unless site_gateway_setting_id == SKIP @gateway_handle = gateway_handle unless gateway_handle == SKIP + @created_at = created_at unless created_at == SKIP + @updated_at = updated_at unless updated_at == SKIP end # Creates an instance of the object from a hash. @@ -257,6 +273,16 @@ def self.from_hash(hash) hash.key?('site_gateway_setting_id') ? hash['site_gateway_setting_id'] : SKIP gateway_handle = hash.key?('gateway_handle') ? hash['gateway_handle'] : SKIP + created_at = if hash.key?('created_at') + (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at']) + else + SKIP + end + updated_at = if hash.key?('updated_at') + (DateTimeHelper.from_rfc3339(hash['updated_at']) if hash['updated_at']) + else + SKIP + end # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -284,9 +310,19 @@ def self.from_hash(hash) chargify_token: chargify_token, site_gateway_setting_id: site_gateway_setting_id, gateway_handle: gateway_handle, + created_at: created_at, + updated_at: updated_at, additional_properties: additional_properties) end + def to_custom_created_at + DateTimeHelper.to_rfc3339(created_at) + end + + def to_custom_updated_at + DateTimeHelper.to_rfc3339(updated_at) + end + # Validates an instance of the object from a given value. # @param [CreditCardPaymentProfile | Hash] The value against the validation is performed. def self.validate(value) @@ -313,7 +349,8 @@ def to_s " #{@customer_vault_token}, billing_address_2: #{@billing_address_2}, payment_type:"\ " #{@payment_type}, disabled: #{@disabled}, chargify_token: #{@chargify_token},"\ " site_gateway_setting_id: #{@site_gateway_setting_id}, gateway_handle: #{@gateway_handle},"\ - " additional_properties: #{get_additional_properties}>" + " created_at: #{@created_at}, updated_at: #{@updated_at}, additional_properties:"\ + " #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -330,7 +367,8 @@ def inspect " billing_address_2: #{@billing_address_2.inspect}, payment_type: #{@payment_type.inspect},"\ " disabled: #{@disabled.inspect}, chargify_token: #{@chargify_token.inspect},"\ " site_gateway_setting_id: #{@site_gateway_setting_id.inspect}, gateway_handle:"\ - " #{@gateway_handle.inspect}, additional_properties: #{get_additional_properties}>" + " #{@gateway_handle.inspect}, created_at: #{@created_at.inspect}, updated_at:"\ + " #{@updated_at.inspect}, additional_properties: #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/list_service_credits_response.rb b/lib/advanced_billing/models/list_service_credits_response.rb new file mode 100644 index 00000000..1b4b8159 --- /dev/null +++ b/lib/advanced_billing/models/list_service_credits_response.rb @@ -0,0 +1,82 @@ +# advanced_billing +# +# This file was automatically generated by APIMATIC v2.0 +# ( https://apimatic.io ). + +module AdvancedBilling + # ListServiceCreditsResponse Model. + class ListServiceCreditsResponse < BaseModel + SKIP = Object.new + private_constant :SKIP + + # TODO: Write general description for this method + # @return [Array[ServiceCredit1]] + attr_accessor :service_credits + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['service_credits'] = 'service_credits' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + service_credits + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(service_credits: SKIP, additional_properties: {}) + # Add additional model properties to the instance. + additional_properties.each do |_name, _value| + instance_variable_set("@#{_name}", _value) + end + + @service_credits = service_credits unless service_credits == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + # Parameter is an array, so we need to iterate through it + service_credits = nil + unless hash['service_credits'].nil? + service_credits = [] + hash['service_credits'].each do |structure| + service_credits << (ServiceCredit1.from_hash(structure) if structure) + end + end + + service_credits = SKIP unless hash.key?('service_credits') + + # Clean out expected properties from Hash. + additional_properties = hash.reject { |k, _| names.value?(k) } + + # Create object from extracted values. + ListServiceCreditsResponse.new(service_credits: service_credits, + additional_properties: additional_properties) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} service_credits: #{@service_credits}, additional_properties:"\ + " #{get_additional_properties}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} service_credits: #{@service_credits.inspect}, additional_properties:"\ + " #{get_additional_properties}>" + end + end +end diff --git a/lib/advanced_billing/models/override_subscription.rb b/lib/advanced_billing/models/override_subscription.rb index 28fd3946..75242a51 100644 --- a/lib/advanced_billing/models/override_subscription.rb +++ b/lib/advanced_billing/models/override_subscription.rb @@ -28,7 +28,9 @@ class OverrideSubscription < BaseModel # Can be used to record an external expiration date. Chargify sets this # field automatically when a subscription expires (ceases billing) after a - # prescribed amount of time. Only ISO8601 format is supported. + # prescribed amount of time. Only ISO8601 format is supported. This field is + # not supported when Multi-frequency is enabled for the Site. To change the + # Term End of a Subscription, use the Update Subscription endpoint. # @return [DateTime] attr_accessor :expires_at diff --git a/lib/advanced_billing/models/paypal_payment_profile.rb b/lib/advanced_billing/models/paypal_payment_profile.rb index b98e4e89..49cdde9a 100644 --- a/lib/advanced_billing/models/paypal_payment_profile.rb +++ b/lib/advanced_billing/models/paypal_payment_profile.rb @@ -3,6 +3,7 @@ # This file was automatically generated by APIMATIC v2.0 # ( https://apimatic.io ). +require 'date' module AdvancedBilling # PaypalPaymentProfile Model. class PaypalPaymentProfile < BaseModel @@ -79,6 +80,14 @@ class PaypalPaymentProfile < BaseModel # @return [String] attr_accessor :paypal_email + # A timestamp indicating when this payment profile was created + # @return [DateTime] + attr_accessor :created_at + + # A timestamp indicating when this payment profile was last updated + # @return [DateTime] + attr_accessor :updated_at + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -99,6 +108,8 @@ def self.names @_hash['site_gateway_setting_id'] = 'site_gateway_setting_id' @_hash['gateway_handle'] = 'gateway_handle' @_hash['paypal_email'] = 'paypal_email' + @_hash['created_at'] = 'created_at' + @_hash['updated_at'] = 'updated_at' @_hash end @@ -121,6 +132,8 @@ def self.optionals site_gateway_setting_id gateway_handle paypal_email + created_at + updated_at ] end @@ -146,8 +159,8 @@ def initialize(payment_type: PaymentType::PAYPAL_ACCOUNT, id: SKIP, billing_state: SKIP, billing_zip: SKIP, billing_country: SKIP, customer_vault_token: SKIP, billing_address_2: SKIP, site_gateway_setting_id: SKIP, - gateway_handle: SKIP, paypal_email: SKIP, - additional_properties: {}) + gateway_handle: SKIP, paypal_email: SKIP, created_at: SKIP, + updated_at: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -170,6 +183,8 @@ def initialize(payment_type: PaymentType::PAYPAL_ACCOUNT, id: SKIP, @site_gateway_setting_id = site_gateway_setting_id unless site_gateway_setting_id == SKIP @gateway_handle = gateway_handle unless gateway_handle == SKIP @paypal_email = paypal_email unless paypal_email == SKIP + @created_at = created_at unless created_at == SKIP + @updated_at = updated_at unless updated_at == SKIP end # Creates an instance of the object from a hash. @@ -200,6 +215,16 @@ def self.from_hash(hash) gateway_handle = hash.key?('gateway_handle') ? hash['gateway_handle'] : SKIP paypal_email = hash.key?('paypal_email') ? hash['paypal_email'] : SKIP + created_at = if hash.key?('created_at') + (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at']) + else + SKIP + end + updated_at = if hash.key?('updated_at') + (DateTimeHelper.from_rfc3339(hash['updated_at']) if hash['updated_at']) + else + SKIP + end # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -222,9 +247,19 @@ def self.from_hash(hash) site_gateway_setting_id: site_gateway_setting_id, gateway_handle: gateway_handle, paypal_email: paypal_email, + created_at: created_at, + updated_at: updated_at, additional_properties: additional_properties) end + def to_custom_created_at + DateTimeHelper.to_rfc3339(created_at) + end + + def to_custom_updated_at + DateTimeHelper.to_rfc3339(updated_at) + end + # Validates an instance of the object from a given value. # @param [PaypalPaymentProfile | Hash] The value against the validation is performed. def self.validate(value) @@ -249,7 +284,8 @@ def to_s " #{@billing_country}, customer_vault_token: #{@customer_vault_token}, billing_address_2:"\ " #{@billing_address_2}, payment_type: #{@payment_type}, site_gateway_setting_id:"\ " #{@site_gateway_setting_id}, gateway_handle: #{@gateway_handle}, paypal_email:"\ - " #{@paypal_email}, additional_properties: #{get_additional_properties}>" + " #{@paypal_email}, created_at: #{@created_at}, updated_at: #{@updated_at},"\ + " additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -263,7 +299,8 @@ def inspect " #{@billing_country.inspect}, customer_vault_token: #{@customer_vault_token.inspect},"\ " billing_address_2: #{@billing_address_2.inspect}, payment_type: #{@payment_type.inspect},"\ " site_gateway_setting_id: #{@site_gateway_setting_id.inspect}, gateway_handle:"\ - " #{@gateway_handle.inspect}, paypal_email: #{@paypal_email.inspect}, additional_properties:"\ + " #{@gateway_handle.inspect}, paypal_email: #{@paypal_email.inspect}, created_at:"\ + " #{@created_at.inspect}, updated_at: #{@updated_at.inspect}, additional_properties:"\ " #{get_additional_properties}>" end end diff --git a/lib/advanced_billing/models/service_credit1.rb b/lib/advanced_billing/models/service_credit1.rb new file mode 100644 index 00000000..5f6d8a43 --- /dev/null +++ b/lib/advanced_billing/models/service_credit1.rb @@ -0,0 +1,161 @@ +# advanced_billing +# +# This file was automatically generated by APIMATIC v2.0 +# ( https://apimatic.io ). + +require 'date' +module AdvancedBilling + # ServiceCredit1 Model. + class ServiceCredit1 < BaseModel + SKIP = Object.new + private_constant :SKIP + + # TODO: Write general description for this method + # @return [Integer] + attr_accessor :id + + # The amount in cents of the entry + # @return [Integer] + attr_accessor :amount_in_cents + + # The new balance for the credit account + # @return [Integer] + attr_accessor :ending_balance_in_cents + + # The type of entry + # @return [ServiceCreditType] + attr_accessor :entry_type + + # The memo attached to the entry + # @return [String] + attr_accessor :memo + + # The invoice uid associated with the entry. Only present for debit entries + # @return [String] + attr_accessor :invoice_uid + + # The remaining balance for the entry + # @return [Integer] + attr_accessor :remaining_balance_in_cents + + # The date and time the entry was created + # @return [DateTime] + attr_accessor :created_at + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['id'] = 'id' + @_hash['amount_in_cents'] = 'amount_in_cents' + @_hash['ending_balance_in_cents'] = 'ending_balance_in_cents' + @_hash['entry_type'] = 'entry_type' + @_hash['memo'] = 'memo' + @_hash['invoice_uid'] = 'invoice_uid' + @_hash['remaining_balance_in_cents'] = 'remaining_balance_in_cents' + @_hash['created_at'] = 'created_at' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + id + amount_in_cents + ending_balance_in_cents + entry_type + memo + invoice_uid + remaining_balance_in_cents + created_at + ] + end + + # An array for nullable fields + def self.nullables + %w[ + invoice_uid + ] + end + + def initialize(id: SKIP, amount_in_cents: SKIP, + ending_balance_in_cents: SKIP, entry_type: SKIP, memo: SKIP, + invoice_uid: SKIP, remaining_balance_in_cents: SKIP, + created_at: SKIP, additional_properties: {}) + # Add additional model properties to the instance. + additional_properties.each do |_name, _value| + instance_variable_set("@#{_name}", _value) + end + + @id = id unless id == SKIP + @amount_in_cents = amount_in_cents unless amount_in_cents == SKIP + @ending_balance_in_cents = ending_balance_in_cents unless ending_balance_in_cents == SKIP + @entry_type = entry_type unless entry_type == SKIP + @memo = memo unless memo == SKIP + @invoice_uid = invoice_uid unless invoice_uid == SKIP + unless remaining_balance_in_cents == SKIP + @remaining_balance_in_cents = + remaining_balance_in_cents + end + @created_at = created_at unless created_at == SKIP + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + id = hash.key?('id') ? hash['id'] : SKIP + amount_in_cents = + hash.key?('amount_in_cents') ? hash['amount_in_cents'] : SKIP + ending_balance_in_cents = + hash.key?('ending_balance_in_cents') ? hash['ending_balance_in_cents'] : SKIP + entry_type = hash.key?('entry_type') ? hash['entry_type'] : SKIP + memo = hash.key?('memo') ? hash['memo'] : SKIP + invoice_uid = hash.key?('invoice_uid') ? hash['invoice_uid'] : SKIP + remaining_balance_in_cents = + hash.key?('remaining_balance_in_cents') ? hash['remaining_balance_in_cents'] : SKIP + created_at = if hash.key?('created_at') + (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at']) + else + SKIP + end + + # Clean out expected properties from Hash. + additional_properties = hash.reject { |k, _| names.value?(k) } + + # Create object from extracted values. + ServiceCredit1.new(id: id, + amount_in_cents: amount_in_cents, + ending_balance_in_cents: ending_balance_in_cents, + entry_type: entry_type, + memo: memo, + invoice_uid: invoice_uid, + remaining_balance_in_cents: remaining_balance_in_cents, + created_at: created_at, + additional_properties: additional_properties) + end + + def to_custom_created_at + DateTimeHelper.to_rfc3339(created_at) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} id: #{@id}, amount_in_cents: #{@amount_in_cents}, ending_balance_in_cents:"\ + " #{@ending_balance_in_cents}, entry_type: #{@entry_type}, memo: #{@memo}, invoice_uid:"\ + " #{@invoice_uid}, remaining_balance_in_cents: #{@remaining_balance_in_cents}, created_at:"\ + " #{@created_at}, additional_properties: #{get_additional_properties}>" + end + + # Provides a debugging-friendly string with detailed object information. + def inspect + class_name = self.class.name.split('::').last + "<#{class_name} id: #{@id.inspect}, amount_in_cents: #{@amount_in_cents.inspect},"\ + " ending_balance_in_cents: #{@ending_balance_in_cents.inspect}, entry_type:"\ + " #{@entry_type.inspect}, memo: #{@memo.inspect}, invoice_uid: #{@invoice_uid.inspect},"\ + " remaining_balance_in_cents: #{@remaining_balance_in_cents.inspect}, created_at:"\ + " #{@created_at.inspect}, additional_properties: #{get_additional_properties}>" + end + end +end diff --git a/lib/advanced_billing/models/subscription_group_credit_card.rb b/lib/advanced_billing/models/subscription_group_credit_card.rb index 530c1bba..25d13db7 100644 --- a/lib/advanced_billing/models/subscription_group_credit_card.rb +++ b/lib/advanced_billing/models/subscription_group_credit_card.rb @@ -9,18 +9,6 @@ class SubscriptionGroupCreditCard < BaseModel SKIP = Object.new private_constant :SKIP - # TODO: Write general description for this method - # @return [Object] - attr_accessor :full_number - - # TODO: Write general description for this method - # @return [Object] - attr_accessor :expiration_month - - # TODO: Write general description for this method - # @return [Object] - attr_accessor :expiration_year - # TODO: Write general description for this method # @return [String] attr_accessor :chargify_token @@ -79,6 +67,21 @@ class SubscriptionGroupCreditCard < BaseModel # @return [String] attr_accessor :billing_country + # The vault that stores the payment profile with the provided `vault_token`. + # Use `bogus` for testing. + # @return [Object] + attr_accessor :full_number + + # The vault that stores the payment profile with the provided `vault_token`. + # Use `bogus` for testing. + # @return [Object] + attr_accessor :expiration_month + + # The vault that stores the payment profile with the provided `vault_token`. + # Use `bogus` for testing. + # @return [Object] + attr_accessor :expiration_year + # The vault that stores the payment profile with the provided `vault_token`. # Use `bogus` for testing. # @return [String] @@ -103,9 +106,6 @@ class SubscriptionGroupCreditCard < BaseModel # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? - @_hash['full_number'] = 'full_number' - @_hash['expiration_month'] = 'expiration_month' - @_hash['expiration_year'] = 'expiration_year' @_hash['chargify_token'] = 'chargify_token' @_hash['vault_token'] = 'vault_token' @_hash['current_vault'] = 'current_vault' @@ -118,6 +118,9 @@ def self.names @_hash['billing_state'] = 'billing_state' @_hash['billing_zip'] = 'billing_zip' @_hash['billing_country'] = 'billing_country' + @_hash['full_number'] = 'full_number' + @_hash['expiration_month'] = 'expiration_month' + @_hash['expiration_year'] = 'expiration_year' @_hash['last_four'] = 'last_four' @_hash['card_type'] = 'card_type' @_hash['customer_vault_token'] = 'customer_vault_token' @@ -129,9 +132,6 @@ def self.names # An array for optional fields def self.optionals %w[ - full_number - expiration_month - expiration_year chargify_token vault_token current_vault @@ -144,6 +144,9 @@ def self.optionals billing_state billing_zip billing_country + full_number + expiration_month + expiration_year last_four card_type customer_vault_token @@ -157,23 +160,19 @@ def self.nullables [] end - def initialize(full_number: SKIP, expiration_month: SKIP, - expiration_year: SKIP, chargify_token: SKIP, - vault_token: SKIP, current_vault: SKIP, gateway_handle: SKIP, - first_name: SKIP, last_name: SKIP, billing_address: SKIP, - billing_address_2: SKIP, billing_city: SKIP, - billing_state: SKIP, billing_zip: SKIP, - billing_country: SKIP, last_four: SKIP, card_type: SKIP, - customer_vault_token: SKIP, cvv: SKIP, payment_type: SKIP, - additional_properties: {}) + def initialize(chargify_token: SKIP, vault_token: SKIP, current_vault: SKIP, + gateway_handle: SKIP, first_name: SKIP, last_name: SKIP, + billing_address: SKIP, billing_address_2: SKIP, + billing_city: SKIP, billing_state: SKIP, billing_zip: SKIP, + billing_country: SKIP, full_number: SKIP, + expiration_month: SKIP, expiration_year: SKIP, + last_four: SKIP, card_type: SKIP, customer_vault_token: SKIP, + cvv: SKIP, payment_type: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) end - @full_number = full_number unless full_number == SKIP - @expiration_month = expiration_month unless expiration_month == SKIP - @expiration_year = expiration_year unless expiration_year == SKIP @chargify_token = chargify_token unless chargify_token == SKIP @vault_token = vault_token unless vault_token == SKIP @current_vault = current_vault unless current_vault == SKIP @@ -186,6 +185,9 @@ def initialize(full_number: SKIP, expiration_month: SKIP, @billing_state = billing_state unless billing_state == SKIP @billing_zip = billing_zip unless billing_zip == SKIP @billing_country = billing_country unless billing_country == SKIP + @full_number = full_number unless full_number == SKIP + @expiration_month = expiration_month unless expiration_month == SKIP + @expiration_year = expiration_year unless expiration_year == SKIP @last_four = last_four unless last_four == SKIP @card_type = card_type unless card_type == SKIP @customer_vault_token = customer_vault_token unless customer_vault_token == SKIP @@ -198,15 +200,6 @@ def self.from_hash(hash) return nil unless hash # Extract variables from the hash. - full_number = hash.key?('full_number') ? APIHelper.deserialize_union_type( - UnionTypeLookUp.get(:SubscriptionGroupCreditCardFullNumber), hash['full_number'] - ) : SKIP - expiration_month = hash.key?('expiration_month') ? APIHelper.deserialize_union_type( - UnionTypeLookUp.get(:SubscriptionGroupCreditCardExpirationMonth), hash['expiration_month'] - ) : SKIP - expiration_year = hash.key?('expiration_year') ? APIHelper.deserialize_union_type( - UnionTypeLookUp.get(:SubscriptionGroupCreditCardExpirationYear), hash['expiration_year'] - ) : SKIP chargify_token = hash.key?('chargify_token') ? hash['chargify_token'] : SKIP vault_token = hash.key?('vault_token') ? hash['vault_token'] : SKIP @@ -224,6 +217,15 @@ def self.from_hash(hash) billing_zip = hash.key?('billing_zip') ? hash['billing_zip'] : SKIP billing_country = hash.key?('billing_country') ? hash['billing_country'] : SKIP + full_number = hash.key?('full_number') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:SubscriptionGroupCreditCardFullNumber), hash['full_number'] + ) : SKIP + expiration_month = hash.key?('expiration_month') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:SubscriptionGroupCreditCardExpirationMonth), hash['expiration_month'] + ) : SKIP + expiration_year = hash.key?('expiration_year') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:SubscriptionGroupCreditCardExpirationYear), hash['expiration_year'] + ) : SKIP last_four = hash.key?('last_four') ? hash['last_four'] : SKIP card_type = hash.key?('card_type') ? hash['card_type'] : SKIP customer_vault_token = @@ -235,10 +237,7 @@ def self.from_hash(hash) additional_properties = hash.reject { |k, _| names.value?(k) } # Create object from extracted values. - SubscriptionGroupCreditCard.new(full_number: full_number, - expiration_month: expiration_month, - expiration_year: expiration_year, - chargify_token: chargify_token, + SubscriptionGroupCreditCard.new(chargify_token: chargify_token, vault_token: vault_token, current_vault: current_vault, gateway_handle: gateway_handle, @@ -250,6 +249,9 @@ def self.from_hash(hash) billing_state: billing_state, billing_zip: billing_zip, billing_country: billing_country, + full_number: full_number, + expiration_month: expiration_month, + expiration_year: expiration_year, last_four: last_four, card_type: card_type, customer_vault_token: customer_vault_token, @@ -271,13 +273,13 @@ def self.validate(value) # Provides a human-readable string representation of the object. def to_s class_name = self.class.name.split('::').last - "<#{class_name} full_number: #{@full_number}, expiration_month: #{@expiration_month},"\ - " expiration_year: #{@expiration_year}, chargify_token: #{@chargify_token}, vault_token:"\ - " #{@vault_token}, current_vault: #{@current_vault}, gateway_handle: #{@gateway_handle},"\ - " first_name: #{@first_name}, last_name: #{@last_name}, billing_address:"\ - " #{@billing_address}, billing_address_2: #{@billing_address_2}, billing_city:"\ - " #{@billing_city}, billing_state: #{@billing_state}, billing_zip: #{@billing_zip},"\ - " billing_country: #{@billing_country}, last_four: #{@last_four}, card_type: #{@card_type},"\ + "<#{class_name} chargify_token: #{@chargify_token}, vault_token: #{@vault_token},"\ + " current_vault: #{@current_vault}, gateway_handle: #{@gateway_handle}, first_name:"\ + " #{@first_name}, last_name: #{@last_name}, billing_address: #{@billing_address},"\ + " billing_address_2: #{@billing_address_2}, billing_city: #{@billing_city}, billing_state:"\ + " #{@billing_state}, billing_zip: #{@billing_zip}, billing_country: #{@billing_country},"\ + " full_number: #{@full_number}, expiration_month: #{@expiration_month}, expiration_year:"\ + " #{@expiration_year}, last_four: #{@last_four}, card_type: #{@card_type},"\ " customer_vault_token: #{@customer_vault_token}, cvv: #{@cvv}, payment_type:"\ " #{@payment_type}, additional_properties: #{get_additional_properties}>" end @@ -285,15 +287,15 @@ def to_s # Provides a debugging-friendly string with detailed object information. def inspect class_name = self.class.name.split('::').last - "<#{class_name} full_number: #{@full_number.inspect}, expiration_month:"\ - " #{@expiration_month.inspect}, expiration_year: #{@expiration_year.inspect},"\ - " chargify_token: #{@chargify_token.inspect}, vault_token: #{@vault_token.inspect},"\ - " current_vault: #{@current_vault.inspect}, gateway_handle: #{@gateway_handle.inspect},"\ - " first_name: #{@first_name.inspect}, last_name: #{@last_name.inspect}, billing_address:"\ - " #{@billing_address.inspect}, billing_address_2: #{@billing_address_2.inspect},"\ - " billing_city: #{@billing_city.inspect}, billing_state: #{@billing_state.inspect},"\ - " billing_zip: #{@billing_zip.inspect}, billing_country: #{@billing_country.inspect},"\ - " last_four: #{@last_four.inspect}, card_type: #{@card_type.inspect}, customer_vault_token:"\ + "<#{class_name} chargify_token: #{@chargify_token.inspect}, vault_token:"\ + " #{@vault_token.inspect}, current_vault: #{@current_vault.inspect}, gateway_handle:"\ + " #{@gateway_handle.inspect}, first_name: #{@first_name.inspect}, last_name:"\ + " #{@last_name.inspect}, billing_address: #{@billing_address.inspect}, billing_address_2:"\ + " #{@billing_address_2.inspect}, billing_city: #{@billing_city.inspect}, billing_state:"\ + " #{@billing_state.inspect}, billing_zip: #{@billing_zip.inspect}, billing_country:"\ + " #{@billing_country.inspect}, full_number: #{@full_number.inspect}, expiration_month:"\ + " #{@expiration_month.inspect}, expiration_year: #{@expiration_year.inspect}, last_four:"\ + " #{@last_four.inspect}, card_type: #{@card_type.inspect}, customer_vault_token:"\ " #{@customer_vault_token.inspect}, cvv: #{@cvv.inspect}, payment_type:"\ " #{@payment_type.inspect}, additional_properties: #{get_additional_properties}>" end diff --git a/lib/advanced_billing/models/update_subscription.rb b/lib/advanced_billing/models/update_subscription.rb index cfa09972..81a528fe 100644 --- a/lib/advanced_billing/models/update_subscription.rb +++ b/lib/advanced_billing/models/update_subscription.rb @@ -40,33 +40,80 @@ class UpdateSubscription < BaseModel # @return [Object] attr_accessor :snap_day - # Use for subscriptions with product eligible for calendar billing only. - # Value can be 1-28 or 'end'. + # (Optional) Set this attribute to a future date/time to update a + # subscription in the Awaiting Signup Date state, to Awaiting Signup. In the + # Awaiting Signup state, a subscription behaves like any other. It can be + # canceled, allocated to, or have its billing date changed. etc. When the + # `initial_billing_at` date hits, the subscription will transition to the + # expected state. If the product has a trial, the subscription will enter a + # trial, otherwise it will go active. Setup fees will be respected either + # before or after the trial, as configured on the price point. If the + # payment is due at the initial_billing_at and it fails the subscription + # will be immediately canceled. You can omit the initial_billing_at date to + # activate the subscription immediately. See the [subscription + # import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advance + # d-Billing-Subscription-Imports#date-format) documentation for more + # information about Date/Time formats. + # @return [DateTime] + attr_accessor :initial_billing_at + + # (Optional) Set this attribute to true to move the subscription from + # Awaiting Signup, to Awaiting Signup Date. Use this when you want to update + # a subscription that has an unknown initial billing date. When the first + # billing date is known, update a subscription to set the + # `initial_billing_at` date. The subscription moves to the awaiting signup + # with a scheduled initial billing date. You can omit the initial_billing_at + # date to activate the subscription immediately. See [Subscription + # States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773 + # -Subscription-States) for more information. + # @return [TrueClass | FalseClass] + attr_accessor :defer_signup + + # (Optional) Set this attribute to true to move the subscription from + # Awaiting Signup, to Awaiting Signup Date. Use this when you want to update + # a subscription that has an unknown initial billing date. When the first + # billing date is known, update a subscription to set the + # `initial_billing_at` date. The subscription moves to the awaiting signup + # with a scheduled initial billing date. You can omit the initial_billing_at + # date to activate the subscription immediately. See [Subscription + # States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773 + # -Subscription-States) for more information. # @return [DateTime] attr_accessor :next_billing_at - # Use for subscriptions with product eligible for calendar billing only. - # Value can be 1-28 or 'end'. + # Timestamp giving the expiration date of this subscription (if any). You + # may manually change the expiration date at any point during a subscription + # period. + # @return [DateTime] + attr_accessor :expires_at + + # Timestamp giving the expiration date of this subscription (if any). You + # may manually change the expiration date at any point during a subscription + # period. # @return [String] attr_accessor :payment_collection_method - # Use for subscriptions with product eligible for calendar billing only. - # Value can be 1-28 or 'end'. + # Timestamp giving the expiration date of this subscription (if any). You + # may manually change the expiration date at any point during a subscription + # period. # @return [TrueClass | FalseClass] attr_accessor :receives_invoice_emails - # Use for subscriptions with product eligible for calendar billing only. - # Value can be 1-28 or 'end'. + # Timestamp giving the expiration date of this subscription (if any). You + # may manually change the expiration date at any point during a subscription + # period. # @return [Object] attr_accessor :net_terms - # Use for subscriptions with product eligible for calendar billing only. - # Value can be 1-28 or 'end'. + # Timestamp giving the expiration date of this subscription (if any). You + # may manually change the expiration date at any point during a subscription + # period. # @return [Integer] attr_accessor :stored_credential_transaction_id - # Use for subscriptions with product eligible for calendar billing only. - # Value can be 1-28 or 'end'. + # Timestamp giving the expiration date of this subscription (if any). You + # may manually change the expiration date at any point during a subscription + # period. # @return [String] attr_accessor :reference @@ -108,7 +155,10 @@ def self.names @_hash['next_product_id'] = 'next_product_id' @_hash['next_product_price_point_id'] = 'next_product_price_point_id' @_hash['snap_day'] = 'snap_day' + @_hash['initial_billing_at'] = 'initial_billing_at' + @_hash['defer_signup'] = 'defer_signup' @_hash['next_billing_at'] = 'next_billing_at' + @_hash['expires_at'] = 'expires_at' @_hash['payment_collection_method'] = 'payment_collection_method' @_hash['receives_invoice_emails'] = 'receives_invoice_emails' @_hash['net_terms'] = 'net_terms' @@ -136,7 +186,10 @@ def self.optionals next_product_id next_product_price_point_id snap_day + initial_billing_at + defer_signup next_billing_at + expires_at payment_collection_method receives_invoice_emails net_terms @@ -161,7 +214,8 @@ def self.nullables def initialize(credit_card_attributes: SKIP, product_handle: SKIP, product_id: SKIP, product_change_delayed: SKIP, next_product_id: SKIP, next_product_price_point_id: SKIP, - snap_day: SKIP, next_billing_at: SKIP, + snap_day: SKIP, initial_billing_at: SKIP, + defer_signup: false, next_billing_at: SKIP, expires_at: SKIP, payment_collection_method: SKIP, receives_invoice_emails: SKIP, net_terms: SKIP, stored_credential_transaction_id: SKIP, reference: SKIP, @@ -185,7 +239,10 @@ def initialize(credit_card_attributes: SKIP, product_handle: SKIP, next_product_price_point_id end @snap_day = snap_day unless snap_day == SKIP + @initial_billing_at = initial_billing_at unless initial_billing_at == SKIP + @defer_signup = defer_signup unless defer_signup == SKIP @next_billing_at = next_billing_at unless next_billing_at == SKIP + @expires_at = expires_at unless expires_at == SKIP unless payment_collection_method == SKIP @payment_collection_method = payment_collection_method @@ -233,11 +290,22 @@ def self.from_hash(hash) snap_day = hash.key?('snap_day') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:UpdateSubscriptionSnapDay), hash['snap_day'] ) : SKIP + initial_billing_at = if hash.key?('initial_billing_at') + (DateTimeHelper.from_rfc3339(hash['initial_billing_at']) if hash['initial_billing_at']) + else + SKIP + end + defer_signup = hash['defer_signup'] ||= false next_billing_at = if hash.key?('next_billing_at') (DateTimeHelper.from_rfc3339(hash['next_billing_at']) if hash['next_billing_at']) else SKIP end + expires_at = if hash.key?('expires_at') + (DateTimeHelper.from_rfc3339(hash['expires_at']) if hash['expires_at']) + else + SKIP + end payment_collection_method = hash.key?('payment_collection_method') ? hash['payment_collection_method'] : SKIP receives_invoice_emails = @@ -280,7 +348,10 @@ def self.from_hash(hash) next_product_id: next_product_id, next_product_price_point_id: next_product_price_point_id, snap_day: snap_day, + initial_billing_at: initial_billing_at, + defer_signup: defer_signup, next_billing_at: next_billing_at, + expires_at: expires_at, payment_collection_method: payment_collection_method, receives_invoice_emails: receives_invoice_emails, net_terms: net_terms, @@ -295,10 +366,18 @@ def self.from_hash(hash) additional_properties: additional_properties) end + def to_custom_initial_billing_at + DateTimeHelper.to_rfc3339(initial_billing_at) + end + def to_custom_next_billing_at DateTimeHelper.to_rfc3339(next_billing_at) end + def to_custom_expires_at + DateTimeHelper.to_rfc3339(expires_at) + end + # Validates an instance of the object from a given value. # @param [UpdateSubscription | Hash] The value against the validation is performed. def self.validate(value) @@ -316,9 +395,10 @@ def to_s " #{@product_handle}, product_id: #{@product_id}, product_change_delayed:"\ " #{@product_change_delayed}, next_product_id: #{@next_product_id},"\ " next_product_price_point_id: #{@next_product_price_point_id}, snap_day: #{@snap_day},"\ - " next_billing_at: #{@next_billing_at}, payment_collection_method:"\ - " #{@payment_collection_method}, receives_invoice_emails: #{@receives_invoice_emails},"\ - " net_terms: #{@net_terms}, stored_credential_transaction_id:"\ + " initial_billing_at: #{@initial_billing_at}, defer_signup: #{@defer_signup},"\ + " next_billing_at: #{@next_billing_at}, expires_at: #{@expires_at},"\ + " payment_collection_method: #{@payment_collection_method}, receives_invoice_emails:"\ + " #{@receives_invoice_emails}, net_terms: #{@net_terms}, stored_credential_transaction_id:"\ " #{@stored_credential_transaction_id}, reference: #{@reference}, custom_price:"\ " #{@custom_price}, components: #{@components}, dunning_communication_delay_enabled:"\ " #{@dunning_communication_delay_enabled}, dunning_communication_delay_time_zone:"\ @@ -334,15 +414,16 @@ def inspect " #{@product_handle.inspect}, product_id: #{@product_id.inspect}, product_change_delayed:"\ " #{@product_change_delayed.inspect}, next_product_id: #{@next_product_id.inspect},"\ " next_product_price_point_id: #{@next_product_price_point_id.inspect}, snap_day:"\ - " #{@snap_day.inspect}, next_billing_at: #{@next_billing_at.inspect},"\ - " payment_collection_method: #{@payment_collection_method.inspect}, receives_invoice_emails:"\ - " #{@receives_invoice_emails.inspect}, net_terms: #{@net_terms.inspect},"\ - " stored_credential_transaction_id: #{@stored_credential_transaction_id.inspect}, reference:"\ - " #{@reference.inspect}, custom_price: #{@custom_price.inspect}, components:"\ - " #{@components.inspect}, dunning_communication_delay_enabled:"\ - " #{@dunning_communication_delay_enabled.inspect}, dunning_communication_delay_time_zone:"\ - " #{@dunning_communication_delay_time_zone.inspect}, product_price_point_id:"\ - " #{@product_price_point_id.inspect}, product_price_point_handle:"\ + " #{@snap_day.inspect}, initial_billing_at: #{@initial_billing_at.inspect}, defer_signup:"\ + " #{@defer_signup.inspect}, next_billing_at: #{@next_billing_at.inspect}, expires_at:"\ + " #{@expires_at.inspect}, payment_collection_method: #{@payment_collection_method.inspect},"\ + " receives_invoice_emails: #{@receives_invoice_emails.inspect}, net_terms:"\ + " #{@net_terms.inspect}, stored_credential_transaction_id:"\ + " #{@stored_credential_transaction_id.inspect}, reference: #{@reference.inspect},"\ + " custom_price: #{@custom_price.inspect}, components: #{@components.inspect},"\ + " dunning_communication_delay_enabled: #{@dunning_communication_delay_enabled.inspect},"\ + " dunning_communication_delay_time_zone: #{@dunning_communication_delay_time_zone.inspect},"\ + " product_price_point_id: #{@product_price_point_id.inspect}, product_price_point_handle:"\ " #{@product_price_point_handle.inspect}, additional_properties:"\ " #{get_additional_properties}>" end