diff --git a/.rubocop.yml b/.rubocop.yml index b563c468..7e659c74 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -21,6 +21,10 @@ Metrics/PerceivedComplexity: Layout/EndOfLine: Enabled: false + +Layout/EmptyLines: + Enabled: false + Lint/UnderscorePrefixedVariableName: Enabled: false diff --git a/README.md b/README.md index ce65978b..cee7e1d4 100644 --- a/README.md +++ b/README.md @@ -29,16 +29,16 @@ 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 9.1.0 +gem install maxio-advanced-billing-sdk -v 10.0.0 ``` Or add the gem to your Gemfile and run `bundle`: ```ruby -gem 'maxio-advanced-billing-sdk', '9.1.0' +gem 'maxio-advanced-billing-sdk', '10.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/9.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/10.0.0). ## IRB Console Usage @@ -77,14 +77,14 @@ ruby bin/console ## Initialize the API Client -**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/client.md) +**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.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`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/README.md#environments) | The API environment.
**Default: `Environment.US`** | +| environment | [`Environment`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/README.md#environments) | 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** | @@ -94,8 +94,8 @@ The following parameters are configurable for the API Client: | 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. | -| proxy_settings | [`ProxySettings`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. | -| basic_auth_credentials | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/auth/basic-authentication.md) | The credential object for Basic Authentication | +| proxy_settings | [`ProxySettings`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. | +| basic_auth_credentials | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/auth/basic-authentication.md) | The credential object for Basic Authentication | The API client can be initialized as follows: @@ -125,7 +125,7 @@ include AdvancedBilling client = Client.from_env ``` -See the [`Environment-Based Client Initialization`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/environment-based-client-initialization.md) section for details. +See the [`Environment-Based Client Initialization`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/environment-based-client-initialization.md) section for details. ## Environments @@ -142,58 +142,58 @@ 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/9.1.0/doc/auth/basic-authentication.md) +* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/auth/basic-authentication.md) ## List of APIs -* [API Exports](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/api-exports.md) -* [Advance Invoice](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/advance-invoice.md) -* [Billing Portal](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/billing-portal.md) -* [Component Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/component-price-points.md) -* [Custom Fields](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/custom-fields.md) -* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/events-based-billing-segments.md) -* [Payment Profiles](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/payment-profiles.md) -* [Product Families](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/product-families.md) -* [Product Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/product-price-points.md) -* [Proforma Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/proforma-invoices.md) -* [Reason Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/reason-codes.md) -* [Referral Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/referral-codes.md) -* [Sales Commissions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/sales-commissions.md) -* [Subscription Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-components.md) -* [Subscription Groups](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-groups.md) -* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-group-invoice-account.md) -* [Subscription Group Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-group-status.md) -* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-invoice-account.md) -* [Subscription Notes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-notes.md) -* [Subscription Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-products.md) -* [Subscription Renewals](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-renewals.md) -* [Subscription Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscription-status.md) -* [Coupons](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/coupons.md) -* [Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/components.md) -* [Customers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/customers.md) -* [Events](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/events.md) -* [Insights](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/insights.md) -* [Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/invoices.md) -* [Offers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/offers.md) -* [Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/products.md) -* [Sites](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/sites.md) -* [Subscriptions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/subscriptions.md) -* [Webhooks](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/controllers/webhooks.md) +* [API Exports](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/api-exports.md) +* [Advance Invoice](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/advance-invoice.md) +* [Billing Portal](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/billing-portal.md) +* [Component Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/component-price-points.md) +* [Custom Fields](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/custom-fields.md) +* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/events-based-billing-segments.md) +* [Payment Profiles](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/payment-profiles.md) +* [Product Families](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/product-families.md) +* [Product Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/product-price-points.md) +* [Proforma Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/proforma-invoices.md) +* [Reason Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/reason-codes.md) +* [Referral Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/referral-codes.md) +* [Sales Commissions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/sales-commissions.md) +* [Subscription Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/subscription-components.md) +* [Subscription Groups](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/subscription-groups.md) +* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/subscription-group-invoice-account.md) +* [Subscription Group Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/subscription-group-status.md) +* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/subscription-invoice-account.md) +* [Subscription Notes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/subscription-notes.md) +* [Subscription Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/subscription-products.md) +* [Subscription Renewals](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/subscription-renewals.md) +* [Subscription Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/subscription-status.md) +* [Coupons](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/coupons.md) +* [Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/components.md) +* [Customers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/customers.md) +* [Events](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/events.md) +* [Insights](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/insights.md) +* [Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/invoices.md) +* [Offers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/offers.md) +* [Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/products.md) +* [Sites](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/sites.md) +* [Subscriptions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/subscriptions.md) +* [Webhooks](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/controllers/webhooks.md) ## SDK Infrastructure ### Configuration -* [ProxySettings](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/proxy-settings.md) -* [Environment-Based Client Initialization](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/environment-based-client-initialization.md) +* [ProxySettings](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/proxy-settings.md) +* [Environment-Based Client Initialization](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/environment-based-client-initialization.md) ### HTTP -* [HttpResponse](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/http-response.md) -* [HttpRequest](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/http-request.md) +* [HttpResponse](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/http-response.md) +* [HttpRequest](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/http-request.md) ### Utilities -* [ApiHelper](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/api-helper.md) -* [DateTimeHelper](https://www.github.com/maxio-com/ab-ruby-sdk/tree/9.1.0/doc/date-time-helper.md) +* [ApiHelper](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/api-helper.md) +* [DateTimeHelper](https://www.github.com/maxio-com/ab-ruby-sdk/tree/10.0.0/doc/date-time-helper.md) diff --git a/advanced_billing.gemspec b/advanced_billing.gemspec index 7376f423..f0c50888 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 = '9.1.0' + s.version = '10.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'] diff --git a/doc/controllers/advance-invoice.md b/doc/controllers/advance-invoice.md index 201c7124..d5307fd1 100644 --- a/doc/controllers/advance-invoice.md +++ b/doc/controllers/advance-invoice.md @@ -17,10 +17,13 @@ advance_invoice_controller = client.advance_invoice # Issue Advance Invoice -Generate an invoice in advance for a subscription's next renewal date. [See our docs](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Invoice-In-Advance) for more information on advance invoices, including eligibility for generating one; for the most part, they function like any other invoice, except they are issued early and have special behavior upon being voided. -A subscription may only have one advance invoice per billing period. Attempting to issue an advance invoice when one already exists will return an error. -That said, regeneration of the invoice may be forced with the params `force: true`, which will void an advance invoice if one exists and generate a new one. If no advance invoice exists, a new one will be generated. -We recommend using either the create or preview endpoints for proforma invoices to preview this advance invoice before using this endpoint to generate it. +Issues an invoice in advance for a subscription's next renewal date. For the most part, advance invoices function like any other invoice, except they are issued early and have special behavior upon being voided. For more information on advance invoices, including eligibility for generating one, see [Issue Invoice In Advance](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Invoice-In-Advance). + +A subscription can only have one advance invoice per billing period. Attempting to issue an advance invoice when one already exists returns an error. + +Regeneration of the invoice can be forced with the params `force: true`, which voids an advance invoice if one exists and generates a new one. If no advance invoice exists, a new one is generated. + +Consider using either the create or preview endpoints for proforma invoices to preview this advance invoice before using this endpoint to generate it. ```ruby def issue_advance_invoice(subscription_id, @@ -110,8 +113,11 @@ puts result # Void Advance Invoice -Void a subscription's existing advance invoice. Once voided, it can later be regenerated if desired. -A `reason` is required in order to void, and the invoice must have an open status. Voiding will cause any prepayments and credits that were applied to the invoice to be returned to the subscription. For a full overview of the impact of voiding, [see our help docs](../../doc/models/invoice.md). +Voids a subscription's existing advance invoice. Once voided, it can later be regenerated if desired. + +A `reason` is required to void, and the invoice must have an open status. Voiding causes any prepayments and credits that were applied to the invoice to be returned to the subscription. + +For a full overview of the impact of voiding, see [Invoice](../../doc/models/invoice.md). ```ruby def void_advance_invoice(subscription_id, diff --git a/doc/controllers/api-exports.md b/doc/controllers/api-exports.md index 26f89c80..e7dafbb1 100644 --- a/doc/controllers/api-exports.md +++ b/doc/controllers/api-exports.md @@ -167,9 +167,7 @@ puts result # Export Proforma Invoices -Creates a proforma invoices export and returns a batch job object. - -It is only available for Relationship Invoicing architecture. +Creates a proforma invoices export and returns a batch job object. Proforma invoices are only available on Relationship Invoicing sites. ```ruby def export_proforma_invoices @@ -267,7 +265,7 @@ puts result # Read Proforma Invoices Export -Returns a batch job object for a proforma invoices export. +Returns a batch job object for a proforma invoices export. Proforma invoices are only available on Relationship Invoicing sites. ```ruby def read_proforma_invoices_export(batch_id) diff --git a/doc/controllers/billing-portal.md b/doc/controllers/billing-portal.md index 8d9c8e87..2483e6f4 100644 --- a/doc/controllers/billing-portal.md +++ b/doc/controllers/billing-portal.md @@ -20,21 +20,15 @@ billing_portal_controller = client.billing_portal Enables Billing Portal access for a customer, with an option to send an invitation email at the same time. -## Billing Portal Documentation - -Full documentation on how the Billing Portal operates within the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24252412965133-Billing-Portal-Overview). - -This documentation is focused on how to configure the Billing Portal Settings, as well as Subscriber Interaction and Merchant Management of the Billing Portal. - -You can use this endpoint to enable Billing Portal access for a Customer, with the option of sending the Customer an Invitation email at the same time. - ## Billing Portal Security -If your customer has been invited to the Billing Portal, then they will receive a link to manage their subscription (the “Management URL”) automatically at the bottom of their statements, invoices, and receipts. **This link changes periodically for security and is only valid for 65 days.** +If your customer has been invited to the Billing Portal, they receive a link to manage their subscription (the “Management URL”) automatically at the bottom of their statements, invoices, and receipts. **This link changes periodically for security and is only valid for 65 days.** + +If you need to provide your customer their Management URL through other means, you can retrieve it [via the API](../../doc/controllers/billing-portal.md#read-billing-portal-link). Because the URL is cryptographically signed with a timestamp, merchants cannot generate the URL without requesting it through the API. -If you need to provide your customer their Management URL through other means, you can retrieve it via the API. Because the URL is cryptographically signed with a timestamp, it is not possible for merchants to generate the URL without requesting it from Advanced Billing. +To prevent abuse and overuse, request a new URL only when absolutely necessary. Management URLs are good for 65 days, so you should re-use a previously generated one as much as possible. If you use the URL frequently (such as to display on your website), **do not** make an API request every time. -In order to prevent abuse & overuse, we ask that you request a new URL only when absolutely necessary. Management URLs are good for 65 days, so you should re-use a previously generated one as much as possible. If you use the URL frequently (such as to display on your website), **do not** make an API request to Advanced Billing every time. +For more information configuring the Billing Portal, see [Billing Portal Overview](https://maxio.zendesk.com/hc/en-us/articles/24252412965133-Billing-Portal-Overview). ```ruby def enable_billing_portal_for_customer(customer_id, @@ -78,13 +72,13 @@ puts result Returns the exact URL required for a subscriber to access the Billing Portal. -## Rules for Management Link API +## Management Link Request Rules -+ When retrieving a management URL, multiple requests for the same customer in a short period will return the **same** URL -+ We will not generate a new URL for 15 days ++ When retrieving a management URL, multiple requests for the same customer in a short period return the **same** URL ++ A new URL is not generated for 15 days + You must cache and remember this URL if you are going to need it again within 15 days + Only request a new URL after the `new_link_available_at` date -+ You are limited to 15 requests for the same URL. If you make more than 15 requests before `new_link_available_at`, you will be blocked from further Management URL requests (with a response code `429`) ++ You are limited to 15 requests for the same URL. If you make more than 15 requests before `new_link_available_at`, you are blocked from further Management URL requests (with a response code `429`). ```ruby def read_billing_portal_link(customer_id) diff --git a/doc/controllers/component-price-points.md b/doc/controllers/component-price-points.md index 5c90b468..00ca6aa2 100644 --- a/doc/controllers/component-price-points.md +++ b/doc/controllers/component-price-points.md @@ -174,8 +174,6 @@ Lists the price points associated with a component. You may specify the component by using either the numeric id or the `handle:gold` syntax. -When fetching a component'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 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. ```ruby @@ -191,7 +189,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `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 | +| `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` | | `filter_type` | [`Array[PricePointType]`](../../doc/models/price-point-type.md) | Query, Optional | Use in query: `filter[type]=catalog,default`. | @@ -632,7 +630,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `component_id` | Integer \| String | Template, Required | This is a container for one-of cases. | | `price_point_id` | Integer \| String | Template, Required | This is a container for one-of cases. | -| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | Include an array of currency price data | +| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | Include an array of currency price data. | ## Response Type diff --git a/doc/controllers/components.md b/doc/controllers/components.md index 8cd13e44..180558b2 100644 --- a/doc/controllers/components.md +++ b/doc/controllers/components.md @@ -32,8 +32,14 @@ Metered components are used to bill for any type of unit that resets to 0 at the Note that this is different from recurring quantity-based components, which DO NOT reset to zero at the start of every billing period. If you want to bill for a quantity of something that does not change unless you change it, then you want quantity components, instead. +#### Hybrid Pricing + +A `volume`, `tiered`, or `stairstep` metered component can combine its primary pricing with a secondary pricing model (the `overage_pricing` parameter) so both bill as a single invoice line item instead of two. This does not apply to metered components configured for event-based billing (metric, meter, or formula). See [Hybrid Pricing](page:introduction/basic-concepts/hybrid-pricing) for requirements and configuration details. + For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. + ```ruby def create_metered_component(product_family_id, body: nil) @@ -145,7 +151,7 @@ puts result Creates a Quantity Based component definition under the specified product family. A Quantity Based component can then be added and “allocated” for a subscription. -When defining a Quantity Based component, you can choose one of 2 types: +When defining a Quantity Based component, you can choose one of two types: #### Recurring @@ -157,8 +163,16 @@ One-time quantity-based components are used to create ad hoc usage charges that The allocated quantity for one-time quantity-based components immediately gets reset back to zero after the allocation is made. +For more information, see [Components Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). + +#### Hybrid Pricing + +A `volume`, `tiered`, or `stairstep` component can combine its primary pricing with a secondary pricing model (the `overage_pricing` parameter) so both bill as a single invoice line item instead of two. See [Hybrid Pricing](page:introduction/basic-concepts/hybrid-pricing) for requirements and configuration details. + For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. + ```ruby def create_quantity_based_component(product_family_id, body: nil) @@ -275,6 +289,8 @@ On/off components are used for any flat fee, recurring add on (think $99/month f For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. + ```ruby def create_on_off_component(product_family_id, body: nil) @@ -372,9 +388,11 @@ puts result Creates a prepaid usage component definition under the specified product family. A prepaid component can then be added and “allocated” for a subscription. -Prepaid components allow customers to pre-purchase units that can be used up over time on their subscription. In a sense, they are the mirror image of metered components; while metered components charge at the end of the period for the amount of units used, prepaid components are charged for at the time of purchase, and we subsequently keep track of the usage against the amount purchased. +Prepaid components allow customers to pre-purchase units that can be used up over time on their subscription. In a sense, they are the mirror image of metered components; while metered components charge at the end of the period for the amount of units used, prepaid components are charged for at the time of purchase, and usage is subsequently tracked against the amount purchased. -For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +For more information, see [Components Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). + +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`; sending a blank value results in a validation error. ```ruby def create_prepaid_usage_component(product_family_id, @@ -515,7 +533,9 @@ Event-based components are similar to other component types, in that you define So, instead of reporting usage directly for each component (as you would with metered components), the usage is derived from analysis of your events. -For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +For more information, see [Components Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). + +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`; sending a blank value results in a validation error. ```ruby def create_event_based_component(product_family_id, @@ -760,6 +780,8 @@ Updates a component from a specific product family. You may read the component by either the component's id or handle. When using the handle, it must be prefixed with `handle:`. +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. + ```ruby def update_product_family_component(product_family_id, component_id, @@ -935,8 +957,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `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. | | `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. | | `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 | +| `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. | +| `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` | | `filter` | [`ListComponentsFilter`](../../doc/models/list-components-filter.md) | Query, Optional | Filter to use for List Components operations | @@ -1073,6 +1095,8 @@ Updates a component. You may read the component by either the component's id or handle. When using the handle, it must be prefixed with `handle:`. +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. + ```ruby def update_component(component_id, body: nil) @@ -1173,7 +1197,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `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. | -| `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. | +| `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. | | `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. | | `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. | diff --git a/doc/controllers/coupons.md b/doc/controllers/coupons.md index 769e65f1..09c16fd0 100644 --- a/doc/controllers/coupons.md +++ b/doc/controllers/coupons.md @@ -30,11 +30,7 @@ coupons_controller = client.coupons Creates a coupon under the specified product family. -You can create either a flat amount coupon by specifying amount_in_cents, or a percentage coupon by specifying percentage -You can restrict a coupon to only apply to specific products / components by optionally passing in `restricted_products` and/or `restricted_components` objects in the format: -`{ "": boolean_value }` - -Coupons can be administered in the Advanced Billing application or created via API. See [creating coupons](https://maxio.zendesk.com/hc/en-us/articles/24261212433165-Creating-Editing-Deleting-Coupons) for more information. +You can create either a flat amount coupon, by specifying `amount_in_cents`, or percentage coupon by specifying `percentage`. See [Apply Coupons to Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions) for information on applying a coupon to a subscription in the Advanced Billing UI. @@ -123,7 +119,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `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`. | +| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | (Optional) If you have defined multiple currencies at the site level, you can pass `?currency_prices=true` to include an array of currency price data in the response. Use in query `currency_prices=true`. | ## Response Type @@ -254,9 +250,9 @@ puts result # Find Coupon -Searches for a coupon by code, returning a 404 if no coupon is found. By passing a code parameter, the find will attempt to locate a coupon that matches that code. +Searches for a coupon by code. -If you have more than one product family and if the coupon you are trying to find does not belong to the default product family in your site, then you will need to specify (either in the url or as a query string param) the product family id. +If you have more than one product family and if the coupon you are trying to find does not belong to the default product family in your site, you need to specify (either in the URL or as a query string param) the `product_family_id`. ```ruby def find_coupon(product_family_id: nil, @@ -274,7 +270,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `product_family_id` | `Integer` | Query, Optional | The Advanced Billing id of the product family to which the coupon belongs | | `code` | `String` | Query, Optional | The code of the coupon | -| `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. | +| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | (Optional) If you have defined multiple currencies at the site level, you can pass `?currency_prices=true` to include an array of currency price data in the response. | ## Response Type @@ -294,12 +290,11 @@ puts result # Read Coupon -Returns a coupon by its Advanced Billing-assigned ID. You must identify the Coupon in this call by the ID parameter that Advanced Billing assigns. -If instead you would like to find a Coupon using a Coupon code, see the Coupon Find method. +Returns a coupon by its system-assigned ID. You must identify the Coupon in this call by the ID parameter assigned to it. -When fetching a coupon, 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 instead you would like to find a Coupon using a Coupon code, use the [Find Coupon](../../doc/controllers/coupons.md#find-coupon) endpoint. -If the coupon 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. +If the coupon is set to `use_site_exchange_rate: true`, it returns pricing based on the current exchange rate. If the flag is set to false, it returns all of the defined prices for each currency. ```ruby def read_coupon(product_family_id, @@ -317,7 +312,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `product_family_id` | `Integer` | Template, Required | The Advanced Billing id of the product family to which the coupon belongs | | `coupon_id` | `Integer` | Template, Required | The Advanced Billing id of the coupon | -| `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. | +| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | (Optional) If you have defined multiple currencies at the site level, you can pass `?currency_prices=true` to include an array of currency price data in the response. | ## Response Type @@ -567,7 +562,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `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`. | +| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | (Optional) If you have defined multiple currencies at the site level, you can pass `?currency_prices=true` to include an array of currency price data in the response. Use in query `currency_prices=true`. | ## Response Type @@ -729,23 +724,17 @@ puts result # Validate Coupon -Verifies whether a specific coupon code is valid. This method is useful for validating coupon codes that are entered by a customer. If the coupon is found and is valid, the coupon will be returned with a 200 status code. - -If the coupon is invalid, the status code will be 404 and the response will say why it is invalid. If the coupon is valid, the status code will be 200 and the coupon will be returned. The following reasons for invalidity are supported: - -+ Coupon not found -+ Coupon is invalid -+ Coupon expired +Verifies whether a specific coupon code is valid. This method is useful for validating coupon codes that are entered by a customer. -If you have more than one product family and if the coupon you are validating does not belong to the first product family in your site, then you will need to specify the product family, either in the url or as a query string param. This can be done by supplying the id or the handle in the `handle:my-family` format. +If you have more than one product family and if the coupon you are validating does not belong to the first product family in your site, you need to specify the product family, either in the URL or as a query string param. This can be done by supplying the id or the handle in the `handle:my-family` format. -Eg. +Supplying the `product_family_handle` in the URL: ``` https://.chargify.com/product_families/handle:/coupons/validate.?code= ``` -Or: +Supplying the `product_family_id` as a query parameter: ``` https://.chargify.com/coupons/validate.?code=&product_family_id= @@ -882,8 +871,6 @@ puts result Creates subcodes for an existing coupon. -## Coupon Subcodes Intro - Coupon Subcodes allow you to create a set of unique codes that allow you to expand the use of one coupon. For example: @@ -898,21 +885,9 @@ Coupon Subcodes: + DP80302 + SPRINGBALTIMORE -Coupon subcodes can be administered in the Admin Interface or via the API. - -When creating a coupon subcode, you must specify a coupon to attach it to using the coupon_id. Valid coupon subcodes are all capital letters, contain only letters and numbers, and do not have any spaces. Lowercase letters will be capitalized before the subcode is created. - -## Coupon Subcodes Documentation +When creating a coupon subcode, you must specify a coupon to attach it to using the coupon_id. Valid coupon subcodes are all capital letters, contain only letters and numbers, and do not have any spaces. Lowercase letters are capitalized before the subcode is created. -Full documentation on how to create coupon subcodes in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24261208729229-Coupon-Codes). - -Additionally, for documentation on how to apply a coupon to a Subscription within the Advanced Billing UI, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions). - -## Create Coupon Subcode - -This request allows you to create specific subcodes underneath an existing coupon code. - -*Note*: If you are using any of the allowed special characters ("%", "@", "+", "-", "_", and "."), you must encode them for use in the URL. +Note: If you are using any of the allowed special characters ("%", "@", "+", "-", "_", and "."), you must encode them for use in the URL. % to %25 @ to %40 @@ -921,7 +896,9 @@ This request allows you to create specific subcodes underneath an existing coupo _ to %5F . to %2E -So, if the coupon subcode is `20%OFF`, the URL to delete this coupon subcode would be: `https://.chargify.com/coupons/567/codes/20%25OFF.` +So, if the coupon subcode is `20%OFF`, the URL to delete this coupon subcode would be: `https://.chargify.com/coupons/567/codes/20%25OFF.`. + +For more information on coupon codes and applying coupons to subscriptions, see [Coupon Codes](https://maxio.zendesk.com/hc/en-us/articles/24261208729229-Coupon-Codes) and [Coupons and Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions). ```ruby def create_coupon_subcodes(coupon_id, @@ -1129,7 +1106,7 @@ Note: If you are using any of the allowed special characters (“%”, “@”, ## Percent Encoding Example -Or if the coupon subcode is 20%OFF, the URL to delete this coupon subcode would be: @https://.chargify.com/coupons/567/codes/20%25OFF. +Or if the coupon subcode is 20%OFF, the URL to delete this coupon subcode would be: @https://.chargify.com/coupons/567/codes/20%25OFF.. ```ruby def delete_coupon_subcode(coupon_id, diff --git a/doc/controllers/customers.md b/doc/controllers/customers.md index dff9ad53..02563a9f 100644 --- a/doc/controllers/customers.md +++ b/doc/controllers/customers.md @@ -21,30 +21,29 @@ customers_controller = client.customers # Create Customer -Creates a new customer; can also be created alongside a new subscription. The only validation restriction is that you may only create one customer for a given reference value. +Creates a new customer; can also be created alongside a new subscription. The only validation restriction is that you can only create one customer for a given reference value. -If provided, the `reference` value must be unique. It represents a unique identifier for the customer from your own app, i.e. the customer’s ID. This allows you to retrieve a given customer via a piece of shared information. Alternatively, you may choose to leave `reference` blank, and store Advanced Billing’s unique ID for the customer, which is in the `id` attribute. +If provided, the `reference` value must be unique. It represents a unique identifier for the customer from your own app, i.e. the customer’s ID. This allows you to retrieve a given customer via a piece of shared information. Alternatively, you can choose to leave `reference` blank, and store the system-assigned unique ID for the customer, which is in the `id` attribute. -Full documentation on how to locate, create and edit Customers in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24252190590093-Customer-Details). +For more information, see [Customer Details](https://maxio.zendesk.com/hc/en-us/articles/24252190590093-Customer-Details). ## Required Country Format -Advanced Billing requires that you use the ISO Standard Country codes when formatting country attribute of the customer. +Format the country attribute of the customer using the ISO Standard Country codes. -Countries should be formatted as 2 characters. For more information, see the following wikipedia article on [ISO_3166-1.](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) +Countries should be formatted as two characters. For more information, see [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes). ## Required State Format -Advanced Billing requires that you use the ISO Standard State codes when formatting state attribute of the customer. +Format the state attribute of the customer using the ISO Standard State codes. -+ US States (2 characters): [ISO_3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US) ++ US States (two characters): see [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US). -+ States Outside the US (2-3 characters): To find the correct state codes outside of the US, go to [ISO_3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) and click on the link in the “ISO 3166-2 codes” column next to country you wish to populate. ++ States Outside the US (two to three characters): To find the correct state codes outside the US, go to [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) and click on the link in the “ISO 3166-2 codes” column next to the country you wish to populate. ## Locale -Advanced Billing allows you to attribute a language/region to your customer to deliver invoices in any required language. -For more: [Customer Locale](https://maxio.zendesk.com/hc/en-us/articles/24286672013709-Customer-Locale) +You can attribute a language/region to the customer to deliver invoices in any required language. For more information, see [Customer Locale](https://maxio.zendesk.com/hc/en-us/articles/24286672013709-Customer-Locale). ```ruby def create_customer(body: nil) @@ -120,6 +119,7 @@ puts result "portal_invite_last_sent_at": null, "portal_invite_last_accepted_at": null, "tax_exempt": false, + "surcharging": false, "vat_number": null, "parent_id": null, "locale": "en-US" @@ -219,7 +219,8 @@ puts result "portal_customer_created_at": "2016-10-04T15:22:29-04:00", "portal_invite_last_sent_at": "2016-10-04T15:22:30-04:00", "portal_invite_last_accepted_at": null, - "tax_exempt": false + "tax_exempt": false, + "surcharging": false } }, { @@ -245,6 +246,7 @@ puts result "portal_invite_last_sent_at": "2016-10-13T16:52:54-04:00", "portal_invite_last_accepted_at": null, "tax_exempt": false, + "surcharging": true, "parent_id": 123 } }, @@ -271,6 +273,7 @@ puts result "portal_invite_last_sent_at": "2016-10-19T10:49:19-04:00", "portal_invite_last_accepted_at": null, "tax_exempt": false, + "surcharging": false, "parent_id": null } } @@ -339,6 +342,7 @@ puts result "portal_invite_last_sent_at": null, "portal_invite_last_accepted_at": null, "tax_exempt": false, + "surcharging": false, "vat_number": null, "parent_id": null, "locale": "es-MX", @@ -421,6 +425,7 @@ puts result "portal_invite_last_sent_at": null, "portal_invite_last_accepted_at": null, "tax_exempt": false, + "surcharging": false, "vat_number": "012345678" } } @@ -505,6 +510,8 @@ puts result Lists all subscriptions that belong to a customer. +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, subscriptions no longer require an associated product. For subscriptions without an associated product, 'product', 'product_price_point_id', and 'product_price_point_type' are returned as 'null'. + ```ruby def list_customer_subscriptions(customer_id) ``` diff --git a/doc/controllers/events-based-billing-segments.md b/doc/controllers/events-based-billing-segments.md index e6a8752f..98fef5e2 100644 --- a/doc/controllers/events-based-billing-segments.md +++ b/doc/controllers/events-based-billing-segments.md @@ -149,9 +149,9 @@ puts result # Update Segment -Updates a single segment for a component with a segmented metric. It allows you to update the pricing for the segment. +Updates a single segment for a component with a segmented metric. You can also update the pricing for the segment. -You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. +You can specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. ```ruby def update_segment(component_id, diff --git a/doc/controllers/events.md b/doc/controllers/events.md index 1dead8c2..1dc6259d 100644 --- a/doc/controllers/events.md +++ b/doc/controllers/events.md @@ -19,15 +19,11 @@ events_controller = client.events Lists events for a site. -## Events Intro +Events include various activity that happens around a Site. This information is **especially** useful to track down issues that arise when subscriptions are not created due to errors. -Advanced Billing Events include various activity that happens around a Site. This information is **especially** useful to track down issues that arise when subscriptions are not created due to errors. +Within the UI, Events are referred to as Site Activity. For more information, see [Site Activity](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Activity). -Within the Advanced Billing UI, "Events" are referred to as "Site Activity". Full documentation on how to view Events / Site Activity in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Activity). - -## List Events for a Site - -This method will retrieve a list of events for a site. Use query string filters to narrow down results. You may use the `key` filter as part of your query string to narrow down results. +Use query string filters to narrow down results. You can use the `filter` parameter to filter by event key. ### Legacy Filters @@ -42,7 +38,7 @@ The following keys are no longer supported. ## Event Key -The event type is identified by the key property. You can check supported keys [here](../../doc/models/event-key.md). +The event type is identified by the key property. See [Event Key](../../doc/models/event-key.md) for a complete list of supported keys. ## Event Specific Data @@ -59,7 +55,7 @@ Here’s an example event for the `subscription_product_change` event: "event": { "id": 351, "key": "subscription_product_change", - "message": "Product changed on Marky Mark's subscription from 'Basic' to 'Pro'", + "message": "Product changed on Mark Alan's subscription from 'Basic' to 'Pro'", "subscription_id": 205, "event_specific_data": { "new_product_id": 3, @@ -77,7 +73,7 @@ Here’s an example event for the `subscription_state_change` event: "event": { "id": 353, "key": "subscription_state_change", - "message": "State changed on Marky Mark's subscription to Pro from trialing to active", + "message": "State changed on Mark Alan's subscription to Pro from trialing to active", "subscription_id": 205, "event_specific_data": { "new_subscription_state": "active", @@ -88,6 +84,22 @@ Here’s an example event for the `subscription_state_change` event: } ``` +## Enhanced Catalog Experience + +If you’re using the [enhanced Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology), you’ll see updated naming in webhook events and messages. + +Event name changes: + +- subscription_product_change → subscription_plan_change +- component_allocation_change → allocation_change +- component_billing_date_change → product_billing_date_change + +Message updates: + +- “Plan changed on Subscription from previous plan to new plan” +- “Successful payment for allocation changes to Product on Subscription” +- “Failed payment for allocation changes to Product on Subscription” + ```ruby def list_events(options = {}) ``` @@ -102,8 +114,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `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 | +| `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` | | `filter` | [`Array[EventKey]`](../../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. | @@ -205,7 +217,7 @@ Lists events for a subscription. ## Event Key -The event type is identified by the key property. You can check supported keys [here](../../doc/models/event-key.md). +The event type is identified by the key property. See [Event Key](../../doc/models/event-key.md) for a complete list of supported keys. ## Event Specific Data @@ -213,6 +225,22 @@ Different event types may include additional data in `event_specific_data` prope While some events share the same schema for `event_specific_data`, others may not include it at all. For precise mappings from key to event_specific_data, refer to [Event](../../doc/models/event.md). +## Enhanced Catalog Experience + +If you’re using the [enhanced Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology), you’ll see updated naming in webhook events and messages. + +Event name changes: + +- subscription_product_change → subscription_plan_change +- component_allocation_change → allocation_change +- component_billing_date_change → product_billing_date_change + +Message updates: + +- “Successful payment for allocation changes to Product on Subscription” +- “Failed payment for allocation changes to Product on Subscription” +- “Plan changed on Subscription from previous plan to new plan” + ```ruby def list_subscription_events(options = {}) ``` @@ -228,8 +256,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `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` | -| `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 | +| `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` | | `filter` | [`Array[EventKey]`](../../doc/models/event-key.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | @@ -305,6 +333,20 @@ puts result Returns the total count of events for a given site. +If you’re using the [enhanced Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology), you’ll see updated naming in webhook events and messages. + +Event name changes: + +- subscription_product_change → subscription_plan_change +- component_allocation_change → allocation_change +- component_billing_date_change → product_billing_date_change + +Message updates: + +- “Successful payment for allocation changes to Product on Subscription” +- “Failed payment for allocation changes to Product on Subscription” +- “Plan changed on Subscription from previous plan to new plan” + ```ruby def read_events_count(options = {}) ``` @@ -319,8 +361,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `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 | +| `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` | | `filter` | [`Array[EventKey]`](../../doc/models/event-key.md) | Query, Optional | You can pass multiple event keys after comma.
Use in query `filter=signup_success,payment_success`. | diff --git a/doc/controllers/insights.md b/doc/controllers/insights.md index 30f32cad..2c5a16dc 100644 --- a/doc/controllers/insights.md +++ b/doc/controllers/insights.md @@ -88,8 +88,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `at_time` | `DateTime` | Query, Optional | submit a timestamp in ISO8601 format to request MRR for a historic time | -| `subscription_id` | `Integer` | Query, Optional | submit the id of a subscription in order to limit results | +| `at_time` | `DateTime` | Query, Optional | submit a timestamp in ISO8601 format to request MRR for a historic time. | +| `subscription_id` | `Integer` | Query, Optional | submit the id of a subscription in order to limit results. | ## Response Type @@ -166,7 +166,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `Integer` | Query, Optional | optionally filter results by subscription | +| `subscription_id` | `Integer` | Query, Optional | (Optional) 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` | | `direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | @@ -246,7 +246,7 @@ puts result **This endpoint is deprecated.** -This endpoint returns your site's current MRR, including plan and usage breakouts split per subscription. +Lists your site's current MRR, including plan and usage breakouts split per subscription. ```ruby def list_mrr_per_subscription(options = {}) diff --git a/doc/controllers/invoices.md b/doc/controllers/invoices.md index d2f76a20..44350a28 100644 --- a/doc/controllers/invoices.md +++ b/doc/controllers/invoices.md @@ -23,6 +23,8 @@ invoices_controller = client.invoices * [Void Invoice](../../doc/controllers/invoices.md#void-invoice) * [List Consolidated Invoice Segments](../../doc/controllers/invoices.md#list-consolidated-invoice-segments) * [Create Invoice](../../doc/controllers/invoices.md#create-invoice) +* [Update Invoice](../../doc/controllers/invoices.md#update-invoice) +* [Delete Invoice](../../doc/controllers/invoices.md#delete-invoice) * [Send Invoice](../../doc/controllers/invoices.md#send-invoice) * [Preview Customer Information Changes](../../doc/controllers/invoices.md#preview-customer-information-changes) * [Update Customer Information](../../doc/controllers/invoices.md#update-customer-information) @@ -31,7 +33,7 @@ invoices_controller = client.invoices # Refund Invoice -Refund an invoice, segment, or consolidated invoice. +Refunds an invoice, segment, or consolidated invoice. ## Partial Refund for Consolidated Invoice @@ -93,7 +95,7 @@ puts result # List Invoices -By default, invoices returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, `custom_fields`, or `refunds`. To include breakdowns, pass the specific field as a key in the query with a value set to `true`. +Lists invoices for a site. By default, invoices returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, `custom_fields`, or `refunds`. To include breakdowns, pass the specific field as a key in the query with a value set to `true`. ```ruby def list_invoices(options = {}) @@ -116,13 +118,13 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `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` | +| `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. | @@ -448,7 +450,7 @@ puts result # Read Invoice -Use this endpoint to retrieve the details for an invoice. +Returns the details for an invoice. ## PDF Invoice retrieval @@ -605,7 +607,7 @@ puts result # List Invoice Events -This endpoint returns a list of invoice events. Each event contains event "data" (such as an applied payment) as well as a snapshot of the `invoice` at the time of event completion. +Lists invoice events for a site. Each event contains event "data" (such as an applied payment) as well as a snapshot of the `invoice` at the time of event completion. Exposed event types are: @@ -1058,7 +1060,7 @@ puts result # Record Payment for Invoice -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. +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 [Record Payment for Multiple Invoices](../../doc/controllers/invoices.md#record-payment-for-multiple-invoices) endpoint. ```ruby def record_payment_for_invoice(uid, @@ -1112,31 +1114,10 @@ puts result # Record Payment for Multiple Invoices -This API call should be used when you want to record an external payment against multiple invoices. +Records an external payment against multiple invoices. To apply a payment to multiple invoices, at minimum, specify the `amount` and `applications` (i.e., `invoice_uid` and `amount`) details. -``` -{ - "payment": { - "memo": "to pay the bills", - "details": "check number 8675309", - "method": "check", - "amount": "250.00", - "applications": [ - { - "invoice_uid": "inv_8gk5bwkct3gqt", - "amount": "100.00" - }, - { - "invoice_uid": "inv_7bc6bwkct3lyt", - "amount": "150.00" - } - ] - } -} -``` - Note that the invoice payment amounts must be greater than 0. Total amount must be greater or equal to invoices payment amount sum. ```ruby @@ -1218,7 +1199,7 @@ puts result # List Credit Notes -Credit Notes are like inverse invoices. They reduce the amount a customer owes. +Lists credit notes for a site. Credit Notes are like inverse invoices. They reduce the amount a customer owes. By default, the credit notes returned by this endpoint will exclude the arrays of `line_items`, `discounts`, `taxes`, `applications`, or `refunds`. To include these arrays, pass the specific field as a key in the query with a value set to `true`. @@ -1237,11 +1218,11 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `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` | +| `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 @@ -1576,7 +1557,7 @@ puts result # Read Credit Note -Use this endpoint to retrieve the details for a credit note. +Returns the details for a credit note. ```ruby def read_credit_note(uid) @@ -1925,7 +1906,7 @@ puts result # Record Payment for Subscription -Record an external payment made against a subscription that will pay partially or in full one or more invoices. +Records an external payment made against a subscription that will pay partially or in full one or more invoices. Payment will be applied starting with the oldest open invoice and then next oldest, and so on until the amount of the payment is fully consumed. @@ -2007,7 +1988,7 @@ puts result # Reopen Invoice -This endpoint allows you to reopen any invoice with the "canceled" status. Invoices enter "canceled" status if they were open at the time the subscription was canceled (whether through dunning or an intentional cancellation). +Reopens any invoice with the "canceled" status. Invoices enter "canceled" status if they were open at the time the subscription was canceled (whether through dunning or an intentional cancellation). Invoices with "canceled" status are no longer considered to be due. Once reopened, they are considered due for payment. Payment may then be captured in one of the following ways: @@ -2059,7 +2040,7 @@ puts result # Void Invoice -This endpoint allows you to void any invoice with the "open" or "canceled" status. It will also allow voiding of an invoice with the "pending" status if it is not a consolidated invoice. +Voids any invoice with the "open" or "canceled" status. It will also allow voiding of an invoice with the "pending" status if it is not a consolidated invoice. ```ruby def void_invoice(uid, @@ -2111,7 +2092,7 @@ puts result # List Consolidated Invoice Segments -Invoice segments returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, or `custom_fields`. +Lists segments for a consolidated invoice. Invoice segments returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, or `custom_fields`. ```ruby def list_consolidated_invoice_segments(options = {}) @@ -2426,7 +2407,7 @@ puts result # Create Invoice -This endpoint will allow you to create an ad hoc invoice. +Creates an ad hoc invoice. ### Basic Behavior @@ -2785,9 +2766,158 @@ puts result | 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | +# Update Invoice + +Updates an ad hoc invoice while it is in the `draft` state. + +**Important: only invoices with the `adhoc` role and `draft` status can be updated.** Any other invoice — issued, or with a different role (e.g. `renewal`, `signup`) — cannot be updated through this endpoint and the request returns a `422` error. If the invoice does not belong to the provided subscription, a `404` error is returned. + +Only the attributes submitted in the request are changed — omitted attributes keep their current values. + +### Line Items + +The `line_items` array describes changes to the invoice's line items. Line items not referenced in the array remain unchanged. + +#### Adding a line item + +A line item without a `uid` is added to the invoice. The same line item types and options as on invoice creation are supported (custom items, `product_id`, `component_id`, price points, period date ranges, taxes). + +#### Updating a line item + +A line item with the `uid` of an existing line item updates that line item with the submitted attributes. Amounts and taxes are recalculated. + +#### Removing a line item + +A line item with a `uid` and `"_destroy": true` is removed from the invoice. Other line items remain unchanged. + +Referencing a `uid` which does not exist on the invoice returns a `422` error. + +### Coupons + +When the `coupons` key is present, the submitted coupons replace all discounts currently applied to the invoice. Send an empty array to remove all discounts. Coupon options are the same as on invoice creation. + +### Invoice Options + +#### Issue Date and Net Terms + +The `issue_date` parameter can be sent to change the invoice's issue date. Only today or dates in the past are accepted. The date is interpreted and validated in your site's time zone, using the `YYYY-MM-DD` format. The `net_terms` parameter indicates the number of days after the issue date on which the invoice is due. The due date is recalculated whenever the issue date or net terms change. + +#### Addresses + +The seller, shipping and billing addresses can be sent to replace the addresses on the invoice. Each address requires to send a `first_name` at a minimum in order to work. Taxes are recalculated after an address change. + +#### Memo and Payment Instructions + +A custom memo can be sent with the `memo` parameter. Likewise, custom payment instructions can be sent with the `payment_instructions` parameter. + +```ruby +def update_invoice(subscription_id, + uid, + body: nil) +``` + +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscription_id` | `Integer` | Template, Required | The Chargify id of the subscription. | +| `uid` | `String` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | +| `body` | [`UpdateInvoiceRequest`](../../doc/models/update-invoice-request.md) | Body, Optional | Request payload for updating a draft ad hoc invoice. | + +## Response Type + +**200**: OK + +[`InvoiceResponse`](../../doc/models/invoice-response.md) + +## Example Usage + +```ruby +subscription_id = 222 + +uid = 'uid0' + +body = UpdateInvoiceRequest.new( + invoice: UpdateInvoice.new( + net_terms: 30, + memo: 'Updated memo' + ) +) + +result = invoices_controller.update_invoice( + subscription_id, + uid, + body: body +) +puts result +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseException`](../../doc/models/error-array-map-response-exception.md) | + + +# Delete Invoice + +Deletes an ad hoc invoice while it is in the `draft` state. + +**Important: only invoices with the `adhoc` role and `draft` status can be deleted.** Any other invoice — issued, or with a different role (e.g. `renewal`, `signup`) — cannot be deleted through this endpoint and the request returns a `422` error. Issued invoices should be voided instead. If the invoice does not belong to the provided subscription, a `404` error is returned. + +A successful deletion returns a `204 No Content` response and the invoice is permanently removed. + +```ruby +def delete_invoice(subscription_id, + uid) +``` + +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscription_id` | `Integer` | Template, Required | The Chargify id of the subscription. | +| `uid` | `String` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | + +## Response Type + +**204**: No Content + +`void` + +## Example Usage + +```ruby +subscription_id = 222 + +uid = 'uid0' + +invoices_controller.delete_invoice( + subscription_id, + uid +) +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseException`](../../doc/models/error-list-response-exception.md) | + + # Send Invoice -This endpoint allows for invoices to be programmatically delivered via email. This endpoint supports the delivery of both ad-hoc and automatically generated invoices. Additionally, this endpoint supports email delivery to direct recipients, carbon-copy (cc) recipients, and blind carbon-copy (bcc) recipients. +Sends an invoice to the customer via email. This endpoint supports the delivery of both ad-hoc and automatically generated invoices. Additionally, this endpoint supports email delivery to direct recipients, carbon-copy (cc) recipients, and blind carbon-copy (bcc) recipients. **File Attachments**: You can attach files to invoice emails using `attachment_urls[]` parameter by providing URLs to the files you want to attach. When using attachments, the request must use `multipart/form-data` content type. Max 10 files, 10MB per file. @@ -2849,7 +2979,7 @@ invoices_controller.send_invoice( # Preview Customer Information Changes -Customer information may change after an invoice is issued, which may lead to a mismatch between customer information that is present on an open invoice and actual customer information. This endpoint allows you to preview these differences, if any. +Previews the effect of customer information changes on an open invoice. Customer information may change after an invoice is issued, which may lead to a mismatch between customer information that is present on an open invoice and actual customer information. This endpoint allows you to preview these differences, if any. The endpoint doesn't accept a request body. Customer information differences are calculated on the application side. @@ -2945,7 +3075,7 @@ puts result # Update Customer Information -This endpoint updates customer information on an open invoice and returns the updated invoice. If you would like to preview changes that will be applied, use the `/invoices/{uid}/customer_information/preview.json` endpoint first. +Updates customer information on an open invoice and returns the updated invoice. If you would like to preview changes that will be applied, use the `/invoices/{uid}/customer_information/preview.json` endpoint first. The endpoint doesn't accept a request body. Customer information differences are calculated on the application side. @@ -3176,7 +3306,7 @@ puts result # Issue Invoice -This endpoint allows you to issue an invoice that is in "pending" or "draft" status. For example, you can issue an invoice that was created when allocating new quantity on a component and using "accrue charges" option. +Issues an invoice that is in "pending" or "draft" status. For example, you can issue an invoice that was created when allocating new quantity on a component and using "accrue charges" option. You cannot issue a pending child invoice that was created for a member subscription in a group. diff --git a/doc/controllers/offers.md b/doc/controllers/offers.md index efab388b..683e770e 100644 --- a/doc/controllers/offers.md +++ b/doc/controllers/offers.md @@ -19,15 +19,13 @@ offers_controller = client.offers # Create Offer -Creates an offer within your Advanced Billing site. - -## Documentation +Creates an offer within your site. Offers allow you to package complicated combinations of products, components and coupons into a convenient package which can then be subscribed to just like products. Once an offer is defined it can be used as an alternative to the product when creating subscriptions. -Full documentation on how to use offers in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24261295098637-Offers-Overview). +For more information, see [Offers](https://maxio.zendesk.com/hc/en-us/articles/24261295098637-Offers-Overview) in the product documentation. ## Using a Product Price Point diff --git a/doc/controllers/payment-profiles.md b/doc/controllers/payment-profiles.md index 8f5e0acd..ef423074 100644 --- a/doc/controllers/payment-profiles.md +++ b/doc/controllers/payment-profiles.md @@ -133,7 +133,7 @@ puts result # List Payment Profiles -Returns all active payment profiles for a site, or for one customer within a site. If no payment profiles are found, this endpoint will return an empty array, not a 404. +Lists all active payment profiles for a site, or for one customer within a site. If no payment profiles are found, this endpoint returns an empty array. ```ruby def list_payment_profiles(options = {}) @@ -457,7 +457,7 @@ puts result Deletes an unused payment profile. -If the payment profile is in use by one or more subscriptions or groups, a 422 and error message will be returned. +If the payment profile is in use by one or more subscriptions or groups, an error message is returned. ```ruby def delete_unused_payment_profile(payment_profile_id) @@ -499,9 +499,9 @@ payment_profiles_controller.delete_unused_payment_profile(payment_profile_id) Deletes a payment profile belonging to the customer on the subscription. -+ If the customer has multiple subscriptions, the payment profile will be removed from all of them. +If the customer has multiple subscriptions, the payment profile is removed from all of them. -+ If you delete the default payment profile for a subscription, you will need to specify another payment profile to be the default through the api, or either prompt the user to enter a card in the billing portal or on the self-service page, or visit the Payment Details tab on the subscription in the Admin UI and use the “Add New Credit Card” or “Make Active Payment Method” link, (depending on whether there are other cards present). +If you delete the default payment profile for a subscription, you need to specify another payment profile to be the default through the API, or either prompt the user to enter a card in the billing portal or on the self-service page, or visit the Payment Details tab on the subscription in the Admin UI and use the “Add New Credit Card” or “Make Active Payment Method” link, (depending on whether there are other cards present). ```ruby def delete_subscriptions_payment_profile(subscription_id, @@ -743,7 +743,7 @@ puts result # Change Subscription Group Default Payment Profile -This will change the default payment profile on the subscription group to the existing payment profile with the id specified. +Changes the default payment profile on the subscription group to the existing payment profile with the specified ID. You must elect to change the existing payment profile to a new payment profile ID in order to receive a satisfactory response from this endpoint. @@ -823,7 +823,7 @@ puts result # Read One Time Token -One Time Tokens aka Advanced Billing Tokens house the credit card or ACH (Authorize.Net or Stripe only) data for a customer. +Returns the one-time token data, including credit card or ACH details, associated with the provided token ID. One Time Tokens aka Advanced Billing Tokens house the credit card or ACH (Authorize.Net or Stripe only) data for a customer. You can use One Time Tokens while creating a subscription or payment profile instead of passing all bank account or credit card data directly to a given API endpoint. @@ -867,7 +867,7 @@ puts result # Send Request Update Payment Email -You can send a "request payment update" email to the customer associated with the subscription. +Sends a "request payment update" email to the customer associated with the subscription. If you attempt to send a "request payment update" email more than five times within a 30-minute period, you will receive a `422` response with an error message in the body. This error message will indicate that the request has been rejected due to excessive attempts, and will provide instructions on how to resubmit the request. diff --git a/doc/controllers/product-families.md b/doc/controllers/product-families.md index ef157d66..0bda9018 100644 --- a/doc/controllers/product-families.md +++ b/doc/controllers/product-families.md @@ -41,7 +41,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `end_date` | `Date` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns products 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 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. | | `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. | -| `include_archived` | `TrueClass \| FalseClass` | Query, Optional | Include archived products | +| `include_archived` | `TrueClass \| FalseClass` | Query, Optional | Include archived products. | | `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`. | ## Response Type @@ -180,7 +180,7 @@ puts result # Create Product Family -Creates a Product Family within your Advanced Billing site. Create a Product Family to act as a container for your products, components, and coupons. +Creates a Product Family within your site. Create a Product Family to act as a container for your products, components, and coupons. Full documentation on how Product Families operate within the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24261098936205-Product-Families). @@ -210,7 +210,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) body = CreateProductFamilyRequest.new( product_family: CreateProductFamily.new( name: 'Acme Projects', - description: 'Amazing project management tool' + description: 'Amazing project management tool', + surcharging: false ) ) @@ -227,7 +228,8 @@ puts result "name": "Acme Projects", "description": "Amazing project management tool", "handle": "acme-projects", - "accounting_code": null + "accounting_code": null, + "surcharging": false } } ``` @@ -241,7 +243,7 @@ puts result # List Product Families -Returns a list of Product Families for a site. +Lists Product Families for a site. ```ruby def list_product_families(options = {}) @@ -289,6 +291,7 @@ puts result "description": null, "handle": "acme-projects", "accounting_code": null, + "surcharging": false, "created_at": "2013-02-20T15:05:51-07:00", "updated_at": "2013-02-20T15:05:51-07:00", "archived_at": null @@ -301,6 +304,7 @@ puts result "description": "Another family.", "handle": "bat-family", "accounting_code": null, + "surcharging": true, "created_at": "2014-04-16T12:41:13-06:00", "updated_at": "2014-04-16T12:41:13-06:00", "archived_at": "2024-11-05T09:30:00-07:00" @@ -355,6 +359,7 @@ puts result "description": "", "handle": "billing-plans", "accounting_code": null, + "surcharging": false, "archived_at": null } } diff --git a/doc/controllers/product-price-points.md b/doc/controllers/product-price-points.md index 8dc2e285..314417e7 100644 --- a/doc/controllers/product-price-points.md +++ b/doc/controllers/product-price-points.md @@ -132,7 +132,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `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` | -| `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. | +| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | (Optional) If you have defined multiple currencies at the site level, you can pass ?currency_prices=true 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[PricePointType]`](../../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. | @@ -286,7 +286,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `product_id` | Integer \| String | Template, Required | This is a container for one-of cases. | | `price_point_id` | Integer \| String | Template, Required | This is a container for one-of cases. | -| `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. | +| `currency_prices` | `TrueClass \| FalseClass` | Query, Optional | (Optional) If you have defined multiple currencies at the site level, you can pass ?currency_prices=true 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. | ## Response Type diff --git a/doc/controllers/products.md b/doc/controllers/products.md index 046993f9..364c37fe 100644 --- a/doc/controllers/products.md +++ b/doc/controllers/products.md @@ -20,11 +20,13 @@ products_controller = client.products # Create Product -Creates a product in your Advanced Billing site. +Creates a product in your site. -See the following product documentation for more information: +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, the `auto_create_signup_page` parameter is not supported. If `auto_create_signup_page` is included (with any value) an error is returned. -+ [Products Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Products-Overview) +For more information, see: + ++ [Products Overview](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Products-Overview) + [Changing a Subscription's Product](https://maxio.zendesk.com/hc/en-us/articles/24252069837581-Product-Changes-and-Migrations) ```ruby diff --git a/doc/controllers/proforma-invoices.md b/doc/controllers/proforma-invoices.md index 5dd8bbcc..2ded2f17 100644 --- a/doc/controllers/proforma-invoices.md +++ b/doc/controllers/proforma-invoices.md @@ -24,7 +24,7 @@ proforma_invoices_controller = client.proforma_invoices # Create Consolidated Proforma Invoice -Creates a consolidated proforma invoice asynchronously. It will return a 201 with no message, or a 422 with any errors. To find and view the new consolidated proforma invoice, you may poll the subscription group listing for proforma invoices; only one consolidated proforma invoice may be created per group at a time. +Creates a consolidated proforma invoice asynchronously. To find and view the new consolidated proforma invoice, you can poll the subscription group listing for proforma invoices; only one consolidated proforma invoice can be created per group at a time. If the information becomes outdated, simply void the old consolidated proforma invoice and generate a new one. @@ -86,12 +86,12 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | 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 @@ -236,12 +236,12 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `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` | +| `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 @@ -386,7 +386,7 @@ puts result # Preview Proforma Invoice -Returns a preview of the data that will be included on a given subscription's proforma invoice if one were to be generated. It will have similar line items and totals as a renewal preview, but the response will be presented in the format of a proforma invoice. Consequently it will include additional information such as the name and addresses that will appear on the proforma invoice. +Previews the data that will be included on a given subscription's proforma invoice if one were to be generated. It will have similar line items and totals as a renewal preview, but the response will be presented in the format of a proforma invoice. Consequently it will include additional information such as the name and addresses that will appear on the proforma invoice. The preview endpoint is subject to all the same conditions as the proforma invoice endpoint. For example, previews are only available on the Relationship Invoicing architecture, and previews cannot be made for end-of-life subscriptions. diff --git a/doc/controllers/reason-codes.md b/doc/controllers/reason-codes.md index 231ca64d..d4904aaf 100644 --- a/doc/controllers/reason-codes.md +++ b/doc/controllers/reason-codes.md @@ -21,21 +21,11 @@ reason_codes_controller = client.reason_codes Creates a reason code for a given site. -# Reason Codes Intro - Reason Codes 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. -## Reason Code Documentation - -Full documentation on how Reason Codes operate within Advanced Billing can be located under the following links. - -[Churn Reason Codes](https://maxio.zendesk.com/hc/en-us/articles/24286647554701-Churn-Reason-Codes) - -## Create Reason Code - -This method gives a merchant the option to create reason codes for a given site. +For more information, see [Churn Reason Codes](https://maxio.zendesk.com/hc/en-us/articles/24286647554701-Churn-Reason-Codes). ```ruby def create_reason_code(body: nil) diff --git a/doc/controllers/referral-codes.md b/doc/controllers/referral-codes.md index f358057e..f5c5b675 100644 --- a/doc/controllers/referral-codes.md +++ b/doc/controllers/referral-codes.md @@ -13,13 +13,7 @@ referral_codes_controller = client.referral_codes Validates whether a referral code is valid and applicable within your site. This method is useful for validating referral codes that are entered by a customer. -## Referrals Documentation - -Full documentation on how to use the referrals feature in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/sections/24286965611405-Referrals). - -## Server Response - -If the referral code is valid the status code will be `200` and the referral code will be returned. If the referral code is invalid, a `404` response will be returned. +For more information, see [Understanding Referrals](https://docs.maxio.com/hc/en-us/articles/24286981223693-Understanding-Referrals) in the product documentation. ```ruby def validate_referral_code(code) diff --git a/doc/controllers/sales-commissions.md b/doc/controllers/sales-commissions.md index 726ac7f7..b5df8a18 100644 --- a/doc/controllers/sales-commissions.md +++ b/doc/controllers/sales-commissions.md @@ -25,7 +25,7 @@ The Sales Commission API differs from other Chargify API endpoints. This resourc Access to the Sales Commission API endpoints is available to users with financial access, where the seller has the Advanced Analytics component enabled. For further information on getting access to Advanced Analytics contact Maxio support. -> Note: The request is at seller level, it means `<>` variable will be replaced by `app` +> Note: The request is at seller level, it means `<>` variable will be replaced by `app`. ```ruby def list_sales_commission_settings(options = {}) @@ -102,7 +102,7 @@ puts result # List Sales Reps -Returns a sales rep list with details. +Lists sales reps with details. ## Modified Authentication Process @@ -110,7 +110,7 @@ The Sales Commission API differs from other Chargify API endpoints. This resourc Access to the Sales Commission API endpoints is available to users with financial access, where the seller has the Advanced Analytics component enabled. For further information on getting access to Advanced Analytics contact Maxio support. -> Note: The request is at seller level, it means `<>` variable will be replaced by `app` +> Note: The request is at seller level, it means `<>` variable will be replaced by `app`. ```ruby def list_sales_reps(options = {}) @@ -244,7 +244,7 @@ The Sales Commission API differs from other Chargify API endpoints. This resourc Access to the Sales Commission API endpoints is available to users with financial access, where the seller has the Advanced Analytics component enabled. For further information on getting access to Advanced Analytics contact Maxio support. -> Note: The request is at seller level, it means `<>` variable will be replaced by `app` +> Note: The request is at seller level, it means `<>` variable will be replaced by `app`. ```ruby def read_sales_rep(seller_id, diff --git a/doc/controllers/sites.md b/doc/controllers/sites.md index d4402cb5..0520ab22 100644 --- a/doc/controllers/sites.md +++ b/doc/controllers/sites.md @@ -19,20 +19,19 @@ sites_controller = client.sites Retrieves site data. -Full documentation on Sites in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/sections/24250550707085-Sites). - -Specifically, the [Clearing Site Data](https://maxio.zendesk.com/hc/en-us/articles/24250617028365-Clearing-Site-Data) section is relevant to this endpoint documentation. +For more information, see [Sites](https://maxio.zendesk.com/hc/en-us/sections/24250550707085-Sites) in the product documentation. Specifically, the [Clearing Site Data](https://maxio.zendesk.com/hc/en-us/articles/24250617028365-Clearing-Site-Data) section is relevant to this endpoint. #### Relationship invoicing enabled -If the site has RI enabled then you will see more settings like: +If the site has Relationship invoicing enabled, additional properties are returned in the response: - "customer_hierarchy_enabled": true, - "whopays_enabled": true, - "whopays_default_payer": "self" +``` +"customer_hierarchy_enabled": true, +"whopays_enabled": true, +"whopays_default_payer": "self" +``` -You can read more about these settings here: -[Who Pays & Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays) +For more information, see [Who Pays & Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays). ```ruby def read_site @@ -144,7 +143,7 @@ sites_controller.clear_site(cleanup_scope: cleanup_scope) # List Chargify Js Public Keys -Returns public keys used for Maxio.js (formerly Chargify.js). +Lists public keys used for Maxio.js (formerly Chargify.js). ```ruby def list_chargify_js_public_keys(options = {}) diff --git a/doc/controllers/subscription-components.md b/doc/controllers/subscription-components.md index d4580890..893eada7 100644 --- a/doc/controllers/subscription-components.md +++ b/doc/controllers/subscription-components.md @@ -561,7 +561,7 @@ puts result # List Allocations -Returns the 50 most recent Allocations, ordered by most recent first. +Lists the 50 most recent Allocations, ordered by most recent first. ## On/Off Components @@ -1220,7 +1220,7 @@ puts result # List Usages -Returns a list of usages associated with a subscription for a particular metered component. This will display the previously recorded components for a subscription. +Lists usages associated with a subscription for a particular metered component. This will display the previously recorded components for a subscription. This endpoint is not compatible with quantity-based components. @@ -1250,8 +1250,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `subscription_id_or_reference` | Integer \| String | Template, Required | This is a container for one-of cases. | | `component_id` | Integer \| String | Template, Required | This is a container for one-of cases. | -| `since_id` | `Integer` | Query, Optional | Returns usages with an id greater than or equal to the one specified | -| `max_id` | `Integer` | Query, Optional | Returns usages with an id less than or equal to the one specified | +| `since_id` | `Integer` | Query, Optional | Returns usages with an id greater than or equal to the one specified. | +| `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` | @@ -1313,13 +1313,13 @@ puts result Activates an event-based component for a single subscription. -In order to bill your subscribers on your Events data under the Events-Based Billing feature, the components must be activated for the subscriber. +To bill your subscribers on your Events data under the Events-Based Billing feature, the components must be activated for the subscriber. -Learn more about the role of activation in the [Events-Based Billing docs](https://maxio.zendesk.com/hc/en-us/articles/24260323329805-Events-Based-Billing-Overview). +For more information, see [Design Your Catalog](https://docs.maxio.com/hc/en-us/articles/24181036583053-Design-Your-Catalog?method=componenttypes). -Use this endpoint to activate an event-based component for a single subscription. Activating an event-based component causes Advanced Billing to bill for events when the subscription is renewed. +Use this endpoint to activate an event-based component for a single subscription. Activating an event-based component causes billing for events when the subscription is renewed. -*Note: it is possible to stream events for a subscription at any time, regardless of component activation status. The activation status only determines if the subscription should be billed for event-based component usage at renewal.* +Note: it is possible to stream events for a subscription at any time, regardless of component activation status. The activation status only determines if the subscription should be billed for event-based component usage at renewal. ```ruby def activate_event_based_component(subscription_id, @@ -1424,21 +1424,15 @@ subscription_components_controller.deactivate_event_based_component( Records a single event for Events-Based Billing. -## Documentation - Events-Based Billing is an evolved form of metered billing that is based on data-rich events streamed in real-time from your system to Advanced Billing. These events can then be transformed, enriched, or analyzed to form the computed totals of usage charges billed to your customers. This API allows you to stream events into the Advanced Billing data ingestion engine. -Learn more about the feature in general in the [Events-Based Billing help docs](https://maxio.zendesk.com/hc/en-us/articles/24260323329805-Events-Based-Billing-Overview). - -## Record Event - -Use this endpoint to record a single event. +For more information, see [Design Your Catalog](https://docs.maxio.com/hc/en-us/articles/24181036583053-Design-Your-Catalog?method=componenttypes). -*Note: this endpoint differs from the standard Chargify API endpoints in that the URL subdomain will be `events` and your site subdomain will be included in the URL path. For example:* +Note: this endpoint differs from the standard URL for this API in that `events` and your site subdomain are included in the path. For example: ``` https://events.chargify.com/my-site-subdomain/events/my-stream-api-handle @@ -1459,7 +1453,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `api_handle` | `String` | Template, Required | Identifies the Stream for which the event should be published. | -| `store_uid` | `String` | Query, Optional | If you've attached your own Keen project as an Advanced Billing event data-store, use this parameter to indicate the data-store. | +| `store_uid` | `String` | Query, Optional | If you've attached your own Keen project as an Advanced Billing event data-store, use this parameter to indicate the data-store. This applies to Legacy Metering sites only — it has no effect on Maxio Metering sites. | | `body` | [`EBBEvent`](../../doc/models/ebb-event.md) | Body, Optional | - | ## Server @@ -1495,7 +1489,7 @@ subscription_components_controller.record_event( Records a collection of events. -*Note: this endpoint differs from the standard Chargify API endpoints in that the subdomain will be `events` and your site subdomain will be included in the URL path.* +Note: this endpoint differs from the standard URL for this API in that `events` and your site subdomain are included in the path. A maximum of 1000 events can be published in a single request. A 422 will be returned if this limit is exceeded. @@ -1514,7 +1508,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `api_handle` | `String` | Template, Required | Identifies the Stream for which the events should be published. | -| `store_uid` | `String` | Query, Optional | If you've attached your own Keen project as an Advanced Billing event data-store, use this parameter to indicate the data-store. | +| `store_uid` | `String` | Query, Optional | If you've attached your own Keen project as an Advanced Billing event data-store, use this parameter to indicate the data-store. This applies to Legacy Metering sites only — it has no effect on Maxio Metering sites. | | `body` | [`Array[EBBEvent]`](../../doc/models/ebb-event.md) | Body, Optional | - | ## Server diff --git a/doc/controllers/subscription-groups.md b/doc/controllers/subscription-groups.md index 2c4bf8fa..dd34cbaa 100644 --- a/doc/controllers/subscription-groups.md +++ b/doc/controllers/subscription-groups.md @@ -162,7 +162,7 @@ puts result # List Subscription Groups -Returns an array of subscription groups for the site. The response is paginated and will return a `meta` key with pagination information. +Lists subscription groups for the site. The response is paginated and will return a `meta` key with pagination information. #### Account Balance Information @@ -310,9 +310,9 @@ puts result "current_billing_amount_in_cents": 11500, "customer": { "first_name": "Mark", - "last_name": "Wannabewahlberg", - "organization": "The Funky Bunch", - "email": "markymark@example.com", + "last_name": "Smith", + "organization": "Acme Inc.", + "email": "smith@example.com", "reference": "4c92223b-bc16-4d0d-87ff-b177a89a2655" }, "account_balances": { @@ -464,7 +464,7 @@ puts result Finds the subscription group associated with a subscription. -If the subscription is not in a group, the endpoint will return a 404 code. +If the subscription is not in a group, this endpoint returns an error. ```ruby def find_subscription_group(subscription_id) @@ -514,9 +514,9 @@ puts result "cancel_at_end_of_period": false, "customer": { "first_name": "Mark", - "last_name": "Wannabewahlberg", - "organization": "The Funky Bunch", - "email": "markymark@example.com", + "last_name": "Smith", + "organization": "Acme Inc.", + "email": "smith@example.com", "reference": "4c92223b-bc16-4d0d-87ff-b177a89a2655" }, "account_balances": { @@ -545,7 +545,7 @@ puts result # Add Subscription to Group -For sites making use of the [Relationship Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview) and [Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays#customer-hierarchies) features, it is possible to add existing subscriptions to subscription groups. +Adds an existing subscription to a subscription group. For sites making use of the [Relationship Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview) and [Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays#customer-hierarchies) features, it is possible to add existing subscriptions to subscription groups. Passing `group` parameters with a `target` containing a `type` and optional `id` is all that's needed. When the `target` parameter specifies a `"customer"` or `"subscription"` that is already part of a hierarchy, the subscription will become a member of the customer's subscription group. If the target customer or subscription is not part of a subscription group, a new group will be created and the subscription will become part of the group with the specified target customer set as the responsible payer for the group's subscriptions. @@ -633,7 +633,7 @@ puts result # Remove Subscription from Group -For sites making use of the [Relationship Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview) and [Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays#customer-hierarchies) features, it is possible to remove an existing subscription from a subscription group. +Removes an existing subscription from a subscription group. For sites making use of the [Relationship Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview) and [Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays#customer-hierarchies) features, it is possible to remove an existing subscription from a subscription group. ```ruby def remove_subscription_from_group(subscription_id) diff --git a/doc/controllers/subscription-notes.md b/doc/controllers/subscription-notes.md index 6ec186ef..3d0285c7 100644 --- a/doc/controllers/subscription-notes.md +++ b/doc/controllers/subscription-notes.md @@ -21,13 +21,11 @@ subscription_notes_controller = client.subscription_notes Creates a note for a subscription. -## How to Use Subscription Notes - Notes allow you to record information about a particular Subscription in a free text format. -If you have structured data such as birth date, color, etc., consider using Metadata instead. +If you have structured data such as birth date, color, etc., consider using [Metadata](../../doc/controllers/custom-fields.md#create-metadata) instead. -Full documentation on how to use Notes in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24251712214413-Subscription-Summary-Overview). +For more information, see [Adding Notes](https://docs.maxio.com/hc/en-us/articles/24251654953997-Understanding-the-Subscription-Summary-Page#billing-portal-status:~:text=documentation%20for%20more.-,Adding%20Notes,-Notes%20are%20optional) in the product documentation. ```ruby def create_subscription_note(subscription_id, diff --git a/doc/controllers/subscription-products.md b/doc/controllers/subscription-products.md index d9bacd61..4ab9ee79 100644 --- a/doc/controllers/subscription-products.md +++ b/doc/controllers/subscription-products.md @@ -18,17 +18,15 @@ subscription_products_controller = client.subscription_products Migrates a subscription to a different product. -In order to create a migration, you must pass the `product_id` or `product_handle` in the object when you send a POST request. You may also pass either a `product_price_point_id` or `product_price_point_handle` to choose which price point the subscription is moved to. If no price point identifier is passed the subscription will be moved to the products default price point. The response will be the updated subscription. +To create a migration, you must pass the `product_id` or `product_handle` in the object when you send a POST request. You can also pass either a `product_price_point_id` or `product_price_point_handle` to choose which price point the subscription is moved to. If no price point identifier is passed, the subscription is moved to the product's default price point. The response is the updated subscription. ## Valid Subscriptions -Subscriptions should be in the `active` or `trialing` state in order to be migrated. +Subscriptions should be in the `active` or `trialing` state to be migrated. (For backwards compatibility reasons, it is possible to migrate a subscription that is in the `trial_ended` state via the API, however this is not recommended. Since `trial_ended` is an end-of-life state, the subscription should be canceled, the product changed, and then the subscription can be reactivated.) -## Migrations Documentation - -Full documentation on how to record Migrations in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24181589372429-Data-Migration-to-Advanced-Billing). +For more information, see [Product Changes and Migrations](https://docs.maxio.com/hc/en-us/articles/24252069837581-Product-Changes-and-Migrations). ## Failed Migrations diff --git a/doc/controllers/subscription-renewals.md b/doc/controllers/subscription-renewals.md index 20b5d3e0..73fd4dab 100644 --- a/doc/controllers/subscription-renewals.md +++ b/doc/controllers/subscription-renewals.md @@ -574,7 +574,7 @@ puts result # Unpublish Scheduled Renewal Configuration -Returns a scheduled renewal configuration to an editable state. +Restores a scheduled renewal configuration to an editable state. ```ruby def unpublish_scheduled_renewal_configuration(subscription_id, @@ -738,6 +738,8 @@ puts result Adds product and component line items to the scheduled renewal. +If your site has list vs sales pricing enabled, accepts renewal_configuration_item.custom_price.list_price_point_id, validates and persists it; omitted value follows existing/default behavior; with list vs sales pricing disabled, parameter is ignored (no validation/behavioral impact). This functionality is supported in the API, but is not currently supported in SDKs. + ```ruby def create_scheduled_renewal_configuration_item(subscription_id, scheduled_renewals_configuration_id, @@ -826,6 +828,8 @@ puts result Updates an existing configuration item’s pricing and quantity. +If you site has list vs sales pricing enabled, accepts renewal_configuration_item.custom_price.list_price_point_id, validates and persists it; omitted value follows existing/default behavior; with list vs sales pricing disabled, parameter is ignored (no validation/behavioral impact). This functionality is supported in the API, but is not currently supported in SDKs. + ```ruby def update_scheduled_renewal_configuration_item(subscription_id, scheduled_renewals_configuration_id, diff --git a/doc/controllers/subscription-status.md b/doc/controllers/subscription-status.md index 149fb719..4ac306fb 100644 --- a/doc/controllers/subscription-status.md +++ b/doc/controllers/subscription-status.md @@ -557,7 +557,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscription_id` | `Integer` | Template, Required | The Chargify id of the subscription. | -| `body` | [`PauseRequest`](../../doc/models/pause-request.md) | Body, Optional | Allows to pause a Subscription | +| `body` | [`PauseRequest`](../../doc/models/pause-request.md) | Body, Optional | Allows you to pause a Subscription. | ## Response Type @@ -723,7 +723,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscription_id` | `Integer` | Template, Required | The Chargify id of the subscription. | -| `body` | [`PauseRequest`](../../doc/models/pause-request.md) | Body, Optional | Allows to pause a Subscription | +| `body` | [`PauseRequest`](../../doc/models/pause-request.md) | Body, Optional | Allows you to pause a Subscription. | ## Response Type @@ -1344,26 +1344,26 @@ puts result Previews a subscription’s next renewal assessment. Renewal Preview is an object representing a subscription’s next assessment. You can retrieve it to see a snapshot of how much your customer will be charged on their next renewal. -The "Next Billing" amount and "Next Billing" date are already represented in the UI on each Subscriber's Summary. For more information, 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 already represented in the UI on each Subscriber's Summary. For more information, see [Subscriber Interface Overview](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). ## Optional Component Fields -This endpoint is particularly useful due to the fact that it will return the computed billing amount for the base product and the components which are in use by a subscriber. +This endpoint is particularly useful because it returns the computed billing amount for the base product and the components which are in use by a subscriber. -By default, the preview will include billing details for all components _at their **current** quantities_. This means: +By default, the preview includes billing details for all components _at their **current** quantities_. This means: * Current `allocated_quantity` for quantity-based components * Current enabled/disabled status for on/off components * Current metered usage `unit_balance` for metered components * Current metric quantity value for events recorded thus far for events-based components -In the above statements, "current" means the quantity or value as of the call to the renewal preview endpoint. We do not predict end-of-period values for components, so metered or events-based usage may be less than it will eventually be at the end of the period. +In the above statements, "current" means the quantity or value as of the call to the renewal preview endpoint. End-of-period values for components are not predicted, so metered or events-based usage may be less than it will eventually be at the end of the period. -Optionally, **you may provide your own custom quantities** for any component to see a billing preview for non-current quantities. This is accomplished by sending a request body with data under the `components` key. See the request body documentation below. +Optionally, **you can provide your own custom quantities** for any component to see a billing preview for non-current quantities. This is accomplished by sending a request body with data under the `components` key. See the request body documentation below. -## Subscription Side Effects +## Preview Behavior -You can request a `POST` to obtain this data from the endpoint without any side effects. This method allows you to preview data, but does not log any changes against a subscription. +Sending a `POST` request to this endpoint returns preview data without modifying the subscription. This method previews data, but does not log any changes against a subscription. ```ruby def preview_renewal(subscription_id, diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md index 663af6c8..c54ce8b7 100644 --- a/doc/controllers/subscriptions.md +++ b/doc/controllers/subscriptions.md @@ -34,6 +34,48 @@ Identify an existing customer with `customer_id` or `customer_reference`. Option Select an option from the **Request Examples** drop-down on the right side of the portal to see examples of common scenarios for creating subscriptions. +## List vs Sales Pricing + +When a subscription uses custom pricing as the sales price, you can optionally provide a list price for any item. If omitted, the list price defaults to the sales price. The difference between the list price and sales price is used to calculate implicit discounts, which appear on Invoices and in reporting. List price can also support revenue allocations in [Advanced Revenue](https://docs.maxio.com/hc/en-us/articles/24177001342861-Create-and-Configure-RevenueBooks). + +If your site has list pricing enabled, the API accepts `custom_price.list_price_point_id` for custom pricing, validates and persists it, and returns list price metadata in subscription responses. If list pricing is disabled, this input is ignored and related response fields are omitted. + +When list pricing is enabled: + +- Subscription → Product `product_price_point_list_price_point_id` (integer) +- `product_price_point_list_price_point_handle` (string) +- Subscription Components (when components are included in the response, such as with subscriptions built from components or component serialization paths) `component_id` (integer) +- `price_point_id` (integer) +- `list_price_point_id` (integer) + +When list pricing is disabled: + +- Subscription → Product `product_price_point_list_price_point_id`: omitted +- `product_price_point_list_price_point_handle`: omitted +- Subscription Components `list_price_point_id`: omitted + +This functionality is supported in the API, but is not currently supported in SDKs. + +## Subscriptions can now work independently from the catalog + +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, you can create subscriptions without a `product_id` or `product_handle` using POST /subscriptions, building them entirely from components. + +A valid subscription must include at least one active component with: + +- a positive `allocated_quantity`, +- a positive `unit_balance`, or +- 'enabled: true' (for on/off components) +- a configured metered component + +`component_id` can be provided as a numeric ID or in handle: format. If `trial_interval` and `trial_interval_unit` are included, they are applied at creation. + +In the response, product and product price point fields are null, and component details are returned instead. + +This functionality is supported in the API, but is not currently supported in SDKs. + +## Payment information + +Payment information may be required to create a subscription, depending on the options for the Product being subscribed. See [product options](https://docs.maxio.com/hc/en-us/articles/24261076617869-Edit-Products) for more information. See the [Payments Profile](../../doc/controllers/payment-profiles.md#create-payment-profile) endpoint for details on payment parameters. See the [Subscription Signups](page:introduction/basic-concepts/subscription-signup) article for more information on working with subscriptions in Advanced Billing. ## Payment information @@ -246,7 +288,9 @@ puts result # List Subscriptions -Returns an array of subscriptions from a Site. Pay close attention to query string filters and pagination in order to control responses from the server. +Lists subscriptions for a site. Use the query string filters and pagination to control responses from the server. + +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, some subscriptions may not have an associated product. For subscriptions without an associated product, 'product', 'product_price_point_id', and 'product_price_point_type' are returned as 'null'. ## Search for a subscription @@ -270,19 +314,28 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `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` | [`SubscriptionSort`](../../doc/models/subscription-sort.md) | Query, Optional | The attribute by which to sort

**Default**: `SubscriptionSort::SIGNUP_DATE` | +| `direction` | [`SortingDirection`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | | `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 | +| `product` | Integer \| String \| nil | Query, Optional | This is a container for one-of cases. | +| `q` | `String` | Query, Optional | Search string. | +| `q_scope` | [`QScope`](../../doc/models/q-scope.md) | Query, Optional | Scope of fields used by the q search. | +| `customer_id` | `Integer` | Query, Optional | The Advanced Billing id of the customer. | +| `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 | +| `collection_method` | [`CollectionMethod1`](../../doc/models/collection-method-1.md) | Query, Optional | The collection method for the subscription. | +| `branding_theme_id` | `Integer` | Query, Optional | Filter subscriptions by the ID of an assigned Branding Theme. Branding Themes is a beta feature. See [Understand Branding Themes](https://docs.maxio.com/hc/en-us/articles/43796895662093-Understand-Branding-Themes#understand-branding-themes-0-0) for more information. | | `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`. | | `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 subscriptions 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_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` | +| `group_status` | [`GroupStatus`](../../doc/models/group-status.md) | Query, Optional | Filter by whether a subscription is in a group. | +| `dunning_exemption` | `TrueClass \| FalseClass` | Query, Optional | Filter by dunning exemption status. | +| `payment_gateways` | `String` | Query, Optional | Comma-separated payment gateway identifiers. | +| `currencies` | `String` | Query, Optional | Comma-separated currency codes. | | `include` | [`Array[SubscriptionListInclude]`](../../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 @@ -297,10 +350,6 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) collect = { 'page' => 1, 'per_page' => 50, - 'start_date' => Date.iso8601('2022-07-01'), - 'end_date' => Date.iso8601('2022-08-01'), - 'start_datetime' => DateTimeHelper.from_rfc3339('2022-07-01 09:00:05'), - 'end_datetime' => DateTimeHelper.from_rfc3339('2022-08-01 10:00:05'), 'sort' => SubscriptionSort::SIGNUP_DATE, 'include' => [ SubscriptionListInclude::SELF_SERVICE_PAGE_TOKEN @@ -362,7 +411,9 @@ The server response will not return data under the key/value pair of `next_billi For a subscription using Calendar Billing, setting the next billing date is a bit different. Send the `snap_day` attribute to change the calendar billing date for **a subscription using a product eligible for calendar billing**. -> Note: If you change the product associated with a subscription that contains a `snap_day` and immediately `READ/GET` the subscription data, it will still contain original `snap_day`. The `snap_day` will reset to null on the next billing cycle. This is because a product change is instantaneous and only affects the product associated with a subscription. +> Note: If you change the product associated with a subscription that contains a `snap_day` and immediately READ/GET the subscription data, it will still contain the original `snap_day`. The `snap_day` will be reset to `null` on the next billing cycle. This is because a product change is instantaneous and only affects the product associated with a subscription. + +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, some subscriptions may not have an associated product. For subscriptions without an associated product, `product`, `product_price_point_id`, and `product_price_point_type` are returned as `null`. ```ruby def update_subscription(subscription_id, @@ -526,6 +577,8 @@ puts result Retrieves subscription details. +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, some subscriptions may not have an associated product. For subscriptions without an associated product, 'product', 'product_price_point_id', and 'product_price_point_type' are returned as 'null'. + ## Self-Service Page token Self-Service Page token for the subscription is not returned by default. If this information is desired, the include[]=self_service_page_token parameter must be provided with the request. @@ -822,7 +875,7 @@ puts result Purges an individual subscription for sites in test mode. -Provide the subscription ID in the url. To confirm, supply the customer ID in the query string `ack` parameter. You may also delete the customer record and/or payment profiles by passing `cascade` parameters. For example, to delete just the customer record, the query params would be: `?ack={customer_id}&cascade[]=customer` +Provide the subscription ID in the URL. To confirm, supply the customer ID in the query string `ack` parameter. You may also delete the customer record and/or payment profiles by passing `cascade` parameters. For example, to delete just the customer record, the query params would be: `?ack={customer_id}&cascade[]=customer` If you need to remove subscriptions from a live site, contact support to discuss your use case. @@ -955,27 +1008,43 @@ Previews a subscription by POSTing the same JSON or XML as for a subscription cr The "Next Billing" amount and "Next Billing" date are represented in each Subscriber's Summary. -A subscription will not be created by utilizing this endpoint; it is meant to serve as a prediction. +This endpoint does not create a subscription; it is meant to serve as a prediction. -For more information, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). +For more information, see [Subscriber Interface Overview](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). + +## Subscriptions can now work independently from the catalog + +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, you can create subscriptions without a `product_id` or `product_handle` using POST /subscriptions, building them entirely from components. + +A valid subscription must include at least one active component with: + +- a positive `allocated_quantity`, +- a positive `unit_balance`, or +- 'enabled: true' (for on/off components) + +`component_id` can be provided as a numeric ID or in handle: format. If `trial_interval` and `trial_interval_unit` are included, they are applied at creation. + +In the response, product and product price point fields are null, and component details are returned instead. + +This functionality is supported in the API, but is not currently supported in SDKs. ## Taxable Subscriptions -This endpoint will preview taxes applicable to a purchase. In order for taxes to be previewed, the following conditions must be met: +This endpoint previews taxes applicable to a purchase. For taxes to be previewed, the following conditions must be met: + Taxes must be configured on the subscription + The preview must be for the purchase of a taxable product or component, or combination of the two. -+ The subscription payload must contain a full billing or shipping address in order to calculate tax ++ The subscription payload must contain a full billing or shipping address to calculate tax -For more information about creating taxable previews, see our documentation guide on how to create [taxable subscriptions.](https://maxio.zendesk.com/hc/en-us/sections/24287012349325-Taxes) +For more information about creating taxable previews, see [Taxes](https://maxio.zendesk.com/hc/en-us/sections/24287012349325-Taxes). -You do **not** need to include a card number to generate tax information when you are previewing a subscription. However, when you actually want to create the subscription, you must include the credit card information if you want the billing address to be stored in Advanced Billing. The billing address and the credit card information are stored together within the payment profile object. Also, you may not send a billing address to Advanced Billing without payment profile information, as the address is stored on the card. +You do **not** need to include a card number to generate tax information when you are previewing a subscription. However, when you actually want to create the subscription, you must include the credit card information if you want the billing address to be stored. The billing address and the credit card information are stored together within the payment profile object. Also, you cannot send a billing address without payment profile information, as the address is stored on the card. You can pass shipping and billing addresses and still decide not to calculate taxes. To do that, pass `skip_billing_manifest_taxes: true` attribute. ## Non-taxable Subscriptions -If you'd like to calculate subscriptions that do not include tax you may leave off the billing information. +If you'd like to calculate subscriptions that do not include tax, you can leave off the billing information. ```ruby def preview_subscription(body: nil) @@ -1347,7 +1416,7 @@ puts result Removes a coupon from an existing subscription. -For more information on the expected behavior of removing a coupon from a subscription, see our documentation [here.](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions#removing-a-coupon) +For more information on the expected behavior of removing a coupon from a subscription, see [Coupons and Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions#removing-a-coupon). ```ruby def remove_coupon_from_subscription(subscription_id, @@ -1395,16 +1464,14 @@ puts result # Activate Subscription -Activates awaiting signup and trialing subscriptions. This feature is only available on the Relationship Invoicing architecture. Subscriptions in a group may not be activated immediately. - -For details on how the activation works, and how to activate subscriptions through the application, see [activation](#). +Activates awaiting signup and trialing subscriptions. This feature is only available on the Relationship Invoicing architecture. Subscriptions in a group cannot be activated immediately. The `revert_on_failure` parameter controls the behavior upon activation failure. -- If set to `true` and something goes wrong i.e. payment fails, then Advanced Billing will not change the subscription's state. The subscription’s billing period will also remain the same. -- If set to `false` and something goes wrong i.e. payment fails, then Advanced Billing will continue through with the activation and enter an end of life state. For trialing subscriptions, that will either be trial ended (if the trial is no obligation), past due (if the trial has an obligation), or canceled (if the site has no dunning strategy, or has a strategy that says to cancel immediately). For awaiting signup subscriptions, that will always be canceled. +- If set to `true` and something goes wrong i.e. payment fails, the subscription's state does not change. The subscription’s billing period also remains the same. +- If set to `false` and something goes wrong i.e. payment fails, the activation continues and enters an end of life state. For trialing subscriptions, that is either trial ended (if the trial is no obligation), past due (if the trial has an obligation), or canceled (if the site has no dunning strategy, or has a strategy that says to cancel immediately). For awaiting signup subscriptions, that is always canceled. -The default activation failure behavior can be configured per activation attempt, or you may set a default value under Config > Settings > Subscription Activation Settings. +The default activation failure behavior can be configured per activation attempt, or you can set a default value under Config > Settings > Subscription Activation Settings. ## Activation Scenarios @@ -1436,8 +1503,8 @@ The default activation failure behavior can be configured per activation attempt ### Activate Trialing subscription -You can read more about the behavior of trialing subscriptions [here](https://maxio.zendesk.com/hc/en-us/articles/24252155721869-Trialing-Subscriptions). -When the `revert_on_failure` parameter is set to `true`, the subscription's state will remain as Trialing, we will void the invoice from activation and return any prepayments and credits applied to the invoice back to the subscription. +For more information about the behavior of trialing subscriptions, see [Trialing Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24252155721869-Trialing-Subscriptions). +When the `revert_on_failure` parameter is set to `true`, the subscription's state remains Trialing; the invoice from activation is voided, and any prepayments and credits applied to the invoice are returned to the subscription. ```ruby def activate_subscription(subscription_id, diff --git a/doc/controllers/webhooks.md b/doc/controllers/webhooks.md index 2028cd6b..ce8a560a 100644 --- a/doc/controllers/webhooks.md +++ b/doc/controllers/webhooks.md @@ -75,7 +75,7 @@ puts result "last_sent_at": "2016-11-08T16:43:54-05:00", "last_sent_url": "http://requestb.in/11u45x71", "successful": false, - "body": "id=141765032&event=statement_settled&payload[site][id]=31615&payload[site][subdomain]=general-goods&payload[subscription][id]=15100141&payload[subscription][state]=active&payload[subscription][balance_in_cents]=0&payload[customer][id]=14585695&payload[customer][first_name]=Pookie&payload[customer][last_name]=Test&payload[customer][reference]=&payload[customer][organization]=&payload[customer][address]=&payload[customer][address_2]=&payload[customer][city]=&payload[customer][state]=&payload[customer][zip]=&payload[customer][country]=&payload[customer][email]=pookie999%40example.com&payload[customer][phone]=&payload[statement][closed_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][id]=80168049&payload[statement][opened_at]=2016-11-07%2016%3A22%3A15%20-0500&payload[statement][settled_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][subscription_id]=15100141&payload[statement][updated_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][starting_balance_in_cents]=0&payload[statement][ending_balance_in_cents]=0&payload[statement][total_in_cents]=6400&payload[statement][memo]=We%20thank%20you%20for%20your%20continued%20business!&payload[statement][events][0][id]=346956565&payload[statement][events][0][key]=renewal_success&payload[statement][events][0][message]=Successful%20renewal%20for%20Pookie%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][events][1][id]=346956579&payload[statement][events][1][key]=payment_success&payload[statement][events][1][message]=Successful%20payment%20of%20%2464.00%20for%20Pookie%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][events][2][id]=347299359&payload[statement][events][2][key]=renewal_success&payload[statement][events][2][message]=Successful%20renewal%20for%20Pookie%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][transactions][0][id]=161537343&payload[statement][transactions][0][subscription_id]=15100141&payload[statement][transactions][0][type]=Charge&payload[statement][transactions][0][kind]=baseline&payload[statement][transactions][0][transaction_type]=charge&payload[statement][transactions][0][success]=true&payload[statement][transactions][0][amount_in_cents]=1000&payload[statement][transactions][0][memo]=%2410%20Basic%20Plan%20(11%2F08%2F2016%20-%2011%2F09%2F2016)&payload[statement][transactions][0][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][transactions][0][starting_balance_in_cents]=0&payload[statement][transactions][0][ending_balance_in_cents]=1000&payload[statement][transactions][0][gateway_used]=&payload[statement][transactions][0][gateway_transaction_id]=&payload[statement][transactions][0][gateway_order_id]=&payload[statement][transactions][0][payment_id]=161537369&payload[statement][transactions][0][product_id]=3792003&payload[statement][transactions][0][tax_id]=&payload[statement][transactions][0][component_id]=&payload[statement][transactions][0][statement_id]=80168049&payload[statement][transactions][0][customer_id]=14585695&payload[statement][transactions][0][original_amount_in_cents]=&payload[statement][transactions][0][discount_amount_in_cents]=&payload[statement][transactions][0][taxable_amount_in_cents]=&payload[statement][transactions][1][id]=161537344&payload[statement][transactions][1][subscription_id]=15100141&payload[statement][transactions][1][type]=Charge&payload[statement][transactions][1][kind]=quantity_based_component&payload[statement][transactions][1][transaction_type]=charge&payload[statement][transactions][1][success]=true&payload[statement][transactions][1][amount_in_cents]=5400&payload[statement][transactions][1][memo]=Timesheet%20Users%3A%2018%20Timesheet%20Users&payload[statement][transactions][1][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][transactions][1][starting_balance_in_cents]=1000&payload[statement][transactions][1][ending_balance_in_cents]=6400&payload[statement][transactions][1][gateway_used]=&payload[statement][transactions][1][gateway_transaction_id]=&payload[statement][transactions][1][gateway_order_id]=&payload[statement][transactions][1][payment_id]=161537369&payload[statement][transactions][1][product_id]=3792003&payload[statement][transactions][1][tax_id]=&payload[statement][transactions][1][component_id]=277221&payload[statement][transactions][1][statement_id]=80168049&payload[statement][transactions][1][customer_id]=14585695&payload[statement][transactions][1][original_amount_in_cents]=&payload[statement][transactions][1][discount_amount_in_cents]=&payload[statement][transactions][1][taxable_amount_in_cents]=&payload[statement][transactions][2][id]=161537369&payload[statement][transactions][2][subscription_id]=15100141&payload[statement][transactions][2][type]=Payment&payload[statement][transactions][2][kind]=&payload[statement][transactions][2][transaction_type]=payment&payload[statement][transactions][2][success]=true&payload[statement][transactions][2][amount_in_cents]=6400&payload[statement][transactions][2][memo]=Pookie%20Test%20-%20%2410%20Basic%20Plan%3A%20Renewal%20payment&payload[statement][transactions][2][created_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][transactions][2][starting_balance_in_cents]=6400&payload[statement][transactions][2][ending_balance_in_cents]=0&payload[statement][transactions][2][gateway_used]=bogus&payload[statement][transactions][2][gateway_transaction_id]=53433&payload[statement][transactions][2][gateway_order_id]=&payload[statement][transactions][2][payment_id]=&payload[statement][transactions][2][product_id]=3792003&payload[statement][transactions][2][tax_id]=&payload[statement][transactions][2][component_id]=&payload[statement][transactions][2][statement_id]=80168049&payload[statement][transactions][2][customer_id]=14585695&payload[statement][transactions][2][card_number]=XXXX-XXXX-XXXX-1&payload[statement][transactions][2][card_expiration]=10%2F2020&payload[statement][transactions][2][card_type]=bogus&payload[statement][transactions][2][refunded_amount_in_cents]=0&payload[product][id]=3792003&payload[product][name]=%2410%20Basic%20Plan&payload[product_family][id]=527890&payload[product_family][name]=Acme%20Projects&payload[payment_profile][id]=10102821&payload[payment_profile][first_name]=Pookie&payload[payment_profile][last_name]=Test&payload[payment_profile][billing_address]=&payload[payment_profile][billing_address_2]=&payload[payment_profile][billing_city]=&payload[payment_profile][billing_country]=&payload[payment_profile][billing_state]=&payload[payment_profile][billing_zip]=&payload[event_id]=347299384", + "body": "id=141765032&event=statement_settled&payload[site][id]=31615&payload[site][subdomain]=general-goods&payload[subscription][id]=15100141&payload[subscription][state]=active&payload[subscription][balance_in_cents]=0&payload[customer][id]=14585695&payload[customer][first_name]=Alan&payload[customer][last_name]=Test&payload[customer][reference]=&payload[customer][organization]=&payload[customer][address]=&payload[customer][address_2]=&payload[customer][city]=&payload[customer][state]=&payload[customer][zip]=&payload[customer][country]=&payload[customer][email]=alan999%40example.com&payload[customer][phone]=&payload[statement][closed_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][id]=80168049&payload[statement][opened_at]=2016-11-07%2016%3A22%3A15%20-0500&payload[statement][settled_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][subscription_id]=15100141&payload[statement][updated_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][starting_balance_in_cents]=0&payload[statement][ending_balance_in_cents]=0&payload[statement][total_in_cents]=6400&payload[statement][memo]=We%20thank%20you%20for%20your%20continued%20business!&payload[statement][events][0][id]=346956565&payload[statement][events][0][key]=renewal_success&payload[statement][events][0][message]=Successful%20renewal%20for%20Alan%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][events][1][id]=346956579&payload[statement][events][1][key]=payment_success&payload[statement][events][1][message]=Successful%20payment%20of%20%2464.00%20for%20Alan%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][events][2][id]=347299359&payload[statement][events][2][key]=renewal_success&payload[statement][events][2][message]=Successful%20renewal%20for%20Alan%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][transactions][0][id]=161537343&payload[statement][transactions][0][subscription_id]=15100141&payload[statement][transactions][0][type]=Charge&payload[statement][transactions][0][kind]=baseline&payload[statement][transactions][0][transaction_type]=charge&payload[statement][transactions][0][success]=true&payload[statement][transactions][0][amount_in_cents]=1000&payload[statement][transactions][0][memo]=%2410%20Basic%20Plan%20(11%2F08%2F2016%20-%2011%2F09%2F2016)&payload[statement][transactions][0][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][transactions][0][starting_balance_in_cents]=0&payload[statement][transactions][0][ending_balance_in_cents]=1000&payload[statement][transactions][0][gateway_used]=&payload[statement][transactions][0][gateway_transaction_id]=&payload[statement][transactions][0][gateway_order_id]=&payload[statement][transactions][0][payment_id]=161537369&payload[statement][transactions][0][product_id]=3792003&payload[statement][transactions][0][tax_id]=&payload[statement][transactions][0][component_id]=&payload[statement][transactions][0][statement_id]=80168049&payload[statement][transactions][0][customer_id]=14585695&payload[statement][transactions][0][original_amount_in_cents]=&payload[statement][transactions][0][discount_amount_in_cents]=&payload[statement][transactions][0][taxable_amount_in_cents]=&payload[statement][transactions][1][id]=161537344&payload[statement][transactions][1][subscription_id]=15100141&payload[statement][transactions][1][type]=Charge&payload[statement][transactions][1][kind]=quantity_based_component&payload[statement][transactions][1][transaction_type]=charge&payload[statement][transactions][1][success]=true&payload[statement][transactions][1][amount_in_cents]=5400&payload[statement][transactions][1][memo]=Timesheet%20Users%3A%2018%20Timesheet%20Users&payload[statement][transactions][1][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][transactions][1][starting_balance_in_cents]=1000&payload[statement][transactions][1][ending_balance_in_cents]=6400&payload[statement][transactions][1][gateway_used]=&payload[statement][transactions][1][gateway_transaction_id]=&payload[statement][transactions][1][gateway_order_id]=&payload[statement][transactions][1][payment_id]=161537369&payload[statement][transactions][1][product_id]=3792003&payload[statement][transactions][1][tax_id]=&payload[statement][transactions][1][component_id]=277221&payload[statement][transactions][1][statement_id]=80168049&payload[statement][transactions][1][customer_id]=14585695&payload[statement][transactions][1][original_amount_in_cents]=&payload[statement][transactions][1][discount_amount_in_cents]=&payload[statement][transactions][1][taxable_amount_in_cents]=&payload[statement][transactions][2][id]=161537369&payload[statement][transactions][2][subscription_id]=15100141&payload[statement][transactions][2][type]=Payment&payload[statement][transactions][2][kind]=&payload[statement][transactions][2][transaction_type]=payment&payload[statement][transactions][2][success]=true&payload[statement][transactions][2][amount_in_cents]=6400&payload[statement][transactions][2][memo]=Alan%20Test%20-%20%2410%20Basic%20Plan%3A%20Renewal%20payment&payload[statement][transactions][2][created_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][transactions][2][starting_balance_in_cents]=6400&payload[statement][transactions][2][ending_balance_in_cents]=0&payload[statement][transactions][2][gateway_used]=bogus&payload[statement][transactions][2][gateway_transaction_id]=53433&payload[statement][transactions][2][gateway_order_id]=&payload[statement][transactions][2][payment_id]=&payload[statement][transactions][2][product_id]=3792003&payload[statement][transactions][2][tax_id]=&payload[statement][transactions][2][component_id]=&payload[statement][transactions][2][statement_id]=80168049&payload[statement][transactions][2][customer_id]=14585695&payload[statement][transactions][2][card_number]=XXXX-XXXX-XXXX-1&payload[statement][transactions][2][card_expiration]=10%2F2020&payload[statement][transactions][2][card_type]=bogus&payload[statement][transactions][2][refunded_amount_in_cents]=0&payload[product][id]=3792003&payload[product][name]=%2410%20Basic%20Plan&payload[product_family][id]=527890&payload[product_family][name]=Acme%20Projects&payload[payment_profile][id]=10102821&payload[payment_profile][first_name]=Alan&payload[payment_profile][last_name]=Test&payload[payment_profile][billing_address]=&payload[payment_profile][billing_address_2]=&payload[payment_profile][billing_city]=&payload[payment_profile][billing_country]=&payload[payment_profile][billing_state]=&payload[payment_profile][billing_zip]=&payload[event_id]=347299384", "signature": "7c606ec4628ce75ec46e284097ce163a", "signature_hmac_sha_256": "40f25e83dd324508bb2149e3e525821922fb210535ebfbfa81e7ab951996b41d" } @@ -91,7 +91,7 @@ puts result "last_sent_at": "2016-11-08T16:43:54-05:00", "last_sent_url": "http://requestb.in/11u45x71", "successful": false, - "body": "id=141765008&event=payment_success&payload[site][id]=31615&payload[site][subdomain]=general-goods&payload[subscription][id]=15100141&payload[subscription][state]=active&payload[subscription][trial_started_at]=&payload[subscription][trial_ended_at]=&payload[subscription][activated_at]=2016-11-04%2017%3A06%3A43%20-0400&payload[subscription][created_at]=2016-11-04%2017%3A06%3A42%20-0400&payload[subscription][updated_at]=2016-11-08%2016%3A22%3A22%20-0500&payload[subscription][expires_at]=&payload[subscription][balance_in_cents]=0&payload[subscription][current_period_ends_at]=2016-11-09%2016%3A06%3A42%20-0500&payload[subscription][next_assessment_at]=2016-11-09%2016%3A06%3A42%20-0500&payload[subscription][canceled_at]=&payload[subscription][cancellation_message]=&payload[subscription][next_product_id]=&payload[subscription][cancel_at_end_of_period]=false&payload[subscription][payment_collection_method]=automatic&payload[subscription][snap_day]=&payload[subscription][cancellation_method]=&payload[subscription][current_period_started_at]=2016-11-08%2016%3A06%3A42%20-0500&payload[subscription][previous_state]=active&payload[subscription][signup_payment_id]=161034048&payload[subscription][signup_revenue]=64.00&payload[subscription][delayed_cancel_at]=&payload[subscription][coupon_code]=&payload[subscription][total_revenue_in_cents]=32000&payload[subscription][product_price_in_cents]=1000&payload[subscription][product_version_number]=7&payload[subscription][payment_type]=credit_card&payload[subscription][referral_code]=pggn84&payload[subscription][coupon_use_count]=&payload[subscription][coupon_uses_allowed]=&payload[subscription][customer][id]=14585695&payload[subscription][customer][first_name]=Test&payload[subscription][customer][last_name]=Test&payload[subscription][customer][organization]=&payload[subscription][customer][email]=pookie999%40example.com&payload[subscription][customer][created_at]=2016-11-04%2017%3A06%3A42%20-0400&payload[subscription][customer][updated_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][reference]=&payload[subscription][customer][address]=&payload[subscription][customer][address_2]=&payload[subscription][customer][city]=&payload[subscription][customer][state]=&payload[subscription][customer][zip]=&payload[subscription][customer][country]=&payload[subscription][customer][phone]=&payload[subscription][customer][portal_invite_last_sent_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][portal_invite_last_accepted_at]=&payload[subscription][customer][verified]=false&payload[subscription][customer][portal_customer_created_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][cc_emails]=&payload[subscription][product][id]=3792003&payload[subscription][product][name]=%2410%20Basic%20Plan&payload[subscription][product][handle]=basic&payload[subscription][product][description]=lorem%20ipsum&payload[subscription][product][accounting_code]=basic&payload[subscription][product][request_credit_card]=false&payload[subscription][product][expiration_interval]=&payload[subscription][product][expiration_interval_unit]=never&payload[subscription][product][created_at]=2016-03-24%2013%3A38%3A39%20-0400&payload[subscription][product][updated_at]=2016-11-03%2013%3A03%3A05%20-0400&payload[subscription][product][price_in_cents]=1000&payload[subscription][product][interval]=1&payload[subscription][product][interval_unit]=day&payload[subscription][product][initial_charge_in_cents]=&payload[subscription][product][trial_price_in_cents]=&payload[subscription][product][trial_interval]=&payload[subscription][product][trial_interval_unit]=month&payload[subscription][product][archived_at]=&payload[subscription][product][require_credit_card]=false&payload[subscription][product][return_params]=&payload[subscription][product][taxable]=false&payload[subscription][product][update_return_url]=&payload[subscription][product][initial_charge_after_trial]=false&payload[subscription][product][version_number]=7&payload[subscription][product][update_return_params]=&payload[subscription][product][product_family][id]=527890&payload[subscription][product][product_family][name]=Acme%20Projects&payload[subscription][product][product_family][description]=&payload[subscription][product][product_family][handle]=billing-plans&payload[subscription][product][product_family][accounting_code]=&payload[subscription][product][public_signup_pages][id]=281054&payload[subscription][product][public_signup_pages][return_url]=http%3A%2F%2Fwww.example.com%3Fsuccessfulsignup&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fkqvmfrbgd89q%2Fbasic&payload[subscription][product][public_signup_pages][id]=281240&payload[subscription][product][public_signup_pages][return_url]=&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fdkffht5dxfd8%2Fbasic&payload[subscription][product][public_signup_pages][id]=282694&payload[subscription][product][public_signup_pages][return_url]=&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fjwffwgdd95s8%2Fbasic&payload[subscription][credit_card][id]=10102821&payload[subscription][credit_card][first_name]=Pookie&payload[subscription][credit_card][last_name]=Test&payload[subscription][credit_card][masked_card_number]=XXXX-XXXX-XXXX-1&payload[subscription][credit_card][card_type]=bogus&payload[subscription][credit_card][expiration_month]=10&payload[subscription][credit_card][expiration_year]=2020&payload[subscription][credit_card][customer_id]=14585695&payload[subscription][credit_card][current_vault]=bogus&payload[subscription][credit_card][vault_token]=1&payload[subscription][credit_card][billing_address]=&payload[subscription][credit_card][billing_city]=&payload[subscription][credit_card][billing_state]=&payload[subscription][credit_card][billing_zip]=&payload[subscription][credit_card][billing_country]=&payload[subscription][credit_card][customer_vault_token]=&payload[subscription][credit_card][billing_address_2]=&payload[subscription][credit_card][payment_type]=credit_card&payload[subscription][credit_card][site_gateway_setting_id]=&payload[subscription][credit_card][gateway_handle]=&payload[transaction][id]=161537369&payload[transaction][subscription_id]=15100141&payload[transaction][type]=Payment&payload[transaction][kind]=&payload[transaction][transaction_type]=payment&payload[transaction][success]=true&payload[transaction][amount_in_cents]=6400&payload[transaction][memo]=Pookie%20Test%20-%20%2410%20Basic%20Plan%3A%20Renewal%20payment&payload[transaction][created_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[transaction][starting_balance_in_cents]=6400&payload[transaction][ending_balance_in_cents]=0&payload[transaction][gateway_used]=bogus&payload[transaction][gateway_transaction_id]=53433&payload[transaction][gateway_response_code]=&payload[transaction][gateway_order_id]=&payload[transaction][payment_id]=&payload[transaction][product_id]=3792003&payload[transaction][tax_id]=&payload[transaction][component_id]=&payload[transaction][statement_id]=80168049&payload[transaction][customer_id]=14585695&payload[transaction][card_number]=XXXX-XXXX-XXXX-1&payload[transaction][card_expiration]=10%2F2020&payload[transaction][card_type]=bogus&payload[transaction][refunded_amount_in_cents]=0&payload[transaction][invoice_id]=&payload[event_id]=347299364", + "body": "id=141765008&event=payment_success&payload[site][id]=31615&payload[site][subdomain]=general-goods&payload[subscription][id]=15100141&payload[subscription][state]=active&payload[subscription][trial_started_at]=&payload[subscription][trial_ended_at]=&payload[subscription][activated_at]=2016-11-04%2017%3A06%3A43%20-0400&payload[subscription][created_at]=2016-11-04%2017%3A06%3A42%20-0400&payload[subscription][updated_at]=2016-11-08%2016%3A22%3A22%20-0500&payload[subscription][expires_at]=&payload[subscription][balance_in_cents]=0&payload[subscription][current_period_ends_at]=2016-11-09%2016%3A06%3A42%20-0500&payload[subscription][next_assessment_at]=2016-11-09%2016%3A06%3A42%20-0500&payload[subscription][canceled_at]=&payload[subscription][cancellation_message]=&payload[subscription][next_product_id]=&payload[subscription][cancel_at_end_of_period]=false&payload[subscription][payment_collection_method]=automatic&payload[subscription][snap_day]=&payload[subscription][cancellation_method]=&payload[subscription][current_period_started_at]=2016-11-08%2016%3A06%3A42%20-0500&payload[subscription][previous_state]=active&payload[subscription][signup_payment_id]=161034048&payload[subscription][signup_revenue]=64.00&payload[subscription][delayed_cancel_at]=&payload[subscription][coupon_code]=&payload[subscription][total_revenue_in_cents]=32000&payload[subscription][product_price_in_cents]=1000&payload[subscription][product_version_number]=7&payload[subscription][payment_type]=credit_card&payload[subscription][referral_code]=pggn84&payload[subscription][coupon_use_count]=&payload[subscription][coupon_uses_allowed]=&payload[subscription][customer][id]=14585695&payload[subscription][customer][first_name]=Test&payload[subscription][customer][last_name]=Test&payload[subscription][customer][organization]=&payload[subscription][customer][email]=alan999%40example.com&payload[subscription][customer][created_at]=2016-11-04%2017%3A06%3A42%20-0400&payload[subscription][customer][updated_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][reference]=&payload[subscription][customer][address]=&payload[subscription][customer][address_2]=&payload[subscription][customer][city]=&payload[subscription][customer][state]=&payload[subscription][customer][zip]=&payload[subscription][customer][country]=&payload[subscription][customer][phone]=&payload[subscription][customer][portal_invite_last_sent_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][portal_invite_last_accepted_at]=&payload[subscription][customer][verified]=false&payload[subscription][customer][portal_customer_created_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][cc_emails]=&payload[subscription][product][id]=3792003&payload[subscription][product][name]=%2410%20Basic%20Plan&payload[subscription][product][handle]=basic&payload[subscription][product][description]=lorem%20ipsum&payload[subscription][product][accounting_code]=basic&payload[subscription][product][request_credit_card]=false&payload[subscription][product][expiration_interval]=&payload[subscription][product][expiration_interval_unit]=never&payload[subscription][product][created_at]=2016-03-24%2013%3A38%3A39%20-0400&payload[subscription][product][updated_at]=2016-11-03%2013%3A03%3A05%20-0400&payload[subscription][product][price_in_cents]=1000&payload[subscription][product][interval]=1&payload[subscription][product][interval_unit]=day&payload[subscription][product][initial_charge_in_cents]=&payload[subscription][product][trial_price_in_cents]=&payload[subscription][product][trial_interval]=&payload[subscription][product][trial_interval_unit]=month&payload[subscription][product][archived_at]=&payload[subscription][product][require_credit_card]=false&payload[subscription][product][return_params]=&payload[subscription][product][taxable]=false&payload[subscription][product][update_return_url]=&payload[subscription][product][initial_charge_after_trial]=false&payload[subscription][product][version_number]=7&payload[subscription][product][update_return_params]=&payload[subscription][product][product_family][id]=527890&payload[subscription][product][product_family][name]=Acme%20Projects&payload[subscription][product][product_family][description]=&payload[subscription][product][product_family][handle]=billing-plans&payload[subscription][product][product_family][accounting_code]=&payload[subscription][product][public_signup_pages][id]=281054&payload[subscription][product][public_signup_pages][return_url]=http%3A%2F%2Fwww.example.com%3Fsuccessfulsignup&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fkqvmfrbgd89q%2Fbasic&payload[subscription][product][public_signup_pages][id]=281240&payload[subscription][product][public_signup_pages][return_url]=&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fdkffht5dxfd8%2Fbasic&payload[subscription][product][public_signup_pages][id]=282694&payload[subscription][product][public_signup_pages][return_url]=&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fjwffwgdd95s8%2Fbasic&payload[subscription][credit_card][id]=10102821&payload[subscription][credit_card][first_name]=Alan&payload[subscription][credit_card][last_name]=Test&payload[subscription][credit_card][masked_card_number]=XXXX-XXXX-XXXX-1&payload[subscription][credit_card][card_type]=bogus&payload[subscription][credit_card][expiration_month]=10&payload[subscription][credit_card][expiration_year]=2020&payload[subscription][credit_card][customer_id]=14585695&payload[subscription][credit_card][current_vault]=bogus&payload[subscription][credit_card][vault_token]=1&payload[subscription][credit_card][billing_address]=&payload[subscription][credit_card][billing_city]=&payload[subscription][credit_card][billing_state]=&payload[subscription][credit_card][billing_zip]=&payload[subscription][credit_card][billing_country]=&payload[subscription][credit_card][customer_vault_token]=&payload[subscription][credit_card][billing_address_2]=&payload[subscription][credit_card][payment_type]=credit_card&payload[subscription][credit_card][site_gateway_setting_id]=&payload[subscription][credit_card][gateway_handle]=&payload[transaction][id]=161537369&payload[transaction][subscription_id]=15100141&payload[transaction][type]=Payment&payload[transaction][kind]=&payload[transaction][transaction_type]=payment&payload[transaction][success]=true&payload[transaction][amount_in_cents]=6400&payload[transaction][memo]=Alan%20Test%20-%20%2410%20Basic%20Plan%3A%20Renewal%20payment&payload[transaction][created_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[transaction][starting_balance_in_cents]=6400&payload[transaction][ending_balance_in_cents]=0&payload[transaction][gateway_used]=bogus&payload[transaction][gateway_transaction_id]=53433&payload[transaction][gateway_response_code]=&payload[transaction][gateway_order_id]=&payload[transaction][payment_id]=&payload[transaction][product_id]=3792003&payload[transaction][tax_id]=&payload[transaction][component_id]=&payload[transaction][statement_id]=80168049&payload[transaction][customer_id]=14585695&payload[transaction][card_number]=XXXX-XXXX-XXXX-1&payload[transaction][card_expiration]=10%2F2020&payload[transaction][card_type]=bogus&payload[transaction][refunded_amount_in_cents]=0&payload[transaction][invoice_id]=&payload[event_id]=347299364", "signature": "fbcf2f6be579f9658cff90c4373e0ca2", "signature_hmac_sha_256": "db96654f5456c5460062feb944ac8bb1418f9d181ae04a8ed982fe9ffdca8de1" } @@ -208,7 +208,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `body` | [`CreateOrUpdateEndpointRequest`](../../doc/models/create-or-update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint | +| `body` | [`CreateOrUpdateEndpointRequest`](../../doc/models/create-or-update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint. | ## Response Type @@ -261,7 +261,7 @@ puts result # List Endpoints -Returns created endpoints for a site. +Lists endpoints configured for a site. ```ruby def list_endpoints @@ -336,7 +336,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `endpoint_id` | `Integer` | Template, Required | The Advanced Billing id for the endpoint that should be updated | -| `body` | [`CreateOrUpdateEndpointRequest`](../../doc/models/create-or-update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint | +| `body` | [`CreateOrUpdateEndpointRequest`](../../doc/models/create-or-update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint. | ## Response Type diff --git a/doc/models/account-balance.md b/doc/models/account-balance.md index bbb6e72c..4841e006 100644 --- a/doc/models/account-balance.md +++ b/doc/models/account-balance.md @@ -13,13 +13,13 @@ | `automatic_balance_in_cents` | `Integer` | Optional | The automatic balance in cents. | | `remittance_balance_in_cents` | `Integer` | Optional | The remittance balance in cents. | -## Example (as JSON) - -```json -{ - "balance_in_cents": 16, - "automatic_balance_in_cents": 226, - "remittance_balance_in_cents": 62 -} +## Example + +```ruby +account_balance = AccountBalance.new( + balance_in_cents: 166, + automatic_balance_in_cents: 76, + remittance_balance_in_cents: 212 +) ``` diff --git a/doc/models/account-balances.md b/doc/models/account-balances.md index 40750788..f2be7a6d 100644 --- a/doc/models/account-balances.md +++ b/doc/models/account-balances.md @@ -9,41 +9,41 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `open_invoices` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the sum of the subscription's open, payable invoices. | -| `pending_invoices` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the sum of the subscription's pending, payable invoices. | +| `open_invoices` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the sum of the subscription's open, payable invoices. | +| `pending_invoices` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the sum of the subscription's pending, payable invoices. | | `pending_discounts` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the subscription's Pending Discount account. | | `service_credits` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the subscription's Service Credit account. | | `prepayments` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the subscription's Prepayment account. | -## Example (as JSON) - -```json -{ - "open_invoices": { - "balance_in_cents": 40, - "automatic_balance_in_cents": 202, - "remittance_balance_in_cents": 170 - }, - "pending_invoices": { - "balance_in_cents": 0, - "automatic_balance_in_cents": 242, - "remittance_balance_in_cents": 46 - }, - "pending_discounts": { - "balance_in_cents": 88, - "automatic_balance_in_cents": 154, - "remittance_balance_in_cents": 134 - }, - "service_credits": { - "balance_in_cents": 84, - "automatic_balance_in_cents": 70, - "remittance_balance_in_cents": 38 - }, - "prepayments": { - "balance_in_cents": 192, - "automatic_balance_in_cents": 178, - "remittance_balance_in_cents": 146 - } -} +## Example + +```ruby +account_balances = AccountBalances.new( + open_invoices: AccountBalance.new( + balance_in_cents: 40, + automatic_balance_in_cents: 202, + remittance_balance_in_cents: 170 + ), + pending_invoices: AccountBalance.new( + balance_in_cents: 0, + automatic_balance_in_cents: 242, + remittance_balance_in_cents: 46 + ), + pending_discounts: AccountBalance.new( + balance_in_cents: 88, + automatic_balance_in_cents: 154, + remittance_balance_in_cents: 134 + ), + service_credits: AccountBalance.new( + balance_in_cents: 84, + automatic_balance_in_cents: 70, + remittance_balance_in_cents: 38 + ), + prepayments: AccountBalance.new( + balance_in_cents: 192, + automatic_balance_in_cents: 178, + remittance_balance_in_cents: 146 + ) +) ``` diff --git a/doc/models/ach-agreement.md b/doc/models/ach-agreement.md index 78d049c7..f60cb2d2 100644 --- a/doc/models/ach-agreement.md +++ b/doc/models/ach-agreement.md @@ -16,14 +16,14 @@ | `authorizer_last_name` | `String` | Optional | (Required when providing ACH agreement params) The last name of the person authorizing the ACH agreement. | | `ip_address` | `String` | Optional | (Required when providing ACH agreement params) The IP address of the person authorizing the ACH agreement. | -## Example (as JSON) - -```json -{ - "agreement_terms": "agreement_terms4", - "authorizer_first_name": "authorizer_first_name2", - "authorizer_last_name": "authorizer_last_name2", - "ip_address": "ip_address2" -} +## Example + +```ruby +ach_agreement = ACHAgreement.new( + agreement_terms: 'agreement_terms0', + authorizer_first_name: 'authorizer_first_name6', + authorizer_last_name: 'authorizer_last_name8', + ip_address: 'ip_address8' +) ``` diff --git a/doc/models/activate-event-based-component.md b/doc/models/activate-event-based-component.md index 37ee98fd..16291de2 100644 --- a/doc/models/activate-event-based-component.md +++ b/doc/models/activate-event-based-component.md @@ -13,33 +13,33 @@ | `billing_schedule` | [`BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | Billing schedule settings for component allocations or usages on multi-frequency subscriptions. Use this to start a component's billing period on a custom date instead of aligning with the product charge schedule. | | `custom_price` | [`ComponentCustomPrice`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | -## Example (as JSON) - -```json -{ - "price_point_id": 44, - "billing_schedule": { - "initial_billing_at": "2016-03-13" - }, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 66, - "interval_unit": "day", - "list_price_point_id": 174, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } -} +## Example + +```ruby +activate_event_based_component = ActivateEventBasedComponent.new( + price_point_id: 166, + billing_schedule: BillingSchedule.new( + initial_billing_at: Date.iso8601('2016-03-13') + ), + custom_price: ComponentCustomPrice.new( + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false, + pricing_scheme: PricingScheme::STAIRSTEP, + interval: 66, + interval_unit: IntervalUnit::DAY, + list_price_point_id: 174 + ) +) ``` diff --git a/doc/models/activate-subscription-request.md b/doc/models/activate-subscription-request.md index bd1ba902..51f62bcb 100644 --- a/doc/models/activate-subscription-request.md +++ b/doc/models/activate-subscription-request.md @@ -9,13 +9,13 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `revert_on_failure` | `TrueClass \| FalseClass` | Optional | You may choose how to handle the activation failure. `true` means do not change the subscription’s state and billing period. `false` means to continue through with the activation and enter an end of life state. If this parameter is omitted or `null` is passed it will default to value set in the site settings (default: `true`) | +| `revert_on_failure` | `TrueClass \| FalseClass` | Optional | You may choose how to handle the activation failure. `true` means do not change the subscription’s state and billing period. `false` means to continue through with the activation and enter an end-of-life state. If this parameter is omitted or `null` is passed it will default to the value set in the site settings (default: `true`). | -## Example (as JSON) +## Example -```json -{ - "revert_on_failure": false -} +```ruby +activate_subscription_request = ActivateSubscriptionRequest.new( + revert_on_failure: false +) ``` diff --git a/doc/models/add-coupons-request.md b/doc/models/add-coupons-request.md index bee9a51c..29688d38 100644 --- a/doc/models/add-coupons-request.md +++ b/doc/models/add-coupons-request.md @@ -11,14 +11,14 @@ | --- | --- | --- | --- | | `codes` | `Array[String]` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "codes": [ - "codes0", - "codes1" +```ruby +add_coupons_request = AddCouponsRequest.new( + codes: [ + 'codes6', + 'codes7' ] -} +) ``` diff --git a/doc/models/add-subscription-to-a-group.md b/doc/models/add-subscription-to-a-group.md index aa4cda28..4db58d7f 100644 --- a/doc/models/add-subscription-to-a-group.md +++ b/doc/models/add-subscription-to-a-group.md @@ -11,21 +11,21 @@ | --- | --- | --- | --- | | `group` | [`GroupSettings`](../../doc/models/group-settings.md) | Optional | - | -## Example (as JSON) - -```json -{ - "group": { - "target": { - "type": "parent", - "id": 236 - }, - "billing": { - "accrue": false, - "align_date": false, - "prorate": false - } - } -} +## Example + +```ruby +add_subscription_to_a_group = AddSubscriptionToAGroup.new( + group: GroupSettings.new( + target: GroupTarget.new( + type: GroupTargetType::PARENT, + id: 236 + ), + billing: GroupBilling.new( + accrue: false, + align_date: false, + prorate: false + ) + ) +) ``` diff --git a/doc/models/address-change.md b/doc/models/address-change.md index 81b4da7f..a04e4b3f 100644 --- a/doc/models/address-change.md +++ b/doc/models/address-change.md @@ -12,24 +12,24 @@ | `before` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Required | - | | `after` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Required | - | -## Example (as JSON) - -```json -{ - "before": { - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" - }, - "after": { - "street": "street2", - "line2": "line26", - "city": "city8", - "state": "state2", - "zip": "zip4" - } -} +## Example + +```ruby +address_change = AddressChange.new( + before: InvoiceAddress.new( + street: 'street0', + line2: 'line24', + city: 'city0', + state: 'state6', + zip: 'zip4' + ), + after: InvoiceAddress.new( + street: 'street2', + line2: 'line26', + city: 'city8', + state: 'state2', + zip: 'zip4' + ) +) ``` diff --git a/doc/models/agreement-acceptance.md b/doc/models/agreement-acceptance.md index d4bb2357..c1a2b2cd 100644 --- a/doc/models/agreement-acceptance.md +++ b/doc/models/agreement-acceptance.md @@ -12,21 +12,21 @@ Required when creating a subscription with Maxio Payments. | Name | Type | Tags | Description | | --- | --- | --- | --- | | `ip_address` | `String` | Optional | Required when providing agreement acceptance params. | -| `terms_url` | `String` | Optional | Required when creating a subscription with Maxio Payments. Either terms_url or provacy_policy_url required when providing agreement_acceptance params. | +| `terms_url` | `String` | Optional | Required when creating a subscription with Maxio Payments. Either terms_url or privacy_policy_url is required when providing agreement_acceptance params. | | `privacy_policy_url` | `String` | Optional | - | | `return_refund_policy_url` | `String` | Optional | - | | `delivery_policy_url` | `String` | Optional | - | | `secure_checkout_policy_url` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "ip_address": "ip_address2", - "terms_url": "terms_url0", - "privacy_policy_url": "privacy_policy_url0", - "return_refund_policy_url": "return_refund_policy_url4", - "delivery_policy_url": "delivery_policy_url8" -} +```ruby +agreement_acceptance = AgreementAcceptance.new( + ip_address: 'ip_address8', + terms_url: 'terms_url6', + privacy_policy_url: 'privacy_policy_url4', + return_refund_policy_url: 'return_refund_policy_url0', + delivery_policy_url: 'delivery_policy_url4' +) ``` diff --git a/doc/models/all-vaults.md b/doc/models/all-vaults.md index 5e5e19d0..9a67c57c 100644 --- a/doc/models/all-vaults.md +++ b/doc/models/all-vaults.md @@ -46,3 +46,9 @@ The vault that stores the payment profile with the provided `vault_token`. Use ` | `UNIPAAS` | | `WIRECARD` | +## Example + +```ruby +all_vaults = AllVaults::STRIPE_CONNECT +``` + diff --git a/doc/models/allocate-components.md b/doc/models/allocate-components.md index 0cbfc61c..546c0e5f 100644 --- a/doc/models/allocate-components.md +++ b/doc/models/allocate-components.md @@ -15,35 +15,27 @@ | `accrue_charge` | `TrueClass \| FalseClass` | Optional | - | | `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. | | `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. | -| `payment_collection_method` | [`CollectionMethod`](../../doc/models/collection-method.md) | Optional | (Optional) If not passed, the allocation(s) will use the payment collection method on the subscription | +| `payment_collection_method` | [`CollectionMethod`](../../doc/models/collection-method.md) | Optional | (Optional) If not passed, the allocation(s) will use the payment collection method on the subscription. | | `initiate_dunning` | `TrueClass \| FalseClass` | Optional | If true, if the immediate component payment fails, initiate dunning for the subscription.
Otherwise, leave the charges on the subscription to pay for at renewal. | -## Example (as JSON) - -```json -{ - "proration_upgrade_scheme": "proration_upgrade_scheme2", - "proration_downgrade_scheme": "proration_downgrade_scheme0", - "allocations": [ - { - "quantity": 26.48, - "decimal_quantity": "decimal_quantity8", - "previous_quantity": 55.5, - "decimal_previous_quantity": "decimal_previous_quantity2", - "component_id": 242, - "memo": "memo6" - }, - { - "quantity": 26.48, - "decimal_quantity": "decimal_quantity8", - "previous_quantity": 55.5, - "decimal_previous_quantity": "decimal_previous_quantity2", - "component_id": 242, - "memo": "memo6" - } +## Example + +```ruby +allocate_components = AllocateComponents.new( + proration_upgrade_scheme: 'proration_upgrade_scheme2', + proration_downgrade_scheme: 'proration_downgrade_scheme0', + allocations: [ + CreateAllocation.new( + quantity: 26.48, + decimal_quantity: 'decimal_quantity8', + previous_quantity: 55.5, + decimal_previous_quantity: 'decimal_previous_quantity2', + component_id: 242, + memo: 'memo6' + ) ], - "accrue_charge": false, - "upgrade_charge": "full" -} + accrue_charge: false, + upgrade_charge: CreditType::PRORATED +) ``` diff --git a/doc/models/allocation-expiration-date.md b/doc/models/allocation-expiration-date.md index 48f93d08..f19343f2 100644 --- a/doc/models/allocation-expiration-date.md +++ b/doc/models/allocation-expiration-date.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `expires_at` | `DateTime` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "expires_at": "2016-03-13T12:52:32.123Z" -} +```ruby +allocation_expiration_date = AllocationExpirationDate.new( + expires_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/allocation-preview-direction.md b/doc/models/allocation-preview-direction.md index 2e124430..4bf65261 100644 --- a/doc/models/allocation-preview-direction.md +++ b/doc/models/allocation-preview-direction.md @@ -12,3 +12,9 @@ | `UPGRADE` | | `DOWNGRADE` | +## Example + +```ruby +allocation_preview_direction = AllocationPreviewDirection::UPGRADE +``` + diff --git a/doc/models/allocation-preview-item.md b/doc/models/allocation-preview-item.md index 348e5622..807ac9f4 100644 --- a/doc/models/allocation-preview-item.md +++ b/doc/models/allocation-preview-item.md @@ -21,22 +21,22 @@ | `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. | | `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. | | `price_point_id` | `Integer` | Optional | - | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component 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 component price point, either month or day. This property is only available for sites with Multifrequency enabled. | | `previous_price_point_id` | `Integer` | Optional | - | | `price_point_handle` | `String` | Optional | - | | `price_point_name` | `String` | Optional | - | | `component_handle` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "component_id": 54, - "subscription_id": 54, - "quantity": 78, - "previous_quantity": 192, - "memo": "memo6" -} +```ruby +allocation_preview_item = AllocationPreviewItem.new( + component_id: 78, + subscription_id: 78, + quantity: 102, + previous_quantity: 168, + memo: 'memo6' +) ``` diff --git a/doc/models/allocation-preview-line-item-kind.md b/doc/models/allocation-preview-line-item-kind.md index cc67eef1..2bc9ac66 100644 --- a/doc/models/allocation-preview-line-item-kind.md +++ b/doc/models/allocation-preview-line-item-kind.md @@ -16,3 +16,9 @@ A handle for the line item kind for allocation preview | `COUPON` | | `TAX` | +## Example + +```ruby +allocation_preview_line_item_kind = AllocationPreviewLineItemKind::COUPON +``` + diff --git a/doc/models/allocation-preview-line-item.md b/doc/models/allocation-preview-line-item.md index 0d91d2c0..21f25fbd 100644 --- a/doc/models/allocation-preview-line-item.md +++ b/doc/models/allocation-preview-line-item.md @@ -17,17 +17,17 @@ | `taxable_amount_in_cents` | `Integer` | Optional | - | | `component_id` | `Integer` | Optional | - | | `component_handle` | `String` | Optional | - | -| `direction` | [`AllocationPreviewDirection`](../../doc/models/allocation-preview-direction.md) | Optional | Visible when using Fine-grained Component Control | - -## Example (as JSON) - -```json -{ - "transaction_type": "credit", - "kind": "quantity_based_component", - "amount_in_cents": 24, - "memo": "memo6", - "discount_amount_in_cents": 172 -} +| `direction` | [`AllocationPreviewDirection`](../../doc/models/allocation-preview-direction.md) | Optional | Visible when using Fine-grained Component Control. | + +## Example + +```ruby +allocation_preview_line_item = AllocationPreviewLineItem.new( + transaction_type: LineItemTransactionType::CHARGE, + kind: AllocationPreviewLineItemKind::COUPON, + amount_in_cents: 58, + memo: 'memo8', + discount_amount_in_cents: 138 +) ``` diff --git a/doc/models/allocation-preview-response.md b/doc/models/allocation-preview-response.md index fd9d8105..80b49814 100644 --- a/doc/models/allocation-preview-response.md +++ b/doc/models/allocation-preview-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `allocation_preview` | [`AllocationPreview`](../../doc/models/allocation-preview.md) | Required | - | -## Example (as JSON) - -```json -{ - "allocation_preview": { - "start_date": "2016-03-13T12:52:32.123Z", - "end_date": "2016-03-13T12:52:32.123Z", - "subtotal_in_cents": 240, - "total_tax_in_cents": 108, - "total_discount_in_cents": 142 - } -} +## Example + +```ruby +allocation_preview_response = AllocationPreviewResponse.new( + allocation_preview: AllocationPreview.new( + start_date: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + end_date: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + subtotal_in_cents: 240, + total_tax_in_cents: 108, + total_discount_in_cents: 142 + ) +) ``` diff --git a/doc/models/allocation-preview.md b/doc/models/allocation-preview.md index 978182c1..1f865fce 100644 --- a/doc/models/allocation-preview.md +++ b/doc/models/allocation-preview.md @@ -23,15 +23,15 @@ | `period_type` | `String` | Optional | - | | `existing_balance_in_cents` | `Integer` | Optional | An integer representing the amount of the subscription's current balance | -## Example (as JSON) - -```json -{ - "start_date": "2016-03-13T12:52:32.123Z", - "end_date": "2016-03-13T12:52:32.123Z", - "subtotal_in_cents": 4, - "total_tax_in_cents": 128, - "total_discount_in_cents": 122 -} +## Example + +```ruby +allocation_preview = AllocationPreview.new( + start_date: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + end_date: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + subtotal_in_cents: 240, + total_tax_in_cents: 108, + total_discount_in_cents: 142 +) ``` diff --git a/doc/models/allocation-response.md b/doc/models/allocation-response.md index 59d3e1ac..d5fc1373 100644 --- a/doc/models/allocation-response.md +++ b/doc/models/allocation-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `allocation` | [`Allocation`](../../doc/models/allocation.md) | Optional | - | -## Example (as JSON) - -```json -{ - "allocation": { - "allocation_id": 238, - "component_id": 8, - "component_handle": "component_handle8", - "subscription_id": 8, - "quantity": 32 - } -} +## Example + +```ruby +allocation_response = AllocationResponse.new( + allocation: Allocation.new( + allocation_id: 238, + component_id: 8, + component_handle: 'component_handle8', + subscription_id: 8, + quantity: 32 + ) +) ``` diff --git a/doc/models/allocation-settings.md b/doc/models/allocation-settings.md index d056e348..04eae611 100644 --- a/doc/models/allocation-settings.md +++ b/doc/models/allocation-settings.md @@ -13,13 +13,13 @@ | `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. | | `accrue_charge` | `String` | Optional | Either "true" or "false". | -## Example (as JSON) - -```json -{ - "upgrade_charge": "none", - "downgrade_credit": "prorated", - "accrue_charge": "accrue_charge0" -} +## Example + +```ruby +allocation_settings = AllocationSettings.new( + upgrade_charge: CreditType::PRORATED, + downgrade_credit: CreditType::PRORATED, + accrue_charge: 'accrue_charge0' +) ``` diff --git a/doc/models/allocation.md b/doc/models/allocation.md index 8f160861..88c9709e 100644 --- a/doc/models/allocation.md +++ b/doc/models/allocation.md @@ -9,21 +9,21 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `allocation_id` | `Integer` | Optional | The allocation unique id | -| `component_id` | `Integer` | Optional | The integer component ID for the allocation. This references a component that you have created in your Product setup | -| `component_handle` | `String` | Optional | The handle of the component. This references a component that you have created in your Product setup | -| `subscription_id` | `Integer` | Optional | The integer subscription ID for the allocation. This references a unique subscription in your Site | +| `allocation_id` | `Integer` | Optional | The allocation unique ID | +| `component_id` | `Integer` | Optional | The integer component ID for the allocation. This references a component that you have created in your Product setup. | +| `component_handle` | `String` | Optional | The handle of the component. This references a component that you have created in your Product setup. | +| `subscription_id` | `Integer` | Optional | The integer subscription ID for the allocation. This references a unique subscription in your Site. | | `quantity` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `previous_quantity` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `memo` | `String` | Optional | The memo passed when the allocation was created | -| `timestamp` | `DateTime` | Optional | The time that the allocation was recorded, in format and UTC timezone, i.e. 2012-11-20T22:00:37Z | +| `timestamp` | `DateTime` | Optional | The time that the allocation was recorded, in ISO 8601 format and UTC timezone, e.g., 2012-11-20T22:00:37Z | | `created_at` | `DateTime` | Optional | Timestamp indicating when this allocation was created | | `proration_upgrade_scheme` | `String` | Optional | The scheme used if the proration was an upgrade. This is only present when the allocation was created mid-period. | | `proration_downgrade_scheme` | `String` | Optional | The scheme used if the proration was a downgrade. This is only present when the allocation was created mid-period. | | `price_point_id` | `Integer` | Optional | - | | `price_point_name` | `String` | Optional | - | | `price_point_handle` | `String` | Optional | - | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component 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 component price point, either month or day. This property is only available for sites with Multifrequency enabled. | | `previous_price_point_id` | `Integer` | Optional | - | | `accrue_charge` | `TrueClass \| FalseClass` | Optional | If the change in cost is an upgrade, this determines if the charge should accrue to the next renewal or if capture should be attempted immediately. | @@ -35,15 +35,15 @@ | `used_quantity` | `Integer` | Optional | - | | `charge_id` | `Integer` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "allocation_id": 102, - "component_id": 144, - "component_handle": "component_handle0", - "subscription_id": 144, - "quantity": 168 -} +```ruby +allocation = Allocation.new( + allocation_id: 238, + component_id: 8, + component_handle: 'component_handle8', + subscription_id: 8, + quantity: 32 +) ``` diff --git a/doc/models/apple-pay-payment-profile.md b/doc/models/apple-pay-payment-profile.md index 0d374a4b..a2789377 100644 --- a/doc/models/apple-pay-payment-profile.md +++ b/doc/models/apple-pay-payment-profile.md @@ -12,7 +12,7 @@ | `id` | `Integer` | Optional | The Chargify-assigned ID of the Apple Pay payment profile. | | `first_name` | `String` | Optional | The first name of the Apple Pay account holder | | `last_name` | `String` | Optional | The last name of the Apple Pay account holder | -| `customer_id` | `Integer` | Optional | The Chargify-assigned id for the customer record to which the Apple Pay account belongs | +| `customer_id` | `Integer` | Optional | The Chargify-assigned ID for the customer record to which the Apple Pay account belongs | | `current_vault` | [`ApplePayVault`](../../doc/models/apple-pay-vault.md) | Optional | The vault that stores the payment profile with the provided vault_token. | | `vault_token` | `String` | Optional | The “token” provided by your vault storage for an already stored payment profile | | `billing_address` | `String` | Optional | The current billing street address for the Apple Pay account | @@ -28,16 +28,16 @@ | `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) - -```json -{ - "payment_type": "apple_pay", - "id": 60, - "first_name": "first_name2", - "last_name": "last_name0", - "customer_id": 98, - "current_vault": "braintree_blue" -} +## Example + +```ruby +apple_pay_payment_profile = ApplePayPaymentProfile.new( + payment_type: PaymentType::APPLE_PAY, + id: 188, + first_name: 'first_name2', + last_name: 'last_name0', + customer_id: 226, + current_vault: ApplePayVault::BRAINTREE_BLUE +) ``` diff --git a/doc/models/apple-pay-vault.md b/doc/models/apple-pay-vault.md index 9e66d7b5..c4ad208e 100644 --- a/doc/models/apple-pay-vault.md +++ b/doc/models/apple-pay-vault.md @@ -13,3 +13,9 @@ The vault that stores the payment profile with the provided vault_token. | --- | | `BRAINTREE_BLUE` | +## Example + +```ruby +apple_pay_vault = ApplePayVault::BRAINTREE_BLUE +``` + diff --git a/doc/models/applied-credit-note-data.md b/doc/models/applied-credit-note-data.md index c9c3d3dc..bf7e2ccb 100644 --- a/doc/models/applied-credit-note-data.md +++ b/doc/models/applied-credit-note-data.md @@ -12,12 +12,12 @@ | `uid` | `String` | Optional | The UID of the credit note | | `number` | `String` | Optional | The number of the credit note | -## Example (as JSON) +## Example -```json -{ - "uid": "uid2", - "number": "number0" -} +```ruby +applied_credit_note_data = AppliedCreditNoteData.new( + uid: 'uid2', + number: 'number0' +) ``` diff --git a/doc/models/apply-credit-note-event-data.md b/doc/models/apply-credit-note-event-data.md index 446c6472..d020e320 100644 --- a/doc/models/apply-credit-note-event-data.md +++ b/doc/models/apply-credit-note-event-data.md @@ -19,32 +19,36 @@ Example schema for an `apply_credit_note` event | `transaction_time` | `DateTime` | Optional | The time the credit note was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" | | `memo` | `String` | Optional | The credit note memo. | | `role` | `String` | Optional | The role of the credit note (e.g. 'general') | -| `consolidated_invoice` | `TrueClass \| FalseClass` | Optional | Shows whether it was applied to consolidated invoice or not | +| `consolidated_invoice` | `TrueClass \| FalseClass` | Optional | Shows whether it was applied to consolidated invoice or not. | | `applied_credit_notes` | [`Array[AppliedCreditNoteData]`](../../doc/models/applied-credit-note-data.md) | Optional | List of credit notes applied to children invoices (if consolidated invoice) | -## Example (as JSON) - -```json -{ - "uid": "uid2", - "credit_note_number": "credit_note_number4", - "credit_note_uid": "credit_note_uid4", - "original_amount": "original_amount6", - "applied_amount": "applied_amount6", - "transaction_time": "2016-03-13T12:52:32.123Z", - "memo": "memo6", - "role": "role4", - "consolidated_invoice": false, - "applied_credit_notes": [ - { - "uid": "uid4", - "number": "number8" - }, - { - "uid": "uid4", - "number": "number8" - } +## Example + +```ruby +apply_credit_note_event_data = ApplyCreditNoteEventData.new( + uid: 'uid8', + credit_note_number: 'credit_note_number8', + credit_note_uid: 'credit_note_uid8', + original_amount: 'original_amount2', + applied_amount: 'applied_amount0', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + memo: 'memo2', + role: 'role8', + consolidated_invoice: false, + applied_credit_notes: [ + AppliedCreditNoteData.new( + uid: 'uid4', + number: 'number8' + ), + AppliedCreditNoteData.new( + uid: 'uid4', + number: 'number8' + ), + AppliedCreditNoteData.new( + uid: 'uid4', + number: 'number8' + ) ] -} +) ``` diff --git a/doc/models/apply-credit-note-event.md b/doc/models/apply-credit-note-event.md index 2b9a6500..05eca48e 100644 --- a/doc/models/apply-credit-note-event.md +++ b/doc/models/apply-credit-note-event.md @@ -15,49 +15,49 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::APPLY_CREDIT_NOTE` | | `event_data` | [`ApplyCreditNoteEventData`](../../doc/models/apply-credit-note-event-data.md) | Required | Example schema for an `apply_credit_note` event | -## Example (as JSON) - -```json -{ - "id": 214, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "apply_credit_note", - "event_data": { - "uid": "uid6", - "credit_note_number": "credit_note_number0", - "credit_note_uid": "credit_note_uid0", - "original_amount": "original_amount0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "memo": "memo0", - "role": "role0", - "consolidated_invoice": false, - "applied_credit_notes": [ - { - "uid": "uid4", - "number": "number8" - }, - { - "uid": "uid4", - "number": "number8" - }, - { - "uid": "uid4", - "number": "number8" - } +## Example + +```ruby +apply_credit_note_event = ApplyCreditNoteEvent.new( + id: 56, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::APPLY_CREDIT_NOTE, + event_data: ApplyCreditNoteEventData.new( + uid: 'uid6', + credit_note_number: 'credit_note_number0', + credit_note_uid: 'credit_note_uid0', + original_amount: 'original_amount0', + applied_amount: 'applied_amount2', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + memo: 'memo0', + role: 'role0', + consolidated_invoice: false, + applied_credit_notes: [ + AppliedCreditNoteData.new( + uid: 'uid4', + number: 'number8' + ), + AppliedCreditNoteData.new( + uid: 'uid4', + number: 'number8' + ), + AppliedCreditNoteData.new( + uid: 'uid4', + number: 'number8' + ) ] - } -} + ) +) ``` diff --git a/doc/models/apply-debit-note-event-data.md b/doc/models/apply-debit-note-event-data.md index 9d00afa9..6b8fd59b 100644 --- a/doc/models/apply-debit-note-event-data.md +++ b/doc/models/apply-debit-note-event-data.md @@ -18,16 +18,16 @@ Example schema for an `apply_debit_note` event | `memo` | `String` | Optional | The debit note memo. | | `transaction_time` | `DateTime` | Optional | The time the debit note was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" | -## Example (as JSON) - -```json -{ - "debit_note_number": "debit_note_number0", - "debit_note_uid": "debit_note_uid6", - "original_amount": "original_amount4", - "applied_amount": "applied_amount8", - "memo": "memo4", - "transaction_time": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +apply_debit_note_event_data = ApplyDebitNoteEventData.new( + debit_note_number: 'debit_note_number2', + debit_note_uid: 'debit_note_uid8', + original_amount: 'original_amount6', + applied_amount: 'applied_amount6', + memo: 'memo6', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/apply-debit-note-event.md b/doc/models/apply-debit-note-event.md index fa5c13b6..36d89c33 100644 --- a/doc/models/apply-debit-note-event.md +++ b/doc/models/apply-debit-note-event.md @@ -15,32 +15,32 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::APPLY_DEBIT_NOTE` | | `event_data` | [`ApplyDebitNoteEventData`](../../doc/models/apply-debit-note-event-data.md) | Required | Example schema for an `apply_debit_note` event | -## Example (as JSON) - -```json -{ - "id": 164, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "apply_debit_note", - "event_data": { - "debit_note_number": "debit_note_number6", - "debit_note_uid": "debit_note_uid2", - "original_amount": "original_amount0", - "applied_amount": "applied_amount2", - "memo": "memo0", - "transaction_time": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ruby +apply_debit_note_event = ApplyDebitNoteEvent.new( + id: 216, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::APPLY_DEBIT_NOTE, + event_data: ApplyDebitNoteEventData.new( + debit_note_number: 'debit_note_number6', + debit_note_uid: 'debit_note_uid2', + original_amount: 'original_amount0', + applied_amount: 'applied_amount2', + memo: 'memo0', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/apply-payment-event-data.md b/doc/models/apply-payment-event-data.md index c86f574d..250d2b34 100644 --- a/doc/models/apply-payment-event-data.md +++ b/doc/models/apply-payment-event-data.md @@ -23,23 +23,23 @@ Example schema for an `apply_payment` event | `prepayment` | `TrueClass \| FalseClass` | Optional | - | | `external` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) - -```json -{ - "consolidation_level": "child", - "memo": "memo8", - "original_amount": "original_amount8", - "applied_amount": "applied_amount4", - "transaction_time": "2016-03-13T12:52:32.123Z", - "payment_method": { - "type": "apple_pay" - }, - "transaction_id": 196, - "parent_invoice_number": 174, - "remaining_prepayment_amount": "remaining_prepayment_amount6", - "prepayment": false, - "external": false -} +## Example + +```ruby +apply_payment_event_data = ApplyPaymentEventData.new( + consolidation_level: InvoiceConsolidationLevel::PARENT, + memo: 'memo2', + original_amount: 'original_amount2', + applied_amount: 'applied_amount0', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + payment_method: PaymentMethodApplePay.new( + type: InvoiceEventPaymentMethod::APPLE_PAY + ), + transaction_id: 112, + parent_invoice_number: 2, + remaining_prepayment_amount: 'remaining_prepayment_amount2', + prepayment: false, + external: false +) ``` diff --git a/doc/models/apply-payment-event.md b/doc/models/apply-payment-event.md index cf023777..d589a7a6 100644 --- a/doc/models/apply-payment-event.md +++ b/doc/models/apply-payment-event.md @@ -15,39 +15,39 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::APPLY_PAYMENT` | | `event_data` | [`ApplyPaymentEventData`](../../doc/models/apply-payment-event-data.md) | Required | Example schema for an `apply_payment` event | -## Example (as JSON) - -```json -{ - "id": 234, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "apply_payment", - "event_data": { - "consolidation_level": "child", - "memo": "memo0", - "original_amount": "original_amount0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "payment_method": { - "type": "apple_pay" - }, - "transaction_id": 78, - "parent_invoice_number": 36, - "remaining_prepayment_amount": "remaining_prepayment_amount6", - "prepayment": false, - "external": false - } -} +## Example + +```ruby +apply_payment_event = ApplyPaymentEvent.new( + id: 244, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::APPLY_PAYMENT, + event_data: ApplyPaymentEventData.new( + consolidation_level: InvoiceConsolidationLevel::CHILD, + memo: 'memo0', + original_amount: 'original_amount0', + applied_amount: 'applied_amount2', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + payment_method: PaymentMethodApplePay.new( + type: InvoiceEventPaymentMethod::APPLE_PAY + ), + transaction_id: 78, + parent_invoice_number: 36, + remaining_prepayment_amount: 'remaining_prepayment_amount6', + prepayment: false, + external: false + ) +) ``` diff --git a/doc/models/attribute-error.md b/doc/models/attribute-error.md index fb0f364b..21f0ec86 100644 --- a/doc/models/attribute-error.md +++ b/doc/models/attribute-error.md @@ -11,14 +11,15 @@ | --- | --- | --- | --- | | `attribute` | `Array[String]` | Required | - | -## Example (as JSON) - -```json -{ - "attribute": [ - "attribute6", - "attribute7" +## Example + +```ruby +attribute_error = AttributeError.new( + attribute: [ + 'attribute6', + 'attribute5', + 'attribute4' ] -} +) ``` diff --git a/doc/models/auto-invite.md b/doc/models/auto-invite.md index c467ad11..014fd519 100644 --- a/doc/models/auto-invite.md +++ b/doc/models/auto-invite.md @@ -12,3 +12,9 @@ | `NO` | Do not send the invitation email. | | `YES` | Automatically send the invitation email. | +## Example + +```ruby +auto_invite = AutoInvite::NO +``` + diff --git a/doc/models/auto-resume.md b/doc/models/auto-resume.md index 87f9cdf7..5078faaf 100644 --- a/doc/models/auto-resume.md +++ b/doc/models/auto-resume.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `automatically_resume_at` | `DateTime` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "automatically_resume_at": "2016-03-13T12:52:32.123Z" -} +```ruby +auto_resume = AutoResume.new( + automatically_resume_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/available-actions.md b/doc/models/available-actions.md index 29da049d..94657f78 100644 --- a/doc/models/available-actions.md +++ b/doc/models/available-actions.md @@ -11,14 +11,14 @@ | --- | --- | --- | --- | | `send_email` | [`SendEmail`](../../doc/models/send-email.md) | Optional | - | -## Example (as JSON) - -```json -{ - "send_email": { - "can_execute": false, - "url": "url0" - } -} +## Example + +```ruby +available_actions = AvailableActions.new( + send_email: SendEmail.new( + can_execute: false, + url: 'url0' + ) +) ``` diff --git a/doc/models/backport-invoice-event.md b/doc/models/backport-invoice-event.md index bf38b709..cd3f75da 100644 --- a/doc/models/backport-invoice-event.md +++ b/doc/models/backport-invoice-event.md @@ -15,35 +15,35 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::BACKPORT_INVOICE` | | `event_data` | [`Invoice`](../../doc/models/invoice.md) | Required | Example schema for an `backport_invoice` event | -## Example (as JSON) - -```json -{ - "id": 78, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "backport_invoice", - "event_data": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 206, - "uid": "uid6", - "site_id": 132, - "customer_id": 244, - "subscription_id": 60 - } -} +## Example + +```ruby +backport_invoice_event = BackportInvoiceEvent.new( + id: 236, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::BACKPORT_INVOICE, + event_data: Invoice.new( + id: 206, + uid: 'uid6', + site_id: 132, + customer_id: 244, + subscription_id: 60, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ) +) ``` diff --git a/doc/models/bank-account-attributes.md b/doc/models/bank-account-attributes.md index 658f5ae2..d635a438 100644 --- a/doc/models/bank-account-attributes.md +++ b/doc/models/bank-account-attributes.md @@ -11,26 +11,26 @@ | --- | --- | --- | --- | | `chargify_token` | `String` | Optional | - | | `bank_name` | `String` | Optional | (Required when creating a subscription with ACH or GoCardless) The name of the bank where the customer’s account resides | -| `bank_routing_number` | `String` | Optional | (Required when creating a subscription with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API | +| `bank_routing_number` | `String` | Optional | (Required when creating a subscription with ACH; optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API. | | `bank_account_number` | `String` | Optional | (Required when creating a subscription with ACH. Required when creating a subscription with GoCardless and bank_iban is blank) The customerʼs bank account number | | `bank_account_type` | [`BankAccountType`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking | -| `bank_branch_code` | `String` | Optional | (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided | -| `bank_iban` | `String` | Optional | (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided | +| `bank_branch_code` | `String` | Optional | (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided. | +| `bank_iban` | `String` | Optional | (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided. | | `bank_account_holder_type` | [`BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | | `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Optional | - | | `current_vault` | [`BankAccountVault`](../../doc/models/bank-account-vault.md) | Optional | The vault that stores the payment profile with the provided vault_token. Use `bogus` for testing. | | `vault_token` | `String` | Optional | - | | `customer_vault_token` | `String` | Optional | (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token | -## Example (as JSON) +## Example -```json -{ - "chargify_token": "chargify_token0", - "bank_name": "bank_name2", - "bank_routing_number": "bank_routing_number8", - "bank_account_number": "bank_account_number4", - "bank_account_type": "checking" -} +```ruby +bank_account_attributes = BankAccountAttributes.new( + chargify_token: 'chargify_token6', + bank_name: 'bank_name6', + bank_routing_number: 'bank_routing_number4', + bank_account_number: 'bank_account_number0', + bank_account_type: BankAccountType::CHECKING +) ``` diff --git a/doc/models/bank-account-holder-type.md b/doc/models/bank-account-holder-type.md index 129dc3bc..96c3cb0f 100644 --- a/doc/models/bank-account-holder-type.md +++ b/doc/models/bank-account-holder-type.md @@ -14,3 +14,9 @@ Defaults to personal | `PERSONAL` | | `BUSINESS` | +## Example + +```ruby +bank_account_holder_type = BankAccountHolderType::PERSONAL +``` + diff --git a/doc/models/bank-account-payment-profile.md b/doc/models/bank-account-payment-profile.md index 68a15e49..69b7e204 100644 --- a/doc/models/bank-account-payment-profile.md +++ b/doc/models/bank-account-payment-profile.md @@ -9,10 +9,10 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `Integer` | Optional | The Chargify-assigned ID of the stored bank account. This value can be used as an input to payment_profile_id when creating a subscription, in order to re-use a stored payment profile for the same customer | +| `id` | `Integer` | Optional | The Chargify-assigned ID of the stored bank account. This value can be used as an input to payment_profile_id when creating a subscription, in order to re-use a stored payment profile for the same customer. | | `first_name` | `String` | Optional | The first name of the bank account holder | | `last_name` | `String` | Optional | The last name of the bank account holder | -| `customer_id` | `Integer` | Optional | The Chargify-assigned id for the customer record to which the bank account belongs | +| `customer_id` | `Integer` | Optional | The Chargify-assigned ID for the customer record to which the bank account belongs | | `current_vault` | [`BankAccountVault`](../../doc/models/bank-account-vault.md) | Optional | The vault that stores the payment profile with the provided vault_token. Use `bogus` for testing. | | `vault_token` | `String` | Optional | The "token" provided by your vault storage for an already stored payment profile | | `billing_address` | `String` | Optional | The current billing street address for the bank account | @@ -23,28 +23,28 @@ | `customer_vault_token` | `String` | Optional | (only for Authorize.Net CIM storage): the customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token. | | `billing_address_2` | `String` | Optional | The current billing street address, second line, for the bank account | | `bank_name` | `String` | Optional | The bank where the account resides | -| `masked_bank_routing_number` | `String` | Optional | A string representation of the stored bank routing number with all but the last 4 digits marked with X's (i.e. 'XXXXXXX1111'). payment_type will be bank_account | -| `masked_bank_account_number` | `String` | Optional | A string representation of the stored bank account number with all but the last 4 digits marked with X's (i.e. 'XXXXXXX1111') | +| `masked_bank_routing_number` | `String` | Optional | A string representation of the stored bank routing number with all but the last 4 digits marked with X's (i.e. 'XXXXXXX1111'). payment_type will be bank_account. | +| `masked_bank_account_number` | `String` | Optional | A string representation of the stored bank account number with all but the last 4 digits marked with X's (i.e. 'XXXXXXX1111'). | | `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) - -```json -{ - "payment_type": "bank_account", - "verified": false, - "id": 188, - "first_name": "first_name6", - "last_name": "last_name4", - "customer_id": 226, - "current_vault": "authorizenet" -} +## Example + +```ruby +bank_account_payment_profile = BankAccountPaymentProfile.new( + payment_type: PaymentType::BANK_ACCOUNT, + id: 8, + first_name: 'first_name2', + last_name: 'last_name0', + customer_id: 46, + current_vault: BankAccountVault::GOCARDLESS, + verified: false +) ``` diff --git a/doc/models/bank-account-response.md b/doc/models/bank-account-response.md index 6b72b302..2ff9e923 100644 --- a/doc/models/bank-account-response.md +++ b/doc/models/bank-account-response.md @@ -11,19 +11,19 @@ | --- | --- | --- | --- | | `payment_profile` | [`BankAccountPaymentProfile`](../../doc/models/bank-account-payment-profile.md) | Required | - | -## Example (as JSON) - -```json -{ - "payment_profile": { - "payment_type": "bank_account", - "verified": false, - "id": 44, - "first_name": "first_name4", - "last_name": "last_name2", - "customer_id": 82, - "current_vault": "authorizenet" - } -} +## Example + +```ruby +bank_account_response = BankAccountResponse.new( + payment_profile: BankAccountPaymentProfile.new( + payment_type: PaymentType::BANK_ACCOUNT, + id: 44, + first_name: 'first_name4', + last_name: 'last_name2', + customer_id: 82, + current_vault: BankAccountVault::AUTHORIZENET, + verified: false + ) +) ``` diff --git a/doc/models/bank-account-type.md b/doc/models/bank-account-type.md index 86a4b637..9c66d636 100644 --- a/doc/models/bank-account-type.md +++ b/doc/models/bank-account-type.md @@ -14,3 +14,9 @@ Defaults to checking | `CHECKING` | | `SAVINGS` | +## Example + +```ruby +bank_account_type = BankAccountType::CHECKING +``` + diff --git a/doc/models/bank-account-vault.md b/doc/models/bank-account-vault.md index 9ff1b83a..fce9bced 100644 --- a/doc/models/bank-account-vault.md +++ b/doc/models/bank-account-vault.md @@ -20,3 +20,9 @@ The vault that stores the payment profile with the provided vault_token. Use `bo | `MAXP` | | `STRIPE_CONNECT` | +## Example + +```ruby +bank_account_vault = BankAccountVault::BOGUS +``` + diff --git a/doc/models/bank-account-verification-request.md b/doc/models/bank-account-verification-request.md index dca0300a..98260ab4 100644 --- a/doc/models/bank-account-verification-request.md +++ b/doc/models/bank-account-verification-request.md @@ -11,14 +11,14 @@ | --- | --- | --- | --- | | `bank_account_verification` | [`BankAccountVerification`](../../doc/models/bank-account-verification.md) | Required | - | -## Example (as JSON) - -```json -{ - "bank_account_verification": { - "deposit_1_in_cents": 244, - "deposit_2_in_cents": 6 - } -} +## Example + +```ruby +bank_account_verification_request = BankAccountVerificationRequest.new( + bank_account_verification: BankAccountVerification.new( + deposit_1_in_cents: 244, + deposit_2_in_cents: 6 + ) +) ``` diff --git a/doc/models/bank-account-verification.md b/doc/models/bank-account-verification.md index e9d7af12..f7f94093 100644 --- a/doc/models/bank-account-verification.md +++ b/doc/models/bank-account-verification.md @@ -12,12 +12,12 @@ | `deposit_1_in_cents` | `Integer` | Optional | - | | `deposit_2_in_cents` | `Integer` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "deposit_1_in_cents": 142, - "deposit_2_in_cents": 132 -} +```ruby +bank_account_verification = BankAccountVerification.new( + deposit_1_in_cents: 244, + deposit_2_in_cents: 6 +) ``` diff --git a/doc/models/base-refund-error.md b/doc/models/base-refund-error.md index 1520cb15..e43b8b44 100644 --- a/doc/models/base-refund-error.md +++ b/doc/models/base-refund-error.md @@ -11,24 +11,15 @@ | --- | --- | --- | --- | | `base` | `Array[Object]` | Optional | - | -## Example (as JSON) - -```json -{ - "base": [ - { - "key1": "val1", - "key2": "val2" - }, - { - "key1": "val1", - "key2": "val2" - }, - { - "key1": "val1", - "key2": "val2" - } +## Example + +```ruby +base_refund_error = BaseRefundError.new( + base: [ + { 'key1' => 'val1', 'key2' => 'val2' }, + { 'key1' => 'val1', 'key2' => 'val2' }, + { 'key1' => 'val1', 'key2' => 'val2' } ] -} +) ``` diff --git a/doc/models/base-string-error.md b/doc/models/base-string-error.md index dd5c105d..2e83529c 100644 --- a/doc/models/base-string-error.md +++ b/doc/models/base-string-error.md @@ -13,13 +13,14 @@ The error is base if it is not directly associated with a single attribute. | --- | --- | --- | --- | | `base` | `Array[String]` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "base": [ - "base3" +```ruby +base_string_error = BaseStringError.new( + base: [ + 'base3', + 'base4' ] -} +) ``` diff --git a/doc/models/basic-date-field.md b/doc/models/basic-date-field.md index 8bb95917..8ce27e44 100644 --- a/doc/models/basic-date-field.md +++ b/doc/models/basic-date-field.md @@ -16,7 +16,7 @@ Allows to filter by `created_at` or `updated_at`. ## Example -``` -updated_at +```ruby +basic_date_field = BasicDateField::UPDATED_AT ``` diff --git a/doc/models/batch-job-response.md b/doc/models/batch-job-response.md index 575293fd..2f02eb81 100644 --- a/doc/models/batch-job-response.md +++ b/doc/models/batch-job-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `batchjob` | [`BatchJob`](../../doc/models/batch-job.md) | Required | - | -## Example (as JSON) - -```json -{ - "batchjob": { - "id": 54, - "finished_at": "2016-03-13T12:52:32.123Z", - "row_count": 62, - "created_at": "2016-03-13T12:52:32.123Z", - "completed": "completed4" - } -} +## Example + +```ruby +batch_job_response = BatchJobResponse.new( + batchjob: BatchJob.new( + id: 54, + finished_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + row_count: 62, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + completed: 'completed4' + ) +) ``` diff --git a/doc/models/batch-job.md b/doc/models/batch-job.md index 21b6e7ad..59684720 100644 --- a/doc/models/batch-job.md +++ b/doc/models/batch-job.md @@ -15,15 +15,15 @@ | `created_at` | `DateTime` | Optional | - | | `completed` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 246, - "finished_at": "2016-03-13T12:52:32.123Z", - "row_count": 254, - "created_at": "2016-03-13T12:52:32.123Z", - "completed": "completed0" -} +## Example + +```ruby +batch_job = BatchJob.new( + id: 240, + finished_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + row_count: 248, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + completed: 'completed2' +) ``` diff --git a/doc/models/billing-manifest-item.md b/doc/models/billing-manifest-item.md index 6eb0d2d2..377a657d 100644 --- a/doc/models/billing-manifest-item.md +++ b/doc/models/billing-manifest-item.md @@ -24,15 +24,15 @@ | `period_range_start` | `String` | Optional | - | | `period_range_end` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "transaction_type": "info_transaction", - "kind": "baseline", - "amount_in_cents": 216, - "memo": "memo4", - "discount_amount_in_cents": 236 -} +## Example + +```ruby +billing_manifest_item = BillingManifestItem.new( + transaction_type: LineItemTransactionType::PAYMENT_AUTHORIZATION, + kind: BillingManifestLineItemKind::BASELINE, + amount_in_cents: 152, + memo: 'memo0', + discount_amount_in_cents: 92 +) ``` diff --git a/doc/models/billing-manifest-line-item-kind.md b/doc/models/billing-manifest-line-item-kind.md index 1f99b4e3..53d2f318 100644 --- a/doc/models/billing-manifest-line-item-kind.md +++ b/doc/models/billing-manifest-line-item-kind.md @@ -18,3 +18,9 @@ A handle for the billing manifest line item kind | `COMPONENT` | | `TAX` | +## Example + +```ruby +billing_manifest_line_item_kind = BillingManifestLineItemKind::COMPONENT +``` + diff --git a/doc/models/billing-manifest.md b/doc/models/billing-manifest.md index 6c19761f..1e625be5 100644 --- a/doc/models/billing-manifest.md +++ b/doc/models/billing-manifest.md @@ -19,37 +19,37 @@ | `period_type` | `String` | Optional | - | | `existing_balance_in_cents` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "line_items": [ - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - }, - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - }, - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - } +## Example + +```ruby +billing_manifest = BillingManifest.new( + line_items: [ + BillingManifestItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: BillingManifestLineItemKind::COMPONENT, + amount_in_cents: 24, + memo: 'memo2', + discount_amount_in_cents: 172 + ), + BillingManifestItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: BillingManifestLineItemKind::COMPONENT, + amount_in_cents: 24, + memo: 'memo2', + discount_amount_in_cents: 172 + ), + BillingManifestItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: BillingManifestLineItemKind::COMPONENT, + amount_in_cents: 24, + memo: 'memo2', + discount_amount_in_cents: 172 + ) ], - "total_in_cents": 192, - "total_discount_in_cents": 178, - "total_tax_in_cents": 172, - "subtotal_in_cents": 48 -} + total_in_cents: 6, + total_discount_in_cents: 8, + total_tax_in_cents: 242, + subtotal_in_cents: 118 +) ``` diff --git a/doc/models/billing-schedule.md b/doc/models/billing-schedule.md index d6cef77f..96a5c736 100644 --- a/doc/models/billing-schedule.md +++ b/doc/models/billing-schedule.md @@ -13,11 +13,11 @@ Billing schedule settings for component allocations or usages on multi-frequency | --- | --- | --- | --- | | `initial_billing_at` | `Date` | Optional | Custom start date (ISO 8601 date, YYYY-MM-DD) for the component's first billing period. If omitted or null, billing aligns with the product schedule. If provided, date must be on or after the minimum allowed date for the subscription or component. | -## Example (as JSON) +## Example -```json -{ - "initial_billing_at": "2026-01-01" -} +```ruby +billing_schedule = BillingSchedule.new( + initial_billing_at: Date.iso8601('2026-01-01') +) ``` diff --git a/doc/models/breakouts.md b/doc/models/breakouts.md index 9a0d60a8..5c6261e4 100644 --- a/doc/models/breakouts.md +++ b/doc/models/breakouts.md @@ -14,14 +14,14 @@ | `usage_amount_in_cents` | `Integer` | Optional | - | | `usage_amount_formatted` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "plan_amount_in_cents": 68, - "plan_amount_formatted": "plan_amount_formatted2", - "usage_amount_in_cents": 176, - "usage_amount_formatted": "usage_amount_formatted0" -} +## Example + +```ruby +breakouts = Breakouts.new( + plan_amount_in_cents: 254, + plan_amount_formatted: 'plan_amount_formatted0', + usage_amount_in_cents: 106, + usage_amount_formatted: 'usage_amount_formatted8' +) ``` diff --git a/doc/models/bulk-components-price-point-assignment.md b/doc/models/bulk-components-price-point-assignment.md index b205868d..b2e7b9f8 100644 --- a/doc/models/bulk-components-price-point-assignment.md +++ b/doc/models/bulk-components-price-point-assignment.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `components` | [`Array[ComponentPricePointAssignment]`](../../doc/models/component-price-point-assignment.md) | Optional | - | -## Example (as JSON) - -```json -{ - "components": [ - { - "component_id": 108, - "price_point": "String5" - } +## Example + +```ruby +bulk_components_price_point_assignment = BulkComponentsPricePointAssignment.new( + components: [ + ComponentPricePointAssignment.new( + component_id: 108, + price_point: 'String5' + ) ] -} +) ``` diff --git a/doc/models/bulk-create-product-price-points-request.md b/doc/models/bulk-create-product-price-points-request.md index efad1a89..5cfc5c56 100644 --- a/doc/models/bulk-create-product-price-points-request.md +++ b/doc/models/bulk-create-product-price-points-request.md @@ -11,24 +11,24 @@ | --- | --- | --- | --- | | `price_points` | [`Array[CreateProductPricePoint]`](../../doc/models/create-product-price-point.md) | Required | - | -## Example (as JSON) - -```json -{ - "price_points": [ - { - "name": "name2", - "price_in_cents": 108, - "interval": 92, - "interval_unit": "day", - "use_site_exchange_rate": true, - "handle": "handle8", - "trial_price_in_cents": 196, - "trial_interval": 250, - "trial_interval_unit": "day", - "trial_type": "no_obligation" - } +## Example + +```ruby +bulk_create_product_price_points_request = BulkCreateProductPricePointsRequest.new( + price_points: [ + CreateProductPricePoint.new( + name: 'name2', + price_in_cents: 108, + interval: 92, + interval_unit: IntervalUnit::DAY, + handle: 'handle8', + trial_price_in_cents: 196, + trial_interval: 250, + trial_interval_unit: IntervalUnit::DAY, + trial_type: TrialType::NO_OBLIGATION, + use_site_exchange_rate: true + ) ] -} +) ``` diff --git a/doc/models/bulk-create-product-price-points-response.md b/doc/models/bulk-create-product-price-points-response.md index e143c625..b63a4d8e 100644 --- a/doc/models/bulk-create-product-price-points-response.md +++ b/doc/models/bulk-create-product-price-points-response.md @@ -11,19 +11,19 @@ | --- | --- | --- | --- | | `price_points` | [`Array[ProductPricePoint]`](../../doc/models/product-price-point.md) | Optional | - | -## Example (as JSON) - -```json -{ - "price_points": [ - { - "id": 40, - "name": "name2", - "handle": "handle8", - "price_in_cents": 108, - "interval": 92 - } +## Example + +```ruby +bulk_create_product_price_points_response = BulkCreateProductPricePointsResponse.new( + price_points: [ + ProductPricePoint.new( + id: 40, + name: 'name2', + handle: 'handle8', + price_in_cents: 108, + interval: 92 + ) ] -} +) ``` diff --git a/doc/models/bulk-create-segments.md b/doc/models/bulk-create-segments.md index 3e4e7e0e..d1b79817 100644 --- a/doc/models/bulk-create-segments.md +++ b/doc/models/bulk-create-segments.md @@ -11,36 +11,84 @@ | --- | --- | --- | --- | | `segments` | [`Array[CreateSegment]`](../../doc/models/create-segment.md) | Optional | **Constraints**: *Maximum Items*: `2000` | -## Example (as JSON) - -```json -{ - "segments": [ - { - "segment_property_1_value": "String3", - "segment_property_2_value": "String5", - "segment_property_3_value": "String3", - "segment_property_4_value": "String7", - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } +## Example + +```ruby +bulk_create_segments = BulkCreateSegments.new( + segments: [ + CreateSegment.new( + pricing_scheme: PricingScheme::STAIRSTEP, + segment_property_1_value: 'String3', + segment_property_2_value: 'String5', + segment_property_3_value: 'String3', + segment_property_4_value: 'String7', + prices: [ + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ) + ] + ), + CreateSegment.new( + pricing_scheme: PricingScheme::STAIRSTEP, + segment_property_1_value: 'String3', + segment_property_2_value: 'String5', + segment_property_3_value: 'String3', + segment_property_4_value: 'String7', + prices: [ + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ) + ] + ), + CreateSegment.new( + pricing_scheme: PricingScheme::STAIRSTEP, + segment_property_1_value: 'String3', + segment_property_2_value: 'String5', + segment_property_3_value: 'String3', + segment_property_4_value: 'String7', + prices: [ + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ) ] - } + ) ] -} +) ``` diff --git a/doc/models/bulk-update-segments-item.md b/doc/models/bulk-update-segments-item.md index 495e8a65..ce944cbd 100644 --- a/doc/models/bulk-update-segments-item.md +++ b/doc/models/bulk-update-segments-item.md @@ -13,19 +13,19 @@ | `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[CreateOrUpdateSegmentPrice]`](../../doc/models/create-or-update-segment-price.md) | Required | - | -## Example (as JSON) - -```json -{ - "id": 180, - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } +## Example + +```ruby +bulk_update_segments_item = BulkUpdateSegmentsItem.new( + id: 156, + pricing_scheme: PricingScheme::PER_UNIT, + prices: [ + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ) ] -} +) ``` diff --git a/doc/models/bulk-update-segments.md b/doc/models/bulk-update-segments.md index 7d1a90fb..006dad35 100644 --- a/doc/models/bulk-update-segments.md +++ b/doc/models/bulk-update-segments.md @@ -11,54 +11,54 @@ | --- | --- | --- | --- | | `segments` | [`Array[BulkUpdateSegmentsItem]`](../../doc/models/bulk-update-segments-item.md) | Optional | **Constraints**: *Maximum Items*: `1000` | -## Example (as JSON) +## Example -```json -{ - "segments": [ - { - "id": 50, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } +```ruby +bulk_update_segments = BulkUpdateSegments.new( + segments: [ + BulkUpdateSegmentsItem.new( + id: 50, + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ) ] - }, - { - "id": 50, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } + ), + BulkUpdateSegmentsItem.new( + id: 50, + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ) ] - } + ) ] -} +) ``` diff --git a/doc/models/calendar-billing.md b/doc/models/calendar-billing.md index 8b8ff4b6..ee081f1a 100644 --- a/doc/models/calendar-billing.md +++ b/doc/models/calendar-billing.md @@ -1,7 +1,7 @@ # Calendar Billing -(Optional). Cannot be used when also specifying next_billing_at +(Optional). Cannot be used when also specifying next_billing_at. ## Structure @@ -14,12 +14,12 @@ | `snap_day` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `calendar_billing_first_charge` | [`FirstChargeType`](../../doc/models/first-charge-type.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "snap_day": 210, - "calendar_billing_first_charge": "prorated" -} +```ruby +calendar_billing = CalendarBilling.new( + snap_day: 170, + calendar_billing_first_charge: FirstChargeType::PRORATED +) ``` diff --git a/doc/models/cancel-grouped-subscriptions-request.md b/doc/models/cancel-grouped-subscriptions-request.md index 95564e1c..43949881 100644 --- a/doc/models/cancel-grouped-subscriptions-request.md +++ b/doc/models/cancel-grouped-subscriptions-request.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `charge_unbilled_usage` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "charge_unbilled_usage": false -} +```ruby +cancel_grouped_subscriptions_request = CancelGroupedSubscriptionsRequest.new( + charge_unbilled_usage: false +) ``` diff --git a/doc/models/cancellation-method.md b/doc/models/cancellation-method.md index b0b7765a..37cf30ef 100644 --- a/doc/models/cancellation-method.md +++ b/doc/models/cancellation-method.md @@ -18,3 +18,9 @@ The process used to cancel the subscription, if the subscription has been cancel | `UNKNOWN` | | `IMPORTED` | +## Example + +```ruby +cancellation_method = CancellationMethod::UNKNOWN +``` + diff --git a/doc/models/cancellation-options.md b/doc/models/cancellation-options.md index 264b1446..b19d1d7c 100644 --- a/doc/models/cancellation-options.md +++ b/doc/models/cancellation-options.md @@ -12,18 +12,18 @@ | `cancellation_message` | `String` | Optional | An indication as to why the subscription is being canceled. For your internal use. | | `reason_code` | `String` | Optional | The reason code associated with the cancellation. Use the [List Reason Codes](../../doc/controllers/reason-codes.md#list-reason-codes) endpoint to retrieve the reason codes associated with your site. | | `cancel_at_end_of_period` | `TrueClass \| FalseClass` | Optional | When true, the subscription is cancelled at the current period end instead of immediately. To use this option, the Schedule Subscription Cancellation feature must be enabled on your site. | -| `scheduled_cancellation_at` | `DateTime` | Optional | Schedules the cancellation on the provided date. This is option is not applicable for prepaid subscriptions. To use this option, the Schedule Subscription Cancellation feature must be enabled on your site. | +| `scheduled_cancellation_at` | `DateTime` | Optional | Schedules the cancellation on the provided date. This option is not applicable for prepaid subscriptions. To use this option, the Schedule Subscription Cancellation feature must be enabled on your site. | | `refund_prepayment_account_balance` | `TrueClass \| FalseClass` | Optional | Applies to prepaid subscriptions. When true, which is the default, the remaining prepaid balance is refunded as part of cancellation processing. When false, prepaid balance is not refunded as part of cancellation processing. To use this option, the Schedule Subscription Cancellation feature must be enabled on your site. | -## Example (as JSON) +## Example -```json -{ - "cancellation_message": "cancellation_message0", - "reason_code": "reason_code6", - "cancel_at_end_of_period": false, - "scheduled_cancellation_at": "2016-03-13T12:52:32.123Z", - "refund_prepayment_account_balance": false -} +```ruby +cancellation_options = CancellationOptions.new( + cancellation_message: 'cancellation_message0', + reason_code: 'reason_code6', + cancel_at_end_of_period: false, + scheduled_cancellation_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + refund_prepayment_account_balance: false +) ``` diff --git a/doc/models/cancellation-request.md b/doc/models/cancellation-request.md index 7b229041..9b449a25 100644 --- a/doc/models/cancellation-request.md +++ b/doc/models/cancellation-request.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `subscription` | [`CancellationOptions`](../../doc/models/cancellation-options.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscription": { - "cancellation_message": "cancellation_message2", - "reason_code": "reason_code8", - "cancel_at_end_of_period": false, - "scheduled_cancellation_at": "2016-03-13T12:52:32.123Z", - "refund_prepayment_account_balance": false - } -} +## Example + +```ruby +cancellation_request = CancellationRequest.new( + subscription: CancellationOptions.new( + cancellation_message: 'cancellation_message2', + reason_code: 'reason_code8', + cancel_at_end_of_period: false, + scheduled_cancellation_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + refund_prepayment_account_balance: false + ) +) ``` diff --git a/doc/models/card-type.md b/doc/models/card-type.md index 4b00c0c2..2fa08e91 100644 --- a/doc/models/card-type.md +++ b/doc/models/card-type.md @@ -48,3 +48,9 @@ The type of card used. | `SOLO` | | `LASER` | +## Example + +```ruby +card_type = CardType::BOGUS +``` + diff --git a/doc/models/change-chargeback-status-event-data.md b/doc/models/change-chargeback-status-event-data.md index 825e9df4..ced8465e 100644 --- a/doc/models/change-chargeback-status-event-data.md +++ b/doc/models/change-chargeback-status-event-data.md @@ -13,11 +13,11 @@ Example schema for an `change_chargeback_status` event | --- | --- | --- | --- | | `chargeback_status` | [`ChargebackStatus`](../../doc/models/chargeback-status.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "chargeback_status": "open" -} +```ruby +change_chargeback_status_event_data = ChangeChargebackStatusEventData.new( + chargeback_status: ChargebackStatus::OPEN +) ``` diff --git a/doc/models/change-chargeback-status-event.md b/doc/models/change-chargeback-status-event.md index bd5a2b3d..d9cd4557 100644 --- a/doc/models/change-chargeback-status-event.md +++ b/doc/models/change-chargeback-status-event.md @@ -15,27 +15,27 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::CHANGE_CHARGEBACK_STATUS` | | `event_data` | [`ChangeChargebackStatusEventData`](../../doc/models/change-chargeback-status-event-data.md) | Required | Example schema for an `change_chargeback_status` event | -## Example (as JSON) - -```json -{ - "id": 214, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "change_chargeback_status", - "event_data": { - "chargeback_status": "won" - } -} +## Example + +```ruby +change_chargeback_status_event = ChangeChargebackStatusEvent.new( + id: 114, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::CHANGE_CHARGEBACK_STATUS, + event_data: ChangeChargebackStatusEventData.new( + chargeback_status: ChargebackStatus::WON + ) +) ``` diff --git a/doc/models/change-invoice-collection-method-event-data.md b/doc/models/change-invoice-collection-method-event-data.md index 2609c9ea..013b8641 100644 --- a/doc/models/change-invoice-collection-method-event-data.md +++ b/doc/models/change-invoice-collection-method-event-data.md @@ -14,12 +14,12 @@ Example schema for an `change_invoice_collection_method` event | `from_collection_method` | `String` | Required | The previous collection method of the invoice. | | `to_collection_method` | `String` | Required | The new collection method of the invoice. | -## Example (as JSON) +## Example -```json -{ - "from_collection_method": "from_collection_method4", - "to_collection_method": "to_collection_method2" -} +```ruby +change_invoice_collection_method_event_data = ChangeInvoiceCollectionMethodEventData.new( + from_collection_method: 'from_collection_method2', + to_collection_method: 'to_collection_method0' +) ``` diff --git a/doc/models/change-invoice-collection-method-event.md b/doc/models/change-invoice-collection-method-event.md index 2e9c6e5f..71674022 100644 --- a/doc/models/change-invoice-collection-method-event.md +++ b/doc/models/change-invoice-collection-method-event.md @@ -15,28 +15,28 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::CHANGE_INVOICE_COLLECTION_METHOD` | | `event_data` | [`ChangeInvoiceCollectionMethodEventData`](../../doc/models/change-invoice-collection-method-event-data.md) | Required | Example schema for an `change_invoice_collection_method` event | -## Example (as JSON) - -```json -{ - "id": 246, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "change_invoice_collection_method", - "event_data": { - "from_collection_method": "from_collection_method4", - "to_collection_method": "to_collection_method8" - } -} +## Example + +```ruby +change_invoice_collection_method_event = ChangeInvoiceCollectionMethodEvent.new( + id: 216, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::CHANGE_INVOICE_COLLECTION_METHOD, + event_data: ChangeInvoiceCollectionMethodEventData.new( + from_collection_method: 'from_collection_method4', + to_collection_method: 'to_collection_method8' + ) +) ``` diff --git a/doc/models/change-invoice-status-event-data.md b/doc/models/change-invoice-status-event-data.md index 21b8bff7..326cdba9 100644 --- a/doc/models/change-invoice-status-event-data.md +++ b/doc/models/change-invoice-status-event-data.md @@ -17,15 +17,15 @@ Example schema for an `change_invoice_status` event | `to_status` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Required | The updated status of the invoice after changes have been made. See [Invoice Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview#invoice-statuses) for more. | | `consolidation_level` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Optional | - | -## Example (as JSON) - -```json -{ - "gateway_trans_id": "gateway_trans_id2", - "amount": "amount2", - "from_status": "draft", - "to_status": "pending", - "consolidation_level": "none" -} +## Example + +```ruby +change_invoice_status_event_data = ChangeInvoiceStatusEventData.new( + from_status: InvoiceStatus::VOIDED, + to_status: InvoiceStatus::DRAFT, + gateway_trans_id: 'gateway_trans_id6', + amount: 'amount4', + consolidation_level: InvoiceConsolidationLevel::NONE +) ``` diff --git a/doc/models/change-invoice-status-event.md b/doc/models/change-invoice-status-event.md index 5556ebf8..dc9e275e 100644 --- a/doc/models/change-invoice-status-event.md +++ b/doc/models/change-invoice-status-event.md @@ -15,31 +15,31 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::CHANGE_INVOICE_STATUS` | | `event_data` | [`ChangeInvoiceStatusEventData`](../../doc/models/change-invoice-status-event-data.md) | Required | Example schema for an `change_invoice_status` event | -## Example (as JSON) - -```json -{ - "id": 92, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "change_invoice_status", - "event_data": { - "gateway_trans_id": "gateway_trans_id2", - "amount": "amount8", - "from_status": "open", - "to_status": "pending", - "consolidation_level": "child" - } -} +## Example + +```ruby +change_invoice_status_event = ChangeInvoiceStatusEvent.new( + id: 36, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::CHANGE_INVOICE_STATUS, + event_data: ChangeInvoiceStatusEventData.new( + from_status: InvoiceStatus::OPEN, + to_status: InvoiceStatus::PENDING, + gateway_trans_id: 'gateway_trans_id2', + amount: 'amount8', + consolidation_level: InvoiceConsolidationLevel::CHILD + ) +) ``` diff --git a/doc/models/chargeback-status.md b/doc/models/chargeback-status.md index 5541f264..5c05bc65 100644 --- a/doc/models/chargeback-status.md +++ b/doc/models/chargeback-status.md @@ -16,3 +16,9 @@ The current chargeback status. | `WON` | | `CLOSED` | +## Example + +```ruby +chargeback_status = ChargebackStatus::OPEN +``` + diff --git a/doc/models/chargify-ebb.md b/doc/models/chargify-ebb.md index 606deee5..bfd08467 100644 --- a/doc/models/chargify-ebb.md +++ b/doc/models/chargify-ebb.md @@ -16,15 +16,15 @@ | `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. | -## Example (as JSON) - -```json -{ - "timestamp": "2016-03-13T12:52:32.123Z", - "id": "id4", - "created_at": "2016-03-13T12:52:32.123Z", - "uniqueness_token": "uniqueness_token0", - "subscription_id": 200 -} +## Example + +```ruby +chargify_ebb = ChargifyEBB.new( + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + id: 'id4', + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + uniqueness_token: 'uniqueness_token0', + subscription_id: 30 +) ``` diff --git a/doc/models/chjs-tokenization-failure.md b/doc/models/chjs-tokenization-failure.md index 008974d3..14f72c2b 100644 --- a/doc/models/chjs-tokenization-failure.md +++ b/doc/models/chjs-tokenization-failure.md @@ -12,16 +12,16 @@ | `errors` | `String` | Required | - | | `payment_profile_params` | [`PaymentProfileParams`](../../doc/models/payment-profile-params.md) | Optional | PCI-safe cardholder fields only. Full card numbers, CVV, and billing address are never included. | -## Example (as JSON) - -```json -{ - "errors": "errors2", - "payment_profile_params": { - "first_name": "first_name2", - "last_name": "last_name0", - "card_type": "card_type2" - } -} +## Example + +```ruby +chjs_tokenization_failure = ChjsTokenizationFailure.new( + errors: 'errors4', + payment_profile_params: PaymentProfileParams.new( + first_name: 'first_name2', + last_name: 'last_name0', + card_type: 'card_type2' + ) +) ``` diff --git a/doc/models/chjs-tokenization-success.md b/doc/models/chjs-tokenization-success.md index a098c0df..9e9315db 100644 --- a/doc/models/chjs-tokenization-success.md +++ b/doc/models/chjs-tokenization-success.md @@ -12,17 +12,17 @@ | `payment_profile` | [`TokenizedPaymentProfile`](../../doc/models/tokenized-payment-profile.md) | Required | - | | `gateway_customer_id` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "payment_profile": { - "id": 44, - "vault_token": "vault_token6", - "gateway_handle": "gateway_handle4", - "customer_vault_token": "customer_vault_token2" - }, - "gateway_customer_id": 44 -} +## Example + +```ruby +chjs_tokenization_success = ChjsTokenizationSuccess.new( + payment_profile: TokenizedPaymentProfile.new( + id: 44, + vault_token: 'vault_token6', + gateway_handle: 'gateway_handle4', + customer_vault_token: 'customer_vault_token2' + ), + gateway_customer_id: 106 +) ``` diff --git a/doc/models/cleanup-scope.md b/doc/models/cleanup-scope.md index 234cc07c..6d91b44a 100644 --- a/doc/models/cleanup-scope.md +++ b/doc/models/cleanup-scope.md @@ -14,3 +14,9 @@ all: Will clear all products, customers, and related subscriptions from the site | `ALL` | | `CUSTOMERS` | +## Example + +```ruby +cleanup_scope = CleanupScope::ALL +``` + diff --git a/doc/models/clone-component-price-point-request.md b/doc/models/clone-component-price-point-request.md index 25aa3aef..aba01059 100644 --- a/doc/models/clone-component-price-point-request.md +++ b/doc/models/clone-component-price-point-request.md @@ -11,14 +11,14 @@ | --- | --- | --- | --- | | `price_point` | [`CloneComponentPricePoint`](../../doc/models/clone-component-price-point.md) | Required | - | -## Example (as JSON) - -```json -{ - "price_point": { - "name": "name0", - "handle": "handle6" - } -} +## Example + +```ruby +clone_component_price_point_request = CloneComponentPricePointRequest.new( + price_point: CloneComponentPricePoint.new( + name: 'name0', + handle: 'handle6' + ) +) ``` diff --git a/doc/models/clone-component-price-point.md b/doc/models/clone-component-price-point.md index ad540de8..9f3f28ce 100644 --- a/doc/models/clone-component-price-point.md +++ b/doc/models/clone-component-price-point.md @@ -12,12 +12,12 @@ | `name` | `String` | Required | - | | `handle` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "name": "name2", - "handle": "handle8" -} +```ruby +clone_component_price_point = CloneComponentPricePoint.new( + name: 'name2', + handle: 'handle8' +) ``` diff --git a/doc/models/collection-method-1.md b/doc/models/collection-method-1.md new file mode 100644 index 00000000..f0374873 --- /dev/null +++ b/doc/models/collection-method-1.md @@ -0,0 +1,21 @@ + +# Collection Method 1 + +## Enumeration + +`CollectionMethod1` + +## Fields + +| Name | +| --- | +| `AUTOMATIC` | +| `REMITTANCE` | +| `PREPAID` | + +## Example + +```ruby +collection_method1 = CollectionMethod1::REMITTANCE +``` + diff --git a/doc/models/collection-method.md b/doc/models/collection-method.md index 50b7215d..cdfcddeb 100644 --- a/doc/models/collection-method.md +++ b/doc/models/collection-method.md @@ -16,3 +16,9 @@ The type of payment collection to be used in the subscription. For legacy Statem | `PREPAID` | | `INVOICE` | +## Example + +```ruby +collection_method = CollectionMethod::PREPAID +``` + diff --git a/doc/models/component-allocation-change.md b/doc/models/component-allocation-change.md index c1389ede..485a51b6 100644 --- a/doc/models/component-allocation-change.md +++ b/doc/models/component-allocation-change.md @@ -17,17 +17,17 @@ | `allocation_id` | `Integer` | Required | - | | `allocated_quantity` | Integer \| String \| nil | Optional | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "previous_allocation": 94, - "new_allocation": 102, - "component_id": 88, - "component_handle": "component_handle8", - "memo": "memo2", - "allocation_id": 158, - "allocated_quantity": 104 -} +## Example + +```ruby +component_allocation_change = ComponentAllocationChange.new( + previous_allocation: 124, + new_allocation: 72, + component_id: 118, + component_handle: 'component_handle0', + memo: 'memo4', + allocation_id: 128, + allocated_quantity: 134 +) ``` diff --git a/doc/models/component-allocation-error-exception.md b/doc/models/component-allocation-error-exception.md index a7de6284..4ab9e982 100644 --- a/doc/models/component-allocation-error-exception.md +++ b/doc/models/component-allocation-error-exception.md @@ -11,30 +11,13 @@ | --- | --- | --- | --- | | `errors` | [`Array[ComponentAllocationErrorItem]`](../../doc/models/component-allocation-error-item.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": [ - { - "component_id": 236, - "message": "message0", - "kind": "kind8", - "on": "on0" - }, - { - "component_id": 236, - "message": "message0", - "kind": "kind8", - "on": "on0" - }, - { - "component_id": 236, - "message": "message0", - "kind": "kind8", - "on": "on0" - } - ] -} +## Example + +```ruby +begin + # make the API call +rescue ComponentAllocationErrorException => e + puts "Caught ComponentAllocationErrorException: #{e.message}" +end ``` diff --git a/doc/models/component-allocation-error-item.md b/doc/models/component-allocation-error-item.md index 760c79af..d20375de 100644 --- a/doc/models/component-allocation-error-item.md +++ b/doc/models/component-allocation-error-item.md @@ -14,14 +14,14 @@ | `kind` | `String` | Optional | - | | `on` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "component_id": 188, - "message": "message0", - "kind": "kind8", - "on": "on0" -} +## Example + +```ruby +component_allocation_error_item = ComponentAllocationErrorItem.new( + component_id: 238, + message: 'message8', + kind: 'kind6', + on: 'on8' +) ``` diff --git a/doc/models/component-cost-data-rate-tier.md b/doc/models/component-cost-data-rate-tier.md index 1a723548..bb53a297 100644 --- a/doc/models/component-cost-data-rate-tier.md +++ b/doc/models/component-cost-data-rate-tier.md @@ -15,15 +15,15 @@ | `unit_price` | `String` | Optional | - | | `amount` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "starting_quantity": 132, - "ending_quantity": 106, - "quantity": "quantity0", - "unit_price": "unit_price2", - "amount": "amount6" -} +## Example + +```ruby +component_cost_data_rate_tier = ComponentCostDataRateTier.new( + starting_quantity: 216, + ending_quantity: 190, + quantity: 'quantity0', + unit_price: 'unit_price2', + amount: 'amount6' +) ``` diff --git a/doc/models/component-cost-data.md b/doc/models/component-cost-data.md index 0f6b8804..91ab0323 100644 --- a/doc/models/component-cost-data.md +++ b/doc/models/component-cost-data.md @@ -17,15 +17,15 @@ | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `tiers` | [`Array[ComponentCostDataRateTier]`](../../doc/models/component-cost-data-rate-tier.md) | Optional | - | -## Example (as JSON) - -```json -{ - "component_code_id": 16, - "price_point_id": 186, - "product_id": 250, - "quantity": "quantity8", - "amount": "amount4" -} +## Example + +```ruby +component_cost_data = ComponentCostData.new( + component_code_id: 36, + price_point_id: 50, + product_id: 242, + quantity: 'quantity4', + amount: 'amount0' +) ``` diff --git a/doc/models/component-currency-price.md b/doc/models/component-currency-price.md index 6a41b181..f18dbf8e 100644 --- a/doc/models/component-currency-price.md +++ b/doc/models/component-currency-price.md @@ -16,15 +16,15 @@ | `price_id` | `Integer` | Optional | - | | `price_point_id` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 4, - "currency": "currency8", - "price": "price4", - "formatted_price": "formatted_price6", - "price_id": 162 -} +## Example + +```ruby +component_currency_price = ComponentCurrencyPrice.new( + id: 170, + currency: 'currency2', + price: 'price4', + formatted_price: 'formatted_price6', + price_id: 252 +) ``` diff --git a/doc/models/component-currency-prices-response.md b/doc/models/component-currency-prices-response.md index 4f1686ba..a2beffd8 100644 --- a/doc/models/component-currency-prices-response.md +++ b/doc/models/component-currency-prices-response.md @@ -11,19 +11,19 @@ | --- | --- | --- | --- | | `currency_prices` | [`Array[ComponentCurrencyPrice]`](../../doc/models/component-currency-price.md) | Required | - | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "id": 50, - "currency": "currency8", - "price": "price4", - "formatted_price": "formatted_price6", - "price_id": 116 - } +## Example + +```ruby +component_currency_prices_response = ComponentCurrencyPricesResponse.new( + currency_prices: [ + ComponentCurrencyPrice.new( + id: 50, + currency: 'currency8', + price: 'price4', + formatted_price: 'formatted_price6', + price_id: 116 + ) ] -} +) ``` diff --git a/doc/models/component-custom-price.md b/doc/models/component-custom-price.md index ec990eda..f0d0a3ea 100644 --- a/doc/models/component-custom-price.md +++ b/doc/models/component-custom-price.md @@ -12,10 +12,10 @@ Create or update custom pricing unique to the subscription. Used in place of `pr | Name | Type | Tags | Description | | --- | --- | --- | --- | | `tax_included` | `TrueClass \| FalseClass` | Optional | Whether or not the price point includes tax | -| `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | Omit for On/Off components | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | Omit for On/Off components. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component 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 component price point, either month or day. This property is only available for sites with Multifrequency enabled. | -| `list_price_point_id` | `Integer` | Optional | Optional id of the price point to use for list price calculations when
overriding the customer price. | +| `list_price_point_id` | `Integer` | Optional | (Optional) Id of the price point to use for list price calculations when
overriding the customer price. | | `use_default_list_price` | `TrueClass \| FalseClass` | Optional | When true, list price calculations will continue to use the default price point even when a `custom_price` is supplied. | | `prices` | [`Array[Price]`](../../doc/models/price.md) | Required | On/off components only need one price bracket starting at 1. | | `renew_prepaid_allocation` | `TrueClass \| FalseClass` | Optional | Applicable only to prepaid usage components. Controls whether the allocated quantity renews each period. | @@ -23,22 +23,22 @@ Create or update custom pricing unique to the subscription. Used in place of `pr | `expiration_interval` | `Integer` | Optional | Applicable only when rollover is enabled. Number of `expiration_interval_unit`s after which rollover amounts expire. | | `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | Applicable only when rollover is enabled. Interval unit for rollover expiration (month or day). | -## Example (as JSON) +## Example -```json -{ - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +```ruby +component_custom_price = ComponentCustomPrice.new( + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 162, - "interval_unit": "day", - "list_price_point_id": 146 -} + tax_included: false, + pricing_scheme: PricingScheme::PER_UNIT, + interval: 136, + interval_unit: IntervalUnit::DAY, + list_price_point_id: 104 +) ``` diff --git a/doc/models/component-kind.md b/doc/models/component-kind.md index f8b65b77..0ff30083 100644 --- a/doc/models/component-kind.md +++ b/doc/models/component-kind.md @@ -17,3 +17,9 @@ A handle for the component type | `PREPAID_USAGE_COMPONENT` | | `EVENT_BASED_COMPONENT` | +## Example + +```ruby +component_kind = ComponentKind::ON_OFF_COMPONENT +``` + diff --git a/doc/models/component-price-point-assignment.md b/doc/models/component-price-point-assignment.md index f6bc0e38..a8c809a1 100644 --- a/doc/models/component-price-point-assignment.md +++ b/doc/models/component-price-point-assignment.md @@ -12,12 +12,12 @@ | `component_id` | `Integer` | Optional | - | | `price_point` | String \| Integer \| nil | Optional | This is a container for one-of cases. | -## Example (as JSON) +## Example -```json -{ - "component_id": 114, - "price_point": "String9" -} +```ruby +component_price_point_assignment = ComponentPricePointAssignment.new( + component_id: 122, + price_point: 'String5' +) ``` diff --git a/doc/models/component-price-point-currency-overage-response.md b/doc/models/component-price-point-currency-overage-response.md index 0721f1f9..f83cc8e1 100644 --- a/doc/models/component-price-point-currency-overage-response.md +++ b/doc/models/component-price-point-currency-overage-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `price_point` | [`CurrencyOveragePrices`](../../doc/models/currency-overage-prices.md) | Required | Extends a component price point with currency overage prices. | -## Example (as JSON) - -```json -{ - "price_point": { - "id": 248, - "type": "default", - "default": false, - "name": "name0", - "pricing_scheme": "per_unit" - } -} +## Example + +```ruby +component_price_point_currency_overage_response = ComponentPricePointCurrencyOverageResponse.new( + price_point: CurrencyOveragePrices.new( + id: 248, + type: PricePointType::DEFAULT, + default: false, + name: 'name0', + pricing_scheme: PricingScheme::PER_UNIT + ) +) ``` diff --git a/doc/models/component-price-point-error-exception.md b/doc/models/component-price-point-error-exception.md index 87f0a0c2..55ccd012 100644 --- a/doc/models/component-price-point-error-exception.md +++ b/doc/models/component-price-point-error-exception.md @@ -11,22 +11,13 @@ | --- | --- | --- | --- | | `errors` | [`Array[ComponentPricePointErrorItem]`](../../doc/models/component-price-point-error-item.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": [ - { - "component_id": 236, - "message": "message0", - "price_point": 122 - }, - { - "component_id": 236, - "message": "message0", - "price_point": 122 - } - ] -} +## Example + +```ruby +begin + # make the API call +rescue ComponentPricePointErrorException => e + puts "Caught ComponentPricePointErrorException: #{e.message}" +end ``` diff --git a/doc/models/component-price-point-error-item.md b/doc/models/component-price-point-error-item.md index 84202847..4858bb93 100644 --- a/doc/models/component-price-point-error-item.md +++ b/doc/models/component-price-point-error-item.md @@ -13,13 +13,13 @@ | `message` | `String` | Optional | - | | `price_point` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "component_id": 206, - "message": "message4", - "price_point": 152 -} +## Example + +```ruby +component_price_point_error_item = ComponentPricePointErrorItem.new( + component_id: 152, + message: 'message0', + price_point: 50 +) ``` diff --git a/doc/models/component-price-point-item.md b/doc/models/component-price-point-item.md index ee68f4e8..a77d48d1 100644 --- a/doc/models/component-price-point-item.md +++ b/doc/models/component-price-point-item.md @@ -12,19 +12,19 @@ | `name` | `String` | Optional | - | | `handle` | `String` | Optional | - | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component 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 component price point, either month or day. This property is only available for sites with Multifrequency enabled. | | `prices` | [`Array[Price]`](../../doc/models/price.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "name": "name6", - "handle": "handle2", - "pricing_scheme": "per_unit", - "interval": 196, - "interval_unit": "day" -} +```ruby +component_price_point_item = ComponentPricePointItem.new( + name: 'name6', + handle: 'handle2', + pricing_scheme: PricingScheme::STAIRSTEP, + interval: 50, + interval_unit: IntervalUnit::DAY +) ``` diff --git a/doc/models/component-price-point-response.md b/doc/models/component-price-point-response.md index 19dc28a5..b7c62da1 100644 --- a/doc/models/component-price-point-response.md +++ b/doc/models/component-price-point-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `price_point` | [`ComponentPricePoint`](../../doc/models/component-price-point.md) | Required | - | -## Example (as JSON) - -```json -{ - "price_point": { - "id": 248, - "type": "default", - "default": false, - "name": "name0", - "pricing_scheme": "per_unit" - } -} +## Example + +```ruby +component_price_point_response = ComponentPricePointResponse.new( + price_point: ComponentPricePoint.new( + id: 248, + type: PricePointType::DEFAULT, + default: false, + name: 'name0', + pricing_scheme: PricingScheme::PER_UNIT + ) +) ``` diff --git a/doc/models/component-price-point.md b/doc/models/component-price-point.md index 452cf4cd..5454990c 100644 --- a/doc/models/component-price-point.md +++ b/doc/models/component-price-point.md @@ -11,7 +11,7 @@ | --- | --- | --- | --- | | `id` | `Integer` | Optional | - | | `type` | [`PricePointType`](../../doc/models/price-point-type.md) | Optional | Price point type. We expose the following types:

1. **default**: a price point that is marked as a default price for a certain product.
2. **custom**: a custom price point.
3. **catalog**: a price point that is **not** marked as a default price for a certain product and is **not** a custom one. | -| `default` | `TrueClass \| FalseClass` | Optional | Note: Refer to type attribute instead | +| `default` | `TrueClass \| FalseClass` | Optional | Note: Refer to type attribute instead. | | `name` | `String` | Optional | - | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `component_id` | `Integer` | Optional | - | @@ -23,7 +23,7 @@ | `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. Defaults to true during creation. | | `subscription_id` | `Integer` | Optional | (only used for Custom Pricing - ie. when the price point's type is `custom`) The id of the subscription that the custom price point is for. | | `tax_included` | `TrueClass \| FalseClass` | Optional | - | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component 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 component price point, either month or day. This property is only available for sites with Multifrequency enabled. | | `currency_prices` | [`Array[ComponentCurrencyPrice]`](../../doc/models/component-currency-price.md) | Optional | An array of currency pricing data is available when multiple currencies are defined for the site. It varies based on the use_site_exchange_rate setting for the price point. This parameter is present only in the response of read endpoints, after including the appropriate query parameter. The clone endpoint always returns currency prices if they are present. | | `overage_prices` | [`Array[ComponentPrice]`](../../doc/models/component-price.md) | Optional | Applicable only to prepaid usage components. An array of overage price brackets. | @@ -33,15 +33,15 @@ | `expiration_interval` | `Integer` | Optional | Applicable only to prepaid usage components where rollover_prepaid_remainder is true. The number of `expiration_interval_unit`s after which rollover amounts should expire. | | `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | Applicable only to prepaid usage components where rollover_prepaid_remainder is true. A string representing the expiration interval unit for this component, either month or day. | -## Example (as JSON) +## Example -```json -{ - "id": 190, - "type": "custom", - "default": false, - "name": "name2", - "pricing_scheme": "stairstep" -} +```ruby +component_price_point = ComponentPricePoint.new( + id: 160, + type: PricePointType::CATALOG, + default: false, + name: 'name8', + pricing_scheme: PricingScheme::PER_UNIT +) ``` diff --git a/doc/models/component-price-points-response.md b/doc/models/component-price-points-response.md index 679b8d94..83b422d7 100644 --- a/doc/models/component-price-points-response.md +++ b/doc/models/component-price-points-response.md @@ -12,32 +12,32 @@ | `price_points` | [`Array[ComponentPricePoint]`](../../doc/models/component-price-point.md) | Optional | - | | `meta` | [`ListPublicKeysMeta`](../../doc/models/list-public-keys-meta.md) | Optional | - | -## Example (as JSON) - -```json -{ - "price_points": [ - { - "id": 40, - "type": "default", - "default": false, - "name": "name2", - "pricing_scheme": "per_unit" - }, - { - "id": 40, - "type": "default", - "default": false, - "name": "name2", - "pricing_scheme": "per_unit" - } +## Example + +```ruby +component_price_points_response = ComponentPricePointsResponse.new( + price_points: [ + ComponentPricePoint.new( + id: 40, + type: PricePointType::DEFAULT, + default: false, + name: 'name2', + pricing_scheme: PricingScheme::PER_UNIT + ), + ComponentPricePoint.new( + id: 40, + type: PricePointType::DEFAULT, + default: false, + name: 'name2', + pricing_scheme: PricingScheme::PER_UNIT + ) ], - "meta": { - "total_count": 150, - "current_page": 126, - "total_pages": 138, - "per_page": 152 - } -} + meta: ListPublicKeysMeta.new( + total_count: 150, + current_page: 126, + total_pages: 138, + per_page: 152 + ) +) ``` diff --git a/doc/models/component-price.md b/doc/models/component-price.md index 519f04d5..f3204d28 100644 --- a/doc/models/component-price.md +++ b/doc/models/component-price.md @@ -18,15 +18,15 @@ | `formatted_unit_price` | `String` | Optional | - | | `segment_id` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 234, - "component_id": 88, - "starting_quantity": 104, - "ending_quantity": 78, - "unit_price": "unit_price0" -} +## Example + +```ruby +component_price = ComponentPrice.new( + id: 38, + component_id: 148, + starting_quantity: 44, + ending_quantity: 18, + unit_price: 'unit_price8' +) ``` diff --git a/doc/models/component-response.md b/doc/models/component-response.md index c322ada8..88cd1bbc 100644 --- a/doc/models/component-response.md +++ b/doc/models/component-response.md @@ -11,18 +11,18 @@ | --- | --- | --- | --- | | `component` | [`Component`](../../doc/models/component.md) | Required | - | -## Example (as JSON) - -```json -{ - "component": { - "item_category": "Business Software", - "id": 80, - "name": "name8", - "handle": "handle4", - "pricing_scheme": "per_unit", - "unit_name": "unit_name0" - } -} +## Example + +```ruby +component_response = ComponentResponse.new( + component: Component.new( + id: 80, + name: 'name8', + handle: 'handle4', + pricing_scheme: PricingScheme::PER_UNIT, + unit_name: 'unit_name0', + item_category: ItemCategory::ENUM_BUSINESS_SOFTWARE + ) +) ``` diff --git a/doc/models/component.md b/doc/models/component.md index 8e3edf3e..351fe2d2 100644 --- a/doc/models/component.md +++ b/doc/models/component.md @@ -10,15 +10,15 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `id` | `Integer` | Optional | The unique ID assigned to the component by Chargify. This ID can be used to fetch the component from the API. | -| `name` | `String` | Optional | The name of the Component, suitable for display on statements. i.e. Text Messages. | +| `name` | `String` | Optional | The name of the Component, suitable for display on statements. e.g., Text Messages. | | `handle` | `String` | Optional | The component API handle | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | - | -| `unit_name` | `String` | Optional | The name of the unit that the component’s usage is measured in. i.e. message | +| `unit_name` | `String` | Optional | The name of the unit that the component’s usage is measured in. e.g., message | | `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 | +| `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. | | `description` | `String` | Optional | The description of the component. | @@ -42,19 +42,20 @@ | `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | - | | `accounting_code` | `String` | Optional | E.g. Internal ID or SKU Number | | `event_based_billing_metric_id` | `Integer` | Optional | (Only for Event Based Components) This is an ID of a metric attached to the component. This metric is used to bill upon collected events. | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component’s default 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 component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. | - -## Example (as JSON) - -```json -{ - "item_category": "Business Software", - "id": 24, - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "unit_name": "unit_name4" -} +| `unspsc_code` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | + +## Example + +```ruby +component = Component.new( + id: 80, + name: 'name8', + handle: 'handle4', + pricing_scheme: PricingScheme::PER_UNIT, + unit_name: 'unit_name0', + item_category: ItemCategory::ENUM_BUSINESS_SOFTWARE +) ``` diff --git a/doc/models/compounding-strategy.md b/doc/models/compounding-strategy.md index ec68b1f7..53960810 100644 --- a/doc/models/compounding-strategy.md +++ b/doc/models/compounding-strategy.md @@ -14,3 +14,9 @@ Applicable only to stackable coupons. For `compound`, Percentage-based discounts | `COMPOUND` | | `FULLPRICE` | +## Example + +```ruby +compounding_strategy = CompoundingStrategy::COMPOUND +``` + diff --git a/doc/models/consolidated-invoice.md b/doc/models/consolidated-invoice.md index ef02b81e..2de54337 100644 --- a/doc/models/consolidated-invoice.md +++ b/doc/models/consolidated-invoice.md @@ -11,26 +11,19 @@ | --- | --- | --- | --- | | `invoices` | [`Array[Invoice]`](../../doc/models/invoice.md) | Optional | - | -## Example (as JSON) - -```json -{ - "invoices": [ - { - "id": 196, - "uid": "uid6", - "site_id": 122, - "customer_id": 234, - "subscription_id": 50 - }, - { - "id": 196, - "uid": "uid6", - "site_id": 122, - "customer_id": 234, - "subscription_id": 50 - } +## Example + +```ruby +consolidated_invoice = ConsolidatedInvoice.new( + invoices: [ + Invoice.new( + id: 196, + uid: 'uid6', + site_id: 122, + customer_id: 234, + subscription_id: 50 + ) ] -} +) ``` diff --git a/doc/models/containers/create-subscription-component-unit-balance.md b/doc/models/containers/create-subscription-component-unit-balance.md new file mode 100644 index 00000000..fc42f400 --- /dev/null +++ b/doc/models/containers/create-subscription-component-unit-balance.md @@ -0,0 +1,34 @@ + +# Create Subscription Component Unit Balance + +## Data Type + +`Integer | String` + +## Cases + +| Type | +| --- | +| `Integer` | +| `String` | + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/event-event-specific-data.md b/doc/models/containers/event-event-specific-data.md index 485d469f..e65836ae 100644 --- a/doc/models/containers/event-event-specific-data.md +++ b/doc/models/containers/event-event-specific-data.md @@ -109,7 +109,7 @@ value = ComponentAllocationChange.new( ```ruby value = MeteredUsage.new( previous_unit_balance: 'previous_unit_balance6', - new_unit_balance: 80, + new_unit_balance: 2, usage_quantity: 42, component_id: 4, component_handle: 'component_handle8', @@ -127,8 +127,8 @@ value = MeteredUsage.new( value = PrepaidUsage.new( previous_unit_balance: 'previous_unit_balance0', previous_overage_unit_balance: 'previous_overage_unit_balance4', - new_unit_balance: 252, - new_overage_unit_balance: 224, + new_unit_balance: 174, + new_overage_unit_balance: 146, usage_quantity: 214, overage_usage_quantity: 106, component_id: 176, diff --git a/doc/models/containers/get-one-time-token-request-payment-profile.md b/doc/models/containers/get-one-time-token-request-payment-profile.md new file mode 100644 index 00000000..a6ef82e3 --- /dev/null +++ b/doc/models/containers/get-one-time-token-request-payment-profile.md @@ -0,0 +1,69 @@ + +# Get One Time Token Request Payment Profile + +## Data Type + +`GetOneTimeTokenPaymentProfile | GetOneTimeTokenBankAccountPaymentProfile` + +## Cases + +| Type | +| --- | +| [`GetOneTimeTokenPaymentProfile`](../../../doc/models/get-one-time-token-payment-profile.md) | +| [`GetOneTimeTokenBankAccountPaymentProfile`](../../../doc/models/get-one-time-token-bank-account-payment-profile.md) | + +## GetOneTimeTokenPaymentProfile + +### Initialization Code + +#### Example + +```ruby +value = GetOneTimeTokenPaymentProfile.new( + first_name: 'first_name2', + last_name: 'last_name0', + masked_card_number: 'masked_card_number0', + card_type: CardType::ROUTEX, + expiration_month: 187.78, + expiration_year: 164.44, + current_vault: CreditCardVault::BRAINTREE_BLUE, + vault_token: 'vault_token4', + billing_address: 'billing_address4', + billing_city: 'billing_city0', + billing_country: 'billing_country6', + billing_state: 'billing_state6', + billing_zip: 'billing_zip0', + payment_type: 'payment_type2', + disabled: false, + site_gateway_setting_id: 232 +) +``` + +## GetOneTimeTokenBankAccountPaymentProfile + +### Initialization Code + +#### Example + +```ruby +value = GetOneTimeTokenBankAccountPaymentProfile.new( + first_name: 'first_name8', + last_name: 'last_name6', + current_vault: BankAccountVault::MAXP, + vault_token: 'vault_token0', + billing_address: 'billing_address0', + billing_city: 'billing_city4', + billing_country: 'billing_country2', + billing_state: 'billing_state8', + billing_zip: 'billing_zip6', + bank_name: 'bank_name6', + masked_bank_routing_number: 'masked_bank_routing_number6', + masked_bank_account_number: 'masked_bank_account_number0', + bank_account_type: BankAccountType::CHECKING, + bank_account_holder_type: BankAccountHolderType::PERSONAL, + payment_type: 'payment_type2', + disabled: false, + site_gateway_setting_id: 254 +) +``` + diff --git a/doc/models/containers/list-subscriptions-input-product.md b/doc/models/containers/list-subscriptions-input-product.md new file mode 100644 index 00000000..a253a5b2 --- /dev/null +++ b/doc/models/containers/list-subscriptions-input-product.md @@ -0,0 +1,34 @@ + +# List Subscriptions Input Product + +## Data Type + +`Integer | String` + +## Cases + +| Type | +| --- | +| `Integer` | +| `String` | + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/metered-usage-new-unit-balance.md b/doc/models/containers/metered-usage-new-unit-balance.md new file mode 100644 index 00000000..6ff79dd3 --- /dev/null +++ b/doc/models/containers/metered-usage-new-unit-balance.md @@ -0,0 +1,34 @@ + +# Metered Usage New Unit Balance + +## Data Type + +`Integer | String` + +## Cases + +| Type | +| --- | +| `Integer` | +| `String` | + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/prepaid-usage-new-overage-unit-balance.md b/doc/models/containers/prepaid-usage-new-overage-unit-balance.md new file mode 100644 index 00000000..481246a0 --- /dev/null +++ b/doc/models/containers/prepaid-usage-new-overage-unit-balance.md @@ -0,0 +1,34 @@ + +# Prepaid Usage New Overage Unit Balance + +## Data Type + +`Integer | String` + +## Cases + +| Type | +| --- | +| `Integer` | +| `String` | + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/prepaid-usage-new-unit-balance.md b/doc/models/containers/prepaid-usage-new-unit-balance.md new file mode 100644 index 00000000..5589f012 --- /dev/null +++ b/doc/models/containers/prepaid-usage-new-unit-balance.md @@ -0,0 +1,34 @@ + +# Prepaid Usage New Unit Balance + +## Data Type + +`Integer | String` + +## Cases + +| Type | +| --- | +| `Integer` | +| `String` | + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/subscription-component-unit-balance.md b/doc/models/containers/subscription-component-unit-balance.md new file mode 100644 index 00000000..15b722f3 --- /dev/null +++ b/doc/models/containers/subscription-component-unit-balance.md @@ -0,0 +1,34 @@ + +# Subscription Component Unit Balance + +## Data Type + +`Integer | String` + +## Cases + +| Type | +| --- | +| `Integer` | +| `String` | + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/update-invoice-item-component-id.md b/doc/models/containers/update-invoice-item-component-id.md new file mode 100644 index 00000000..a67b2334 --- /dev/null +++ b/doc/models/containers/update-invoice-item-component-id.md @@ -0,0 +1,34 @@ + +# Update Invoice Item Component Id + +## Data Type + +`String | Integer` + +## Cases + +| Type | +| --- | +| `String` | +| `Integer` | + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/update-invoice-item-price-point-id.md b/doc/models/containers/update-invoice-item-price-point-id.md new file mode 100644 index 00000000..c9682be1 --- /dev/null +++ b/doc/models/containers/update-invoice-item-price-point-id.md @@ -0,0 +1,34 @@ + +# Update Invoice Item Price Point Id + +## Data Type + +`String | Integer` + +## Cases + +| Type | +| --- | +| `String` | +| `Integer` | + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/update-invoice-item-product-id.md b/doc/models/containers/update-invoice-item-product-id.md new file mode 100644 index 00000000..07ebf9ef --- /dev/null +++ b/doc/models/containers/update-invoice-item-product-id.md @@ -0,0 +1,34 @@ + +# Update Invoice Item Product Id + +## Data Type + +`String | Integer` + +## Cases + +| Type | +| --- | +| `String` | +| `Integer` | + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/update-invoice-item-product-price-point-id.md b/doc/models/containers/update-invoice-item-product-price-point-id.md new file mode 100644 index 00000000..789e8cdf --- /dev/null +++ b/doc/models/containers/update-invoice-item-product-price-point-id.md @@ -0,0 +1,34 @@ + +# Update Invoice Item Product Price Point Id + +## Data Type + +`String | Integer` + +## Cases + +| Type | +| --- | +| `String` | +| `Integer` | + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + +## Integer + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + diff --git a/doc/models/containers/update-invoice-item-quantity.md b/doc/models/containers/update-invoice-item-quantity.md new file mode 100644 index 00000000..915d6ab7 --- /dev/null +++ b/doc/models/containers/update-invoice-item-quantity.md @@ -0,0 +1,34 @@ + +# Update Invoice Item Quantity + +## Data Type + +`Float | String` + +## Cases + +| Type | +| --- | +| `Float` | +| `String` | + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/containers/update-invoice-item-unit-price.md b/doc/models/containers/update-invoice-item-unit-price.md new file mode 100644 index 00000000..186db084 --- /dev/null +++ b/doc/models/containers/update-invoice-item-unit-price.md @@ -0,0 +1,34 @@ + +# Update Invoice Item Unit Price + +## Data Type + +`Float | String` + +## Cases + +| Type | +| --- | +| `Float` | +| `String` | + +## Float + +### Initialization Code + +#### Example + +```ruby +value = 0 +``` + +## String + +### Initialization Code + +#### Example + +```ruby +value = 'String0' +``` + diff --git a/doc/models/contract.md b/doc/models/contract.md index 6e12ab3d..5be3319d 100644 --- a/doc/models/contract.md +++ b/doc/models/contract.md @@ -16,19 +16,19 @@ Contract linked to the scheduled renewal configuration. | `number` | `String` | Optional | - | | `register` | [`Register`](../../doc/models/register.md) | Optional | - | -## Example (as JSON) - -```json -{ - "id": 136, - "maxio_id": "maxio_id8", - "number": "number6", - "register": { - "id": 54, - "maxio_id": "maxio_id4", - "name": "name2", - "currency_code": "currency_code2" - } -} +## Example + +```ruby +contract = Contract.new( + id: 112, + maxio_id: 'maxio_id6', + number: 'number2', + register: Register.new( + id: 54, + maxio_id: 'maxio_id4', + name: 'name2', + currency_code: 'currency_code2' + ) +) ``` diff --git a/doc/models/count-response.md b/doc/models/count-response.md index 8c84da5f..1bc25ed7 100644 --- a/doc/models/count-response.md +++ b/doc/models/count-response.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `count` | `Integer` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "count": 60 -} +```ruby +count_response = CountResponse.new( + count: 174 +) ``` diff --git a/doc/models/coupon-currency-request.md b/doc/models/coupon-currency-request.md index d7ec7865..c20627d1 100644 --- a/doc/models/coupon-currency-request.md +++ b/doc/models/coupon-currency-request.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `currency_prices` | [`Array[UpdateCouponCurrency]`](../../doc/models/update-coupon-currency.md) | Required | - | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "currency": "currency8", - "price": 78 - } +## Example + +```ruby +coupon_currency_request = CouponCurrencyRequest.new( + currency_prices: [ + UpdateCouponCurrency.new( + currency: 'currency8', + price: 78 + ) ] -} +) ``` diff --git a/doc/models/coupon-currency-response.md b/doc/models/coupon-currency-response.md index cceaffc3..87fa9237 100644 --- a/doc/models/coupon-currency-response.md +++ b/doc/models/coupon-currency-response.md @@ -11,30 +11,30 @@ | --- | --- | --- | --- | | `currency_prices` | [`Array[CouponCurrency]`](../../doc/models/coupon-currency.md) | Optional | - | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "id": 50, - "currency": "currency8", - "price": 233.74, - "coupon_id": 224 - }, - { - "id": 50, - "currency": "currency8", - "price": 233.74, - "coupon_id": 224 - }, - { - "id": 50, - "currency": "currency8", - "price": 233.74, - "coupon_id": 224 - } +## Example + +```ruby +coupon_currency_response = CouponCurrencyResponse.new( + currency_prices: [ + CouponCurrency.new( + id: 50, + currency: 'currency8', + price: 233.74, + coupon_id: 224 + ), + CouponCurrency.new( + id: 50, + currency: 'currency8', + price: 233.74, + coupon_id: 224 + ), + CouponCurrency.new( + id: 50, + currency: 'currency8', + price: 233.74, + coupon_id: 224 + ) ] -} +) ``` diff --git a/doc/models/coupon-currency.md b/doc/models/coupon-currency.md index f4712bd2..940ff7ce 100644 --- a/doc/models/coupon-currency.md +++ b/doc/models/coupon-currency.md @@ -14,14 +14,14 @@ | `price` | `Float` | Optional | - | | `coupon_id` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 228, - "currency": "currency8", - "price": 169.96, - "coupon_id": 210 -} +## Example + +```ruby +coupon_currency = CouponCurrency.new( + id: 52, + currency: 'currency8', + price: 136.44, + coupon_id: 222 +) ``` diff --git a/doc/models/coupon-payload.md b/doc/models/coupon-payload.md index 63e5910f..4d6270d5 100644 --- a/doc/models/coupon-payload.md +++ b/doc/models/coupon-payload.md @@ -10,10 +10,10 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `name` | `String` | Optional | Required when creating a new coupon. This name is not displayed to customers and is limited to 255 characters. | -| `code` | `String` | Optional | Required when creating a new coupon. The code is limited to 255 characters. May contain uppercase alphanumeric characters and these special characters (which allow for email addresses to be used): “%”, “@”, “+”, “-”, “_”, and “.” | +| `code` | `String` | Optional | Required when creating a new coupon. The code is limited to 255 characters. May contain uppercase alphanumeric characters and these special characters (which allow for email addresses to be used): “%”, “@”, “+”, “-”, “_”, and “.”. | | `description` | `String` | Optional | Required when creating a new coupon. A description of the coupon that can be displayed to customers in transactions and on statements. The description is limited to 255 characters. | | `percentage` | String \| Float \| nil | Optional | This is a container for one-of cases. | -| `amount_in_cents` | `Integer` | Optional | Required when creating a new flat amount coupon. Can't be used together with percentage. Flat USD discount | +| `amount_in_cents` | `Integer` | Optional | Required when creating a new flat amount coupon. Can't be used together with percentage. Flat USD discount. | | `allow_negative_balance` | `TrueClass \| FalseClass` | Optional | If set to true, discount is not limited (credits will carry forward to next billing). Can't be used together with restrictions. | | `recurring` | `TrueClass \| FalseClass` | Optional | - | | `end_date` | `Date` | Optional | After the end of the given day, this coupon code will be invalid for new signups. Recurring discounts started before this date will continue to recur even after this date. | @@ -24,15 +24,15 @@ | `apply_on_cancel_at_end_of_period` | `TrueClass \| FalseClass` | Optional | - | | `apply_on_subscription_expiration` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "name": "name8", - "code": "code6", - "description": "description8", - "percentage": "String7", - "amount_in_cents": 110 -} +```ruby +coupon_payload = CouponPayload.new( + name: 'name8', + code: 'code6', + description: 'description2', + percentage: 'String7', + amount_in_cents: 136 +) ``` diff --git a/doc/models/coupon-request.md b/doc/models/coupon-request.md index 4ba4855e..5d5b78a5 100644 --- a/doc/models/coupon-request.md +++ b/doc/models/coupon-request.md @@ -10,26 +10,26 @@ | 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 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) - -```json -{ - "coupon": { - "name": "name4", - "code": "code2", - "description": "description6", - "percentage": "String3", - "amount_in_cents": 230 +| `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 + +```ruby +coupon_request = CouponRequest.new( + coupon: CouponPayload.new( + name: 'name4', + code: 'code2', + description: 'description6', + percentage: 'String3', + amount_in_cents: 230 + ), + restricted_products: { + 'key0': true }, - "restricted_products": { - "key0": true - }, - "restricted_components": { - "key0": true + restricted_components: { + 'key0': true } -} +) ``` diff --git a/doc/models/coupon-response.md b/doc/models/coupon-response.md index 7c5ad38a..6d750c27 100644 --- a/doc/models/coupon-response.md +++ b/doc/models/coupon-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `coupon` | [`Coupon`](../../doc/models/coupon.md) | Optional | - | -## Example (as JSON) - -```json -{ - "coupon": { - "id": 196, - "name": "name4", - "code": "code2", - "description": "description6", - "amount": 97.66 - } -} +## Example + +```ruby +coupon_response = CouponResponse.new( + coupon: Coupon.new( + id: 196, + name: 'name4', + code: 'code2', + description: 'description6', + amount: 97.66 + ) +) ``` diff --git a/doc/models/coupon-restriction.md b/doc/models/coupon-restriction.md index d28a66b8..d1f55140 100644 --- a/doc/models/coupon-restriction.md +++ b/doc/models/coupon-restriction.md @@ -15,15 +15,15 @@ | `name` | `String` | Optional | - | | `handle` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 180, - "item_type": "Component", - "item_id": 184, - "name": "name4", - "handle": "handle0" -} +## Example + +```ruby +coupon_restriction = CouponRestriction.new( + id: 190, + item_type: RestrictionType::COMPONENT, + item_id: 82, + name: 'name2', + handle: 'handle8' +) ``` diff --git a/doc/models/coupon-subcodes-response.md b/doc/models/coupon-subcodes-response.md index 47053340..6c542f68 100644 --- a/doc/models/coupon-subcodes-response.md +++ b/doc/models/coupon-subcodes-response.md @@ -13,23 +13,21 @@ | `duplicate_codes` | `Array[String]` | Optional | - | | `invalid_codes` | `Array[String]` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "created_codes": [ - "created_codes1", - "created_codes2" +```ruby +coupon_subcodes_response = CouponSubcodesResponse.new( + created_codes: [ + 'created_codes7', + 'created_codes8' ], - "duplicate_codes": [ - "duplicate_codes8", - "duplicate_codes7" + duplicate_codes: [ + 'duplicate_codes0', + 'duplicate_codes1' ], - "invalid_codes": [ - "invalid_codes0", - "invalid_codes9", - "invalid_codes8" + invalid_codes: [ + 'invalid_codes4' ] -} +) ``` diff --git a/doc/models/coupon-subcodes.md b/doc/models/coupon-subcodes.md index 2935c369..1fe46a60 100644 --- a/doc/models/coupon-subcodes.md +++ b/doc/models/coupon-subcodes.md @@ -11,13 +11,15 @@ | --- | --- | --- | --- | | `codes` | `Array[String]` | Optional | - | -## Example (as JSON) - -```json -{ - "codes": [ - "codes8" +## Example + +```ruby +coupon_subcodes = CouponSubcodes.new( + codes: [ + 'codes0', + 'codes1', + 'codes2' ] -} +) ``` diff --git a/doc/models/coupon-usage.md b/doc/models/coupon-usage.md index 31a5ef57..f87b1c11 100644 --- a/doc/models/coupon-usage.md +++ b/doc/models/coupon-usage.md @@ -14,18 +14,18 @@ | `signups` | `Integer` | Optional | Number of times the coupon has been applied | | `savings` | `Integer` | Optional | Dollar amount of customer savings as a result of the coupon. | | `savings_in_cents` | `Integer` | Optional | Dollar amount of customer savings as a result of the coupon. | -| `revenue` | `Integer` | Optional | Total revenue of the all subscriptions that have received a discount from this coupon. | -| `revenue_in_cents` | `Integer` | Optional | Total revenue of the all subscriptions that have received a discount from this coupon. | - -## Example (as JSON) - -```json -{ - "id": 14, - "name": "name0", - "signups": 34, - "savings": 52, - "savings_in_cents": 138 -} +| `revenue` | `Integer` | Optional | Total revenue of all subscriptions that have received a discount from this coupon. | +| `revenue_in_cents` | `Integer` | Optional | Total revenue of all subscriptions that have received a discount from this coupon. | + +## Example + +```ruby +coupon_usage = CouponUsage.new( + id: 76, + name: 'name8', + signups: 96, + savings: 114, + savings_in_cents: 200 +) ``` diff --git a/doc/models/coupon.md b/doc/models/coupon.md index 655c6eb4..03c3c22e 100644 --- a/doc/models/coupon.md +++ b/doc/models/coupon.md @@ -41,15 +41,15 @@ | `coupon_restrictions` | [`Array[CouponRestriction]`](../../doc/models/coupon-restriction.md) | Optional | - | | `currency_prices` | [`Array[CouponCurrency]`](../../doc/models/coupon-currency.md) | Optional | Returned in read, find, and list endpoints if the query parameter is provided. | -## Example (as JSON) - -```json -{ - "id": 22, - "name": "name2", - "code": "code0", - "description": "description2", - "amount": 62.64 -} +## Example + +```ruby +coupon = Coupon.new( + id: 196, + name: 'name4', + code: 'code2', + description: 'description6', + amount: 97.66 +) ``` diff --git a/doc/models/create-allocation-request.md b/doc/models/create-allocation-request.md index e94dd765..6159c441 100644 --- a/doc/models/create-allocation-request.md +++ b/doc/models/create-allocation-request.md @@ -11,18 +11,18 @@ | --- | --- | --- | --- | | `allocation` | [`CreateAllocation`](../../doc/models/create-allocation.md) | Required | - | -## Example (as JSON) - -```json -{ - "allocation": { - "quantity": 228.94, - "decimal_quantity": "decimal_quantity6", - "previous_quantity": 254.04, - "decimal_previous_quantity": "decimal_previous_quantity8", - "component_id": 8, - "memo": "memo2" - } -} +## Example + +```ruby +create_allocation_request = CreateAllocationRequest.new( + allocation: CreateAllocation.new( + quantity: 228.94, + decimal_quantity: 'decimal_quantity6', + previous_quantity: 254.04, + decimal_previous_quantity: 'decimal_previous_quantity8', + component_id: 8, + memo: 'memo2' + ) +) ``` diff --git a/doc/models/create-allocation.md b/doc/models/create-allocation.md index 8c093e51..da5f529f 100644 --- a/doc/models/create-allocation.md +++ b/doc/models/create-allocation.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `quantity` | `Float` | Required | The allocated quantity to which to set the line-items allocated quantity. By default, this is an integer. If decimal allocations are enabled for the component, it will be a decimal number. For On/Off components, use 1for on and 0 for off. | +| `quantity` | `Float` | Required | The allocated quantity to which to set the line-items allocated quantity. By default, this is an integer. If decimal allocations are enabled for the component, it will be a decimal number. For On/Off components, use 1 for on and 0 for off. | | `decimal_quantity` | `String` | Optional | Decimal representation of the allocated quantity. Only valid when decimal
allocations are enabled for the component. | | `previous_quantity` | `Float` | Optional | The quantity that was in effect before this allocation. Responses always
include this value; it may be supplied on preview requests to ensure the
expected change is evaluated. | | `decimal_previous_quantity` | `String` | Optional | Decimal representation of `previous_quantity`. Only valid when decimal
allocations are enabled for the component. | @@ -25,16 +25,16 @@ | `billing_schedule` | [`BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | Billing schedule settings for component allocations or usages on multi-frequency subscriptions. Use this to start a component's billing period on a custom date instead of aligning with the product charge schedule. | | `custom_price` | [`ComponentCustomPrice`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | -## Example (as JSON) - -```json -{ - "quantity": 8.06, - "decimal_quantity": "decimal_quantity4", - "previous_quantity": 218.92, - "decimal_previous_quantity": "decimal_previous_quantity0", - "component_id": 192, - "memo": "memo4" -} +## Example + +```ruby +create_allocation = CreateAllocation.new( + quantity: 176.5, + decimal_quantity: 'decimal_quantity0', + previous_quantity: 50.48, + decimal_previous_quantity: 'decimal_previous_quantity4', + component_id: 140, + memo: 'memo8' +) ``` diff --git a/doc/models/create-component-price-point-request.md b/doc/models/create-component-price-point-request.md index 2ffd8714..bf9e6d77 100644 --- a/doc/models/create-component-price-point-request.md +++ b/doc/models/create-component-price-point-request.md @@ -11,26 +11,26 @@ | --- | --- | --- | --- | | `price_point` | [Create Component Price Point](../../doc/models/create-component-price-point.md) \| [Create Prepaid Usage Component Price Point](../../doc/models/create-prepaid-usage-component-price-point.md) | Required | This is a container for any-of cases. | -## Example (as JSON) - -```json -{ - "price_point": { - "name": "name0", - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +## Example + +```ruby +create_component_price_point_request = CreateComponentPricePointRequest.new( + price_point: CreateComponentPricePoint.new( + name: 'name0', + pricing_scheme: PricingScheme::PER_UNIT, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "use_site_exchange_rate": true, - "handle": "handle6", - "tax_included": false, - "interval": 24, - "interval_unit": "day" - } -} + handle: 'handle6', + use_site_exchange_rate: true, + tax_included: false, + interval: 24, + interval_unit: IntervalUnit::DAY + ) +) ``` diff --git a/doc/models/create-component-price-point.md b/doc/models/create-component-price-point.md index 2c775918..26b855e6 100644 --- a/doc/models/create-component-price-point.md +++ b/doc/models/create-component-price-point.md @@ -15,27 +15,27 @@ | `prices` | [`Array[Price]`](../../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` | | `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` | `Integer` | Optional | The numerical interval. e.g., 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. | -## Example (as JSON) - -```json -{ - "name": "name0", - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +## Example + +```ruby +create_component_price_point = CreateComponentPricePoint.new( + name: 'name4', + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "use_site_exchange_rate": true, - "handle": "handle6", - "tax_included": false, - "interval": 24, - "interval_unit": "day" -} + handle: 'handle0', + use_site_exchange_rate: true, + tax_included: false, + interval: 70, + interval_unit: IntervalUnit::DAY +) ``` diff --git a/doc/models/create-component-price-points-request.md b/doc/models/create-component-price-points-request.md index f8c2a75e..828bd2fa 100644 --- a/doc/models/create-component-price-points-request.md +++ b/doc/models/create-component-price-points-request.md @@ -11,64 +11,64 @@ | --- | --- | --- | --- | | `price_points` | Array[[Create Component Price Point](../../doc/models/create-component-price-point.md) \| [Create Prepaid Usage Component Price Point](../../doc/models/create-prepaid-usage-component-price-point.md)] | Required | This is Array of a container for any-of cases. | -## Example (as JSON) +## Example -```json -{ - "price_points": [ - { - "name": "name0", - "handle": "handle6", - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +```ruby +create_component_price_points_request = CreateComponentPricePointsRequest.new( + price_points: [ + CreateComponentPricePoint.new( + name: 'name0', + pricing_scheme: PricingScheme::PER_UNIT, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "use_site_exchange_rate": false, - "tax_included": false, - "interval": 24, - "interval_unit": "day" - }, - { - "name": "name0", - "handle": "handle6", - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } + handle: 'handle6', + use_site_exchange_rate: false, + tax_included: false, + interval: 24, + interval_unit: IntervalUnit::DAY + ), + CreateComponentPricePoint.new( + name: 'name0', + pricing_scheme: PricingScheme::PER_UNIT, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "use_site_exchange_rate": false, - "tax_included": false, - "interval": 24, - "interval_unit": "day" - } + handle: 'handle6', + use_site_exchange_rate: false, + tax_included: false, + interval: 24, + interval_unit: IntervalUnit::DAY + ) ] -} +) ``` diff --git a/doc/models/create-credit-note-event.md b/doc/models/create-credit-note-event.md index a90f3322..2857d0be 100644 --- a/doc/models/create-credit-note-event.md +++ b/doc/models/create-credit-note-event.md @@ -15,31 +15,31 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::CREATE_CREDIT_NOTE` | | `event_data` | [`CreditNote`](../../doc/models/credit-note.md) | Required | Example schema for an `create_credit_note` event | -## Example (as JSON) - -```json -{ - "id": 28, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "create_credit_note", - "event_data": { - "uid": "uid6", - "site_id": 132, - "customer_id": 244, - "subscription_id": 60, - "number": "number6" - } -} +## Example + +```ruby +create_credit_note_event = CreateCreditNoteEvent.new( + id: 166, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::CREATE_CREDIT_NOTE, + event_data: CreditNote.new( + uid: 'uid6', + site_id: 132, + customer_id: 244, + subscription_id: 60, + number: 'number6' + ) +) ``` diff --git a/doc/models/create-currency-price.md b/doc/models/create-currency-price.md index 92e579c1..bf167f7e 100644 --- a/doc/models/create-currency-price.md +++ b/doc/models/create-currency-price.md @@ -13,13 +13,13 @@ | `price` | `Float` | Optional | Price for the price level in this currency | | `price_id` | `Integer` | Optional | ID of the price that this corresponds with | -## Example (as JSON) - -```json -{ - "currency": "currency2", - "price": 10.4, - "price_id": 54 -} +## Example + +```ruby +create_currency_price = CreateCurrencyPrice.new( + currency: 'currency8', + price: 24.44, + price_id: 178 +) ``` diff --git a/doc/models/create-currency-prices-request.md b/doc/models/create-currency-prices-request.md index adce7a12..857a54b1 100644 --- a/doc/models/create-currency-prices-request.md +++ b/doc/models/create-currency-prices-request.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `currency_prices` | [`Array[CreateCurrencyPrice]`](../../doc/models/create-currency-price.md) | Required | - | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "currency": "currency8", - "price": 233.74, - "price_id": 116 - } +## Example + +```ruby +create_currency_prices_request = CreateCurrencyPricesRequest.new( + currency_prices: [ + CreateCurrencyPrice.new( + currency: 'currency8', + price: 233.74, + price_id: 116 + ) ] -} +) ``` diff --git a/doc/models/create-customer-request.md b/doc/models/create-customer-request.md index c1f23bfb..b906cef7 100644 --- a/doc/models/create-customer-request.md +++ b/doc/models/create-customer-request.md @@ -11,20 +11,20 @@ | --- | --- | --- | --- | | `customer` | [`CreateCustomer`](../../doc/models/create-customer.md) | Required | - | -## Example (as JSON) - -```json -{ - "customer": { - "first_name": "first_name0", - "last_name": "last_name8", - "email": "email6", - "cc_emails": "cc_emails0", - "organization": "organization6", - "reference": "reference4", - "address": "address6", - "address_2": "address_24" - } -} +## Example + +```ruby +create_customer_request = CreateCustomerRequest.new( + customer: CreateCustomer.new( + first_name: 'first_name0', + last_name: 'last_name8', + email: 'email6', + cc_emails: 'cc_emails0', + organization: 'organization6', + reference: 'reference4', + address: 'address6', + address_2: 'address_24' + ) +) ``` diff --git a/doc/models/create-customer.md b/doc/models/create-customer.md index 7392b31c..bb304f7c 100644 --- a/doc/models/create-customer.md +++ b/doc/models/create-customer.md @@ -25,22 +25,24 @@ | `locale` | `String` | Optional | Set a specific language on a customer record. | | `vat_number` | `String` | Optional | - | | `tax_exempt` | `TrueClass \| FalseClass` | Optional | - | +| `surcharging` | `TrueClass \| FalseClass` | Optional | Whether surcharging is enabled for the customer. Defaults to `true` when omitted. Only applied on sites where surcharging control is enabled. | | `tax_exempt_reason` | `String` | Optional | - | | `parent_id` | `Integer` | Optional | The parent ID in Chargify if applicable. Parent is another Customer object. | | `salesforce_id` | `String` | Optional | The Salesforce ID of the customer | - -## Example (as JSON) - -```json -{ - "first_name": "first_name8", - "last_name": "last_name6", - "email": "email8", - "cc_emails": "cc_emails8", - "organization": "organization2", - "reference": "reference4", - "address": "address4", - "address_2": "address_22" -} +| `branding_theme_id` | `Integer` | Optional | The ID of the Branding Theme assigned to this customer as the customer's default Branding Theme. This customer-level Branding Theme is used when a subscription does not have its own subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. | + +## Example + +```ruby +create_customer = CreateCustomer.new( + first_name: 'first_name0', + last_name: 'last_name8', + email: 'email6', + cc_emails: 'cc_emails0', + organization: 'organization6', + reference: 'reference4', + address: 'address6', + address_2: 'address_24' +) ``` diff --git a/doc/models/create-debit-note-event.md b/doc/models/create-debit-note-event.md index 64b81fce..8e4d61d7 100644 --- a/doc/models/create-debit-note-event.md +++ b/doc/models/create-debit-note-event.md @@ -15,31 +15,31 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::CREATE_DEBIT_NOTE` | | `event_data` | [`DebitNote`](../../doc/models/debit-note.md) | Required | Example schema for an `create_debit_note` event | -## Example (as JSON) - -```json -{ - "id": 98, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "create_debit_note", - "event_data": { - "uid": "uid6", - "site_id": 132, - "customer_id": 244, - "subscription_id": 60, - "number": 64 - } -} +## Example + +```ruby +create_debit_note_event = CreateDebitNoteEvent.new( + id: 246, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::CREATE_DEBIT_NOTE, + event_data: DebitNote.new( + uid: 'uid6', + site_id: 132, + customer_id: 244, + subscription_id: 60, + number: 64 + ) +) ``` diff --git a/doc/models/create-ebb-component.md b/doc/models/create-ebb-component.md index 83797bce..48a50963 100644 --- a/doc/models/create-ebb-component.md +++ b/doc/models/create-ebb-component.md @@ -11,35 +11,35 @@ | --- | --- | --- | --- | | `event_based_component` | [`EBBComponent`](../../doc/models/ebb-component.md) | Required | - | -## Example (as JSON) - -```json -{ - "event_based_component": { - "name": "name8", - "unit_name": "unit_name0", - "description": "description8", - "handle": "handle4", - "taxable": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +## Example + +```ruby +create_ebb_component = CreateEBBComponent.new( + event_based_component: EBBComponent.new( + name: 'name8', + unit_name: 'unit_name0', + pricing_scheme: PricingScheme::STAIRSTEP, + event_based_billing_metric_id: 68, + description: 'description8', + handle: 'handle4', + taxable: false, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "price_points": [ - { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" - } - ], - "event_based_billing_metric_id": 68 - } -} + price_points: [ + ComponentPricePointItem.new( + name: 'name2', + handle: 'handle8', + pricing_scheme: PricingScheme::PER_UNIT, + interval: 92, + interval_unit: IntervalUnit::DAY + ) + ] + ) +) ``` diff --git a/doc/models/create-invoice-address.md b/doc/models/create-invoice-address.md index b2dba20d..c83b1ad7 100644 --- a/doc/models/create-invoice-address.md +++ b/doc/models/create-invoice-address.md @@ -21,15 +21,15 @@ Overrides the default address. | `zip` | `String` | Optional | - | | `country` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "first_name": "first_name4", - "last_name": "last_name2", - "phone": "phone6", - "address": "address0", - "address_2": "address_28" -} +## Example + +```ruby +create_invoice_address = CreateInvoiceAddress.new( + first_name: 'first_name8', + last_name: 'last_name6', + phone: 'phone2', + address: 'address4', + address_2: 'address_22' +) ``` diff --git a/doc/models/create-invoice-coupon.md b/doc/models/create-invoice-coupon.md index a2b42203..beef7e81 100644 --- a/doc/models/create-invoice-coupon.md +++ b/doc/models/create-invoice-coupon.md @@ -17,15 +17,15 @@ | `product_family_id` | String \| Integer \| nil | Optional | This is a container for one-of cases. | | `compounding_strategy` | [`CompoundingStrategy`](../../doc/models/compounding-strategy.md) | Optional | Applicable only to stackable coupons. For `compound`, Percentage-based discounts will be calculated against the remaining price, after prior discounts have been calculated. For `full-price`, Percentage-based discounts will always be calculated against the original item price, before other discounts are applied. | -## Example (as JSON) - -```json -{ - "percentage": 50.0, - "code": "code4", - "subcode": "subcode8", - "amount": "String9", - "description": "description4" -} +## Example + +```ruby +create_invoice_coupon = CreateInvoiceCoupon.new( + code: 'code6', + subcode: 'subcode6', + percentage: 50, + amount: 'String1', + description: 'description8' +) ``` diff --git a/doc/models/create-invoice-item.md b/doc/models/create-invoice-item.md index bcb0dcb8..ed180357 100644 --- a/doc/models/create-invoice-item.md +++ b/doc/models/create-invoice-item.md @@ -22,15 +22,15 @@ | `product_price_point_id` | String \| Integer \| nil | Optional | This is a container for one-of cases. | | `description` | `String` | Optional | **Constraints**: *Maximum Length*: `255` | -## Example (as JSON) - -```json -{ - "title": "title2", - "quantity": 154.86, - "unit_price": 138.08, - "taxable": false, - "tax_code": "tax_code4" -} +## Example + +```ruby +create_invoice_item = CreateInvoiceItem.new( + title: 'title2', + quantity: 163.26, + unit_price: 146.48, + taxable: false, + tax_code: 'tax_code4' +) ``` diff --git a/doc/models/create-invoice-payment-application.md b/doc/models/create-invoice-payment-application.md index 6ffdf49d..482a51f4 100644 --- a/doc/models/create-invoice-payment-application.md +++ b/doc/models/create-invoice-payment-application.md @@ -12,12 +12,12 @@ | `invoice_uid` | `String` | Required | Unique identifier for the invoice. It has the prefix "inv_" followed by alphanumeric characters. | | `amount` | `String` | Required | Dollar amount of the invoice payment (eg. "10.50" => $10.50). | -## Example (as JSON) +## Example -```json -{ - "invoice_uid": "invoice_uid4", - "amount": "amount6" -} +```ruby +create_invoice_payment_application = CreateInvoicePaymentApplication.new( + invoice_uid: 'invoice_uid8', + amount: 'amount0' +) ``` diff --git a/doc/models/create-invoice-payment-request.md b/doc/models/create-invoice-payment-request.md index 9d168b13..28fd646f 100644 --- a/doc/models/create-invoice-payment-request.md +++ b/doc/models/create-invoice-payment-request.md @@ -12,18 +12,18 @@ | `payment` | [`CreateInvoicePayment`](../../doc/models/create-invoice-payment.md) | Required | - | | `type` | [`InvoicePaymentType`](../../doc/models/invoice-payment-type.md) | Optional | The type of payment to be applied to an Invoice. Defaults to external. | -## Example (as JSON) - -```json -{ - "payment": { - "amount": "String9", - "memo": "memo0", - "method": "ach", - "details": "details6", - "payment_profile_id": 42 - }, - "type": "external" -} +## Example + +```ruby +create_invoice_payment_request = CreateInvoicePaymentRequest.new( + payment: CreateInvoicePayment.new( + amount: 'String9', + memo: 'memo0', + method: InvoicePaymentMethodType::ACH, + details: 'details6', + payment_profile_id: 42 + ), + type: InvoicePaymentType::SERVICE_CREDIT +) ``` diff --git a/doc/models/create-invoice-payment.md b/doc/models/create-invoice-payment.md index d12c68c3..1c1fa473 100644 --- a/doc/models/create-invoice-payment.md +++ b/doc/models/create-invoice-payment.md @@ -16,15 +16,15 @@ | `payment_profile_id` | `Integer` | Optional | The ID of the payment profile to be used for the payment. | | `received_on` | `Date` | Optional | Date reflecting when the payment was received from a customer. Must be in the past. Applicable only to
`external` payments. | -## Example (as JSON) - -```json -{ - "amount": "String9", - "memo": "memo0", - "method": "cash", - "details": "details6", - "payment_profile_id": 122 -} +## Example + +```ruby +create_invoice_payment = CreateInvoicePayment.new( + amount: 'String7', + memo: 'memo8', + method: InvoicePaymentMethodType::CREDIT_CARD, + details: 'details4', + payment_profile_id: 210 +) ``` diff --git a/doc/models/create-invoice-request.md b/doc/models/create-invoice-request.md index a74b5075..80c1497d 100644 --- a/doc/models/create-invoice-request.md +++ b/doc/models/create-invoice-request.md @@ -11,40 +11,40 @@ | --- | --- | --- | --- | | `invoice` | [`CreateInvoice`](../../doc/models/create-invoice.md) | Required | - | -## Example (as JSON) - -```json -{ - "invoice": { - "issue_date": "2024-01-01", - "status": "draft", - "line_items": [ - { - "title": "title4", - "quantity": 56.68, - "unit_price": 39.9, - "taxable": false, - "tax_code": "tax_code6" - }, - { - "title": "title4", - "quantity": 56.68, - "unit_price": 39.9, - "taxable": false, - "tax_code": "tax_code6" - }, - { - "title": "title4", - "quantity": 56.68, - "unit_price": 39.9, - "taxable": false, - "tax_code": "tax_code6" - } +## Example + +```ruby +create_invoice_request = CreateInvoiceRequest.new( + invoice: CreateInvoice.new( + line_items: [ + CreateInvoiceItem.new( + title: 'title4', + quantity: 56.68, + unit_price: 39.9, + taxable: false, + tax_code: 'tax_code6' + ), + CreateInvoiceItem.new( + title: 'title4', + quantity: 56.68, + unit_price: 39.9, + taxable: false, + tax_code: 'tax_code6' + ), + CreateInvoiceItem.new( + title: 'title4', + quantity: 56.68, + unit_price: 39.9, + taxable: false, + tax_code: 'tax_code6' + ) ], - "net_terms": 144, - "payment_instructions": "payment_instructions6", - "memo": "memo0" - } -} + issue_date: Date.iso8601('2024-01-01'), + net_terms: 144, + payment_instructions: 'payment_instructions6', + memo: 'memo0', + status: CreateInvoiceStatus::DRAFT + ) +) ``` diff --git a/doc/models/create-invoice-status.md b/doc/models/create-invoice-status.md index 73171a87..834dc5a4 100644 --- a/doc/models/create-invoice-status.md +++ b/doc/models/create-invoice-status.md @@ -14,7 +14,7 @@ ## Example -``` -draft +```ruby +create_invoice_status = CreateInvoiceStatus::DRAFT ``` diff --git a/doc/models/create-invoice.md b/doc/models/create-invoice.md index 457d3cc8..e0700ccf 100644 --- a/doc/models/create-invoice.md +++ b/doc/models/create-invoice.md @@ -14,30 +14,37 @@ | `net_terms` | `Integer` | Optional | By default, invoices will be created with a due date matching the date of invoice creation. If a different due date is desired, the net_terms parameter can be sent indicating the number of days in advance the due date should be. | | `payment_instructions` | `String` | Optional | - | | `memo` | `String` | Optional | A custom memo can be sent to override the site's default. | -| `seller_address` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the defaults for the site | -| `billing_address` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the default for the customer | -| `shipping_address` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the default for the customer | +| `seller_address` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the defaults for the site. | +| `billing_address` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the default for the customer. | +| `shipping_address` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Overrides the default for the customer. | | `coupons` | [`Array[CreateInvoiceCoupon]`](../../doc/models/create-invoice-coupon.md) | Optional | - | | `status` | [`CreateInvoiceStatus`](../../doc/models/create-invoice-status.md) | Optional | **Default**: `CreateInvoiceStatus::OPEN` | -## Example (as JSON) - -```json -{ - "issue_date": "2024-01-01", - "status": "draft", - "line_items": [ - { - "title": "title4", - "quantity": 56.68, - "unit_price": 39.9, - "taxable": false, - "tax_code": "tax_code6" - } +## Example + +```ruby +create_invoice = CreateInvoice.new( + line_items: [ + CreateInvoiceItem.new( + title: 'title4', + quantity: 56.68, + unit_price: 39.9, + taxable: false, + tax_code: 'tax_code6' + ), + CreateInvoiceItem.new( + title: 'title4', + quantity: 56.68, + unit_price: 39.9, + taxable: false, + tax_code: 'tax_code6' + ) ], - "net_terms": 18, - "payment_instructions": "payment_instructions0", - "memo": "memo6" -} + issue_date: Date.iso8601('2024-01-01'), + net_terms: 100, + payment_instructions: 'payment_instructions4', + memo: 'memo0', + status: CreateInvoiceStatus::DRAFT +) ``` diff --git a/doc/models/create-metadata-request.md b/doc/models/create-metadata-request.md index 1a3b437f..6897e7bc 100644 --- a/doc/models/create-metadata-request.md +++ b/doc/models/create-metadata-request.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `metadata` | [`Array[CreateMetadata]`](../../doc/models/create-metadata.md) | Required | - | -## Example (as JSON) - -```json -{ - "metadata": [ - { - "name": "name6", - "value": "value8" - } +## Example + +```ruby +create_metadata_request = CreateMetadataRequest.new( + metadata: [ + CreateMetadata.new( + name: 'name6', + value: 'value8' + ) ] -} +) ``` diff --git a/doc/models/create-metadata.md b/doc/models/create-metadata.md index a744574d..345d783a 100644 --- a/doc/models/create-metadata.md +++ b/doc/models/create-metadata.md @@ -12,12 +12,12 @@ | `name` | `String` | Optional | - | | `value` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "name": "name4", - "value": "value6" -} +```ruby +create_metadata = CreateMetadata.new( + name: 'name2', + value: 'value4' +) ``` diff --git a/doc/models/create-metafield.md b/doc/models/create-metafield.md index 6689b549..7c481804 100644 --- a/doc/models/create-metafield.md +++ b/doc/models/create-metafield.md @@ -11,26 +11,26 @@ | --- | --- | --- | --- | | `name` | `String` | Optional | - | | `scope` | [`MetafieldScope`](../../doc/models/metafield-scope.md) | Optional | Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. | -| `input_type` | [`MetafieldInput`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | +| `input_type` | [`MetafieldInput`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | | `enum` | `Array[String]` | Optional | Only applicable when input_type is radio or dropdown. Empty strings will not be submitted. | -## Example (as JSON) - -```json -{ - "name": "my_field", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0", - "public_edit": "0" - }, - "input_type": "text", - "enum": [ - "string" +## Example + +```ruby +create_metafield = CreateMetafield.new( + name: 'my_field', + scope: MetafieldScope.new( + csv: IncludeOption::EXCLUDE, + invoices: IncludeOption::EXCLUDE, + statements: IncludeOption::EXCLUDE, + portal: IncludeOption::EXCLUDE, + public_show: IncludeOption::EXCLUDE, + public_edit: IncludeOption::EXCLUDE + ), + input_type: MetafieldInput::TEXT, + enum: [ + 'string' ] -} +) ``` diff --git a/doc/models/create-metafields-request.md b/doc/models/create-metafields-request.md index 75fb57c6..8e360c79 100644 --- a/doc/models/create-metafields-request.md +++ b/doc/models/create-metafields-request.md @@ -11,25 +11,25 @@ | --- | --- | --- | --- | | `metafields` | [Create Metafield](../../doc/models/create-metafield.md) \| Array[[Create Metafield](../../doc/models/create-metafield.md)] | Required | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "metafields": { - "name": "my_field", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0", - "public_edit": "0" - }, - "input_type": "text", - "enum": [ - "string" +## Example + +```ruby +create_metafields_request = CreateMetafieldsRequest.new( + metafields: CreateMetafield.new( + name: 'my_field', + scope: MetafieldScope.new( + csv: IncludeOption::EXCLUDE, + invoices: IncludeOption::EXCLUDE, + statements: IncludeOption::EXCLUDE, + portal: IncludeOption::EXCLUDE, + public_show: IncludeOption::EXCLUDE, + public_edit: IncludeOption::EXCLUDE + ), + input_type: MetafieldInput::TEXT, + enum: [ + 'string' ] - } -} + ) +) ``` diff --git a/doc/models/create-metered-component.md b/doc/models/create-metered-component.md index 0a56ac91..6653e5f5 100644 --- a/doc/models/create-metered-component.md +++ b/doc/models/create-metered-component.md @@ -11,58 +11,58 @@ | --- | --- | --- | --- | | `metered_component` | [`MeteredComponent`](../../doc/models/metered-component.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "metered_component": { - "name": "name0", - "unit_name": "unit_name2", - "description": "description0", - "handle": "handle6", - "taxable": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +```ruby +create_metered_component = CreateMeteredComponent.new( + metered_component: MeteredComponent.new( + name: 'name0', + unit_name: 'unit_name2', + pricing_scheme: PricingScheme::STAIRSTEP, + description: 'description0', + handle: 'handle6', + taxable: false, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "price_points": [ - { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" - }, - { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" - }, - { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" - } + price_points: [ + ComponentPricePointItem.new( + name: 'name2', + handle: 'handle8', + pricing_scheme: PricingScheme::PER_UNIT, + interval: 92, + interval_unit: IntervalUnit::DAY + ), + ComponentPricePointItem.new( + name: 'name2', + handle: 'handle8', + pricing_scheme: PricingScheme::PER_UNIT, + interval: 92, + interval_unit: IntervalUnit::DAY + ), + ComponentPricePointItem.new( + name: 'name2', + handle: 'handle8', + pricing_scheme: PricingScheme::PER_UNIT, + interval: 92, + interval_unit: IntervalUnit::DAY + ) ] - } -} + ) +) ``` diff --git a/doc/models/create-multi-invoice-payment-request.md b/doc/models/create-multi-invoice-payment-request.md index 7388e47b..8c8aed62 100644 --- a/doc/models/create-multi-invoice-payment-request.md +++ b/doc/models/create-multi-invoice-payment-request.md @@ -11,23 +11,23 @@ | --- | --- | --- | --- | | `payment` | [`CreateMultiInvoicePayment`](../../doc/models/create-multi-invoice-payment.md) | Required | - | -## Example (as JSON) - -```json -{ - "payment": { - "amount": "String9", - "applications": [ - { - "invoice_uid": "invoice_uid8", - "amount": "amount0" - } +## Example + +```ruby +create_multi_invoice_payment_request = CreateMultiInvoicePaymentRequest.new( + payment: CreateMultiInvoicePayment.new( + amount: 'String9', + applications: [ + CreateInvoicePaymentApplication.new( + invoice_uid: 'invoice_uid8', + amount: 'amount0' + ) ], - "memo": "memo0", - "details": "details6", - "method": "ach", - "received_on": "received_on8" - } -} + memo: 'memo0', + details: 'details6', + method: InvoicePaymentMethodType::ACH, + received_on: 'received_on8' + ) +) ``` diff --git a/doc/models/create-multi-invoice-payment.md b/doc/models/create-multi-invoice-payment.md index 62ab0c6a..e9871a4f 100644 --- a/doc/models/create-multi-invoice-payment.md +++ b/doc/models/create-multi-invoice-payment.md @@ -16,21 +16,21 @@ | `received_on` | `String` | Optional | Date reflecting when the payment was received from a customer. Must be in the past. | | `applications` | [`Array[CreateInvoicePaymentApplication]`](../../doc/models/create-invoice-payment-application.md) | Required | - | -## Example (as JSON) - -```json -{ - "amount": "String7", - "applications": [ - { - "invoice_uid": "invoice_uid8", - "amount": "amount0" - } +## Example + +```ruby +create_multi_invoice_payment = CreateMultiInvoicePayment.new( + amount: 'String5', + applications: [ + CreateInvoicePaymentApplication.new( + invoice_uid: 'invoice_uid8', + amount: 'amount0' + ) ], - "memo": "memo8", - "details": "details4", - "method": "credit_card", - "received_on": "received_on6" -} + memo: 'memo6', + details: 'details2', + method: InvoicePaymentMethodType::ACH, + received_on: 'received_on4' +) ``` diff --git a/doc/models/create-offer-component.md b/doc/models/create-offer-component.md index 1a11b921..3aa3c87e 100644 --- a/doc/models/create-offer-component.md +++ b/doc/models/create-offer-component.md @@ -13,13 +13,13 @@ | `price_point_id` | `Integer` | Optional | - | | `starting_quantity` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "component_id": 242, - "price_point_id": 10, - "starting_quantity": 50 -} +## Example + +```ruby +create_offer_component = CreateOfferComponent.new( + component_id: 206, + price_point_id: 230, + starting_quantity: 242 +) ``` diff --git a/doc/models/create-offer-request.md b/doc/models/create-offer-request.md index add33999..a3581171 100644 --- a/doc/models/create-offer-request.md +++ b/doc/models/create-offer-request.md @@ -11,32 +11,32 @@ | --- | --- | --- | --- | | `offer` | [`CreateOffer`](../../doc/models/create-offer.md) | Required | - | -## Example (as JSON) - -```json -{ - "offer": { - "name": "name4", - "handle": "handle0", - "description": "description6", - "product_id": 30, - "product_price_point_id": 150, - "components": [ - { - "component_id": 108, - "price_point_id": 124, - "starting_quantity": 84 - }, - { - "component_id": 108, - "price_point_id": 124, - "starting_quantity": 84 - } +## Example + +```ruby +create_offer_request = CreateOfferRequest.new( + offer: CreateOffer.new( + name: 'name4', + handle: 'handle0', + product_id: 30, + description: 'description6', + product_price_point_id: 150, + components: [ + CreateOfferComponent.new( + component_id: 108, + price_point_id: 124, + starting_quantity: 84 + ), + CreateOfferComponent.new( + component_id: 108, + price_point_id: 124, + starting_quantity: 84 + ) ], - "coupons": [ - "coupons6" + coupons: [ + 'coupons6' ] - } -} + ) +) ``` diff --git a/doc/models/create-offer.md b/doc/models/create-offer.md index e654e7c4..3a8cda36 100644 --- a/doc/models/create-offer.md +++ b/doc/models/create-offer.md @@ -17,30 +17,30 @@ | `components` | [`Array[CreateOfferComponent]`](../../doc/models/create-offer-component.md) | Optional | - | | `coupons` | `Array[String]` | Optional | - | -## Example (as JSON) - -```json -{ - "name": "name4", - "handle": "handle0", - "description": "description4", - "product_id": 208, - "product_price_point_id": 132, - "components": [ - { - "component_id": 108, - "price_point_id": 124, - "starting_quantity": 84 - }, - { - "component_id": 108, - "price_point_id": 124, - "starting_quantity": 84 - } +## Example + +```ruby +create_offer = CreateOffer.new( + name: 'name2', + handle: 'handle8', + product_id: 8, + description: 'description2', + product_price_point_id: 188, + components: [ + CreateOfferComponent.new( + component_id: 108, + price_point_id: 124, + starting_quantity: 84 + ), + CreateOfferComponent.new( + component_id: 108, + price_point_id: 124, + starting_quantity: 84 + ) ], - "coupons": [ - "coupons4" + coupons: [ + 'coupons8' ] -} +) ``` diff --git a/doc/models/create-on-off-component.md b/doc/models/create-on-off-component.md index a87d8fc5..d8d05fd0 100644 --- a/doc/models/create-on-off-component.md +++ b/doc/models/create-on-off-component.md @@ -11,19 +11,19 @@ | --- | --- | --- | --- | | `on_off_component` | [`OnOffComponent`](../../doc/models/on-off-component.md) | Required | - | -## Example (as JSON) - -```json -{ - "on_off_component": { - "name": "name6", - "description": "description6", - "handle": "handle2", - "taxable": false, - "upgrade_charge": "full", - "downgrade_credit": "full", - "unit_price": "String5" - } -} +## Example + +```ruby +create_on_off_component = CreateOnOffComponent.new( + on_off_component: OnOffComponent.new( + name: 'name6', + unit_price: 'String5', + description: 'description6', + handle: 'handle2', + taxable: false, + upgrade_charge: CreditType::FULL, + downgrade_credit: CreditType::FULL + ) +) ``` diff --git a/doc/models/create-or-update-endpoint-request.md b/doc/models/create-or-update-endpoint-request.md index 787658ee..811ee4a7 100644 --- a/doc/models/create-or-update-endpoint-request.md +++ b/doc/models/create-or-update-endpoint-request.md @@ -1,7 +1,7 @@ # Create or Update Endpoint Request -Used to Create or Update Endpoint +Used to Create or Update Endpoint. ## Structure @@ -11,18 +11,18 @@ Used to Create or Update Endpoint | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `endpoint` | [`CreateOrUpdateEndpoint`](../../doc/models/create-or-update-endpoint.md) | Required | Used to Create or Update Endpoint | +| `endpoint` | [`CreateOrUpdateEndpoint`](../../doc/models/create-or-update-endpoint.md) | Required | Used to Create or Update Endpoint. | -## Example (as JSON) +## Example -```json -{ - "endpoint": { - "url": "url2", - "webhook_subscriptions": [ - "subscription_prepayment_account_balance_changed" +```ruby +create_or_update_endpoint_request = CreateOrUpdateEndpointRequest.new( + endpoint: CreateOrUpdateEndpoint.new( + url: 'url2', + webhook_subscriptions: [ + WebhookSubscription::STATEMENT_CLOSED ] - } -} + ) +) ``` diff --git a/doc/models/create-or-update-endpoint.md b/doc/models/create-or-update-endpoint.md index 19b5d1ce..98beb439 100644 --- a/doc/models/create-or-update-endpoint.md +++ b/doc/models/create-or-update-endpoint.md @@ -1,7 +1,7 @@ # Create or Update Endpoint -Used to Create or Update Endpoint +Used to Create or Update Endpoint. ## Structure @@ -14,14 +14,14 @@ Used to Create or Update Endpoint | `url` | `String` | Required | - | | `webhook_subscriptions` | [`Array[WebhookSubscription]`](../../doc/models/webhook-subscription.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "url": "url8", - "webhook_subscriptions": [ - "refund_success" +```ruby +create_or_update_endpoint = CreateOrUpdateEndpoint.new( + url: 'url2', + webhook_subscriptions: [ + WebhookSubscription::EXPIRATION_DATE_CHANGE ] -} +) ``` diff --git a/doc/models/create-or-update-product-request.md b/doc/models/create-or-update-product-request.md index 27bf13ae..45e1febe 100644 --- a/doc/models/create-or-update-product-request.md +++ b/doc/models/create-or-update-product-request.md @@ -11,22 +11,22 @@ | --- | --- | --- | --- | | `product` | [`CreateOrUpdateProduct`](../../doc/models/create-or-update-product.md) | Required | - | -## Example (as JSON) - -```json -{ - "product": { - "name": "name0", - "handle": "handle6", - "description": "description0", - "accounting_code": "accounting_code6", - "require_credit_card": false, - "price_in_cents": 54, - "interval": 186, - "interval_unit": "day", - "trial_price_in_cents": 34, - "trial_interval": 88 - } -} +## Example + +```ruby +create_or_update_product_request = CreateOrUpdateProductRequest.new( + product: CreateOrUpdateProduct.new( + name: 'name0', + description: 'description0', + price_in_cents: 54, + interval: 186, + interval_unit: IntervalUnit::DAY, + handle: 'handle6', + accounting_code: 'accounting_code6', + require_credit_card: false, + trial_price_in_cents: 34, + trial_interval: 88 + ) +) ``` diff --git a/doc/models/create-or-update-product.md b/doc/models/create-or-update-product.md index a47d1b69..ce52460b 100644 --- a/doc/models/create-or-update-product.md +++ b/doc/models/create-or-update-product.md @@ -15,31 +15,32 @@ | `accounting_code` | `String` | Optional | E.g. Internal ID or SKU Number | | `require_credit_card` | `TrueClass \| FalseClass` | Optional | Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, read this attribute from under the signup page. | | `price_in_cents` | `Integer` | Required | The product price, in integer cents | -| `interval` | `Integer` | Required | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days | +| `interval` | `Integer` | Required | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Required | A string representing the interval unit for this product, either month or day | | `trial_price_in_cents` | `Integer` | Optional | The product trial price, in integer cents | -| `trial_interval` | `Integer` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product trial would last 30 days. | +| `trial_interval` | `Integer` | Optional | The numerical trial interval. e.g., an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product trial would last 30 days. | | `trial_interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product, either month or day | -| `trial_type` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | -| `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. | +| `trial_type` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | +| `expiration_interval` | `Integer` | Optional | The numerical expiration interval. e.g., 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 AvaTax to tax based on locale. This attribute has a max length of 25 characters. | - -## Example (as JSON) - -```json -{ - "name": "name8", - "handle": "handle4", - "description": "description8", - "accounting_code": "accounting_code4", - "require_credit_card": false, - "price_in_cents": 190, - "interval": 174, - "interval_unit": "day", - "trial_price_in_cents": 22, - "trial_interval": 76 -} +| `unspsc_code` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this product instead of the default derived from item_category. | + +## Example + +```ruby +create_or_update_product = CreateOrUpdateProduct.new( + name: 'name0', + description: 'description0', + price_in_cents: 48, + interval: 64, + interval_unit: IntervalUnit::DAY, + handle: 'handle6', + accounting_code: 'accounting_code6', + require_credit_card: false, + trial_price_in_cents: 216, + trial_interval: 162 +) ``` diff --git a/doc/models/create-or-update-segment-price.md b/doc/models/create-or-update-segment-price.md index 492bcadd..fb832a5d 100644 --- a/doc/models/create-or-update-segment-price.md +++ b/doc/models/create-or-update-segment-price.md @@ -13,13 +13,13 @@ | `ending_quantity` | `Integer` | Optional | - | | `unit_price` | String \| Float | Required | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "starting_quantity": 78, - "ending_quantity": 52, - "unit_price": "String7" -} +## Example + +```ruby +create_or_update_segment_price = CreateOrUpdateSegmentPrice.new( + unit_price: 'String7', + starting_quantity: 94, + ending_quantity: 188 +) ``` diff --git a/doc/models/create-payment-profile-request.md b/doc/models/create-payment-profile-request.md index 5cbd6846..aa4b96a4 100644 --- a/doc/models/create-payment-profile-request.md +++ b/doc/models/create-payment-profile-request.md @@ -11,18 +11,18 @@ | --- | --- | --- | --- | | `payment_profile` | [`CreatePaymentProfile`](../../doc/models/create-payment-profile.md) | Required | - | -## Example (as JSON) - -```json -{ - "payment_profile": { - "chargify_token": "tok_9g6hw85pnpt6knmskpwp4ttt", - "full_number": "5424000000000015", - "id": 44, - "payment_type": "credit_card", - "first_name": "first_name4", - "last_name": "last_name2" - } -} +## Example + +```ruby +create_payment_profile_request = CreatePaymentProfileRequest.new( + payment_profile: CreatePaymentProfile.new( + chargify_token: 'tok_9g6hw85pnpt6knmskpwp4ttt', + id: 44, + payment_type: PaymentType::CREDIT_CARD, + first_name: 'first_name4', + last_name: 'last_name2', + full_number: '5424000000000015' + ) +) ``` diff --git a/doc/models/create-payment-profile.md b/doc/models/create-payment-profile.md index fae22031..a10d078d 100644 --- a/doc/models/create-payment-profile.md +++ b/doc/models/create-payment-profile.md @@ -19,12 +19,12 @@ | `card_type` | [`CardType`](../../doc/models/card-type.md) | Optional | The type of card used. | | `expiration_month` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `expiration_year` | Integer \| String \| nil | Optional | This is a container for one-of cases. | -| `billing_address` | `String` | Optional | The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. | -| `billing_address_2` | `String` | Optional | Second line of the customer’s billing address i.e. Apt. 100 | -| `billing_city` | `String` | Optional | The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. | -| `billing_state` | `String` | Optional | The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | -| `billing_country` | `String` | Optional | The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | -| `billing_zip` | `String` | Optional | The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. | +| `billing_address` | `String` | Optional | The credit card or bank account billing street address (e.g., 123 Main St.). This value is merely passed through to the payment gateway. | +| `billing_address_2` | `String` | Optional | Second line of the customer’s billing address e.g., Apt. 100 | +| `billing_city` | `String` | Optional | The credit card or bank account billing address city (e.g., “Boston”). This value is merely passed through to the payment gateway. | +| `billing_state` | `String` | Optional | The credit card or bank account billing address state (e.g., MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | +| `billing_country` | `String` | Optional | “The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time.” | +| `billing_zip` | `String` | Optional | The credit card or bank account billing address zip code (e.g., 12345). This value is merely passed through to the payment gateway. | | `current_vault` | [`AllVaults`](../../doc/models/all-vaults.md) | Optional | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | | `vault_token` | `String` | Optional | The “token” provided by your vault storage for an already stored payment profile | | `customer_vault_token` | `String` | Optional | (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token | @@ -34,24 +34,24 @@ | `gateway_handle` | `String` | Optional | This attribute is only available if MultiGateway feature is enabled for your Site. This feature is in the Private Beta currently. gateway_handle is used to directly select a gateway where a payment profile will be stored in. Every connected gateway must have a unique gateway handle specified. Read [Multigateway description](https://chargify.zendesk.com/hc/en-us/articles/4407761759643#connecting-with-multiple-gateways) to learn more about new concepts that MultiGateway introduces and the default behavior when this attribute is not passed. | | `cvv` | `String` | Optional | The 3- or 4-digit Card Verification Value. This value is merely passed through to the payment gateway. | | `bank_name` | `String` | Optional | (Required when creating with ACH or GoCardless, optional with Stripe Direct Debit). The name of the bank where the customerʼs account resides | -| `bank_iban` | `String` | Optional | (Optional when creating with GoCardless, required with Stripe Direct Debit). International Bank Account Number. Alternatively, local bank details can be provided | -| `bank_routing_number` | `String` | Optional | (Required when creating with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API | +| `bank_iban` | `String` | Optional | (Optional when creating with GoCardless, required with Stripe Direct Debit). International Bank Account Number. Alternatively, local bank details can be provided. | +| `bank_routing_number` | `String` | Optional | (Required when creating with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API. | | `bank_account_number` | `String` | Optional | (Required when creating with ACH, GoCardless, Stripe BECS or BACS Direct Debit, and bank_iban is blank) The customerʼs bank account number | -| `bank_branch_code` | `String` | Optional | (Optional when creating with GoCardless, required with Stripe BECS or BACS Direct Debit) Branch/Sort code. Alternatively, an IBAN can be provided | +| `bank_branch_code` | `String` | Optional | (Optional when creating with GoCardless, required with Stripe BECS or BACS Direct Debit) Branch/Sort code. Alternatively, an IBAN can be provided. | | `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 | | `last_four` | `String` | Optional | (Optional) Used for creating subscription with payment profile imported using vault_token, for proper display in Advanced Billing UI | -## Example (as JSON) - -```json -{ - "chargify_token": "tok_9g6hw85pnpt6knmskpwp4ttt", - "full_number": "5424000000000015", - "id": 76, - "payment_type": "credit_card", - "first_name": "first_name8", - "last_name": "last_name6" -} +## Example + +```ruby +create_payment_profile = CreatePaymentProfile.new( + chargify_token: 'tok_9g6hw85pnpt6knmskpwp4ttt', + id: 32, + payment_type: PaymentType::CREDIT_CARD, + first_name: 'first_name4', + last_name: 'last_name2', + full_number: '5424000000000015' +) ``` diff --git a/doc/models/create-payment.md b/doc/models/create-payment.md index cac6b91d..6a485f00 100644 --- a/doc/models/create-payment.md +++ b/doc/models/create-payment.md @@ -14,14 +14,14 @@ | `payment_details` | `String` | Required | - | | `payment_method` | [`InvoicePaymentMethodType`](../../doc/models/invoice-payment-method-type.md) | Required | The type of payment method used. Defaults to other. | -## Example (as JSON) - -```json -{ - "amount": "amount6", - "memo": "memo8", - "payment_details": "payment_details4", - "payment_method": "cash" -} +## Example + +```ruby +create_payment = CreatePayment.new( + amount: 'amount0', + memo: 'memo2', + payment_details: 'payment_details8', + payment_method: InvoicePaymentMethodType::ACH +) ``` diff --git a/doc/models/create-prepaid-component.md b/doc/models/create-prepaid-component.md index 402f80e0..83610114 100644 --- a/doc/models/create-prepaid-component.md +++ b/doc/models/create-prepaid-component.md @@ -11,36 +11,36 @@ | --- | --- | --- | --- | | `prepaid_usage_component` | [`PrepaidUsageComponent`](../../doc/models/prepaid-usage-component.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepaid_usage_component": { - "name": "name2", - "unit_name": "unit_name4", - "description": "description2", - "handle": "handle8", - "taxable": false, - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "upgrade_charge": "full", - "overage_pricing": { - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +## Example + +```ruby +create_prepaid_component = CreatePrepaidComponent.new( + prepaid_usage_component: PrepaidUsageComponent.new( + name: 'name2', + unit_name: 'unit_name4', + pricing_scheme: PricingScheme::PER_UNIT, + overage_pricing: OveragePricing.new( + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ] - } - } -} + ), + description: 'description2', + handle: 'handle8', + taxable: false, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + upgrade_charge: CreditType::FULL + ) +) ``` diff --git a/doc/models/create-prepaid-usage-component-price-point.md b/doc/models/create-prepaid-usage-component-price-point.md index 62d1e9da..4086f6a7 100644 --- a/doc/models/create-prepaid-usage-component-price-point.md +++ b/doc/models/create-prepaid-usage-component-price-point.md @@ -15,39 +15,39 @@ | `prices` | [`Array[Price]`](../../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` | -| `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 | -| `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | (only for prepaid usage components where rollover_prepaid_remainder is true) A string representing the expiration interval unit for this component, either month or day | - -## Example (as JSON) - -```json -{ - "name": "name0", - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +| `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. | +| `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | (only for prepaid usage components where rollover_prepaid_remainder is true) A string representing the expiration interval unit for this component, either month or day. | + +## Example + +```ruby +create_prepaid_usage_component_price_point = CreatePrepaidUsageComponentPricePoint.new( + name: 'name6', + pricing_scheme: PricingScheme::PER_UNIT, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "overage_pricing": { - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } + overage_pricing: OveragePricing.new( + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ] - }, - "use_site_exchange_rate": true, - "handle": "handle6", - "rollover_prepaid_remainder": false, - "renew_prepaid_allocation": false, - "expiration_interval": 101.18 -} + ), + handle: 'handle2', + use_site_exchange_rate: true, + rollover_prepaid_remainder: false, + renew_prepaid_allocation: false, + expiration_interval: 117.54 +) ``` diff --git a/doc/models/create-prepayment-method.md b/doc/models/create-prepayment-method.md index 2b0a9c05..c48c1f0d 100644 --- a/doc/models/create-prepayment-method.md +++ b/doc/models/create-prepayment-method.md @@ -1,7 +1,7 @@ # Create Prepayment Method -:- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. +When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. ## Enumeration @@ -20,3 +20,9 @@ | `CREDIT_CARD_ON_FILE` | | `OTHER` | +## Example + +```ruby +create_prepayment_method = CreatePrepaymentMethod::PAYPAL_ACCOUNT +``` + diff --git a/doc/models/create-prepayment-request.md b/doc/models/create-prepayment-request.md index 661cec6b..c748b64b 100644 --- a/doc/models/create-prepayment-request.md +++ b/doc/models/create-prepayment-request.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `prepayment` | [`CreatePrepayment`](../../doc/models/create-prepayment.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepayment": { - "amount": 11.6, - "details": "details8", - "memo": "memo2", - "method": "money_order", - "payment_profile_id": 240 - } -} +## Example + +```ruby +create_prepayment_request = CreatePrepaymentRequest.new( + prepayment: CreatePrepayment.new( + amount: 11.6, + details: 'details8', + memo: 'memo2', + method: CreatePrepaymentMethod::MONEY_ORDER, + payment_profile_id: 240 + ) +) ``` diff --git a/doc/models/create-prepayment-response.md b/doc/models/create-prepayment-response.md index 7945637d..828409d3 100644 --- a/doc/models/create-prepayment-response.md +++ b/doc/models/create-prepayment-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `prepayment` | [`CreatedPrepayment`](../../doc/models/created-prepayment.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepayment": { - "id": 38, - "subscription_id": 148, - "amount_in_cents": 124, - "memo": "memo2", - "created_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ruby +create_prepayment_response = CreatePrepaymentResponse.new( + prepayment: CreatedPrepayment.new( + id: 38, + subscription_id: 148, + amount_in_cents: 124, + memo: 'memo2', + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/create-prepayment.md b/doc/models/create-prepayment.md index dd9685d7..7bea5411 100644 --- a/doc/models/create-prepayment.md +++ b/doc/models/create-prepayment.md @@ -12,18 +12,18 @@ | `amount` | `Float` | Required | - | | `details` | `String` | Required | - | | `memo` | `String` | Required | - | -| `method` | [`CreatePrepaymentMethod`](../../doc/models/create-prepayment-method.md) | Required | :- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. | +| `method` | [`CreatePrepaymentMethod`](../../doc/models/create-prepayment-method.md) | Required | When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. | | `payment_profile_id` | `Integer` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "amount": 23.92, - "details": "details6", - "memo": "memo0", - "method": "credit_card_on_file", - "payment_profile_id": 240 -} +```ruby +create_prepayment = CreatePrepayment.new( + amount: 14.84, + details: 'details2', + memo: 'memo6', + method: CreatePrepaymentMethod::MONEY_ORDER, + payment_profile_id: 204 +) ``` diff --git a/doc/models/create-product-currency-price.md b/doc/models/create-product-currency-price.md index 0eeb41cc..44ad3931 100644 --- a/doc/models/create-product-currency-price.md +++ b/doc/models/create-product-currency-price.md @@ -13,13 +13,13 @@ | `price` | `Integer` | Required | Price for the given role. | | `role` | [`CurrencyPriceRole`](../../doc/models/currency-price-role.md) | Required | Role for the price. | -## Example (as JSON) - -```json -{ - "currency": "currency0", - "price": 222, - "role": "baseline" -} +## Example + +```ruby +create_product_currency_price = CreateProductCurrencyPrice.new( + currency: 'currency6', + price: 34, + role: CurrencyPriceRole::BASELINE +) ``` diff --git a/doc/models/create-product-currency-prices-request.md b/doc/models/create-product-currency-prices-request.md index 86f5278e..da64a944 100644 --- a/doc/models/create-product-currency-prices-request.md +++ b/doc/models/create-product-currency-prices-request.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `currency_prices` | [`Array[CreateProductCurrencyPrice]`](../../doc/models/create-product-currency-price.md) | Required | - | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "currency": "currency8", - "price": 78, - "role": "initial" - } +## Example + +```ruby +create_product_currency_prices_request = CreateProductCurrencyPricesRequest.new( + currency_prices: [ + CreateProductCurrencyPrice.new( + currency: 'currency8', + price: 78, + role: CurrencyPriceRole::INITIAL + ) ] -} +) ``` diff --git a/doc/models/create-product-family-request.md b/doc/models/create-product-family-request.md index 60d87a27..603eb81d 100644 --- a/doc/models/create-product-family-request.md +++ b/doc/models/create-product-family-request.md @@ -11,15 +11,16 @@ | --- | --- | --- | --- | | `product_family` | [`CreateProductFamily`](../../doc/models/create-product-family.md) | Required | - | -## Example (as JSON) - -```json -{ - "product_family": { - "name": "name0", - "handle": "handle6", - "description": "description0" - } -} +## Example + +```ruby +create_product_family_request = CreateProductFamilyRequest.new( + product_family: CreateProductFamily.new( + name: 'name0', + handle: 'handle6', + description: 'description0', + surcharging: false + ) +) ``` diff --git a/doc/models/create-product-family.md b/doc/models/create-product-family.md index eb13f6dc..aab4af2b 100644 --- a/doc/models/create-product-family.md +++ b/doc/models/create-product-family.md @@ -12,14 +12,16 @@ | `name` | `String` | Required | - | | `handle` | `String` | Optional | - | | `description` | `String` | Optional | - | +| `surcharging` | `TrueClass \| FalseClass` | Optional | Whether surcharging applies to this product family. Defaults to `true` when omitted. Only applied on sites where surcharging is enabled. | -## Example (as JSON) +## Example -```json -{ - "name": "name6", - "handle": "handle2", - "description": "description6" -} +```ruby +create_product_family = CreateProductFamily.new( + name: 'name6', + handle: 'handle2', + description: 'description4', + surcharging: false +) ``` diff --git a/doc/models/create-product-price-point-request.md b/doc/models/create-product-price-point-request.md index d0d73471..9231c12a 100644 --- a/doc/models/create-product-price-point-request.md +++ b/doc/models/create-product-price-point-request.md @@ -11,22 +11,22 @@ | --- | --- | --- | --- | | `price_point` | [`CreateProductPricePoint`](../../doc/models/create-product-price-point.md) | Required | - | -## Example (as JSON) - -```json -{ - "price_point": { - "name": "name0", - "price_in_cents": 196, - "interval": 44, - "interval_unit": "day", - "use_site_exchange_rate": true, - "handle": "handle6", - "trial_price_in_cents": 108, - "trial_interval": 202, - "trial_interval_unit": "day", - "trial_type": "no_obligation" - } -} +## Example + +```ruby +create_product_price_point_request = CreateProductPricePointRequest.new( + price_point: CreateProductPricePoint.new( + name: 'name0', + price_in_cents: 196, + interval: 44, + interval_unit: IntervalUnit::DAY, + handle: 'handle6', + trial_price_in_cents: 108, + trial_interval: 202, + trial_interval_unit: IntervalUnit::DAY, + trial_type: TrialType::NO_OBLIGATION, + use_site_exchange_rate: true + ) +) ``` diff --git a/doc/models/create-product-price-point.md b/doc/models/create-product-price-point.md index 07bb487d..1ac33fed 100644 --- a/doc/models/create-product-price-point.md +++ b/doc/models/create-product-price-point.md @@ -12,32 +12,32 @@ | `name` | `String` | Required | The product price point name | | `handle` | `String` | Optional | The product price point API handle | | `price_in_cents` | `Integer` | Required | The product price point price, in integer cents | -| `interval` | `Integer` | Required | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days | +| `interval` | `Integer` | Required | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Required | A string representing the interval unit for this product price point, either month or day | | `trial_price_in_cents` | `Integer` | Optional | The product price point trial price, in integer cents | -| `trial_interval` | `Integer` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days. | +| `trial_interval` | `Integer` | Optional | The numerical trial interval. e.g., an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days. | | `trial_interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product price point, either month or day | -| `trial_type` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | +| `trial_type` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | | `initial_charge_in_cents` | `Integer` | Optional | The product price point initial charge, in integer cents | | `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` | `Integer` | Optional | The numerical expiration interval. e.g., 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` | -## Example (as JSON) - -```json -{ - "name": "name6", - "price_in_cents": 216, - "interval": 200, - "interval_unit": "day", - "use_site_exchange_rate": true, - "handle": "handle2", - "trial_price_in_cents": 48, - "trial_interval": 102, - "trial_interval_unit": "day", - "trial_type": "no_obligation" -} +## Example + +```ruby +create_product_price_point = CreateProductPricePoint.new( + name: 'name4', + price_in_cents: 42, + interval: 198, + interval_unit: IntervalUnit::DAY, + handle: 'handle0', + trial_price_in_cents: 210, + trial_interval: 100, + trial_interval_unit: IntervalUnit::DAY, + trial_type: TrialType::NO_OBLIGATION, + use_site_exchange_rate: true +) ``` diff --git a/doc/models/create-quantity-based-component.md b/doc/models/create-quantity-based-component.md index 6206ad07..f276ae81 100644 --- a/doc/models/create-quantity-based-component.md +++ b/doc/models/create-quantity-based-component.md @@ -11,31 +11,31 @@ | --- | --- | --- | --- | | `quantity_based_component` | [`QuantityBasedComponent`](../../doc/models/quantity-based-component.md) | Required | - | -## Example (as JSON) - -```json -{ - "quantity_based_component": { - "name": "name0", - "unit_name": "unit_name2", - "description": "description0", - "handle": "handle6", - "taxable": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +## Example + +```ruby +create_quantity_based_component = CreateQuantityBasedComponent.new( + quantity_based_component: QuantityBasedComponent.new( + name: 'name0', + unit_name: 'unit_name2', + pricing_scheme: PricingScheme::STAIRSTEP, + description: 'description0', + handle: 'handle6', + taxable: false, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "upgrade_charge": "prorated" - } -} + upgrade_charge: CreditType::PRORATED + ) +) ``` diff --git a/doc/models/create-reason-code-request.md b/doc/models/create-reason-code-request.md index fcd21fd1..49882080 100644 --- a/doc/models/create-reason-code-request.md +++ b/doc/models/create-reason-code-request.md @@ -11,15 +11,15 @@ | --- | --- | --- | --- | | `reason_code` | [`CreateReasonCode`](../../doc/models/create-reason-code.md) | Required | - | -## Example (as JSON) - -```json -{ - "reason_code": { - "code": "code4", - "description": "description6", - "position": 14 - } -} +## Example + +```ruby +create_reason_code_request = CreateReasonCodeRequest.new( + reason_code: CreateReasonCode.new( + code: 'code4', + description: 'description6', + position: 14 + ) +) ``` diff --git a/doc/models/create-reason-code.md b/doc/models/create-reason-code.md index 9ab63c1f..427c822c 100644 --- a/doc/models/create-reason-code.md +++ b/doc/models/create-reason-code.md @@ -13,13 +13,13 @@ | `description` | `String` | Required | The friendly summary of what the code signifies | | `position` | `Integer` | Optional | The order that code appears in lists | -## Example (as JSON) - -```json -{ - "code": "code4", - "description": "description6", - "position": 86 -} +## Example + +```ruby +create_reason_code = CreateReasonCode.new( + code: 'code6', + description: 'description8', + position: 252 +) ``` diff --git a/doc/models/create-segment-request.md b/doc/models/create-segment-request.md index d41bef0e..53809913 100644 --- a/doc/models/create-segment-request.md +++ b/doc/models/create-segment-request.md @@ -11,34 +11,34 @@ | --- | --- | --- | --- | | `segment` | [`CreateSegment`](../../doc/models/create-segment.md) | Required | - | -## Example (as JSON) - -```json -{ - "segment": { - "segment_property_1_value": "String1", - "segment_property_2_value": "String3", - "segment_property_3_value": "String1", - "segment_property_4_value": "String5", - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } +## Example + +```ruby +create_segment_request = CreateSegmentRequest.new( + segment: CreateSegment.new( + pricing_scheme: PricingScheme::STAIRSTEP, + segment_property_1_value: 'String1', + segment_property_2_value: 'String3', + segment_property_3_value: 'String1', + segment_property_4_value: 'String5', + prices: [ + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ) ] - } -} + ) +) ``` diff --git a/doc/models/create-segment.md b/doc/models/create-segment.md index 2828f6c8..7b255a58 100644 --- a/doc/models/create-segment.md +++ b/doc/models/create-segment.md @@ -16,32 +16,32 @@ | `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[CreateOrUpdateSegmentPrice]`](../../doc/models/create-or-update-segment-price.md) | Optional | - | -## Example (as JSON) - -```json -{ - "segment_property_1_value": "String9", - "segment_property_2_value": "String1", - "segment_property_3_value": "String3", - "segment_property_4_value": "String3", - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } +## Example + +```ruby +create_segment = CreateSegment.new( + pricing_scheme: PricingScheme::STAIRSTEP, + segment_property_1_value: 'String3', + segment_property_2_value: 'String5', + segment_property_3_value: 'String3', + segment_property_4_value: 'String7', + prices: [ + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ) ] -} +) ``` diff --git a/doc/models/create-signup-proforma-preview-include.md b/doc/models/create-signup-proforma-preview-include.md index e652ba44..d6dffa03 100644 --- a/doc/models/create-signup-proforma-preview-include.md +++ b/doc/models/create-signup-proforma-preview-include.md @@ -13,7 +13,7 @@ ## Example -``` -next_proforma_invoice +```ruby +create_signup_proforma_preview_include = CreateSignupProformaPreviewInclude::NEXT_PROFORMA_INVOICE ``` diff --git a/doc/models/create-subscription-component.md b/doc/models/create-subscription-component.md index 619279f0..edf47606 100644 --- a/doc/models/create-subscription-component.md +++ b/doc/models/create-subscription-component.md @@ -11,21 +11,21 @@ | --- | --- | --- | --- | | `component_id` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `enabled` | `TrueClass \| FalseClass` | Optional | Used for on/off components only. | -| `unit_balance` | `Integer` | Optional | Used for metered and events based components. | +| `unit_balance` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `allocated_quantity` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `quantity` | `Integer` | Optional | Deprecated. Use `allocated_quantity` instead. | | `price_point_id` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `custom_price` | [`ComponentCustomPrice`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | -## Example (as JSON) +## Example -```json -{ - "component_id": 8, - "enabled": false, - "unit_balance": 144, - "allocated_quantity": 102, - "quantity": 188 -} +```ruby +create_subscription_component = CreateSubscriptionComponent.new( + component_id: 66, + enabled: false, + unit_balance: 124, + allocated_quantity: 160, + quantity: 246 +) ``` diff --git a/doc/models/create-subscription-group-request.md b/doc/models/create-subscription-group-request.md index b6812984..27bafc0f 100644 --- a/doc/models/create-subscription-group-request.md +++ b/doc/models/create-subscription-group-request.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `subscription_group` | [`CreateSubscriptionGroup`](../../doc/models/create-subscription-group.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "subscription_group": { - "subscription_id": 36, - "member_ids": [ +```ruby +create_subscription_group_request = CreateSubscriptionGroupRequest.new( + subscription_group: CreateSubscriptionGroup.new( + subscription_id: 36, + member_ids: [ 164, 165 ] - } -} + ) +) ``` diff --git a/doc/models/create-subscription-group.md b/doc/models/create-subscription-group.md index c23657d0..ee6e0c3c 100644 --- a/doc/models/create-subscription-group.md +++ b/doc/models/create-subscription-group.md @@ -12,14 +12,14 @@ | `subscription_id` | `Integer` | Required | - | | `member_ids` | `Array[Integer]` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "subscription_id": 38, - "member_ids": [ - 162 +```ruby +create_subscription_group = CreateSubscriptionGroup.new( + subscription_id: 130, + member_ids: [ + 230 ] -} +) ``` diff --git a/doc/models/create-subscription-request.md b/doc/models/create-subscription-request.md index 3c5137ba..9150367e 100644 --- a/doc/models/create-subscription-request.md +++ b/doc/models/create-subscription-request.md @@ -11,33 +11,33 @@ | --- | --- | --- | --- | | `subscription` | [`CreateSubscription`](../../doc/models/create-subscription.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscription": { - "defer_signup": false, - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" +## Example + +```ruby +create_subscription_request = CreateSubscriptionRequest.new( + subscription: CreateSubscription.new( + product_handle: 'product_handle6', + product_id: 206, + product_price_point_handle: 'product_price_point_handle2', + product_price_point_id: 130, + custom_price: SubscriptionCustomPrice.new( + price_in_cents: 'String3', + interval: 'String3', + interval_unit: IntervalUnit::DAY, + name: 'name4', + handle: 'handle0', + trial_price_in_cents: 'String3', + trial_interval: 'String5', + trial_interval_unit: IntervalUnit::DAY + ), + defer_signup: false, + metafields: { + 'custom_field_name_1': 'custom_field_value_1', + 'custom_field_name_2': 'custom_field_value_2' }, - "dunning_communication_delay_enabled": false, - "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", - "product_handle": "product_handle6", - "product_id": 206, - "product_price_point_handle": "product_price_point_handle2", - "product_price_point_id": 130, - "custom_price": { - "name": "name4", - "handle": "handle0", - "price_in_cents": "String3", - "interval": "String3", - "interval_unit": "day", - "trial_price_in_cents": "String3", - "trial_interval": "String5", - "trial_interval_unit": "day" - } - } -} + dunning_communication_delay_enabled: false, + dunning_communication_delay_time_zone: '"Eastern Time (US & Canada)"' + ) +) ``` diff --git a/doc/models/create-subscription.md b/doc/models/create-subscription.md index 125d47e5..e502eebf 100644 --- a/doc/models/create-subscription.md +++ b/doc/models/create-subscription.md @@ -20,19 +20,20 @@ | `receives_invoice_emails` | `String` | Optional | (Optional) Default: True - Whether or not this subscription is set to receive emails related to this subscription. | | `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. | +| `branding_theme_id` | `Integer` | Optional | The ID of the Branding Theme to assign to this subscription. When set, this subscription-level Branding Theme is used instead of the customer's default Branding Theme for subscription-related documents and communications that use subscription theming. Pass null or an empty value to clear the subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. Not returned in the response. | | `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. 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` | +| `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) | +| `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 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. | | `bank_account_attributes` | [`BankAccountAttributes`](../../doc/models/bank-account-attributes.md) | Optional | - | | `components` | [`Array[CreateSubscriptionComponent]`](../../doc/models/create-subscription-component.md) | Optional | (Optional) An array of component ids and quantities to be added to the subscription. See [Components](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview) for more information. | -| `calendar_billing` | [`CalendarBilling`](../../doc/models/calendar-billing.md) | Optional | (Optional). Cannot be used when also specifying next_billing_at | +| `calendar_billing` | [`CalendarBilling`](../../doc/models/calendar-billing.md) | Optional | (Optional). Cannot be used when also specifying next_billing_at. | | `metafields` | `Hash[String, String]` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | | `customer_reference` | `String` | Optional | The reference value (provided by your app) of an existing customer within Chargify. Required, unless a `customer_id` or a set of `customer_attributes` is given. | | `group` | [`GroupSettings`](../../doc/models/group-settings.md) | Optional | - | @@ -60,31 +61,31 @@ | `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. Defaults to `false` when not provided. | -## Example (as JSON) +## Example -```json -{ - "defer_signup": false, - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" +```ruby +create_subscription = CreateSubscription.new( + product_handle: 'product_handle0', + product_id: 60, + product_price_point_handle: 'product_price_point_handle6', + product_price_point_id: 240, + custom_price: SubscriptionCustomPrice.new( + price_in_cents: 'String3', + interval: 'String3', + interval_unit: IntervalUnit::DAY, + name: 'name4', + handle: 'handle0', + trial_price_in_cents: 'String3', + trial_interval: 'String5', + trial_interval_unit: IntervalUnit::DAY + ), + defer_signup: false, + metafields: { + 'custom_field_name_1': 'custom_field_value_1', + 'custom_field_name_2': 'custom_field_value_2' }, - "dunning_communication_delay_enabled": false, - "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", - "product_handle": "product_handle6", - "product_id": 212, - "product_price_point_handle": "product_price_point_handle0", - "product_price_point_id": 136, - "custom_price": { - "name": "name4", - "handle": "handle0", - "price_in_cents": "String3", - "interval": "String3", - "interval_unit": "day", - "trial_price_in_cents": "String3", - "trial_interval": "String5", - "trial_interval_unit": "day" - } -} + dunning_communication_delay_enabled: false, + dunning_communication_delay_time_zone: '"Eastern Time (US & Canada)"' +) ``` diff --git a/doc/models/create-usage-request.md b/doc/models/create-usage-request.md index 1a754cbc..b06321fb 100644 --- a/doc/models/create-usage-request.md +++ b/doc/models/create-usage-request.md @@ -11,37 +11,37 @@ | --- | --- | --- | --- | | `usage` | [`CreateUsage`](../../doc/models/create-usage.md) | Required | - | -## Example (as JSON) - -```json -{ - "usage": { - "quantity": 162.34, - "price_point_id": "price_point_id0", - "memo": "memo2", - "billing_schedule": { - "initial_billing_at": "2016-03-13" - }, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 66, - "interval_unit": "day", - "list_price_point_id": 174, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } - } -} +## Example + +```ruby +create_usage_request = CreateUsageRequest.new( + usage: CreateUsage.new( + quantity: 162.34, + price_point_id: 'price_point_id0', + memo: 'memo2', + billing_schedule: BillingSchedule.new( + initial_billing_at: Date.iso8601('2016-03-13') + ), + custom_price: ComponentCustomPrice.new( + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false, + pricing_scheme: PricingScheme::STAIRSTEP, + interval: 66, + interval_unit: IntervalUnit::DAY, + list_price_point_id: 174 + ) + ) +) ``` diff --git a/doc/models/create-usage.md b/doc/models/create-usage.md index 6dad891d..a6d447fe 100644 --- a/doc/models/create-usage.md +++ b/doc/models/create-usage.md @@ -15,35 +15,35 @@ | `billing_schedule` | [`BillingSchedule`](../../doc/models/billing-schedule.md) | Optional | Billing schedule settings for component allocations or usages on multi-frequency subscriptions. Use this to start a component's billing period on a custom date instead of aligning with the product charge schedule. | | `custom_price` | [`ComponentCustomPrice`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | -## Example (as JSON) - -```json -{ - "quantity": 23.44, - "price_point_id": "price_point_id0", - "memo": "memo2", - "billing_schedule": { - "initial_billing_at": "2016-03-13" - }, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 66, - "interval_unit": "day", - "list_price_point_id": 174, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } -} +## Example + +```ruby +create_usage = CreateUsage.new( + quantity: 244.02, + price_point_id: 'price_point_id8', + memo: 'memo0', + billing_schedule: BillingSchedule.new( + initial_billing_at: Date.iso8601('2016-03-13') + ), + custom_price: ComponentCustomPrice.new( + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false, + pricing_scheme: PricingScheme::STAIRSTEP, + interval: 66, + interval_unit: IntervalUnit::DAY, + list_price_point_id: 174 + ) +) ``` diff --git a/doc/models/created-prepayment.md b/doc/models/created-prepayment.md index fc798e39..9ed57e92 100644 --- a/doc/models/created-prepayment.md +++ b/doc/models/created-prepayment.md @@ -17,15 +17,15 @@ | `starting_balance_in_cents` | `Integer` | Optional | **Constraints**: `>= 0` | | `ending_balance_in_cents` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 110, - "subscription_id": 220, - "amount_in_cents": 196, - "memo": "memo6", - "created_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +created_prepayment = CreatedPrepayment.new( + id: 228, + subscription_id: 82, + amount_in_cents: 198, + memo: 'memo6', + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/credit-account-balance-changed.md b/doc/models/credit-account-balance-changed.md index d9bfd09e..9a1312ce 100644 --- a/doc/models/credit-account-balance-changed.md +++ b/doc/models/credit-account-balance-changed.md @@ -15,15 +15,15 @@ | `currency_code` | `String` | Required | - | | `at_time` | `DateTime` | Required | - | -## Example (as JSON) - -```json -{ - "reason": "reason8", - "service_credit_account_balance_in_cents": 10, - "service_credit_balance_change_in_cents": 116, - "currency_code": "currency_code8", - "at_time": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +credit_account_balance_changed = CreditAccountBalanceChanged.new( + reason: 'reason8', + service_credit_account_balance_in_cents: 64, + service_credit_balance_change_in_cents: 190, + currency_code: 'currency_code8', + at_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/credit-card-attributes.md b/doc/models/credit-card-attributes.md index 93322fbb..bb363113 100644 --- a/doc/models/credit-card-attributes.md +++ b/doc/models/credit-card-attributes.md @@ -13,13 +13,13 @@ | `expiration_month` | `String` | Optional | - | | `expiration_year` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "full_number": "full_number0", - "expiration_month": "expiration_month6", - "expiration_year": "expiration_year0" -} +## Example + +```ruby +credit_card_attributes = CreditCardAttributes.new( + full_number: 'full_number2', + expiration_month: 'expiration_month6', + expiration_year: 'expiration_year2' +) ``` diff --git a/doc/models/credit-card-payment-profile.md b/doc/models/credit-card-payment-profile.md index 893b2e2f..80aef025 100644 --- a/doc/models/credit-card-payment-profile.md +++ b/doc/models/credit-card-payment-profile.md @@ -12,10 +12,10 @@ | `id` | `Integer` | Optional | The Chargify-assigned ID of the stored card. This value can be used as an input to payment_profile_id when creating a subscription, in order to re-use a stored payment profile for the same customer. | | `first_name` | `String` | Optional | The first name of the card holder. | | `last_name` | `String` | Optional | The last name of the card holder. | -| `masked_card_number` | `String` | Optional | A string representation of the credit card number with all but the last 4 digits masked with X’s (i.e. ‘XXXX-XXXX-XXXX-1234’). | +| `masked_card_number` | `String` | Optional | A string representation of the credit card number with all but the last 4 digits masked with X’s (e.g., ‘XXXX-XXXX-XXXX-1234’). | | `card_type` | [`CardType`](../../doc/models/card-type.md) | Optional | The type of card used. | | `expiration_month` | `Integer` | Optional | An integer representing the expiration month of the card(1 – 12). | -| `expiration_year` | `Integer` | Optional | An integer representing the 4-digit expiration year of the card(i.e. ‘2012’). | +| `expiration_year` | `Integer` | Optional | An integer representing the 4-digit expiration year of the card(e.g., ‘2012’). | | `customer_id` | `Integer` | Optional | The Chargify-assigned id for the customer record to which the card belongs. | | `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. | | `vault_token` | `String` | Optional | The “token” provided by your vault storage for an already stored payment profile. | @@ -28,36 +28,36 @@ | `billing_address_2` | `String` | Optional | The current billing street address, second line, for the card. | | `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Required | **Default**: `PaymentType::CREDIT_CARD` | | `disabled` | `TrueClass \| FalseClass` | Optional | - | -| `chargify_token` | `String` | Optional | Token received after sending billing information using Maxio.js (formerly Chargify.js). This token will only be received if passed as a sole attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) | +| `chargify_token` | `String` | Optional | Token received after sending billing information using Maxio.js (formerly Chargify.js). This token will only be received if passed as a sole attribute of credit_card_attributes (e.g., 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) - -```json -{ - "id": 10088716, - "first_name": "Test", - "last_name": "Subscription", - "masked_card_number": "XXXX-XXXX-XXXX-1", - "card_type": "bogus", - "expiration_month": 1, - "expiration_year": 2022, - "customer_id": 14543792, - "current_vault": "bogus", - "vault_token": "1", - "billing_address": "123 Montana Way", - "billing_city": "Billings", - "billing_state": "MT", - "billing_zip": "59101", - "billing_country": "US", - "customer_vault_token": null, - "billing_address_2": "", - "payment_type": "credit_card", - "site_gateway_setting_id": 1, - "gateway_handle": null -} +## Example + +```ruby +credit_card_payment_profile = CreditCardPaymentProfile.new( + payment_type: PaymentType::CREDIT_CARD, + id: 10088716, + first_name: 'Test', + last_name: 'Subscription', + masked_card_number: 'XXXX-XXXX-XXXX-1', + card_type: CardType::BOGUS, + expiration_month: 1, + expiration_year: 2022, + customer_id: 14543792, + current_vault: CreditCardVault::BOGUS, + vault_token: '1', + billing_address: '123 Montana Way', + billing_city: 'Billings', + billing_state: 'MT', + billing_zip: '59101', + billing_country: 'US', + customer_vault_token: 'customer_vault_token2', + billing_address_2: '', + site_gateway_setting_id: 1, + gateway_handle: 'gateway_handle8' +) ``` diff --git a/doc/models/credit-card-vault.md b/doc/models/credit-card-vault.md index 64f7914a..556a2e7b 100644 --- a/doc/models/credit-card-vault.md +++ b/doc/models/credit-card-vault.md @@ -45,3 +45,9 @@ The vault that stores the payment profile with the provided `vault_token`. Use ` | `UNIPAAS` | | `WIRECARD` | +## Example + +```ruby +credit_card_vault = CreditCardVault::BRAINTREE1 +``` + diff --git a/doc/models/credit-note-application.md b/doc/models/credit-note-application.md index af17966a..308e4897 100644 --- a/doc/models/credit-note-application.md +++ b/doc/models/credit-note-application.md @@ -15,15 +15,15 @@ | `memo` | `String` | Optional | - | | `applied_amount` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid0", - "transaction_time": "2016-03-13T12:52:32.123Z", - "invoice_uid": "invoice_uid0", - "memo": "memo4", - "applied_amount": "applied_amount8" -} +## Example + +```ruby +credit_note_application = CreditNoteApplication.new( + uid: 'uid0', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice_uid: 'invoice_uid0', + memo: 'memo4', + applied_amount: 'applied_amount2' +) ``` diff --git a/doc/models/credit-note-line-item.md b/doc/models/credit-note-line-item.md index 2ebeb0b8..98006d8a 100644 --- a/doc/models/credit-note-line-item.md +++ b/doc/models/credit-note-line-item.md @@ -13,7 +13,7 @@ | `title` | `String` | Optional | A short descriptor for the credit given by this line. | | `description` | `String` | Optional | Detailed description for the credit given by this line. May include proration details in plain text.

Note: this string may contain line breaks that are hints for the best display format on the credit note. | | `quantity` | `String` | Optional | The quantity or count of units credited by the line item.

This is a decimal number represented as a string. (See "About Decimal Numbers".) | -| `unit_price` | `String` | Optional | The price per unit for the line item.

When tiered pricing was used (i.e. not every unit was actually priced at the same price) this will be the blended average cost per unit and the `tiered_unit_price` field will be set to `true`. | +| `unit_price` | `String` | Optional | The price per unit for the line item.

When tiered pricing was used (i.e., not every unit was actually priced at the same price) this will be the blended average cost per unit and the `tiered_unit_price` field will be set to `true`. | | `subtotal_amount` | `String` | Optional | The line subtotal, generally calculated as `quantity * unit_price`. This is the canonical amount of record for the line - when rounding differences are in play, `subtotal_amount` takes precedence over the value derived from `quantity * unit_price` (which may not have the proper precision to exactly equal this amount). | | `discount_amount` | `String` | Optional | The approximate discount of just this line.

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total discount among many lines. Several lines may have been summed prior to applying the discount to arrive at `discount_amount` for the invoice - backing that out to the discount on a single line may introduce rounding or precision errors. | | `tax_amount` | `String` | Optional | The approximate tax of just this line.

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total tax among many lines. Several lines may have been summed prior to applying the tax rate to arrive at `tax_amount` for the invoice - backing that out to the tax on a single line may introduce rounding or precision errors. | @@ -30,15 +30,15 @@ | `custom_item` | `TrueClass \| FalseClass` | Optional | - | | `prepaid_allocation_expires_at` | `Date` | Optional | The date a prepaid allocation is set to expire. Only present on line items representing prepaid component allocations. The format is `"YYYY-MM-DD"`. | -## Example (as JSON) +## Example -```json -{ - "uid": "uid4", - "title": "title0", - "description": "description6", - "quantity": "quantity0", - "unit_price": "unit_price2" -} +```ruby +credit_note_line_item = CreditNoteLineItem.new( + uid: 'uid2', + title: 'title8', + description: 'description2', + quantity: 'quantity8', + unit_price: 'unit_price0' +) ``` diff --git a/doc/models/credit-note-status.md b/doc/models/credit-note-status.md index 1b4271a3..cf3d0d2a 100644 --- a/doc/models/credit-note-status.md +++ b/doc/models/credit-note-status.md @@ -14,3 +14,9 @@ Current status of the credit note. | `OPEN` | | `APPLIED` | +## Example + +```ruby +credit_note_status = CreditNoteStatus::OPEN +``` + diff --git a/doc/models/credit-note.md b/doc/models/credit-note.md index a9a5dc0c..3d0b430e 100644 --- a/doc/models/credit-note.md +++ b/doc/models/credit-note.md @@ -21,13 +21,13 @@ | `currency` | `String` | Optional | The ISO 4217 currency code (3 character string) representing the currency of the credit note amount fields. | | `memo` | `String` | Optional | The memo printed on credit note, which is a description of the reason for the credit. | | `seller` | [`InvoiceSeller`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the credit note. | -| `customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the credited subscription. | +| `customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient of the credited subscription. | | `billing_address` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The billing address of the credit subscription. | | `shipping_address` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The shipping address of the credited subscription. | | `subtotal_amount` | `String` | Optional | Subtotal of the credit note, which is the sum of all line items before discounts or taxes. Note that this is a positive amount representing the credit back to the customer. | -| `discount_amount` | `String` | Optional | Total discount applied to the credit note. Note that this is a positive amount representing the discount amount being credited back to the customer (i.e. a credit on an earlier discount). For example, if the original purchase was $1.00 and the original discount was $0.10, a credit of $0.50 of the original purchase (half) would have a discount credit of $0.05 (also half). | -| `tax_amount` | `String` | Optional | Total tax of the credit note. Note that this is a positive amount representing a previously taxex amount being credited back to the customer (i.e. a credit of an earlier tax). For example, if the original purchase was $1.00 and the original tax was $0.10, a credit of $0.50 of the original purchase (half) would also have a tax credit of $0.05 (also half). | -| `total_amount` | `String` | Optional | The credit note total, which is `subtotal_amount - discount_amount + tax_amount`.' | +| `discount_amount` | `String` | Optional | Total discount applied to the credit note. Note that this is a positive amount representing the discount amount being credited back to the customer (i.e., a credit on an earlier discount). For example, if the original purchase was $1.00 and the original discount was $0.10, a credit of $0.50 of the original purchase (half) would have a discount credit of $0.05 (also half). | +| `tax_amount` | `String` | Optional | Total tax of the credit note. Note that this is a positive amount representing a previously taxed amount being credited back to the customer (i.e., a credit of an earlier tax). For example, if the original purchase was $1.00 and the original tax was $0.10, a credit of $0.50 of the original purchase (half) would also have a tax credit of $0.05 (also half). | +| `total_amount` | `String` | Optional | The credit note total, which is `subtotal_amount - discount_amount + tax_amount`. | | `applied_amount` | `String` | Optional | The amount of the credit note that has already been applied to invoices. | | `remaining_amount` | `String` | Optional | The amount of the credit note remaining to be applied to invoices, which is `total_amount - applied_amount`. | | `line_items` | [`Array[CreditNoteLineItem]`](../../doc/models/credit-note-line-item.md) | Optional | Line items on the credit note. | @@ -35,17 +35,17 @@ | `taxes` | [`Array[InvoiceTax]`](../../doc/models/invoice-tax.md) | Optional | - | | `applications` | [`Array[CreditNoteApplication]`](../../doc/models/credit-note-application.md) | Optional | - | | `refunds` | [`Array[InvoiceRefund]`](../../doc/models/invoice-refund.md) | Optional | - | -| `origin_invoices` | [`Array[OriginInvoice]`](../../doc/models/origin-invoice.md) | Optional | An array of origin invoices for the credit note. Learn more about [Origin Invoice from our docs](https://maxio.zendesk.com/hc/en-us/articles/24252261284749-Credit-Notes-Proration#origin-invoices) | - -## Example (as JSON) - -```json -{ - "uid": "uid2", - "site_id": 218, - "customer_id": 74, - "subscription_id": 146, - "number": "number0" -} +| `origin_invoices` | [`Array[OriginInvoice]`](../../doc/models/origin-invoice.md) | Optional | An array of origin invoices for the credit note. Learn more about [Origin Invoice from our docs](https://maxio.zendesk.com/hc/en-us/articles/24252261284749-Credit-Notes-Proration#origin-invoices). | + +## Example + +```ruby +credit_note = CreditNote.new( + uid: 'uid0', + site_id: 68, + customer_id: 180, + subscription_id: 252, + number: 'number8' +) ``` diff --git a/doc/models/credit-scheme-request.md b/doc/models/credit-scheme-request.md index 168c9348..7417adff 100644 --- a/doc/models/credit-scheme-request.md +++ b/doc/models/credit-scheme-request.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `credit_scheme` | [`CreditScheme`](../../doc/models/credit-scheme.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "credit_scheme": "credit" -} +```ruby +credit_scheme_request = CreditSchemeRequest.new( + credit_scheme: CreditScheme::REFUND +) ``` diff --git a/doc/models/credit-scheme.md b/doc/models/credit-scheme.md index fdf3956d..ca717e35 100644 --- a/doc/models/credit-scheme.md +++ b/doc/models/credit-scheme.md @@ -13,3 +13,9 @@ | `CREDIT` | | `REFUND` | +## Example + +```ruby +credit_scheme = CreditScheme::NONE +``` + diff --git a/doc/models/credit-type.md b/doc/models/credit-type.md index f7d2a090..b57693ce 100644 --- a/doc/models/credit-type.md +++ b/doc/models/credit-type.md @@ -15,3 +15,9 @@ The type of credit to be created when upgrading/downgrading. Defaults to the com | `PRORATED` | | `NONE` | +## Example + +```ruby +credit_type = CreditType::NONE +``` + diff --git a/doc/models/currency-overage-prices.md b/doc/models/currency-overage-prices.md index 695688bd..6f2dfdf3 100644 --- a/doc/models/currency-overage-prices.md +++ b/doc/models/currency-overage-prices.md @@ -13,7 +13,7 @@ Extends a component price point with currency overage prices. | --- | --- | --- | --- | | `id` | `Integer` | Optional | - | | `type` | [`PricePointType`](../../doc/models/price-point-type.md) | Optional | Price point type. We expose the following types:

1. **default**: a price point that is marked as a default price for a certain product.
2. **custom**: a custom price point.
3. **catalog**: a price point that is **not** marked as a default price for a certain product and is **not** a custom one. | -| `default` | `TrueClass \| FalseClass` | Optional | Note: Refer to type attribute instead | +| `default` | `TrueClass \| FalseClass` | Optional | Note: Refer to type attribute instead. | | `name` | `String` | Optional | - | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `component_id` | `Integer` | Optional | - | @@ -25,7 +25,7 @@ Extends a component price point with currency overage prices. | `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. Defaults to true during creation. | | `subscription_id` | `Integer` | Optional | (only used for Custom Pricing - ie. when the price point's type is `custom`) The id of the subscription that the custom price point is for. | | `tax_included` | `TrueClass \| FalseClass` | Optional | - | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component 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 component price point, either month or day. This property is only available for sites with Multifrequency enabled. | | `currency_prices` | [`Array[ComponentCurrencyPrice]`](../../doc/models/component-currency-price.md) | Optional | An array of currency pricing data is available when multiple currencies are defined for the site. It varies based on the use_site_exchange_rate setting for the price point. This parameter is present only in the response of read endpoints, after including the appropriate query parameter. The clone endpoint always returns currency prices if they are present. | | `overage_prices` | [`Array[ComponentPrice]`](../../doc/models/component-price.md) | Optional | Applicable only to prepaid usage components. An array of overage price brackets. | @@ -36,15 +36,15 @@ Extends a component price point with currency overage prices. | `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | Applicable only to prepaid usage components where rollover_prepaid_remainder is true. A string representing the expiration interval unit for this component, either month or day. | | `currency_overage_prices` | [`Array[ComponentCurrencyPrice]`](../../doc/models/component-currency-price.md) | Optional | Applicable only to prepaid usage components. An array of currency pricing data for overage prices. | -## Example (as JSON) +## Example -```json -{ - "id": 50, - "type": "catalog", - "default": false, - "name": "name8", - "pricing_scheme": "stairstep" -} +```ruby +currency_overage_prices = CurrencyOveragePrices.new( + id: 26, + type: PricePointType::CATALOG, + default: false, + name: 'name8', + pricing_scheme: PricingScheme::STAIRSTEP +) ``` diff --git a/doc/models/currency-price-role.md b/doc/models/currency-price-role.md index 32d78475..fa423fe0 100644 --- a/doc/models/currency-price-role.md +++ b/doc/models/currency-price-role.md @@ -15,3 +15,9 @@ Role for the price. | `TRIAL` | | `INITIAL` | +## Example + +```ruby +currency_price_role = CurrencyPriceRole::TRIAL +``` + diff --git a/doc/models/currency-price.md b/doc/models/currency-price.md index e5da3646..37f52ac0 100644 --- a/doc/models/currency-price.md +++ b/doc/models/currency-price.md @@ -18,15 +18,15 @@ | `product_price_point_id` | `Integer` | Optional | - | | `role` | [`CurrencyPriceRole`](../../doc/models/currency-price-role.md) | Optional | Role for the price. | -## Example (as JSON) - -```json -{ - "id": 88, - "currency": "currency6", - "price": 41.36, - "formatted_price": "formatted_price4", - "price_id": 178 -} +## Example + +```ruby +currency_price = CurrencyPrice.new( + id: 254, + currency: 'currency6', + price: 247.06, + formatted_price: 'formatted_price4', + price_id: 168 +) ``` diff --git a/doc/models/currency-prices-response.md b/doc/models/currency-prices-response.md index b0566a0f..90e329cf 100644 --- a/doc/models/currency-prices-response.md +++ b/doc/models/currency-prices-response.md @@ -11,19 +11,19 @@ | --- | --- | --- | --- | | `currency_prices` | [`Array[CurrencyPrice]`](../../doc/models/currency-price.md) | Required | - | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "id": 50, - "currency": "currency8", - "price": 233.74, - "formatted_price": "formatted_price6", - "price_id": 116 - } +## Example + +```ruby +currency_prices_response = CurrencyPricesResponse.new( + currency_prices: [ + CurrencyPrice.new( + id: 50, + currency: 'currency8', + price: 233.74, + formatted_price: 'formatted_price6', + price_id: 116 + ) ] -} +) ``` diff --git a/doc/models/custom-field-owner.md b/doc/models/custom-field-owner.md index 77c2f821..9f75881c 100644 --- a/doc/models/custom-field-owner.md +++ b/doc/models/custom-field-owner.md @@ -12,3 +12,9 @@ | `CUSTOMER` | | `SUBSCRIPTION` | +## Example + +```ruby +custom_field_owner = CustomFieldOwner::CUSTOMER +``` + diff --git a/doc/models/custom-field-value-change.md b/doc/models/custom-field-value-change.md index af60194d..f019d1ed 100644 --- a/doc/models/custom-field-value-change.md +++ b/doc/models/custom-field-value-change.md @@ -17,17 +17,17 @@ | `resource_type` | `String` | Required | - | | `resource_id` | `Integer` | Required | - | -## Example (as JSON) - -```json -{ - "event_type": "event_type2", - "metafield_name": "metafield_name6", - "metafield_id": 78, - "old_value": "old_value2", - "new_value": "new_value8", - "resource_type": "resource_type2", - "resource_id": 74 -} +## Example + +```ruby +custom_field_value_change = CustomFieldValueChange.new( + event_type: 'event_type0', + metafield_name: 'metafield_name4', + metafield_id: 176, + old_value: 'old_value4', + new_value: 'new_value0', + resource_type: 'resource_type4', + resource_id: 232 +) ``` diff --git a/doc/models/customer-attributes.md b/doc/models/customer-attributes.md index 3dc4a6f9..c0f47b5b 100644 --- a/doc/models/customer-attributes.md +++ b/doc/models/customer-attributes.md @@ -12,37 +12,38 @@ | `first_name` | `String` | Optional | The first name of the customer. Required when creating a customer via attributes. | | `last_name` | `String` | Optional | The last name of the customer. Required when creating a customer via attributes. | | `email` | `String` | Optional | The email address of the customer. Required when creating a customer via attributes. | -| `cc_emails` | `String` | Optional | A list of emails that should be cc’d on all customer communications. Optional. | -| `organization` | `String` | Optional | The organization/company of the customer. Optional. | -| `reference` | `String` | Optional | A customer “reference”, or unique identifier from your app, stored in Chargify. Can be used so that you may reference your customer’s within Chargify using the same unique value you use in your application. Optional. | -| `address` | `String` | Optional | (Optional) The customer’s shipping street address (i.e. “123 Main St.”). | -| `address_2` | `String` | Optional | (Optional) Second line of the customer’s shipping address i.e. “Apt. 100” | -| `city` | `String` | Optional | (Optional) The customer’s shipping address city (i.e. “Boston”). | -| `state` | `String` | Optional | (Optional) The customer’s shipping address state (i.e. “MA”). This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | -| `zip` | `String` | Optional | (Optional) The customer’s shipping address zip code (i.e. “12345”). | -| `country` | `String` | Optional | (Optional) The customer shipping address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). | +| `cc_emails` | `String` | Optional | (Optional) A list of emails that should be cc’d on all customer communications. | +| `organization` | `String` | Optional | (Optional) The organization/company of the customer. | +| `reference` | `String` | Optional | (Optional) A customer “reference”, or unique identifier from your app, stored in Chargify. Can be used so that you may reference your customer’s within Chargify using the same unique value you use in your application. | +| `address` | `String` | Optional | (Optional) The customer’s shipping street address (e.g., “123 Main St.”). | +| `address_2` | `String` | Optional | (Optional) Second line of the customer’s shipping address e.g., “Apt. 100” | +| `city` | `String` | Optional | (Optional) The customer’s shipping address city (e.g., “Boston”). | +| `state` | `String` | Optional | “(Optional) The customer’s shipping address state (e.g., “MA”). This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes.” | +| `zip` | `String` | Optional | (Optional) The customer’s shipping address zip code (e.g., “12345”). | +| `country` | `String` | Optional | “(Optional) The customer shipping address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”).” | | `phone` | `String` | Optional | (Optional) The phone number of the customer. | | `verified` | `TrueClass \| FalseClass` | Optional | - | | `tax_exempt` | `TrueClass \| FalseClass` | Optional | (Optional) The tax_exempt status of the customer. Acceptable values are true or 1 for true and false or 0 for false. | -| `vat_number` | `String` | Optional | (Optional) Supplying the VAT number allows EU customer’s to opt-out of the Value Added Tax assuming the merchant address and customer billing address are not within the same EU country. It’s important to omit the country code from the VAT number upon entry. Otherwise, taxes will be assessed upon the purchase. | +| `surcharging` | `TrueClass \| FalseClass` | Optional | (Optional) Whether surcharging is enabled for the customer. Defaults to `true` when omitted. Only applied on sites where surcharging control is enabled. | +| `vat_number` | `String` | Optional | (Optional) Supplying the VAT number allows EU customers to opt-out of the Value Added Tax assuming the merchant address and customer billing address are not within the same EU country. It’s important to omit the country code from the VAT number upon entry. Otherwise, taxes will be assessed upon the purchase. | | `metafields` | `Hash[String, String]` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | | `parent_id` | `Integer` | Optional | The parent ID in Chargify if applicable. Parent is another Customer object. | | `salesforce_id` | `String` | Optional | (Optional) The Salesforce ID of the customer. | | `default_auto_renewal_profile_id` | `Integer` | Optional | (Optional) The default auto-renewal profile ID for the customer | -## Example (as JSON) - -```json -{ - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" - }, - "first_name": "first_name4", - "last_name": "last_name2", - "email": "email2", - "cc_emails": "cc_emails6", - "organization": "organization8" -} +## Example + +```ruby +customer_attributes = CustomerAttributes.new( + first_name: 'first_name2', + last_name: 'last_name0', + email: 'email4', + cc_emails: 'cc_emails8', + organization: 'organization4', + metafields: { + 'custom_field_name_1': 'custom_field_value_1', + 'custom_field_name_2': 'custom_field_value_2' + } +) ``` diff --git a/doc/models/customer-change.md b/doc/models/customer-change.md index 60737e73..b96abfda 100644 --- a/doc/models/customer-change.md +++ b/doc/models/customer-change.md @@ -14,97 +14,97 @@ | `billing_address` | [`AddressChange`](../../doc/models/address-change.md) | Optional | - | | `custom_fields` | [`CustomerCustomFieldsChange`](../../doc/models/customer-custom-fields-change.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "payer": { - "before": { - "first_name": "first_name0", - "last_name": "last_name8", - "organization": "organization4", - "email": "email6" - }, - "after": { - "first_name": "first_name2", - "last_name": "last_name0", - "organization": "organization4", - "email": "email4" - } - }, - "shipping_address": { - "before": { - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" - }, - "after": { - "street": "street2", - "line2": "line26", - "city": "city8", - "state": "state2", - "zip": "zip4" - } - }, - "billing_address": { - "before": { - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" - }, - "after": { - "street": "street2", - "line2": "line26", - "city": "city8", - "state": "state2", - "zip": "zip4" - } - }, - "custom_fields": { - "before": [ - { - "owner_id": 26, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 26 - }, - { - "owner_id": 26, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 26 - } +```ruby +customer_change = CustomerChange.new( + payer: CustomerPayerChange.new( + before: InvoicePayerChange.new( + first_name: 'first_name0', + last_name: 'last_name8', + organization: 'organization4', + email: 'email6' + ), + after: InvoicePayerChange.new( + first_name: 'first_name2', + last_name: 'last_name0', + organization: 'organization4', + email: 'email4' + ) + ), + shipping_address: AddressChange.new( + before: InvoiceAddress.new( + street: 'street0', + line2: 'line24', + city: 'city0', + state: 'state6', + zip: 'zip4' + ), + after: InvoiceAddress.new( + street: 'street2', + line2: 'line26', + city: 'city8', + state: 'state2', + zip: 'zip4' + ) + ), + billing_address: AddressChange.new( + before: InvoiceAddress.new( + street: 'street0', + line2: 'line24', + city: 'city0', + state: 'state6', + zip: 'zip4' + ), + after: InvoiceAddress.new( + street: 'street2', + line2: 'line26', + city: 'city8', + state: 'state2', + zip: 'zip4' + ) + ), + custom_fields: CustomerCustomFieldsChange.new( + before: [ + InvoiceCustomField.new( + owner_id: 26, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name0', + value: 'value2', + metadatum_id: 26 + ), + InvoiceCustomField.new( + owner_id: 26, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name0', + value: 'value2', + metadatum_id: 26 + ) ], - "after": [ - { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - }, - { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - }, - { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - } + after: [ + InvoiceCustomField.new( + owner_id: 130, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name2', + value: 'value4', + metadatum_id: 130 + ), + InvoiceCustomField.new( + owner_id: 130, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name2', + value: 'value4', + metadatum_id: 130 + ), + InvoiceCustomField.new( + owner_id: 130, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name2', + value: 'value4', + metadatum_id: 130 + ) ] - } -} + ) +) ``` diff --git a/doc/models/customer-changes-preview-response.md b/doc/models/customer-changes-preview-response.md index f96e12f8..7029344a 100644 --- a/doc/models/customer-changes-preview-response.md +++ b/doc/models/customer-changes-preview-response.md @@ -11,99 +11,99 @@ | --- | --- | --- | --- | | `changes` | [`CustomerChange`](../../doc/models/customer-change.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "changes": { - "payer": { - "before": { - "first_name": "first_name0", - "last_name": "last_name8", - "organization": "organization4", - "email": "email6" - }, - "after": { - "first_name": "first_name2", - "last_name": "last_name0", - "organization": "organization4", - "email": "email4" - } - }, - "shipping_address": { - "before": { - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" - }, - "after": { - "street": "street2", - "line2": "line26", - "city": "city8", - "state": "state2", - "zip": "zip4" - } - }, - "billing_address": { - "before": { - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" - }, - "after": { - "street": "street2", - "line2": "line26", - "city": "city8", - "state": "state2", - "zip": "zip4" - } - }, - "custom_fields": { - "before": [ - { - "owner_id": 26, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 26 - }, - { - "owner_id": 26, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 26 - } +```ruby +customer_changes_preview_response = CustomerChangesPreviewResponse.new( + changes: CustomerChange.new( + payer: CustomerPayerChange.new( + before: InvoicePayerChange.new( + first_name: 'first_name0', + last_name: 'last_name8', + organization: 'organization4', + email: 'email6' + ), + after: InvoicePayerChange.new( + first_name: 'first_name2', + last_name: 'last_name0', + organization: 'organization4', + email: 'email4' + ) + ), + shipping_address: AddressChange.new( + before: InvoiceAddress.new( + street: 'street0', + line2: 'line24', + city: 'city0', + state: 'state6', + zip: 'zip4' + ), + after: InvoiceAddress.new( + street: 'street2', + line2: 'line26', + city: 'city8', + state: 'state2', + zip: 'zip4' + ) + ), + billing_address: AddressChange.new( + before: InvoiceAddress.new( + street: 'street0', + line2: 'line24', + city: 'city0', + state: 'state6', + zip: 'zip4' + ), + after: InvoiceAddress.new( + street: 'street2', + line2: 'line26', + city: 'city8', + state: 'state2', + zip: 'zip4' + ) + ), + custom_fields: CustomerCustomFieldsChange.new( + before: [ + InvoiceCustomField.new( + owner_id: 26, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name0', + value: 'value2', + metadatum_id: 26 + ), + InvoiceCustomField.new( + owner_id: 26, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name0', + value: 'value2', + metadatum_id: 26 + ) ], - "after": [ - { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - }, - { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - }, - { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - } + after: [ + InvoiceCustomField.new( + owner_id: 130, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name2', + value: 'value4', + metadatum_id: 130 + ), + InvoiceCustomField.new( + owner_id: 130, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name2', + value: 'value4', + metadatum_id: 130 + ), + InvoiceCustomField.new( + owner_id: 130, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name2', + value: 'value4', + metadatum_id: 130 + ) ] - } - } -} + ) + ) +) ``` diff --git a/doc/models/customer-custom-fields-change.md b/doc/models/customer-custom-fields-change.md index b3cd8763..a444a9f0 100644 --- a/doc/models/customer-custom-fields-change.md +++ b/doc/models/customer-custom-fields-change.md @@ -12,28 +12,28 @@ | `before` | [`Array[InvoiceCustomField]`](../../doc/models/invoice-custom-field.md) | Required | - | | `after` | [`Array[InvoiceCustomField]`](../../doc/models/invoice-custom-field.md) | Required | - | -## Example (as JSON) - -```json -{ - "before": [ - { - "owner_id": 26, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 26 - } +## Example + +```ruby +customer_custom_fields_change = CustomerCustomFieldsChange.new( + before: [ + InvoiceCustomField.new( + owner_id: 26, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name0', + value: 'value2', + metadatum_id: 26 + ) ], - "after": [ - { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - } + after: [ + InvoiceCustomField.new( + owner_id: 130, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name2', + value: 'value4', + metadatum_id: 130 + ) ] -} +) ``` diff --git a/doc/models/customer-error-response-exception.md b/doc/models/customer-error-response-exception.md index fbeb6b23..d56e2fc4 100644 --- a/doc/models/customer-error-response-exception.md +++ b/doc/models/customer-error-response-exception.md @@ -11,13 +11,13 @@ | --- | --- | --- | --- | | `errors` | [Customer Error](../../doc/models/customer-error.md) \| Array[String] \| nil | Optional | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "errors": { - "customer": "customer8" - } -} +## Example + +```ruby +begin + # make the API call +rescue CustomerErrorResponseException => e + puts "Caught CustomerErrorResponseException: #{e.message}" +end ``` diff --git a/doc/models/customer-error.md b/doc/models/customer-error.md index f6c7db3c..ae99928a 100644 --- a/doc/models/customer-error.md +++ b/doc/models/customer-error.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `customer` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "customer": "customer8" -} +```ruby +customer_error = CustomerError.new( + customer: 'customer8' +) ``` diff --git a/doc/models/customer-payer-change.md b/doc/models/customer-payer-change.md index e7d2ba8c..f6dc5216 100644 --- a/doc/models/customer-payer-change.md +++ b/doc/models/customer-payer-change.md @@ -12,22 +12,22 @@ | `before` | [`InvoicePayerChange`](../../doc/models/invoice-payer-change.md) | Required | - | | `after` | [`InvoicePayerChange`](../../doc/models/invoice-payer-change.md) | Required | - | -## Example (as JSON) - -```json -{ - "before": { - "first_name": "first_name0", - "last_name": "last_name8", - "organization": "organization4", - "email": "email6" - }, - "after": { - "first_name": "first_name2", - "last_name": "last_name0", - "organization": "organization4", - "email": "email4" - } -} +## Example + +```ruby +customer_payer_change = CustomerPayerChange.new( + before: InvoicePayerChange.new( + first_name: 'first_name0', + last_name: 'last_name8', + organization: 'organization4', + email: 'email6' + ), + after: InvoicePayerChange.new( + first_name: 'first_name2', + last_name: 'last_name0', + organization: 'organization4', + email: 'email4' + ) +) ``` diff --git a/doc/models/customer-response.md b/doc/models/customer-response.md index 244270e3..1865e6bd 100644 --- a/doc/models/customer-response.md +++ b/doc/models/customer-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `customer` | [`Customer`](../../doc/models/customer.md) | Required | - | -## Example (as JSON) - -```json -{ - "customer": { - "first_name": "first_name0", - "last_name": "last_name8", - "email": "email6", - "cc_emails": "cc_emails0", - "organization": "organization6" - } -} +## Example + +```ruby +customer_response = CustomerResponse.new( + customer: Customer.new( + first_name: 'first_name0', + last_name: 'last_name8', + email: 'email6', + cc_emails: 'cc_emails0', + organization: 'organization6' + ) +) ``` diff --git a/doc/models/customer.md b/doc/models/customer.md index b6c05652..759c9dd5 100644 --- a/doc/models/customer.md +++ b/doc/models/customer.md @@ -12,18 +12,18 @@ | `first_name` | `String` | Optional | The first name of the customer | | `last_name` | `String` | Optional | The last name of the customer | | `email` | `String` | Optional | The email address of the customer | -| `cc_emails` | `String` | Optional | A comma-separated list of emails that should be cc’d on all customer communications (i.e. “joe@example.com, sue@example.com”) | +| `cc_emails` | `String` | Optional | “A comma-separated list of emails that should be cc’d on all customer communications (e.g., “joe@example.com, sue@example.com”)” | | `organization` | `String` | Optional | The organization of the customer. If no value, `null` or empty string is provided, `organization` will be populated with the customer's first and last name, separated with a space. | | `reference` | `String` | Optional | The unique identifier used within your own application for this customer | | `id` | `Integer` | Optional | The customer ID in Chargify | | `created_at` | `DateTime` | Optional | The timestamp in which the customer object was created in Chargify | | `updated_at` | `DateTime` | Optional | The timestamp in which the customer object was last edited | -| `address` | `String` | Optional | The customer’s shipping street address (i.e. “123 Main St.”) | -| `address_2` | `String` | Optional | Second line of the customer’s shipping address i.e. “Apt. 100” | -| `city` | `String` | Optional | The customer’s shipping address city (i.e. “Boston”) | -| `state` | `String` | Optional | The customer’s shipping address state (i.e. “MA”) | +| `address` | `String` | Optional | The customer’s shipping street address (e.g., “123 Main St.”) | +| `address_2` | `String` | Optional | Second line of the customer’s shipping address e.g., “Apt. 100” | +| `city` | `String` | Optional | The customer’s shipping address city (e.g., “Boston”) | +| `state` | `String` | Optional | The customer’s shipping address state (e.g., “MA”) | | `state_name` | `String` | Optional | The customer's full name of state | -| `zip` | `String` | Optional | The customer’s shipping address zip code (i.e. “12345”) | +| `zip` | `String` | Optional | The customer’s shipping address zip code (e.g., “12345”) | | `country` | `String` | Optional | The customer shipping address country | | `country_name` | `String` | Optional | The customer's full name of country | | `phone` | `String` | Optional | The phone number of the customer | @@ -32,6 +32,7 @@ | `portal_invite_last_sent_at` | `DateTime` | Optional | The timestamp of when the Billing Portal invite was last sent at | | `portal_invite_last_accepted_at` | `DateTime` | Optional | The timestamp of when the Billing Portal invite was last accepted | | `tax_exempt` | `TrueClass \| FalseClass` | Optional | The tax exempt status for the customer. Acceptable values are true or 1 for true and false or 0 for false. | +| `surcharging` | `TrueClass \| FalseClass` | Optional | Whether surcharging is enabled for the customer. Only included on sites where surcharging control is enabled. | | `vat_number` | `String` | Optional | The VAT business identification number for the customer. This number is used to determine VAT tax opt out rules. It is not validated when added or updated on a customer record. Instead, it is validated via VIES before calculating taxes. Only valid business identification numbers will allow for VAT opt out. | | `parent_id` | `Integer` | Optional | The parent ID in Chargify if applicable. Parent is another Customer object. | | `locale` | `String` | Optional | The locale for the customer to identify language-region | @@ -40,16 +41,17 @@ | `tax_exempt_reason` | `String` | Optional | The Tax Exemption Reason Code for the customer | | `default_auto_renewal_profile_id` | `Integer` | Optional | The default auto-renewal profile ID for the customer | | `maxioid` | `String` | Optional | The Maxio-generated unique identifier for the customer. | - -## Example (as JSON) - -```json -{ - "first_name": "first_name8", - "last_name": "last_name6", - "email": "email8", - "cc_emails": "cc_emails2", - "organization": "organization8" -} +| `branding_theme_id` | `Integer` | Optional | The ID of the Branding Theme assigned to this customer as the customer's default Branding Theme. This customer-level Branding Theme is used when a subscription does not have its own subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. | + +## Example + +```ruby +customer = Customer.new( + first_name: 'first_name0', + last_name: 'last_name8', + email: 'email6', + cc_emails: 'cc_emails0', + organization: 'organization6' +) ``` diff --git a/doc/models/debit-note-role.md b/doc/models/debit-note-role.md index 9c261a9f..6d34aed8 100644 --- a/doc/models/debit-note-role.md +++ b/doc/models/debit-note-role.md @@ -14,3 +14,9 @@ The role of the debit note. | `CHARGEBACK` | | `REFUND` | +## Example + +```ruby +debit_note_role = DebitNoteRole::CHARGEBACK +``` + diff --git a/doc/models/debit-note-status.md b/doc/models/debit-note-status.md index 48eb3cb1..741dfc41 100644 --- a/doc/models/debit-note-status.md +++ b/doc/models/debit-note-status.md @@ -16,3 +16,9 @@ Current status of the debit note. | `BANISHED` | | `PAID` | +## Example + +```ruby +debit_note_status = DebitNoteStatus::BANISHED +``` + diff --git a/doc/models/debit-note.md b/doc/models/debit-note.md index ae4276d7..a8a06ed3 100644 --- a/doc/models/debit-note.md +++ b/doc/models/debit-note.md @@ -13,10 +13,10 @@ | `site_id` | `Integer` | Optional | ID of the site to which the debit note belongs. | | `customer_id` | `Integer` | Optional | ID of the customer to which the debit note belongs. | | `subscription_id` | `Integer` | Optional | ID of the subscription that generated the debit note. | -| `number` | `Integer` | Optional | A unique, identifier that appears on the debit note and in places it is referenced. | +| `number` | `Integer` | Optional | A unique identifier that appears on the debit note and in places it is referenced. | | `sequence_number` | `Integer` | Optional | A monotonically increasing number assigned to debit notes as they are created. | | `origin_credit_note_uid` | `String` | Optional | Unique identifier for the connected credit note. It is generated automatically by Chargify and has the prefix "cn_" followed by alphanumeric characters.

While the UID is long and not appropriate to show to customers, the number is usually shorter and consumable by the customer and the merchant alike. | -| `origin_credit_note_number` | `String` | Optional | A unique, identifying string of the connected credit note. | +| `origin_credit_note_number` | `String` | Optional | A unique identifying string of the connected credit note. | | `issue_date` | `Date` | Optional | Date the document was issued to the customer. This is the date that the document was made available for payment.

The format is "YYYY-MM-DD". | | `applied_date` | `Date` | Optional | Debit notes are applied to invoices to offset invoiced amounts - they adjust the amount due. This field is the date the debit note document became fully applied to the invoice.

The format is "YYYY-MM-DD". | | `due_date` | `Date` | Optional | Date the document is due for payment. The format is "YYYY-MM-DD". | @@ -25,7 +25,7 @@ | `role` | [`DebitNoteRole`](../../doc/models/debit-note-role.md) | Optional | The role of the debit note. | | `currency` | `String` | Optional | The ISO 4217 currency code (3 character string) representing the currency of the credit note amount fields. | | `seller` | [`InvoiceSeller`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the debit note. | -| `customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the debited subscription. | +| `customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is the owner or recipient of the debited subscription. | | `billing_address` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The billing address of the debited subscription. | | `shipping_address` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The shipping address of the debited subscription. | | `line_items` | [`Array[CreditNoteLineItem]`](../../doc/models/credit-note-line-item.md) | Optional | Line items on the debit note. | @@ -33,15 +33,15 @@ | `taxes` | [`Array[InvoiceTax]`](../../doc/models/invoice-tax.md) | Optional | - | | `refunds` | [`Array[InvoiceRefund]`](../../doc/models/invoice-refund.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "uid": "uid2", - "site_id": 112, - "customer_id": 224, - "subscription_id": 40, - "number": 172 -} +```ruby +debit_note = DebitNote.new( + uid: 'uid4', + site_id: 94, + customer_id: 206, + subscription_id: 22, + number: 154 +) ``` diff --git a/doc/models/deduct-service-credit-request.md b/doc/models/deduct-service-credit-request.md index 4f93ce7f..61ce47ab 100644 --- a/doc/models/deduct-service-credit-request.md +++ b/doc/models/deduct-service-credit-request.md @@ -11,14 +11,14 @@ | --- | --- | --- | --- | | `deduction` | [`DeductServiceCredit`](../../doc/models/deduct-service-credit.md) | Required | - | -## Example (as JSON) - -```json -{ - "deduction": { - "amount": "String9", - "memo": "memo0" - } -} +## Example + +```ruby +deduct_service_credit_request = DeductServiceCreditRequest.new( + deduction: DeductServiceCredit.new( + amount: 'String9', + memo: 'memo0' + ) +) ``` diff --git a/doc/models/deduct-service-credit.md b/doc/models/deduct-service-credit.md index abb98501..0d2d028d 100644 --- a/doc/models/deduct-service-credit.md +++ b/doc/models/deduct-service-credit.md @@ -12,12 +12,12 @@ | `amount` | String \| Float | Required | This is a container for one-of cases. | | `memo` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "amount": "String1", - "memo": "memo2" -} +```ruby +deduct_service_credit = DeductServiceCredit.new( + amount: 'String3', + memo: 'memo4' +) ``` diff --git a/doc/models/delayed-cancellation-response.md b/doc/models/delayed-cancellation-response.md index b743225c..5b05a9b4 100644 --- a/doc/models/delayed-cancellation-response.md +++ b/doc/models/delayed-cancellation-response.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `message` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "message": "message8" -} +```ruby +delayed_cancellation_response = DelayedCancellationResponse.new( + message: 'message0' +) ``` diff --git a/doc/models/delete-subscription-group-response.md b/doc/models/delete-subscription-group-response.md index 5502575a..548e3902 100644 --- a/doc/models/delete-subscription-group-response.md +++ b/doc/models/delete-subscription-group-response.md @@ -12,12 +12,12 @@ | `uid` | `String` | Optional | - | | `deleted` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "uid": "uid4", - "deleted": false -} +```ruby +delete_subscription_group_response = DeleteSubscriptionGroupResponse.new( + uid: 'uid8', + deleted: false +) ``` diff --git a/doc/models/deliver-proforma-invoice-request.md b/doc/models/deliver-proforma-invoice-request.md index 52546246..2d973f30 100644 --- a/doc/models/deliver-proforma-invoice-request.md +++ b/doc/models/deliver-proforma-invoice-request.md @@ -13,21 +13,22 @@ | `cc_recipient_emails` | `Array[String]` | Optional | - | | `bcc_recipient_emails` | `Array[String]` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "recipient_emails": [ - "recipient_emails9" +```ruby +deliver_proforma_invoice_request = DeliverProformaInvoiceRequest.new( + recipient_emails: [ + 'recipient_emails9', + 'recipient_emails0' ], - "cc_recipient_emails": [ - "cc_recipient_emails8" + cc_recipient_emails: [ + 'cc_recipient_emails2', + 'cc_recipient_emails3', + 'cc_recipient_emails4' ], - "bcc_recipient_emails": [ - "bcc_recipient_emails2", - "bcc_recipient_emails3", - "bcc_recipient_emails4" + bcc_recipient_emails: [ + 'bcc_recipient_emails8' ] -} +) ``` diff --git a/doc/models/direction.md b/doc/models/direction.md index ef6c29da..040e7bab 100644 --- a/doc/models/direction.md +++ b/doc/models/direction.md @@ -12,3 +12,9 @@ | `ASC` | | `DESC` | +## Example + +```ruby +direction = Direction::ASC +``` + diff --git a/doc/models/discount-type.md b/doc/models/discount-type.md index 77357ece..bd20f231 100644 --- a/doc/models/discount-type.md +++ b/doc/models/discount-type.md @@ -12,3 +12,9 @@ | `AMOUNT` | | `PERCENT` | +## Example + +```ruby +discount_type = DiscountType::AMOUNT +``` + diff --git a/doc/models/downgrade-credit-credit-type.md b/doc/models/downgrade-credit-credit-type.md index 50858a3b..4706e34b 100644 --- a/doc/models/downgrade-credit-credit-type.md +++ b/doc/models/downgrade-credit-credit-type.md @@ -21,3 +21,9 @@ The type of credit to be created when upgrading/downgrading. Defaults to the com | `PRORATED` | | `NONE` | +## Example + +```ruby +downgrade_credit_credit_type = DowngradeCreditCreditType::NONE +``` + diff --git a/doc/models/dunner-data.md b/doc/models/dunner-data.md index 3a5ad988..7b428658 100644 --- a/doc/models/dunner-data.md +++ b/doc/models/dunner-data.md @@ -16,16 +16,16 @@ | `attempts` | `Integer` | Required | - | | `last_attempted_at` | `DateTime` | Required | - | -## Example (as JSON) - -```json -{ - "state": "state4", - "subscription_id": 126, - "revenue_at_risk_in_cents": 30, - "created_at": "2016-03-13T12:52:32.123Z", - "attempts": 110, - "last_attempted_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +dunner_data = DunnerData.new( + state: 'state2', + subscription_id: 216, + revenue_at_risk_in_cents: 120, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + attempts: 20, + last_attempted_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/dunning-step-data.md b/doc/models/dunning-step-data.md index fb1eb855..a144416e 100644 --- a/doc/models/dunning-step-data.md +++ b/doc/models/dunning-step-data.md @@ -18,18 +18,18 @@ | `send_sms` | `TrueClass \| FalseClass` | Required | - | | `sms_body` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "day_threshold": 88, - "action": "action4", - "email_body": "email_body4", - "email_subject": "email_subject4", - "send_email": false, - "send_bcc_email": false, - "send_sms": false, - "sms_body": "sms_body0" -} +## Example + +```ruby +dunning_step_data = DunningStepData.new( + day_threshold: 90, + action: 'action0', + send_email: false, + send_bcc_email: false, + send_sms: false, + email_body: 'email_body0', + email_subject: 'email_subject0', + sms_body: 'sms_body4' +) ``` diff --git a/doc/models/dunning-step-reached.md b/doc/models/dunning-step-reached.md index de8dcc0c..c5de54f4 100644 --- a/doc/models/dunning-step-reached.md +++ b/doc/models/dunning-step-reached.md @@ -13,38 +13,38 @@ | `current_step` | [`DunningStepData`](../../doc/models/dunning-step-data.md) | Required | - | | `next_step` | [`DunningStepData`](../../doc/models/dunning-step-data.md) | Required | - | -## Example (as JSON) - -```json -{ - "dunner": { - "state": "state8", - "subscription_id": 194, - "revenue_at_risk_in_cents": 98, - "created_at": "2016-03-13T12:52:32.123Z", - "attempts": 42, - "last_attempted_at": "2016-03-13T12:52:32.123Z" - }, - "current_step": { - "day_threshold": 198, - "action": "action4", - "email_body": "email_body4", - "email_subject": "email_subject6", - "send_email": false, - "send_bcc_email": false, - "send_sms": false, - "sms_body": "sms_body0" - }, - "next_step": { - "day_threshold": 30, - "action": "action4", - "email_body": "email_body4", - "email_subject": "email_subject4", - "send_email": false, - "send_bcc_email": false, - "send_sms": false, - "sms_body": "sms_body0" - } -} +## Example + +```ruby +dunning_step_reached = DunningStepReached.new( + dunner: DunnerData.new( + state: 'state8', + subscription_id: 194, + revenue_at_risk_in_cents: 98, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + attempts: 42, + last_attempted_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ), + current_step: DunningStepData.new( + day_threshold: 198, + action: 'action4', + send_email: false, + send_bcc_email: false, + send_sms: false, + email_body: 'email_body4', + email_subject: 'email_subject6', + sms_body: 'sms_body0' + ), + next_step: DunningStepData.new( + day_threshold: 30, + action: 'action4', + send_email: false, + send_bcc_email: false, + send_sms: false, + email_body: 'email_body4', + email_subject: 'email_subject4', + sms_body: 'sms_body0' + ) +) ``` diff --git a/doc/models/ebb-component.md b/doc/models/ebb-component.md index be0ec125..91df5224 100644 --- a/doc/models/ebb-component.md +++ b/doc/models/ebb-component.md @@ -9,10 +9,10 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `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 | +| `name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, i.e., "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 in 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[Price]`](../../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. | @@ -21,36 +21,49 @@ | `tax_code` | `String` | Optional | A string representing the tax code related to the component type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | | `hide_date_range_on_invoice` | `TrueClass \| FalseClass` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | | `event_based_billing_metric_id` | `Integer` | Required | The ID of an event based billing metric that will be attached to this component. | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. i.e., an interval of ‘30’ coupled with an interval_unit of day would mean this component's default 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 component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. | +| `unspsc_code` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | -## Example (as JSON) - -```json -{ - "name": "name0", - "unit_name": "unit_name2", - "description": "description0", - "handle": "handle6", - "taxable": false, - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "price_points": [ - { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" - } +## Example + +```ruby +ebb_component = EBBComponent.new( + name: 'name0', + unit_name: 'unit_name2', + pricing_scheme: PricingScheme::PER_UNIT, + event_based_billing_metric_id: 250, + description: 'description0', + handle: 'handle6', + taxable: false, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "event_based_billing_metric_id": 190 -} + price_points: [ + ComponentPricePointItem.new( + name: 'name2', + handle: 'handle8', + pricing_scheme: PricingScheme::PER_UNIT, + interval: 92, + interval_unit: IntervalUnit::DAY + ), + ComponentPricePointItem.new( + name: 'name2', + handle: 'handle8', + pricing_scheme: PricingScheme::PER_UNIT, + interval: 92, + interval_unit: IntervalUnit::DAY + ) + ] +) ``` diff --git a/doc/models/ebb-event.md b/doc/models/ebb-event.md index 35f3d051..ee616f87 100644 --- a/doc/models/ebb-event.md +++ b/doc/models/ebb-event.md @@ -11,28 +11,14 @@ | --- | --- | --- | --- | | `chargify` | [`ChargifyEBB`](../../doc/models/chargify-ebb.md) | Optional | - | -## Example (as JSON) - -```json -{ - "chargify": { - "subscription_id": 1, - "timestamp": "2020-02-27T17:45:50-05:00", - "id": "id6", - "created_at": "2016-03-13T12:52:32.123Z", - "uniqueness_token": "uniqueness_token2" - }, - "messages": 150, - "country": "US", - "customer": { - "name": "John", - "lastName": "Doe", - "address": { - "street": "Maple Street", - "zip": 4888, - "state": "MA" - } - } -} +## Example + +```ruby +ebb_event = EBBEvent.new( + chargify: ChargifyEBB.new( + timestamp: DateTimeHelper.from_rfc3339('2020-02-27T17:45:50-05:00'), + subscription_id: 1 + ) +) ``` diff --git a/doc/models/enable-webhooks-request.md b/doc/models/enable-webhooks-request.md index 07d16a99..973a1912 100644 --- a/doc/models/enable-webhooks-request.md +++ b/doc/models/enable-webhooks-request.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `webhooks_enabled` | `TrueClass \| FalseClass` | Required | - | -## Example (as JSON) +## Example -```json -{ - "webhooks_enabled": false -} +```ruby +enable_webhooks_request = EnableWebhooksRequest.new( + webhooks_enabled: false +) ``` diff --git a/doc/models/enable-webhooks-response.md b/doc/models/enable-webhooks-response.md index 1c8f9f1d..329bf2c9 100644 --- a/doc/models/enable-webhooks-response.md +++ b/doc/models/enable-webhooks-response.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `webhooks_enabled` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "webhooks_enabled": false -} +```ruby +enable_webhooks_response = EnableWebhooksResponse.new( + webhooks_enabled: false +) ``` diff --git a/doc/models/endpoint-response.md b/doc/models/endpoint-response.md index 3bd269ac..69154e1c 100644 --- a/doc/models/endpoint-response.md +++ b/doc/models/endpoint-response.md @@ -11,19 +11,19 @@ | --- | --- | --- | --- | | `endpoint` | [`Endpoint`](../../doc/models/endpoint.md) | Optional | - | -## Example (as JSON) - -```json -{ - "endpoint": { - "id": 202, - "url": "url2", - "site_id": 128, - "status": "status0", - "webhook_subscriptions": [ - "webhook_subscriptions4" +## Example + +```ruby +endpoint_response = EndpointResponse.new( + endpoint: Endpoint.new( + id: 202, + url: 'url2', + site_id: 128, + status: 'status0', + webhook_subscriptions: [ + 'webhook_subscriptions4' ] - } -} + ) +) ``` diff --git a/doc/models/endpoint.md b/doc/models/endpoint.md index d315d914..451f37de 100644 --- a/doc/models/endpoint.md +++ b/doc/models/endpoint.md @@ -15,18 +15,17 @@ | `status` | `String` | Optional | - | | `webhook_subscriptions` | `Array[String]` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 196, - "url": "url2", - "site_id": 122, - "status": "status0", - "webhook_subscriptions": [ - "webhook_subscriptions4", - "webhook_subscriptions3" +## Example + +```ruby +endpoint = Endpoint.new( + id: 202, + url: 'url2', + site_id: 128, + status: 'status0', + webhook_subscriptions: [ + 'webhook_subscriptions4' ] -} +) ``` diff --git a/doc/models/error-array-map-response-exception.md b/doc/models/error-array-map-response-exception.md index 4565374b..d51d3b79 100644 --- a/doc/models/error-array-map-response-exception.md +++ b/doc/models/error-array-map-response-exception.md @@ -11,16 +11,13 @@ | --- | --- | --- | --- | | `errors` | `Hash[String, Object]` | Optional | - | -## Example (as JSON) - -```json -{ - "errors": { - "key0": { - "key1": "val1", - "key2": "val2" - } - } -} +## Example + +```ruby +begin + # make the API call +rescue ErrorArrayMapResponseException => e + puts "Caught ErrorArrayMapResponseException: #{e.message}" +end ``` diff --git a/doc/models/error-list-response-exception.md b/doc/models/error-list-response-exception.md index 77bc0736..242109c9 100644 --- a/doc/models/error-list-response-exception.md +++ b/doc/models/error-list-response-exception.md @@ -13,15 +13,13 @@ Error which contains list of messages. | --- | --- | --- | --- | | `errors` | `Array[String]` | Required | - | -## Example (as JSON) - -```json -{ - "errors": [ - "errors5", - "errors6", - "errors7" - ] -} +## Example + +```ruby +begin + # make the API call +rescue ErrorListResponseException => e + puts "Caught ErrorListResponseException: #{e.message}" +end ``` diff --git a/doc/models/error-string-map-response-exception.md b/doc/models/error-string-map-response-exception.md index 5efb47a2..e09618da 100644 --- a/doc/models/error-string-map-response-exception.md +++ b/doc/models/error-string-map-response-exception.md @@ -11,14 +11,13 @@ | --- | --- | --- | --- | | `errors` | `Hash[String, String]` | Optional | - | -## Example (as JSON) - -```json -{ - "errors": { - "key0": "errors3", - "key1": "errors4" - } -} +## Example + +```ruby +begin + # make the API call +rescue ErrorStringMapResponseException => e + puts "Caught ErrorStringMapResponseException: #{e.message}" +end ``` diff --git a/doc/models/errors.md b/doc/models/errors.md index 2e5bc561..1bdeb016 100644 --- a/doc/models/errors.md +++ b/doc/models/errors.md @@ -12,18 +12,20 @@ | `per_page` | `Array[String]` | Optional | - | | `price_point` | `Array[String]` | Optional | - | -## Example (as JSON) - -```json -{ - "per_page": [ - "per_page7", - "per_page8" +## Example + +```ruby +errors = Errors.new( + per_page: [ + 'per_page1', + 'per_page2', + 'per_page3' ], - "price_point": [ - "price_point6", - "price_point7" + price_point: [ + 'price_point0', + 'price_point9', + 'price_point8' ] -} +) ``` diff --git a/doc/models/event-based-billing-list-segments-errors-exception.md b/doc/models/event-based-billing-list-segments-errors-exception.md index 278212c1..a634e0f1 100644 --- a/doc/models/event-based-billing-list-segments-errors-exception.md +++ b/doc/models/event-based-billing-list-segments-errors-exception.md @@ -11,22 +11,13 @@ | --- | --- | --- | --- | | `errors` | [`Errors`](../../doc/models/errors.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": { - "per_page": [ - "per_page1", - "per_page2", - "per_page3" - ], - "price_point": [ - "price_point0", - "price_point9", - "price_point8" - ] - } -} +## Example + +```ruby +begin + # make the API call +rescue EventBasedBillingListSegmentsErrorsException => e + puts "Caught EventBasedBillingListSegmentsErrorsException: #{e.message}" +end ``` diff --git a/doc/models/event-based-billing-segment-error.md b/doc/models/event-based-billing-segment-error.md index d933665f..f7f8082b 100644 --- a/doc/models/event-based-billing-segment-error.md +++ b/doc/models/event-based-billing-segment-error.md @@ -11,20 +11,14 @@ | --- | --- | --- | --- | | `segments` | `Hash[String, Object]` | Required | The key of the object would be a number (an index in the request array) where the error occurred. In the value object, the key represents the field and the value is an array with error messages. In most cases, this object would contain just one key. | -## Example (as JSON) - -```json -{ - "segments": { - "key0": { - "key1": "val1", - "key2": "val2" - }, - "key1": { - "key1": "val1", - "key2": "val2" - } +## Example + +```ruby +event_based_billing_segment_error = EventBasedBillingSegmentError.new( + segments: { + 'key0': JSON.parse('{"key1":"val1","key2":"val2"}'), + 'key1': JSON.parse('{"key1":"val1","key2":"val2"}') } -} +) ``` diff --git a/doc/models/event-based-billing-segment-errors-exception.md b/doc/models/event-based-billing-segment-errors-exception.md index a75709b7..1a1c24af 100644 --- a/doc/models/event-based-billing-segment-errors-exception.md +++ b/doc/models/event-based-billing-segment-errors-exception.md @@ -11,24 +11,13 @@ | --- | --- | --- | --- | | `errors` | `Hash[String, Object]` | Optional | The key of the object would be a number (an index in the request array) where the error occurred. In the value object, the key represents the field and the value is an array with error messages. In most cases, this object would contain just one key. | -## Example (as JSON) - -```json -{ - "errors": { - "key0": { - "key1": "val1", - "key2": "val2" - }, - "key1": { - "key1": "val1", - "key2": "val2" - }, - "key2": { - "key1": "val1", - "key2": "val2" - } - } -} +## Example + +```ruby +begin + # make the API call +rescue EventBasedBillingSegmentErrorsException => e + puts "Caught EventBasedBillingSegmentErrorsException: #{e.message}" +end ``` diff --git a/doc/models/event-based-billing-segment-exception.md b/doc/models/event-based-billing-segment-exception.md index 76167500..3c4a6e96 100644 --- a/doc/models/event-based-billing-segment-exception.md +++ b/doc/models/event-based-billing-segment-exception.md @@ -11,18 +11,13 @@ | --- | --- | --- | --- | | `errors` | [`EventBasedBillingSegmentError`](../../doc/models/event-based-billing-segment-error.md) | Required | - | -## Example (as JSON) - -```json -{ - "errors": { - "segments": { - "key0": { - "key1": "val1", - "key2": "val2" - } - } - } -} +## Example + +```ruby +begin + # make the API call +rescue EventBasedBillingSegmentException => e + puts "Caught EventBasedBillingSegmentException: #{e.message}" +end ``` diff --git a/doc/models/event-key.md b/doc/models/event-key.md index a400739e..2e1aa837 100644 --- a/doc/models/event-key.md +++ b/doc/models/event-key.md @@ -21,6 +21,7 @@ | `RENEWAL_FAILURE` | | `SUBSCRIPTION_STATE_CHANGE` | | `SUBSCRIPTION_PRODUCT_CHANGE` | +| `SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED` | | `PENDING_CANCELLATION_CHANGE` | | `EXPIRING_CARD` | | `CUSTOMER_UPDATE` | @@ -93,3 +94,9 @@ | `SUBSCRIPTION_TERM_RENEWAL_ACTIVATED` | | `SUBSCRIPTION_TERM_RENEWAL_REMOVED` | +## Example + +```ruby +event_key = EventKey::INVOICE_IN_COLLECTIONS_CANCELED +``` + diff --git a/doc/models/event-response.md b/doc/models/event-response.md index 1c4163af..a09452b3 100644 --- a/doc/models/event-response.md +++ b/doc/models/event-response.md @@ -11,34 +11,25 @@ | --- | --- | --- | --- | | `event` | [`Event`](../../doc/models/event.md) | Required | - | -## Example (as JSON) - -```json -{ - "event": { - "id": 242, - "key": "maxio_payments_direct_debit_payment_rejected", - "message": "message0", - "subscription_id": 96, - "customer_id": 24, - "created_at": "2016-03-13T12:52:32.123Z", - "event_specific_data": { - "previous_unit_balance": null, - "previous_overage_unit_balance": null, - "new_unit_balance": null, - "new_overage_unit_balance": null, - "usage_quantity": null, - "overage_usage_quantity": null, - "component_id": null, - "component_handle": null, - "memo": null, - "allocation_details": [ - null - ], - "previous_product_id": 126, - "new_product_id": 12 - } - } -} +## Example + +```ruby +event_response = EventResponse.new( + event: Event.new( + id: 242, + key: EventKey::SUBSCRIPTION_REMOVED_FROM_GROUP, + message: 'message0', + subscription_id: 96, + customer_id: 24, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + event_specific_data: SubscriptionProductChange.new( + previous_product_id: 126, + new_product_id: 12, + previous_product_price_point_id: 250, + new_product_price_point_id: 244, + effective_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) + ) +) ``` diff --git a/doc/models/event.md b/doc/models/event.md index 2aa94940..e3b247ee 100644 --- a/doc/models/event.md +++ b/doc/models/event.md @@ -17,32 +17,23 @@ | `created_at` | `DateTime` | Required | - | | `event_specific_data` | [Subscription Product Change](../../doc/models/subscription-product-change.md) \| [Subscription State Change](../../doc/models/subscription-state-change.md) \| [Payment Related Events](../../doc/models/payment-related-events.md) \| [Refund Success](../../doc/models/refund-success.md) \| [Component Allocation Change](../../doc/models/component-allocation-change.md) \| [Metered Usage](../../doc/models/metered-usage.md) \| [Prepaid Usage](../../doc/models/prepaid-usage.md) \| [Dunning Step Reached](../../doc/models/dunning-step-reached.md) \| [Invoice Issued](../../doc/models/invoice-issued.md) \| [Pending Cancellation Change](../../doc/models/pending-cancellation-change.md) \| [Prepaid Subscription Balance Changed](../../doc/models/prepaid-subscription-balance-changed.md) \| [Proforma Invoice Issued](../../doc/models/proforma-invoice-issued.md) \| [Subscription Group Signup Event Data](../../doc/models/subscription-group-signup-event-data.md) \| [Credit Account Balance Changed](../../doc/models/credit-account-balance-changed.md) \| [Prepayment Account Balance Changed](../../doc/models/prepayment-account-balance-changed.md) \| [Payment Collection Method Changed](../../doc/models/payment-collection-method-changed.md) \| [Item Price Point Changed](../../doc/models/item-price-point-changed.md) \| [Custom Field Value Change](../../doc/models/custom-field-value-change.md) \| [Chjs Tokenization Success](../../doc/models/chjs-tokenization-success.md) \| [Chjs Tokenization Failure](../../doc/models/chjs-tokenization-failure.md) \| nil | Required | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "id": 40, - "key": "subscription_group_signup_success", - "message": "message8", - "subscription_id": 150, - "customer_id": 78, - "created_at": "2016-03-13T12:52:32.123Z", - "event_specific_data": { - "previous_unit_balance": null, - "previous_overage_unit_balance": null, - "new_unit_balance": null, - "new_overage_unit_balance": null, - "usage_quantity": null, - "overage_usage_quantity": null, - "component_id": null, - "component_handle": null, - "memo": null, - "allocation_details": [ - null - ], - "previous_product_id": 126, - "new_product_id": 12 - } -} +## Example + +```ruby +event = Event.new( + id: 242, + key: EventKey::SUBSCRIPTION_REMOVED_FROM_GROUP, + message: 'message0', + subscription_id: 96, + customer_id: 24, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + event_specific_data: SubscriptionProductChange.new( + previous_product_id: 126, + new_product_id: 12, + previous_product_price_point_id: 250, + new_product_price_point_id: 244, + effective_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/expiration-interval-unit.md b/doc/models/expiration-interval-unit.md index d6b75bef..7dc4b518 100644 --- a/doc/models/expiration-interval-unit.md +++ b/doc/models/expiration-interval-unit.md @@ -13,3 +13,9 @@ | `MONTH` | | `NEVER` | +## Example + +```ruby +expiration_interval_unit = ExpirationIntervalUnit::NEVER +``` + diff --git a/doc/models/failed-payment-action.md b/doc/models/failed-payment-action.md index 4d48d023..992ccd44 100644 --- a/doc/models/failed-payment-action.md +++ b/doc/models/failed-payment-action.md @@ -5,7 +5,7 @@ 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). +- `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). ## Enumeration @@ -19,3 +19,9 @@ Action taken when payment for an invoice fails: | `ROLLBACK_TO_PENDING` | | `INITIATE_DUNNING` | +## Example + +```ruby +failed_payment_action = FailedPaymentAction::ROLLBACK_TO_PENDING +``` + diff --git a/doc/models/failed-payment-event-data.md b/doc/models/failed-payment-event-data.md index f9203421..cbce64c8 100644 --- a/doc/models/failed-payment-event-data.md +++ b/doc/models/failed-payment-event-data.md @@ -17,15 +17,15 @@ Example schema for an `failed_payment` event | `payment_method` | [`InvoicePaymentMethodType`](../../doc/models/invoice-payment-method-type.md) | Required | - | | `transaction_id` | `Integer` | Required | The transaction ID of the failed payment. | -## Example (as JSON) - -```json -{ - "amount_in_cents": 128, - "applied_amount": 154, - "memo": "memo2", - "payment_method": "credit_card", - "transaction_id": 170 -} +## Example + +```ruby +failed_payment_event_data = FailedPaymentEventData.new( + amount_in_cents: 46, + applied_amount: 20, + payment_method: InvoicePaymentMethodType::CASH, + transaction_id: 252, + memo: 'memo2' +) ``` diff --git a/doc/models/failed-payment-event.md b/doc/models/failed-payment-event.md index f5f39875..93126a75 100644 --- a/doc/models/failed-payment-event.md +++ b/doc/models/failed-payment-event.md @@ -15,31 +15,31 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::FAILED_PAYMENT` | | `event_data` | [`FailedPaymentEventData`](../../doc/models/failed-payment-event-data.md) | Required | Example schema for an `failed_payment` event | -## Example (as JSON) - -```json -{ - "id": 120, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "failed_payment", - "event_data": { - "amount_in_cents": 220, - "applied_amount": 194, - "memo": "memo0", - "payment_method": "cash", - "transaction_id": 78 - } -} +## Example + +```ruby +failed_payment_event = FailedPaymentEvent.new( + id: 140, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::FAILED_PAYMENT, + event_data: FailedPaymentEventData.new( + amount_in_cents: 220, + applied_amount: 194, + payment_method: InvoicePaymentMethodType::CASH, + transaction_id: 78, + memo: 'memo0' + ) +) ``` diff --git a/doc/models/first-charge-type.md b/doc/models/first-charge-type.md index 9fa953d6..e189ac26 100644 --- a/doc/models/first-charge-type.md +++ b/doc/models/first-charge-type.md @@ -13,3 +13,9 @@ | `IMMEDIATE` | | `DELAYED` | +## Example + +```ruby +first_charge_type = FirstChargeType::IMMEDIATE +``` + diff --git a/doc/models/full-subscription-group-response.md b/doc/models/full-subscription-group-response.md index 777869ab..89be1a9a 100644 --- a/doc/models/full-subscription-group-response.md +++ b/doc/models/full-subscription-group-response.md @@ -22,19 +22,19 @@ | `customer` | [`SubscriptionGroupCustomer`](../../doc/models/subscription-group-customer.md) | Optional | - | | `account_balances` | [`SubscriptionGroupBalances`](../../doc/models/subscription-group-balances.md) | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "scheme": 90, - "customer_id": 110, - "payment_profile_id": 18, - "subscription_ids": [ - 220, - 221, - 222 +## Example + +```ruby +full_subscription_group_response = FullSubscriptionGroupResponse.new( + uid: 'uid8', + scheme: 72, + customer_id: 92, + payment_profile_id: 0, + subscription_ids: [ + 202, + 203, + 204 ] -} +) ``` diff --git a/doc/models/get-one-time-token-bank-account-payment-profile.md b/doc/models/get-one-time-token-bank-account-payment-profile.md new file mode 100644 index 00000000..734fb562 --- /dev/null +++ b/doc/models/get-one-time-token-bank-account-payment-profile.md @@ -0,0 +1,64 @@ + +# Get One Time Token Bank Account Payment Profile + +## Structure + +`GetOneTimeTokenBankAccountPaymentProfile` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `String` | Optional | - | +| `first_name` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `last_name` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `customer_id` | `String` | Optional | - | +| `current_vault` | [`BankAccountVault`](../../doc/models/bank-account-vault.md) | Required | The vault that stores the payment profile with the provided vault_token. Use `bogus` for testing. | +| `vault_token` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `billing_address` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `billing_address_2` | `String` | Optional | - | +| `billing_city` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `billing_country` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `billing_state` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `billing_zip` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `bank_name` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `masked_bank_routing_number` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `masked_bank_account_number` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `bank_account_type` | [`BankAccountType`](../../doc/models/bank-account-type.md) | Required | Defaults to checking | +| `bank_account_holder_type` | [`BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Required | Defaults to personal | +| `payment_type` | `String` | Required | **Constraints**: *Minimum Length*: `1` | +| `disabled` | `TrueClass \| FalseClass` | Required | - | +| `site_gateway_setting_id` | `Integer` | Required | - | +| `customer_vault_token` | `String` | Optional | - | +| `gateway_handle` | `String` | Optional | - | +| `verified` | `TrueClass \| FalseClass` | Optional | - | + +## Example + +```ruby +get_one_time_token_bank_account_payment_profile = GetOneTimeTokenBankAccountPaymentProfile.new( + first_name: 'first_name6', + last_name: 'last_name4', + current_vault: BankAccountVault::AUTHORIZENET, + vault_token: 'vault_token8', + billing_address: 'billing_address8', + billing_city: 'billing_city4', + billing_country: 'billing_country0', + billing_state: 'billing_state0', + billing_zip: 'billing_zip4', + bank_name: 'bank_name8', + masked_bank_routing_number: 'masked_bank_routing_number8', + masked_bank_account_number: 'masked_bank_account_number8', + bank_account_type: BankAccountType::CHECKING, + bank_account_holder_type: BankAccountHolderType::PERSONAL, + payment_type: 'payment_type4', + disabled: false, + site_gateway_setting_id: 128, + id: 'id6', + customer_id: 'customer_id4', + billing_address_2: 'billing_address_28', + customer_vault_token: 'customer_vault_token4', + gateway_handle: 'gateway_handle8' +) +``` + diff --git a/doc/models/get-one-time-token-payment-profile.md b/doc/models/get-one-time-token-payment-profile.md index 26d71641..9a2502f4 100644 --- a/doc/models/get-one-time-token-payment-profile.md +++ b/doc/models/get-one-time-token-payment-profile.md @@ -31,31 +31,31 @@ | `customer_vault_token` | `String` | Optional | - | | `gateway_handle` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "id": "id2", - "first_name": "first_name2", - "last_name": "last_name0", - "masked_card_number": "masked_card_number0", - "card_type": "routex", - "expiration_month": 187.78, - "expiration_year": 164.44, - "customer_id": "customer_id0", - "current_vault": "braintree_blue", - "vault_token": "vault_token4", - "billing_address": "billing_address4", - "billing_address_2": "billing_address_24", - "billing_city": "billing_city0", - "billing_country": "billing_country6", - "billing_state": "billing_state6", - "billing_zip": "billing_zip0", - "payment_type": "payment_type2", - "disabled": false, - "site_gateway_setting_id": 232, - "customer_vault_token": "customer_vault_token0", - "gateway_handle": "gateway_handle4" -} +## Example + +```ruby +get_one_time_token_payment_profile = GetOneTimeTokenPaymentProfile.new( + first_name: 'first_name0', + last_name: 'last_name8', + masked_card_number: 'masked_card_number8', + card_type: CardType::VISA, + expiration_month: 114.46, + expiration_year: 91.12, + current_vault: CreditCardVault::ADYEN, + vault_token: 'vault_token2', + billing_address: 'billing_address2', + billing_city: 'billing_city8', + billing_country: 'billing_country4', + billing_state: 'billing_state4', + billing_zip: 'billing_zip8', + payment_type: 'payment_type0', + disabled: false, + site_gateway_setting_id: 68, + id: 'id0', + customer_id: 'customer_id8', + billing_address_2: 'billing_address_22', + customer_vault_token: 'customer_vault_token8', + gateway_handle: 'gateway_handle2' +) ``` diff --git a/doc/models/get-one-time-token-request.md b/doc/models/get-one-time-token-request.md index 034f1408..a4e56586 100644 --- a/doc/models/get-one-time-token-request.md +++ b/doc/models/get-one-time-token-request.md @@ -9,35 +9,35 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `payment_profile` | [`GetOneTimeTokenPaymentProfile`](../../doc/models/get-one-time-token-payment-profile.md) | Required | - | - -## Example (as JSON) - -```json -{ - "payment_profile": { - "id": "id4", - "first_name": "first_name4", - "last_name": "last_name2", - "masked_card_number": "masked_card_number2", - "card_type": "bogus", - "expiration_month": 133.5, - "expiration_year": 156.84, - "customer_id": "customer_id2", - "current_vault": "stripe", - "vault_token": "vault_token6", - "billing_address": "billing_address4", - "billing_address_2": "billing_address_26", - "billing_city": "billing_city8", - "billing_country": "billing_country2", - "billing_state": "billing_state2", - "billing_zip": "billing_zip2", - "payment_type": "payment_type6", - "disabled": false, - "site_gateway_setting_id": 104, - "customer_vault_token": "customer_vault_token2", - "gateway_handle": "gateway_handle4" - } -} +| `payment_profile` | [Get One Time Token Payment Profile](../../doc/models/get-one-time-token-payment-profile.md) \| [Get One Time Token Bank Account Payment Profile](../../doc/models/get-one-time-token-bank-account-payment-profile.md) | Required | This is a container for any-of cases. | + +## Example + +```ruby +get_one_time_token_request = GetOneTimeTokenRequest.new( + payment_profile: GetOneTimeTokenPaymentProfile.new( + first_name: 'first_name2', + last_name: 'last_name0', + masked_card_number: 'masked_card_number0', + card_type: CardType::ROUTEX, + expiration_month: 187.78, + expiration_year: 164.44, + current_vault: CreditCardVault::BRAINTREE_BLUE, + vault_token: 'vault_token4', + billing_address: 'billing_address4', + billing_city: 'billing_city0', + billing_country: 'billing_country6', + billing_state: 'billing_state6', + billing_zip: 'billing_zip0', + payment_type: 'payment_type2', + disabled: false, + site_gateway_setting_id: 232, + id: 'id2', + customer_id: 'customer_id0', + billing_address_2: 'billing_address_24', + customer_vault_token: 'customer_vault_token0', + gateway_handle: 'gateway_handle4' + ) +) ``` diff --git a/doc/models/group-billing.md b/doc/models/group-billing.md index 26a4da19..874999af 100644 --- a/doc/models/group-billing.md +++ b/doc/models/group-billing.md @@ -1,7 +1,7 @@ # Group Billing -Optional attributes related to billing date and accrual. Note: Only applicable for new subscriptions. +(Optional) Attributes related to billing date and accrual. Note: Only applicable for new subscriptions. ## Structure @@ -15,13 +15,13 @@ Optional attributes related to billing date and accrual. Note: Only applicable f | `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) +## Example -```json -{ - "accrue": false, - "align_date": false, - "prorate": false -} +```ruby +group_billing = GroupBilling.new( + accrue: false, + align_date: false, + prorate: false +) ``` diff --git a/doc/models/group-settings.md b/doc/models/group-settings.md index b547e219..0d341ffd 100644 --- a/doc/models/group-settings.md +++ b/doc/models/group-settings.md @@ -10,21 +10,21 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `target` | [`GroupTarget`](../../doc/models/group-target.md) | Required | Attributes of the target customer who will be the responsible payer of the created subscription. Required. | -| `billing` | [`GroupBilling`](../../doc/models/group-billing.md) | Optional | Optional attributes related to billing date and accrual. Note: Only applicable for new subscriptions. | - -## Example (as JSON) - -```json -{ - "target": { - "type": "parent", - "id": 236 - }, - "billing": { - "accrue": false, - "align_date": false, - "prorate": false - } -} +| `billing` | [`GroupBilling`](../../doc/models/group-billing.md) | Optional | (Optional) Attributes related to billing date and accrual. Note: Only applicable for new subscriptions. | + +## Example + +```ruby +group_settings = GroupSettings.new( + target: GroupTarget.new( + type: GroupTargetType::PARENT, + id: 236 + ), + billing: GroupBilling.new( + accrue: false, + align_date: false, + prorate: false + ) +) ``` diff --git a/doc/models/group-status.md b/doc/models/group-status.md new file mode 100644 index 00000000..930d686a --- /dev/null +++ b/doc/models/group-status.md @@ -0,0 +1,20 @@ + +# Group Status + +## Enumeration + +`GroupStatus` + +## Fields + +| Name | +| --- | +| `UNGROUPED` | +| `GROUPED` | + +## Example + +```ruby +group_status = GroupStatus::UNGROUPED +``` + diff --git a/doc/models/group-target-type.md b/doc/models/group-target-type.md index dec1d51c..2b4c56df 100644 --- a/doc/models/group-target-type.md +++ b/doc/models/group-target-type.md @@ -17,3 +17,9 @@ The type of object indicated by the id attribute. | `PARENT` | | `ELDEST` | +## Example + +```ruby +group_target_type = GroupTargetType::ELDEST +``` + diff --git a/doc/models/group-target.md b/doc/models/group-target.md index b02b72d8..fc0a9655 100644 --- a/doc/models/group-target.md +++ b/doc/models/group-target.md @@ -12,14 +12,14 @@ Attributes of the target customer who will be the responsible payer of the creat | Name | Type | Tags | Description | | --- | --- | --- | --- | | `type` | [`GroupTargetType`](../../doc/models/group-target-type.md) | Required | The type of object indicated by the id attribute. | -| `id` | `Integer` | Optional | The id of the target customer or subscription to group the existing subscription with. Ignored and should not be included if type is "self" , "parent", or "eldest" | +| `id` | `Integer` | Optional | The id of the target customer or subscription to group the existing subscription with. Ignored and should not be included if type is "self", "parent", or "eldest". | -## Example (as JSON) +## Example -```json -{ - "type": "self", - "id": 134 -} +```ruby +group_target = GroupTarget.new( + type: GroupTargetType::ENUM_SELF, + id: 50 +) ``` diff --git a/doc/models/group-type.md b/doc/models/group-type.md index bc9c31b9..cd65ce42 100644 --- a/doc/models/group-type.md +++ b/doc/models/group-type.md @@ -12,3 +12,9 @@ | `SINGLE_CUSTOMER` | | `MULTIPLE_CUSTOMERS` | +## Example + +```ruby +group_type = GroupType::SINGLE_CUSTOMER +``` + diff --git a/doc/models/historic-usage.md b/doc/models/historic-usage.md index 833233bf..89482b16 100644 --- a/doc/models/historic-usage.md +++ b/doc/models/historic-usage.md @@ -1,7 +1,7 @@ # Historic Usage -Optional for Event Based Components. If the `include=historic_usages` query param is provided, the last ten billing periods will be returned. +(Optional) For Event Based Components. If the `include=historic_usages` query param is provided, the last ten billing periods will be returned. ## Structure @@ -15,13 +15,13 @@ Optional for Event Based Components. If the `include=historic_usages` query para | `billing_period_starts_at` | `DateTime` | Optional | Start date of billing period | | `billing_period_ends_at` | `DateTime` | Optional | End date of billing period | -## Example (as JSON) +## Example -```json -{ - "total_usage_quantity": 26.6, - "billing_period_starts_at": "2016-03-13T12:52:32.123Z", - "billing_period_ends_at": "2016-03-13T12:52:32.123Z" -} +```ruby +historic_usage = HistoricUsage.new( + total_usage_quantity: 247.74, + billing_period_starts_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + billing_period_ends_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/include-not-null.md b/doc/models/include-not-null.md index 694ffcf9..f10a04fe 100644 --- a/doc/models/include-not-null.md +++ b/doc/models/include-not-null.md @@ -15,7 +15,7 @@ Passed as a parameter to list methods to return only non null values. ## Example -``` -not_null +```ruby +include_not_null = IncludeNotNull::NOT_NULL ``` diff --git a/doc/models/include-null-or-not-null.md b/doc/models/include-null-or-not-null.md index 5ca912d2..9f504232 100644 --- a/doc/models/include-null-or-not-null.md +++ b/doc/models/include-null-or-not-null.md @@ -16,7 +16,7 @@ Allows to filter by `not_null` or `null`. ## Example -``` -not_null +```ruby +include_null_or_not_null = IncludeNullOrNotNull::NOT_NULL ``` diff --git a/doc/models/include-option.md b/doc/models/include-option.md index 0ad125f0..c6f9c809 100644 --- a/doc/models/include-option.md +++ b/doc/models/include-option.md @@ -12,3 +12,9 @@ | `EXCLUDE` | | `INCLUDE` | +## Example + +```ruby +include_option = IncludeOption::EXCLUDE +``` + diff --git a/doc/models/interval-unit.md b/doc/models/interval-unit.md index 7e4cab3b..572ccfd8 100644 --- a/doc/models/interval-unit.md +++ b/doc/models/interval-unit.md @@ -12,3 +12,9 @@ | `DAY` | | `MONTH` | +## Example + +```ruby +interval_unit = IntervalUnit::DAY +``` + diff --git a/doc/models/invoice-address.md b/doc/models/invoice-address.md index d78f2d77..936434b0 100644 --- a/doc/models/invoice-address.md +++ b/doc/models/invoice-address.md @@ -16,15 +16,15 @@ | `zip` | `String` | Optional | - | | `country` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" -} +## Example + +```ruby +invoice_address = InvoiceAddress.new( + street: 'street8', + line2: 'line22', + city: 'city8', + state: 'state4', + zip: 'zip2' +) ``` diff --git a/doc/models/invoice-avatax-details.md b/doc/models/invoice-avatax-details.md index 9da4f1e0..a7965cf6 100644 --- a/doc/models/invoice-avatax-details.md +++ b/doc/models/invoice-avatax-details.md @@ -15,15 +15,15 @@ | `commit_date` | `DateTime` | Optional | - | | `modify_date` | `DateTime` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 112, - "status": "status2", - "document_code": "document_code0", - "commit_date": "2016-03-13T12:52:32.123Z", - "modify_date": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +invoice_avatax_details = InvoiceAvataxDetails.new( + id: 18, + status: 'status2', + document_code: 'document_code0', + commit_date: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + modify_date: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/invoice-balance-item.md b/doc/models/invoice-balance-item.md index 02496fd9..f709ffe9 100644 --- a/doc/models/invoice-balance-item.md +++ b/doc/models/invoice-balance-item.md @@ -13,13 +13,13 @@ | `number` | `String` | Optional | - | | `outstanding_amount` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "number": "number6", - "outstanding_amount": "outstanding_amount6" -} +## Example + +```ruby +invoice_balance_item = InvoiceBalanceItem.new( + uid: 'uid4', + number: 'number2', + outstanding_amount: 'outstanding_amount0' +) ``` diff --git a/doc/models/invoice-consolidation-level.md b/doc/models/invoice-consolidation-level.md index 8b4786e9..b52e5b9d 100644 --- a/doc/models/invoice-consolidation-level.md +++ b/doc/models/invoice-consolidation-level.md @@ -1,7 +1,7 @@ # Invoice Consolidation Level -Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values: +Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values: * "none": A normal invoice with no consolidation. * "child": An invoice segment which has been combined into a consolidated invoice. @@ -23,3 +23,9 @@ See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/ | `CHILD` | | `PARENT` | +## Example + +```ruby +invoice_consolidation_level = InvoiceConsolidationLevel::NONE +``` + diff --git a/doc/models/invoice-credit.md b/doc/models/invoice-credit.md index 11f68de4..ea1746ab 100644 --- a/doc/models/invoice-credit.md +++ b/doc/models/invoice-credit.md @@ -17,15 +17,15 @@ | `original_amount` | `String` | Optional | - | | `applied_amount` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid6", - "credit_note_number": "credit_note_number0", - "credit_note_uid": "credit_note_uid0", - "transaction_time": "2016-03-13T12:52:32.123Z", - "memo": "memo0" -} +## Example + +```ruby +invoice_credit = InvoiceCredit.new( + uid: 'uid8', + credit_note_number: 'credit_note_number8', + credit_note_uid: 'credit_note_uid2', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + memo: 'memo2' +) ``` diff --git a/doc/models/invoice-custom-field.md b/doc/models/invoice-custom-field.md index a1e8e76d..1ecc728c 100644 --- a/doc/models/invoice-custom-field.md +++ b/doc/models/invoice-custom-field.md @@ -15,15 +15,15 @@ | `value` | `String` | Optional | **Constraints**: *Minimum Length*: `1` | | `metadatum_id` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "owner_id": 142, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 142 -} +## Example + +```ruby +invoice_custom_field = InvoiceCustomField.new( + owner_id: 238, + owner_type: CustomFieldOwner::CUSTOMER, + name: 'name4', + value: 'value6', + metadatum_id: 238 +) ``` diff --git a/doc/models/invoice-customer.md b/doc/models/invoice-customer.md index 68081c39..fe98e78c 100644 --- a/doc/models/invoice-customer.md +++ b/doc/models/invoice-customer.md @@ -1,7 +1,7 @@ # Invoice Customer -Information about the customer who is owner or recipient the invoiced subscription. +Information about the customer who is owner or recipient of the invoiced subscription. ## Structure @@ -19,15 +19,15 @@ Information about the customer who is owner or recipient the invoiced subscripti | `vat_number` | `String` | Optional | - | | `reference` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "chargify_id": 236, - "first_name": "first_name0", - "last_name": "last_name8", - "organization": "organization4", - "email": "email6" -} +```ruby +invoice_customer = InvoiceCustomer.new( + chargify_id: 52, + first_name: 'first_name0', + last_name: 'last_name8', + organization: 'organization4', + email: 'email6' +) ``` diff --git a/doc/models/invoice-date-field.md b/doc/models/invoice-date-field.md index 05d7f5f1..27c9a407 100644 --- a/doc/models/invoice-date-field.md +++ b/doc/models/invoice-date-field.md @@ -17,7 +17,7 @@ ## Example -``` -issue_date +```ruby +invoice_date_field = InvoiceDateField::DUE_DATE ``` diff --git a/doc/models/invoice-debit.md b/doc/models/invoice-debit.md index ad15ce3e..5476075d 100644 --- a/doc/models/invoice-debit.md +++ b/doc/models/invoice-debit.md @@ -18,15 +18,15 @@ | `original_amount` | `String` | Optional | - | | `applied_amount` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid2", - "debit_note_number": "debit_note_number2", - "debit_note_uid": "debit_note_uid8", - "role": "chargeback", - "transaction_time": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +invoice_debit = InvoiceDebit.new( + uid: 'uid2', + debit_note_number: 'debit_note_number2', + debit_note_uid: 'debit_note_uid2', + role: DebitNoteRole::CHARGEBACK, + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/invoice-discount-breakout.md b/doc/models/invoice-discount-breakout.md index c9f8da36..3d0ffdec 100644 --- a/doc/models/invoice-discount-breakout.md +++ b/doc/models/invoice-discount-breakout.md @@ -13,13 +13,13 @@ | `eligible_amount` | `String` | Optional | - | | `discount_amount` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "eligible_amount": "eligible_amount0", - "discount_amount": "discount_amount8" -} +## Example + +```ruby +invoice_discount_breakout = InvoiceDiscountBreakout.new( + uid: 'uid2', + eligible_amount: 'eligible_amount4', + discount_amount: 'discount_amount6' +) ``` diff --git a/doc/models/invoice-discount-source-type.md b/doc/models/invoice-discount-source-type.md index 7218f6c9..85eb707f 100644 --- a/doc/models/invoice-discount-source-type.md +++ b/doc/models/invoice-discount-source-type.md @@ -13,3 +13,9 @@ | `REFERRAL` | | `ENUM_AD_HOC_COUPON` | +## Example + +```ruby +invoice_discount_source_type = InvoiceDiscountSourceType::ENUM_AD_HOC_COUPON +``` + diff --git a/doc/models/invoice-discount-type.md b/doc/models/invoice-discount-type.md index 3e5355b5..6cc7aabb 100644 --- a/doc/models/invoice-discount-type.md +++ b/doc/models/invoice-discount-type.md @@ -13,3 +13,9 @@ | `FLAT_AMOUNT` | | `ROLLOVER` | +## Example + +```ruby +invoice_discount_type = InvoiceDiscountType::ROLLOVER +``` + diff --git a/doc/models/invoice-discount.md b/doc/models/invoice-discount.md index a7c394fc..333c12b9 100644 --- a/doc/models/invoice-discount.md +++ b/doc/models/invoice-discount.md @@ -22,15 +22,15 @@ | `transaction_id` | `Integer` | Optional | - | | `line_item_breakouts` | [`Array[InvoiceDiscountBreakout]`](../../doc/models/invoice-discount-breakout.md) | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid0", - "title": "title4", - "description": "description0", - "code": "code8", - "source_type": "Coupon" -} +## Example + +```ruby +invoice_discount = InvoiceDiscount.new( + uid: 'uid2', + title: 'title2', + description: 'description8', + code: 'code0', + source_type: InvoiceDiscountSourceType::REFERRAL +) ``` diff --git a/doc/models/invoice-display-settings.md b/doc/models/invoice-display-settings.md index c9732ba9..1c4e7e9a 100644 --- a/doc/models/invoice-display-settings.md +++ b/doc/models/invoice-display-settings.md @@ -12,12 +12,12 @@ | `hide_zero_subtotal_lines` | `TrueClass \| FalseClass` | Optional | - | | `include_discounts_on_lines` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "hide_zero_subtotal_lines": false, - "include_discounts_on_lines": false -} +```ruby +invoice_display_settings = InvoiceDisplaySettings.new( + hide_zero_subtotal_lines: false, + include_discounts_on_lines: false +) ``` diff --git a/doc/models/invoice-event-payment-method.md b/doc/models/invoice-event-payment-method.md index 8df097ea..701da614 100644 --- a/doc/models/invoice-event-payment-method.md +++ b/doc/models/invoice-event-payment-method.md @@ -15,3 +15,9 @@ | `EXTERNAL` | | `PAYPAL_ACCOUNT` | +## Example + +```ruby +invoice_event_payment_method = InvoiceEventPaymentMethod::BANK_ACCOUNT +``` + diff --git a/doc/models/invoice-event-type.md b/doc/models/invoice-event-type.md index c6c09926..988bdca4 100644 --- a/doc/models/invoice-event-type.md +++ b/doc/models/invoice-event-type.md @@ -27,3 +27,9 @@ Invoice Event Type | `FAILED_PAYMENT` | | `CHANGE_CHARGEBACK_STATUS` | +## Example + +```ruby +invoice_event_type = InvoiceEventType::REMOVE_PAYMENT +``` + diff --git a/doc/models/invoice-issued.md b/doc/models/invoice-issued.md index 20939371..ec0d9e31 100644 --- a/doc/models/invoice-issued.md +++ b/doc/models/invoice-issued.md @@ -25,33 +25,33 @@ | `consolidation_level` | `String` | Required | - | | `line_items` | [`Array[InvoiceLineItemEventData]`](../../doc/models/invoice-line-item-event-data.md) | Required | - | -## Example (as JSON) - -```json -{ - "uid": "uid4", - "number": "number8", - "role": "role2", - "due_date": "2016-03-13", - "issue_date": "issue_date0", - "paid_date": "paid_date6", - "due_amount": "due_amount6", - "paid_amount": "paid_amount4", - "tax_amount": "tax_amount2", - "refund_amount": "refund_amount0", - "total_amount": "total_amount0", - "status_amount": "status_amount4", - "product_name": "product_name0", - "consolidation_level": "consolidation_level4", - "line_items": [ - { - "uid": "uid8", - "title": "title4", - "description": "description8", - "quantity": 102, - "quantity_delta": 204 - } +## Example + +```ruby +invoice_issued = InvoiceIssued.new( + uid: 'uid0', + number: 'number8', + role: 'role4', + due_date: Date.iso8601('2016-03-13'), + issue_date: 'issue_date6', + paid_date: 'paid_date0', + due_amount: 'due_amount2', + paid_amount: 'paid_amount2', + tax_amount: 'tax_amount4', + refund_amount: 'refund_amount6', + total_amount: 'total_amount6', + status_amount: 'status_amount0', + product_name: 'product_name6', + consolidation_level: 'consolidation_level2', + line_items: [ + InvoiceLineItemEventData.new( + uid: 'uid8', + title: 'title4', + description: 'description8', + quantity: 102, + quantity_delta: 204 + ) ] -} +) ``` diff --git a/doc/models/invoice-line-item-component-cost-data.md b/doc/models/invoice-line-item-component-cost-data.md index 3e270892..c377fa31 100644 --- a/doc/models/invoice-line-item-component-cost-data.md +++ b/doc/models/invoice-line-item-component-cost-data.md @@ -11,33 +11,19 @@ | --- | --- | --- | --- | | `rates` | [`Array[ComponentCostData]`](../../doc/models/component-cost-data.md) | Optional | - | -## Example (as JSON) - -```json -{ - "rates": [ - { - "component_code_id": 116, - "price_point_id": 226, - "product_id": 94, - "quantity": "quantity0", - "amount": "amount6" - }, - { - "component_code_id": 116, - "price_point_id": 226, - "product_id": 94, - "quantity": "quantity0", - "amount": "amount6" - }, - { - "component_code_id": 116, - "price_point_id": 226, - "product_id": 94, - "quantity": "quantity0", - "amount": "amount6" - } +## Example + +```ruby +invoice_line_item_component_cost_data = InvoiceLineItemComponentCostData.new( + rates: [ + ComponentCostData.new( + component_code_id: 116, + price_point_id: 226, + product_id: 94, + quantity: 'quantity0', + amount: 'amount6' + ) ] -} +) ``` diff --git a/doc/models/invoice-line-item-event-data.md b/doc/models/invoice-line-item-event-data.md index 53e381ee..e81c7c1b 100644 --- a/doc/models/invoice-line-item-event-data.md +++ b/doc/models/invoice-line-item-event-data.md @@ -30,15 +30,15 @@ | `billing_schedule_item_id` | `Integer` | Optional | - | | `custom_item` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid4", - "title": "title0", - "description": "description6", - "quantity": 40, - "quantity_delta": 114 -} +## Example + +```ruby +invoice_line_item_event_data = InvoiceLineItemEventData.new( + uid: 'uid0', + title: 'title6', + description: 'description0', + quantity: 188, + quantity_delta: 34 +) ``` diff --git a/doc/models/invoice-line-item-pricing-detail.md b/doc/models/invoice-line-item-pricing-detail.md index 348fa7e9..1dc3c85f 100644 --- a/doc/models/invoice-line-item-pricing-detail.md +++ b/doc/models/invoice-line-item-pricing-detail.md @@ -12,12 +12,12 @@ | `label` | `String` | Optional | - | | `amount` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "label": "label0", - "amount": "amount2" -} +```ruby +invoice_line_item_pricing_detail = InvoiceLineItemPricingDetail.new( + label: 'label0', + amount: 'amount2' +) ``` diff --git a/doc/models/invoice-line-item.md b/doc/models/invoice-line-item.md index a1537332..1ae89bfb 100644 --- a/doc/models/invoice-line-item.md +++ b/doc/models/invoice-line-item.md @@ -9,19 +9,19 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `uid` | `String` | Optional | Unique identifier for the line item. Useful when cross-referencing the line against individual discounts in the `discounts` or `taxes` lists. | +| `uid` | `String` | Optional | Unique identifier for the line item. Useful when cross-referencing the line against individual discounts in the `discounts` or `taxes` lists. | | `title` | `String` | Optional | A short descriptor for the charge or item represented by this line. | -| `description` | `String` | Optional | Detailed description for the charge or item represented by this line. May include proration details in plain text.

Note: this string may contain line breaks that are hints for the best display format on the invoice. | +| `description` | `String` | Optional | Detailed description for the charge or item represented by this line. May include proration details in plain text.

Note: this string may contain line breaks that are hints for the best display format on the invoice. | | `quantity` | `String` | Optional | The quantity or count of units billed by the line item.

This is a decimal number represented as a string. (See "About Decimal Numbers".) | -| `unit_price` | `String` | Optional | The price per unit for the line item.

When tiered pricing was used (i.e. not every unit was actually priced at the same price) this will be the blended average cost per unit and the `tiered_unit_price` field will be set to `true`. | +| `unit_price` | `String` | Optional | The price per unit for the line item.

When tiered pricing was used (i.e., not every unit was actually priced at the same price) this will be the blended average cost per unit and the `tiered_unit_price` field will be set to `true`. | | `subtotal_amount` | `String` | Optional | The line subtotal, generally calculated as `quantity * unit_price`. This is the canonical amount of record for the line - when rounding differences are in play, `subtotal_amount` takes precedence over the value derived from `quantity * unit_price` (which may not have the proper precision to exactly equal this amount). | | `discount_amount` | `String` | Optional | The approximate discount applied to just this line.

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total discount among many lines. Several lines may have been summed prior to applying the discount to arrive at `discount_amount` for the invoice - backing that out to the discount on a single line may introduce rounding or precision errors. | | `tax_amount` | `String` | Optional | The approximate tax applied to just this line.

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total tax among many lines. Several lines may have been summed prior to applying the tax rate to arrive at `tax_amount` for the invoice - backing that out to the tax on a single line may introduce rounding or precision errors. | | `tax_included` | `TrueClass \| FalseClass` | Optional | Whether the unit price for this line item is tax-inclusive.

When `true`, `unit_price` already includes tax and `tax_amount` represents the portion of the price attributable to tax. When `false`, any applicable tax is added on top of the price.

The value is inherited from the source price point's `tax_included` setting. Custom or ad-hoc line items (which have no associated price point) always return `false`. | -| `total_amount` | `String` | Optional | The non-canonical total amount for the line.

`subtotal_amount` is the canonical amount for a line. The invoice `total_amount` is derived from the sum of the line `subtotal_amount`s and discounts or taxes applied thereafter. Therefore, due to rounding or precision errors, the sum of line `total_amount`s may not equal the invoice `total_amount`. | +| `total_amount` | `String` | Optional | The non-canonical total amount for the line.

`subtotal_amount` is the canonical amount for a line. The invoice `total_amount` is derived from the sum of the line `subtotal_amount`s and discounts or taxes applied thereafter. Therefore, due to rounding or precision errors, the sum of line `total_amount`s may not equal the invoice `total_amount`. | | `tiered_unit_price` | `TrueClass \| FalseClass` | Optional | When `true`, indicates that the actual pricing scheme for the line was tiered, so the `unit_price` shown is the blended average for all units. | -| `period_range_start` | `Date` | Optional | Start date for the period covered by this line. The format is `"YYYY-MM-DD"`.

* For periodic charges paid in advance, this date will match the billing date, and the end date will be in the future.
* For periodic charges paid in arrears (e.g. metered charges), this date will be the date of the previous billing, and the end date will be the current billing date.
* For non-periodic charges, this date and the end date will match. | -| `period_range_end` | `Date` | Optional | End date for the period covered by this line. The format is `"YYYY-MM-DD"`.

* For periodic charges paid in advance, this date will match the next (future) billing date.
* For periodic charges paid in arrears (e.g. metered charges), this date will be the date of the current billing date.
* For non-periodic charges, this date and the start date will match. | +| `period_range_start` | `Date` | Optional | Start date for the period covered by this line. The format is `"YYYY-MM-DD"`.

* For periodic charges paid in advance, this date will match the billing date, and the end date will be in the future.
* For periodic charges paid in arrears (e.g., metered charges), this date will be the date of the previous billing, and the end date will be the current billing date.
* For non-periodic charges, this date and the end date will match. | +| `period_range_end` | `Date` | Optional | End date for the period covered by this line. The format is `"YYYY-MM-DD"`.

* For periodic charges paid in advance, this date will match the next (future) billing date.
* For periodic charges paid in arrears (e.g., metered charges), this date will be the date of the current billing date.
* For non-periodic charges, this date and the start date will match. | | `transaction_id` | `Integer` | Optional | - | | `product_id` | `Integer` | Optional | The ID of the product subscribed when the charge was made.

This may be set even for component charges, so true product-only (non-component) charges will also have a nil `component_id`. | | `product_version` | `Integer` | Optional | The version of the product subscribed when the charge was made. | @@ -35,15 +35,15 @@ | `kind` | `String` | Optional | - | | `prepaid_allocation_expires_at` | `Date` | Optional | The date a prepaid allocation is set to expire. Only present on line items representing prepaid component allocations. The format is `"YYYY-MM-DD"`. | -## Example (as JSON) +## Example -```json -{ - "uid": "uid4", - "title": "title0", - "description": "description4", - "quantity": "quantity0", - "unit_price": "unit_price2" -} +```ruby +invoice_line_item = InvoiceLineItem.new( + uid: 'uid4', + title: 'title0', + description: 'description4', + quantity: 'quantity0', + unit_price: 'unit_price2' +) ``` diff --git a/doc/models/invoice-payer-change.md b/doc/models/invoice-payer-change.md index 35d4ae7a..4bcfd36f 100644 --- a/doc/models/invoice-payer-change.md +++ b/doc/models/invoice-payer-change.md @@ -14,14 +14,14 @@ | `organization` | `String` | Optional | - | | `email` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "first_name": "first_name2", - "last_name": "last_name0", - "organization": "organization4", - "email": "email4" -} +## Example + +```ruby +invoice_payer_change = InvoicePayerChange.new( + first_name: 'first_name0', + last_name: 'last_name8', + organization: 'organization4', + email: 'email6' +) ``` diff --git a/doc/models/invoice-payer.md b/doc/models/invoice-payer.md index a99f2b81..f7a5d78b 100644 --- a/doc/models/invoice-payer.md +++ b/doc/models/invoice-payer.md @@ -16,15 +16,15 @@ | `email` | `String` | Optional | - | | `vat_number` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "chargify_id": 46, - "first_name": "first_name4", - "last_name": "last_name2", - "organization": "organization8", - "email": "email2" -} +## Example + +```ruby +invoice_payer = InvoicePayer.new( + chargify_id: 108, + first_name: 'first_name2', + last_name: 'last_name0', + organization: 'organization4', + email: 'email4' +) ``` diff --git a/doc/models/invoice-payment-application.md b/doc/models/invoice-payment-application.md index e1ec2c5f..753c3043 100644 --- a/doc/models/invoice-payment-application.md +++ b/doc/models/invoice-payment-application.md @@ -13,13 +13,13 @@ | `application_uid` | `String` | Optional | Unique identifier for the payment. It has the prefix "pmt_" followed by alphanumeric characters. | | `applied_amount` | `String` | Optional | Dollar amount of the paid invoice. | -## Example (as JSON) - -```json -{ - "invoice_uid": "invoice_uid2", - "application_uid": "application_uid4", - "applied_amount": "applied_amount6" -} +## Example + +```ruby +invoice_payment_application = InvoicePaymentApplication.new( + invoice_uid: 'invoice_uid4', + application_uid: 'application_uid8', + applied_amount: 'applied_amount4' +) ``` diff --git a/doc/models/invoice-payment-method-type.md b/doc/models/invoice-payment-method-type.md index a920712d..64223df7 100644 --- a/doc/models/invoice-payment-method-type.md +++ b/doc/models/invoice-payment-method-type.md @@ -18,3 +18,9 @@ The type of payment method used. Defaults to other. | `ACH` | | `OTHER` | +## Example + +```ruby +invoice_payment_method_type = InvoicePaymentMethodType::CREDIT_CARD +``` + diff --git a/doc/models/invoice-payment-method.md b/doc/models/invoice-payment-method.md index 11c3a750..8e2b47de 100644 --- a/doc/models/invoice-payment-method.md +++ b/doc/models/invoice-payment-method.md @@ -18,15 +18,15 @@ | `last_four` | `String` | Optional | - | | `masked_card_number` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "details": "details8", - "kind": "kind6", - "memo": "memo2", - "type": "type8", - "card_brand": "card_brand8" -} +## Example + +```ruby +invoice_payment_method = InvoicePaymentMethod.new( + details: 'details2', + kind: 'kind0', + memo: 'memo6', + type: 'type2', + card_brand: 'card_brand4' +) ``` diff --git a/doc/models/invoice-payment-type.md b/doc/models/invoice-payment-type.md index 8283fc2f..1a131104 100644 --- a/doc/models/invoice-payment-type.md +++ b/doc/models/invoice-payment-type.md @@ -16,3 +16,9 @@ The type of payment to be applied to an Invoice. Defaults to external. | `SERVICE_CREDIT` | | `PAYMENT` | +## Example + +```ruby +invoice_payment_type = InvoicePaymentType::EXTERNAL +``` + diff --git a/doc/models/invoice-payment.md b/doc/models/invoice-payment.md index 2806a988..0e69cbff 100644 --- a/doc/models/invoice-payment.md +++ b/doc/models/invoice-payment.md @@ -22,21 +22,21 @@ | `received_on` | `Date` | Optional | Date reflecting when the payment was received from a customer. Must be in the past. Applicable only to
`external` payments. | | `uid` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "transaction_time": "2016-03-13T12:52:32.123Z", - "memo": "memo6", - "original_amount": "original_amount6", - "applied_amount": "applied_amount6", - "payment_method": { - "details": "details0", - "kind": "kind8", - "memo": "memo4", - "type": "type0", - "card_brand": "card_brand6" - } -} +## Example + +```ruby +invoice_payment = InvoicePayment.new( + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + memo: 'memo4', + original_amount: 'original_amount4', + applied_amount: 'applied_amount8', + payment_method: InvoicePaymentMethod.new( + details: 'details0', + kind: 'kind8', + memo: 'memo4', + type: 'type0', + card_brand: 'card_brand6' + ) +) ``` diff --git a/doc/models/invoice-pre-payment.md b/doc/models/invoice-pre-payment.md index a4c7799e..b524d85b 100644 --- a/doc/models/invoice-pre-payment.md +++ b/doc/models/invoice-pre-payment.md @@ -13,13 +13,13 @@ | `amount_in_cents` | `Integer` | Optional | The amount in cents of the prepayment that was created as a result of this payment. | | `ending_balance_in_cents` | `Integer` | Optional | The total balance of the prepayment account for this subscription including any prior prepayments | -## Example (as JSON) - -```json -{ - "subscription_id": 180, - "amount_in_cents": 100, - "ending_balance_in_cents": 60 -} +## Example + +```ruby +invoice_pre_payment = InvoicePrePayment.new( + subscription_id: 40, + amount_in_cents: 240, + ending_balance_in_cents: 56 +) ``` diff --git a/doc/models/invoice-previous-balance.md b/doc/models/invoice-previous-balance.md index 3bdd43d5..11d1b102 100644 --- a/doc/models/invoice-previous-balance.md +++ b/doc/models/invoice-previous-balance.md @@ -12,18 +12,28 @@ | `captured_at` | `DateTime` | Optional | - | | `invoices` | [`Array[InvoiceBalanceItem]`](../../doc/models/invoice-balance-item.md) | Optional | - | -## Example (as JSON) - -```json -{ - "captured_at": "2016-03-13T12:52:32.123Z", - "invoices": [ - { - "uid": "uid6", - "number": "number6", - "outstanding_amount": "outstanding_amount8" - } +## Example + +```ruby +invoice_previous_balance = InvoicePreviousBalance.new( + captured_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoices: [ + InvoiceBalanceItem.new( + uid: 'uid6', + number: 'number6', + outstanding_amount: 'outstanding_amount8' + ), + InvoiceBalanceItem.new( + uid: 'uid6', + number: 'number6', + outstanding_amount: 'outstanding_amount8' + ), + InvoiceBalanceItem.new( + uid: 'uid6', + number: 'number6', + outstanding_amount: 'outstanding_amount8' + ) ] -} +) ``` diff --git a/doc/models/invoice-refund.md b/doc/models/invoice-refund.md index 6c6ca4a6..be812cbe 100644 --- a/doc/models/invoice-refund.md +++ b/doc/models/invoice-refund.md @@ -19,15 +19,15 @@ | `gateway_handle` | `String` | Optional | - | | `ach_late_reject` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) - -```json -{ - "transaction_id": 172, - "payment_id": 42, - "memo": "memo6", - "original_amount": "original_amount6", - "applied_amount": "applied_amount6" -} +## Example + +```ruby +invoice_refund = InvoiceRefund.new( + transaction_id: 0, + payment_id: 126, + memo: 'memo0', + original_amount: 'original_amount0', + applied_amount: 'applied_amount2' +) ``` diff --git a/doc/models/invoice-response.md b/doc/models/invoice-response.md index 1f4ba040..11c5a682 100644 --- a/doc/models/invoice-response.md +++ b/doc/models/invoice-response.md @@ -11,21 +11,21 @@ | --- | --- | --- | --- | | `invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | - | -## Example (as JSON) - -```json -{ - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - } -} +## Example + +```ruby +invoice_response = InvoiceResponse.new( + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ) +) ``` diff --git a/doc/models/invoice-role.md b/doc/models/invoice-role.md index 2f75a786..404c37e1 100644 --- a/doc/models/invoice-role.md +++ b/doc/models/invoice-role.md @@ -20,3 +20,9 @@ | `BACKPORT` | | `BACKPORTBALANCERECONCILIATION` | +## Example + +```ruby +invoice_role = InvoiceRole::RENEWAL +``` + diff --git a/doc/models/invoice-seller.md b/doc/models/invoice-seller.md index 638387e2..93b57c9e 100644 --- a/doc/models/invoice-seller.md +++ b/doc/models/invoice-seller.md @@ -16,20 +16,20 @@ Information about the seller (merchant) listed on the masthead of the invoice. | `phone` | `String` | Optional | - | | `logo_url` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "name": "name0", - "address": { - "street": "street6", - "line2": "line20", - "city": "city6", - "state": "state2", - "zip": "zip0" - }, - "phone": "phone0", - "logo_url": "logo_url0" -} +## Example + +```ruby +invoice_seller = InvoiceSeller.new( + name: 'name2', + address: InvoiceAddress.new( + street: 'street6', + line2: 'line20', + city: 'city6', + state: 'state2', + zip: 'zip0' + ), + phone: 'phone2', + logo_url: 'logo_url2' +) ``` diff --git a/doc/models/invoice-sort-field.md b/doc/models/invoice-sort-field.md index 83fcdee2..a1e3d82f 100644 --- a/doc/models/invoice-sort-field.md +++ b/doc/models/invoice-sort-field.md @@ -20,7 +20,7 @@ ## Example -``` -total_amount +```ruby +invoice_sort_field = InvoiceSortField::DUE_AMOUNT ``` diff --git a/doc/models/invoice-status.md b/doc/models/invoice-status.md index 87ba0765..124c20b3 100644 --- a/doc/models/invoice-status.md +++ b/doc/models/invoice-status.md @@ -19,3 +19,9 @@ The current status of the invoice. See [Invoice Statuses](https://maxio.zendesk. | `CANCELED` | | `PROCESSING` | +## Example + +```ruby +invoice_status = InvoiceStatus::PROCESSING +``` + diff --git a/doc/models/invoice-tax-breakout.md b/doc/models/invoice-tax-breakout.md index 1d814f82..db86c02b 100644 --- a/doc/models/invoice-tax-breakout.md +++ b/doc/models/invoice-tax-breakout.md @@ -14,14 +14,14 @@ | `tax_amount` | `String` | Optional | - | | `tax_exempt_amount` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid2", - "taxable_amount": "taxable_amount6", - "tax_amount": "tax_amount6", - "tax_exempt_amount": "tax_exempt_amount2" -} +## Example + +```ruby +invoice_tax_breakout = InvoiceTaxBreakout.new( + uid: 'uid2', + taxable_amount: 'taxable_amount6', + tax_amount: 'tax_amount4', + tax_exempt_amount: 'tax_exempt_amount2' +) ``` diff --git a/doc/models/invoice-tax-component-breakout.md b/doc/models/invoice-tax-component-breakout.md index 37a2cc33..a00525b0 100644 --- a/doc/models/invoice-tax-component-breakout.md +++ b/doc/models/invoice-tax-component-breakout.md @@ -24,15 +24,15 @@ | `state_assigned_no` | `String` | Optional | - | | `tax_sub_type` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "tax_rule_id": 226, - "percentage": "percentage0", - "country_code": "country_code8", - "subdivision_code": "subdivision_code6", - "tax_amount": "tax_amount4" -} +## Example + +```ruby +invoice_tax_component_breakout = InvoiceTaxComponentBreakout.new( + tax_rule_id: 4, + percentage: 'percentage0', + country_code: 'country_code2', + subdivision_code: 'subdivision_code4', + tax_amount: 'tax_amount6' +) ``` diff --git a/doc/models/invoice-tax.md b/doc/models/invoice-tax.md index 95e5f366..102e3fbd 100644 --- a/doc/models/invoice-tax.md +++ b/doc/models/invoice-tax.md @@ -24,15 +24,15 @@ | `type` | `String` | Optional | - | | `tax_exempt_amount` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "title": "title6", - "description": "description2", - "source_type": "Tax", - "source_id": 164 -} +## Example + +```ruby +invoice_tax = InvoiceTax.new( + uid: 'uid0', + title: 'title4', + description: 'description0', + source_type: ProformaInvoiceTaxSourceType::TAX, + source_id: 216 +) ``` diff --git a/doc/models/invoice.md b/doc/models/invoice.md index 793c2476..190d11ae 100644 --- a/doc/models/invoice.md +++ b/doc/models/invoice.md @@ -15,11 +15,11 @@ | `customer_id` | `Integer` | Optional | ID of the customer to which the invoice belongs. | | `subscription_id` | `Integer` | Optional | ID of the subscription that generated the invoice. | | `number` | `String` | Optional | A unique, identifying string that appears on the invoice and in places the invoice is referenced.

While the UID is long and not appropriate to show to customers, the number is usually shorter and consumable by the customer and the merchant alike. | -| `sequence_number` | `Integer` | Optional | A monotonically increasing number assigned to invoices as they are created. This number is unique within a site and can be used to sort and order invoices. | +| `sequence_number` | `Integer` | Optional | A monotonically increasing number assigned to invoices as they are created. This number is unique within a site and can be used to sort and order invoices. | | `transaction_time` | `DateTime` | Optional | - | | `created_at` | `DateTime` | Optional | - | | `updated_at` | `DateTime` | Optional | - | -| `issue_date` | `Date` | Optional | Date the invoice was issued to the customer. This is the date that the invoice was made available for payment.

The format is `"YYYY-MM-DD"`. | +| `issue_date` | `Date` | Optional | Date the invoice was issued to the customer. This is the date that the invoice was made available for payment.

The format is `"YYYY-MM-DD"`. | | `due_date` | `Date` | Optional | Date the invoice is due.

The format is `"YYYY-MM-DD"`. | | `paid_date` | `Date` | Optional | Date the invoice became fully paid.

If partial payments are applied to the invoice, this date will not be present until payment has been made in full.

The format is `"YYYY-MM-DD"`. | | `status` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Optional | The current status of the invoice. See [Invoice Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview#invoice-statuses) for more. | @@ -28,7 +28,7 @@ | `collection_method` | [`CollectionMethod`](../../doc/models/collection-method.md) | Optional | The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - `invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`. | | `payment_instructions` | `String` | Optional | A message that is printed on the invoice when it is marked for remittance collection. It is intended to describe to the customer how they may make payment, and is configured by the merchant. | | `currency` | `String` | Optional | The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. | -| `consolidation_level` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | +| `consolidation_level` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | | `parent_invoice_uid` | `String` | Optional | For invoices with `consolidation_level` of `child`, this specifies the UID of the parent (consolidated) invoice. | | `subscription_group_id` | `Integer` | Optional | - | | `parent_invoice_number` | `Integer` | Optional | For invoices with `consolidation_level` of `child`, this specifies the number of the parent (consolidated) invoice. | @@ -36,17 +36,17 @@ | `product_name` | `String` | Optional | The name of the product subscribed when the invoice was generated. | | `product_family_name` | `String` | Optional | The name of the product family subscribed when the invoice was generated. | | `seller` | [`InvoiceSeller`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the invoice. | -| `customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the invoiced subscription. | +| `customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient of the invoiced subscription. | | `payer` | [`InvoicePayer`](../../doc/models/invoice-payer.md) | Optional | - | | `recipient_emails` | `Array[String]` | Optional | **Constraints**: *Maximum Items*: `5` | | `net_terms` | `Integer` | Optional | - | -| `memo` | `String` | Optional | The memo printed on invoices of any collection type. This message is in control of the merchant. | +| `memo` | `String` | Optional | The memo printed on invoices of any collection type. This message is in control of the merchant. | | `billing_address` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The invoice billing address. | | `shipping_address` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | The invoice shipping address. | | `subtotal_amount` | `String` | Optional | Subtotal of the invoice, which is the sum of all line items before discounts or taxes. | | `discount_amount` | `String` | Optional | Total discount applied to the invoice. | | `tax_amount` | `String` | Optional | Total tax on the invoice. | -| `total_amount` | `String` | Optional | The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' | +| `total_amount` | `String` | Optional | The invoice total, which is `subtotal_amount - discount_amount + tax_amount`. | | `credit_amount` | `String` | Optional | The amount of credit (from credit notes) applied to this invoice.

Credits offset the amount due from the customer. | | `debit_amount` | `String` | Optional | - | | `refund_amount` | `String` | Optional | - | @@ -65,20 +65,21 @@ | `public_url` | `String` | Optional | The public URL of the invoice | | `previous_balance_data` | [`InvoicePreviousBalance`](../../doc/models/invoice-previous-balance.md) | Optional | - | | `public_url_expires_on` | `Date` | Optional | The format is `"YYYY-MM-DD"`. | +| `branding_theme_id` | `Integer` | Optional | The ID of the Branding Theme associated with this invoice. This value represents the Branding Theme used for invoice theming, such as themed invoice rendering. Available only when Branding Themes are enabled for the site. | -## Example (as JSON) +## Example -```json -{ - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 252, - "uid": "uid0", - "site_id": 178, - "customer_id": 34, - "subscription_id": 106 -} +```ruby +invoice = Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') +) ``` diff --git a/doc/models/issue-advance-invoice-request.md b/doc/models/issue-advance-invoice-request.md index 55fef0b1..ff022e47 100644 --- a/doc/models/issue-advance-invoice-request.md +++ b/doc/models/issue-advance-invoice-request.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `force` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "force": false -} +```ruby +issue_advance_invoice_request = IssueAdvanceInvoiceRequest.new( + force: false +) ``` diff --git a/doc/models/issue-invoice-event-data.md b/doc/models/issue-invoice-event-data.md index a709b7d6..d696bc0f 100644 --- a/doc/models/issue-invoice-event-data.md +++ b/doc/models/issue-invoice-event-data.md @@ -11,21 +11,21 @@ Example schema for an `issue_invoice` event | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `consolidation_level` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Required | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | +| `consolidation_level` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Required | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | | `from_status` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Required | The status of the invoice before event occurrence. See [Invoice Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview#invoice-statuses) for more. | | `to_status` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Required | The status of the invoice after event occurrence. See [Invoice Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview#invoice-statuses) for more. | | `due_amount` | `String` | Required | Amount due on the invoice, which is `total_amount - credit_amount - paid_amount`. | | `total_amount` | `String` | Required | The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' | -## Example (as JSON) +## Example -```json -{ - "consolidation_level": "none", - "from_status": "voided", - "to_status": "draft", - "due_amount": "due_amount6", - "total_amount": "total_amount0" -} +```ruby +issue_invoice_event_data = IssueInvoiceEventData.new( + consolidation_level: InvoiceConsolidationLevel::PARENT, + from_status: InvoiceStatus::DRAFT, + to_status: InvoiceStatus::VOIDED, + due_amount: 'due_amount6', + total_amount: 'total_amount0' +) ``` diff --git a/doc/models/issue-invoice-event.md b/doc/models/issue-invoice-event.md index 51ac435c..7689ca94 100644 --- a/doc/models/issue-invoice-event.md +++ b/doc/models/issue-invoice-event.md @@ -15,31 +15,31 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::ISSUE_INVOICE` | | `event_data` | [`IssueInvoiceEventData`](../../doc/models/issue-invoice-event-data.md) | Required | Example schema for an `issue_invoice` event | -## Example (as JSON) - -```json -{ - "id": 130, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "issue_invoice", - "event_data": { - "consolidation_level": "child", - "from_status": "open", - "to_status": "pending", - "due_amount": "due_amount8", - "total_amount": "total_amount2" - } -} +## Example + +```ruby +issue_invoice_event = IssueInvoiceEvent.new( + id: 238, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::ISSUE_INVOICE, + event_data: IssueInvoiceEventData.new( + consolidation_level: InvoiceConsolidationLevel::CHILD, + from_status: InvoiceStatus::OPEN, + to_status: InvoiceStatus::PENDING, + due_amount: 'due_amount8', + total_amount: 'total_amount2' + ) +) ``` diff --git a/doc/models/issue-invoice-request.md b/doc/models/issue-invoice-request.md index 504783cc..b0cfb4b2 100644 --- a/doc/models/issue-invoice-request.md +++ b/doc/models/issue-invoice-request.md @@ -9,13 +9,13 @@ | 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) +## Example -```json -{ - "on_failed_payment": "leave_open_invoice" -} +```ruby +issue_invoice_request = IssueInvoiceRequest.new( + on_failed_payment: FailedPaymentAction::LEAVE_OPEN_INVOICE +) ``` diff --git a/doc/models/issue-service-credit-request.md b/doc/models/issue-service-credit-request.md index bf725d8d..68ef1561 100644 --- a/doc/models/issue-service-credit-request.md +++ b/doc/models/issue-service-credit-request.md @@ -11,14 +11,14 @@ | --- | --- | --- | --- | | `service_credit` | [`IssueServiceCredit`](../../doc/models/issue-service-credit.md) | Required | - | -## Example (as JSON) - -```json -{ - "service_credit": { - "amount": 31.42, - "memo": "memo0" - } -} +## Example + +```ruby +issue_service_credit_request = IssueServiceCreditRequest.new( + service_credit: IssueServiceCredit.new( + amount: 31.42, + memo: 'memo0' + ) +) ``` diff --git a/doc/models/issue-service-credit.md b/doc/models/issue-service-credit.md index efb88559..a9c58d7f 100644 --- a/doc/models/issue-service-credit.md +++ b/doc/models/issue-service-credit.md @@ -12,12 +12,12 @@ | `amount` | Float \| String | Required | This is a container for one-of cases. | | `memo` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "amount": 5.82, - "memo": "memo4" -} +```ruby +issue_service_credit = IssueServiceCredit.new( + amount: 216.68, + memo: 'memo6' +) ``` diff --git a/doc/models/item-category.md b/doc/models/item-category.md index 8a73b8c3..e1c8d3ff 100644 --- a/doc/models/item-category.md +++ b/doc/models/item-category.md @@ -19,7 +19,7 @@ One of the following: Business Software, Consumer Software, Digital Services, Ph ## Example -``` -Business Software +```ruby +item_category = ItemCategory::ENUM_CONSUMER_SOFTWARE ``` diff --git a/doc/models/item-price-point-changed.md b/doc/models/item-price-point-changed.md index f717c5d3..8efd17ed 100644 --- a/doc/models/item-price-point-changed.md +++ b/doc/models/item-price-point-changed.md @@ -16,24 +16,24 @@ | `previous_price_point` | [`ItemPricePointData`](../../doc/models/item-price-point-data.md) | Required | - | | `current_price_point` | [`ItemPricePointData`](../../doc/models/item-price-point-data.md) | Required | - | -## Example (as JSON) - -```json -{ - "item_id": 66, - "item_type": "item_type6", - "item_handle": "item_handle4", - "item_name": "item_name8", - "previous_price_point": { - "id": 216, - "handle": "handle6", - "name": "name0" - }, - "current_price_point": { - "id": 218, - "handle": "handle6", - "name": "name0" - } -} +## Example + +```ruby +item_price_point_changed = ItemPricePointChanged.new( + item_id: 66, + item_type: 'item_type2', + item_handle: 'item_handle0', + item_name: 'item_name4', + previous_price_point: ItemPricePointData.new( + id: 216, + handle: 'handle6', + name: 'name0' + ), + current_price_point: ItemPricePointData.new( + id: 218, + handle: 'handle6', + name: 'name0' + ) +) ``` diff --git a/doc/models/item-price-point-data.md b/doc/models/item-price-point-data.md index 5ff77fc3..1e4979cc 100644 --- a/doc/models/item-price-point-data.md +++ b/doc/models/item-price-point-data.md @@ -13,13 +13,13 @@ | `handle` | `String` | Optional | - | | `name` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 192, - "handle": "handle6", - "name": "name0" -} +## Example + +```ruby +item_price_point_data = ItemPricePointData.new( + id: 180, + handle: 'handle2', + name: 'name6' +) ``` diff --git a/doc/models/line-item-kind.md b/doc/models/line-item-kind.md index 380d29ea..806973fa 100644 --- a/doc/models/line-item-kind.md +++ b/doc/models/line-item-kind.md @@ -22,3 +22,9 @@ A handle for the line item kind | `COUPON` | | `TAX` | +## Example + +```ruby +line_item_kind = LineItemKind::COUPON +``` + diff --git a/doc/models/line-item-transaction-type.md b/doc/models/line-item-transaction-type.md index f5847f6b..f6ed230d 100644 --- a/doc/models/line-item-transaction-type.md +++ b/doc/models/line-item-transaction-type.md @@ -19,3 +19,9 @@ A handle for the line item transaction type | `INFO_TRANSACTION` | | `PAYMENT_AUTHORIZATION` | +## Example + +```ruby +line_item_transaction_type = LineItemTransactionType::REFUND +``` + diff --git a/doc/models/list-components-filter.md b/doc/models/list-components-filter.md index 3330abbd..36148cfa 100644 --- a/doc/models/list-components-filter.md +++ b/doc/models/list-components-filter.md @@ -12,16 +12,16 @@ | `ids` | `Array[Integer]` | 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) +## Example -```json -{ - "ids": [ +```ruby +list_components_filter = ListComponentsFilter.new( + ids: [ 1, 2, 3 ], - "use_site_exchange_rate": false -} + use_site_exchange_rate: false +) ``` diff --git a/doc/models/list-components-price-points-include.md b/doc/models/list-components-price-points-include.md index 31cc7ea7..08004a1c 100644 --- a/doc/models/list-components-price-points-include.md +++ b/doc/models/list-components-price-points-include.md @@ -13,7 +13,7 @@ ## Example -``` -currency_prices +```ruby +list_components_price_points_include = ListComponentsPricePointsInclude::CURRENCY_PRICES ``` diff --git a/doc/models/list-components-price-points-response.md b/doc/models/list-components-price-points-response.md index bc6ff174..cac844e5 100644 --- a/doc/models/list-components-price-points-response.md +++ b/doc/models/list-components-price-points-response.md @@ -11,19 +11,19 @@ | --- | --- | --- | --- | | `price_points` | [`Array[ComponentPricePoint]`](../../doc/models/component-price-point.md) | Required | - | -## Example (as JSON) - -```json -{ - "price_points": [ - { - "id": 40, - "type": "default", - "default": false, - "name": "name2", - "pricing_scheme": "per_unit" - } +## Example + +```ruby +list_components_price_points_response = ListComponentsPricePointsResponse.new( + price_points: [ + ComponentPricePoint.new( + id: 40, + type: PricePointType::DEFAULT, + default: false, + name: 'name2', + pricing_scheme: PricingScheme::PER_UNIT + ) ] -} +) ``` diff --git a/doc/models/list-coupons-filter.md b/doc/models/list-coupons-filter.md index acfaba1f..d2915f1f 100644 --- a/doc/models/list-coupons-filter.md +++ b/doc/models/list-coupons-filter.md @@ -19,24 +19,24 @@ | `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | If true, restricts the list to coupons whose pricing is recalculated from the site’s current exchange rates, so their currency_prices array contains on-the-fly conversions rather than stored price records. If false, restricts the list to coupons that have manually defined amounts for each currency, ensuring the response includes the saved currency_prices entries instead of exchange-rate-derived values. Use in query `filter[use_site_exchange_rate]=true`. | | `include_archived` | `TrueClass \| FalseClass` | Optional | Controls returning archived coupons. | -## Example (as JSON) - -```json -{ - "start_date": "2011-12-17", - "end_date": "2011-12-15", - "start_datetime": "12/19/2011 09:15:30", - "end_datetime": "06/07/2019 17:20:06", - "ids": [ +## Example + +```ruby +list_coupons_filter = ListCouponsFilter.new( + date_field: BasicDateField::UPDATED_AT, + start_date: Date.iso8601('2011-12-17'), + end_date: Date.iso8601('2011-12-15'), + start_datetime: DateTimeHelper.from_rfc3339('2011-12-19T09:15:30+00:00'), + end_datetime: DateTimeHelper.from_rfc3339('2019-06-07T17:20:06Z'), + ids: [ 1, 2, 3 ], - "codes": [ - "free", - "free_trial" - ], - "date_field": "updated_at" -} + codes: [ + 'free', + 'free_trial' + ] +) ``` diff --git a/doc/models/list-credit-notes-response.md b/doc/models/list-credit-notes-response.md index 70d7cfa5..6b3aca78 100644 --- a/doc/models/list-credit-notes-response.md +++ b/doc/models/list-credit-notes-response.md @@ -11,19 +11,19 @@ | --- | --- | --- | --- | | `credit_notes` | [`Array[CreditNote]`](../../doc/models/credit-note.md) | Required | - | -## Example (as JSON) - -```json -{ - "credit_notes": [ - { - "uid": "uid2", - "site_id": 112, - "customer_id": 224, - "subscription_id": 40, - "number": "number0" - } +## Example + +```ruby +list_credit_notes_response = ListCreditNotesResponse.new( + credit_notes: [ + CreditNote.new( + uid: 'uid2', + site_id: 112, + customer_id: 224, + subscription_id: 40, + number: 'number0' + ) ] -} +) ``` diff --git a/doc/models/list-events-date-field.md b/doc/models/list-events-date-field.md index 7ac6c5f0..39bb4b8a 100644 --- a/doc/models/list-events-date-field.md +++ b/doc/models/list-events-date-field.md @@ -13,7 +13,7 @@ ## Example -``` -created_at +```ruby +list_events_date_field = ListEventsDateField::CREATED_AT ``` diff --git a/doc/models/list-invoice-events-response.md b/doc/models/list-invoice-events-response.md index 6bc71aaa..1e6115d7 100644 --- a/doc/models/list-invoice-events-response.md +++ b/doc/models/list-invoice-events-response.md @@ -14,52 +14,52 @@ | `per_page` | `Integer` | Optional | - | | `total_pages` | `Integer` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "events": [ - { - "event_type": "apply_credit_note", - "id": 214, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_data": { - "uid": "uid6", - "credit_note_number": "credit_note_number0", - "credit_note_uid": "credit_note_uid0", - "original_amount": "original_amount0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "memo": "memo0", - "role": "role0", - "consolidated_invoice": false, - "applied_credit_notes": [ - { - "uid": "uid4", - "number": "number8" - }, - { - "uid": "uid4", - "number": "number8" - }, - { - "uid": "uid4", - "number": "number8" - } +```ruby +list_invoice_events_response = ListInvoiceEventsResponse.new( + events: [ + ApplyCreditNoteEvent.new( + id: 214, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20 + ), + event_type: InvoiceEventType::APPLY_CREDIT_NOTE, + event_data: ApplyCreditNoteEventData.new( + uid: 'uid6', + credit_note_number: 'credit_note_number0', + credit_note_uid: 'credit_note_uid0', + original_amount: 'original_amount0', + applied_amount: 'applied_amount2', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + memo: 'memo0', + role: 'role0', + consolidated_invoice: false, + applied_credit_notes: [ + AppliedCreditNoteData.new( + uid: 'uid4', + number: 'number8' + ), + AppliedCreditNoteData.new( + uid: 'uid4', + number: 'number8' + ), + AppliedCreditNoteData.new( + uid: 'uid4', + number: 'number8' + ) ] - } - } + ) + ) ], - "page": 184, - "per_page": 96, - "total_pages": 194 -} + page: 76, + per_page: 244, + total_pages: 46 +) ``` diff --git a/doc/models/list-invoices-response.md b/doc/models/list-invoices-response.md index 2076f92f..dc0239d5 100644 --- a/doc/models/list-invoices-response.md +++ b/doc/models/list-invoices-response.md @@ -11,23 +11,23 @@ | --- | --- | --- | --- | | `invoices` | [`Array[Invoice]`](../../doc/models/invoice.md) | Required | - | -## Example (as JSON) - -```json -{ - "invoices": [ - { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 196, - "uid": "uid6", - "site_id": 122, - "customer_id": 234, - "subscription_id": 50 - } +## Example + +```ruby +list_invoices_response = ListInvoicesResponse.new( + invoices: [ + Invoice.new( + id: 196, + uid: 'uid6', + site_id: 122, + customer_id: 234, + subscription_id: 50, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ) ] -} +) ``` diff --git a/doc/models/list-metafields-response.md b/doc/models/list-metafields-response.md index 36e89e7d..57aa6126 100644 --- a/doc/models/list-metafields-response.md +++ b/doc/models/list-metafields-response.md @@ -15,29 +15,55 @@ | `per_page` | `Integer` | Optional | - | | `metafields` | [`Array[Metafield]`](../../doc/models/metafield.md) | Optional | - | -## Example (as JSON) - -```json -{ - "total_count": 210, - "current_page": 186, - "total_pages": 198, - "per_page": 92, - "metafields": [ - { - "id": 22, - "name": "name2", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0" - }, - "data_count": 10, - "input_type": "balance_tracker" - } +## Example + +```ruby +list_metafields_response = ListMetafieldsResponse.new( + total_count: 70, + current_page: 46, + total_pages: 58, + per_page: 232, + metafields: [ + Metafield.new( + id: 22, + name: 'name2', + scope: MetafieldScope.new( + csv: IncludeOption::EXCLUDE, + invoices: IncludeOption::EXCLUDE, + statements: IncludeOption::EXCLUDE, + portal: IncludeOption::EXCLUDE, + public_show: IncludeOption::EXCLUDE + ), + data_count: 10, + input_type: MetafieldInput::BALANCE_TRACKER + ), + Metafield.new( + id: 22, + name: 'name2', + scope: MetafieldScope.new( + csv: IncludeOption::EXCLUDE, + invoices: IncludeOption::EXCLUDE, + statements: IncludeOption::EXCLUDE, + portal: IncludeOption::EXCLUDE, + public_show: IncludeOption::EXCLUDE + ), + data_count: 10, + input_type: MetafieldInput::BALANCE_TRACKER + ), + Metafield.new( + id: 22, + name: 'name2', + scope: MetafieldScope.new( + csv: IncludeOption::EXCLUDE, + invoices: IncludeOption::EXCLUDE, + statements: IncludeOption::EXCLUDE, + portal: IncludeOption::EXCLUDE, + public_show: IncludeOption::EXCLUDE + ), + data_count: 10, + input_type: MetafieldInput::BALANCE_TRACKER + ) ] -} +) ``` diff --git a/doc/models/list-mrr-filter.md b/doc/models/list-mrr-filter.md index 308b2ba5..3009ff28 100644 --- a/doc/models/list-mrr-filter.md +++ b/doc/models/list-mrr-filter.md @@ -11,15 +11,15 @@ | --- | --- | --- | --- | | `subscription_ids` | `Array[Integer]` | Optional | Submit ids in order to limit results. Use in query: `filter[subscription_ids]=1,2,3`.

**Constraints**: *Minimum Items*: `1` | -## Example (as JSON) +## Example -```json -{ - "subscription_ids": [ +```ruby +list_mrr_filter = ListMrrFilter.new( + subscription_ids: [ 1, 2, 3 ] -} +) ``` diff --git a/doc/models/list-mrr-response-result.md b/doc/models/list-mrr-response-result.md index 76cfd538..71ddec8a 100644 --- a/doc/models/list-mrr-response-result.md +++ b/doc/models/list-mrr-response-result.md @@ -17,15 +17,15 @@ | `currency_symbol` | `String` | Optional | - | | `movements` | [`Array[Movement]`](../../doc/models/movement.md) | Optional | - | -## Example (as JSON) - -```json -{ - "page": 150, - "per_page": 238, - "total_pages": 16, - "total_entries": 112, - "currency": "currency8" -} +## Example + +```ruby +list_mrr_response_result = ListMRRResponseResult.new( + page: 170, + per_page: 82, + total_pages: 208, + total_entries: 48, + currency: 'currency6' +) ``` diff --git a/doc/models/list-mrr-response.md b/doc/models/list-mrr-response.md index dc0cbd64..f155400c 100644 --- a/doc/models/list-mrr-response.md +++ b/doc/models/list-mrr-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `mrr` | [`ListMRRResponseResult`](../../doc/models/list-mrr-response-result.md) | Required | - | -## Example (as JSON) - -```json -{ - "mrr": { - "page": 30, - "per_page": 198, - "total_pages": 92, - "total_entries": 188, - "currency": "currency4" - } -} +## Example + +```ruby +list_mrr_response = ListMRRResponse.new( + mrr: ListMRRResponseResult.new( + page: 30, + per_page: 198, + total_pages: 92, + total_entries: 188, + currency: 'currency4' + ) +) ``` diff --git a/doc/models/list-offers-response.md b/doc/models/list-offers-response.md index d89cc071..461f6951 100644 --- a/doc/models/list-offers-response.md +++ b/doc/models/list-offers-response.md @@ -11,33 +11,26 @@ | --- | --- | --- | --- | | `offers` | [`Array[Offer]`](../../doc/models/offer.md) | Optional | - | -## Example (as JSON) - -```json -{ - "offers": [ - { - "id": 12, - "site_id": 194, - "product_family_id": 16, - "product_id": 210, - "product_price_point_id": 134 - }, - { - "id": 12, - "site_id": 194, - "product_family_id": 16, - "product_id": 210, - "product_price_point_id": 134 - }, - { - "id": 12, - "site_id": 194, - "product_family_id": 16, - "product_id": 210, - "product_price_point_id": 134 - } +## Example + +```ruby +list_offers_response = ListOffersResponse.new( + offers: [ + Offer.new( + id: 12, + site_id: 194, + product_family_id: 16, + product_id: 210, + product_price_point_id: 134 + ), + Offer.new( + id: 12, + site_id: 194, + product_family_id: 16, + product_id: 210, + product_price_point_id: 134 + ) ] -} +) ``` diff --git a/doc/models/list-prepayment-date-field.md b/doc/models/list-prepayment-date-field.md index fb729cda..0e70edbb 100644 --- a/doc/models/list-prepayment-date-field.md +++ b/doc/models/list-prepayment-date-field.md @@ -14,7 +14,7 @@ ## Example -``` -created_at +```ruby +list_prepayment_date_field = ListPrepaymentDateField::CREATED_AT ``` diff --git a/doc/models/list-prepayments-filter.md b/doc/models/list-prepayments-filter.md index c47d40b7..473b5d77 100644 --- a/doc/models/list-prepayments-filter.md +++ b/doc/models/list-prepayments-filter.md @@ -13,13 +13,13 @@ | `start_date` | `Date` | Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns prepayments with a timestamp at or after midnight (12:00:00 AM) in your site's time zone on the date specified. Use in query: `filter[start_date]=2011-12-15`. | | `end_date` | `Date` | Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns prepayments 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`. | -## Example (as JSON) - -```json -{ - "date_field": "created_at", - "start_date": "2024-01-01", - "end_date": "2024-01-31" -} +## Example + +```ruby +list_prepayments_filter = ListPrepaymentsFilter.new( + date_field: ListPrepaymentDateField::CREATED_AT, + start_date: Date.iso8601('2024-01-01'), + end_date: Date.iso8601('2024-01-31') +) ``` diff --git a/doc/models/list-price-points-filter.md b/doc/models/list-price-points-filter.md index 4cf6e619..3c1184e4 100644 --- a/doc/models/list-price-points-filter.md +++ b/doc/models/list-price-points-filter.md @@ -18,25 +18,25 @@ | `ids` | `Array[Integer]` | Optional | Allows fetching price points with matching id based on provided values. Use in query: `filter[ids]=1,2,3`. | | `archived_at` | [`IncludeNullOrNotNull`](../../doc/models/include-null-or-not-null.md) | Optional | Allows fetching price points only if archived_at is present or not. Use in query: `filter[archived_at]=not_null`. | -## Example (as JSON) - -```json -{ - "start_date": "2011-12-17", - "end_date": "2011-12-15", - "start_datetime": "12/19/2011 09:15:30", - "end_datetime": "06/07/2019 17:20:06", - "type": [ - "catalog", - "default", - "custom" +## Example + +```ruby +list_price_points_filter = ListPricePointsFilter.new( + date_field: BasicDateField::UPDATED_AT, + start_date: Date.iso8601('2011-12-17'), + end_date: Date.iso8601('2011-12-15'), + start_datetime: DateTimeHelper.from_rfc3339('2011-12-19T09:15:30+00:00'), + end_datetime: DateTimeHelper.from_rfc3339('2019-06-07T17:20:06Z'), + type: [ + PricePointType::CATALOG, + PricePointType::DEFAULT, + PricePointType::CUSTOM ], - "ids": [ + ids: [ 1, 2, 3 - ], - "date_field": "updated_at" -} + ] +) ``` diff --git a/doc/models/list-product-price-points-response.md b/doc/models/list-product-price-points-response.md index 52ce0146..45cdf0d3 100644 --- a/doc/models/list-product-price-points-response.md +++ b/doc/models/list-product-price-points-response.md @@ -11,19 +11,19 @@ | --- | --- | --- | --- | | `price_points` | [`Array[ProductPricePoint]`](../../doc/models/product-price-point.md) | Required | - | -## Example (as JSON) - -```json -{ - "price_points": [ - { - "id": 40, - "name": "name2", - "handle": "handle8", - "price_in_cents": 108, - "interval": 92 - } +## Example + +```ruby +list_product_price_points_response = ListProductPricePointsResponse.new( + price_points: [ + ProductPricePoint.new( + id: 40, + name: 'name2', + handle: 'handle8', + price_in_cents: 108, + interval: 92 + ) ] -} +) ``` diff --git a/doc/models/list-products-filter.md b/doc/models/list-products-filter.md index 7f93d239..f80f0e38 100644 --- a/doc/models/list-products-filter.md +++ b/doc/models/list-products-filter.md @@ -13,19 +13,19 @@ | `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`. | -## Example (as JSON) +## Example -```json -{ - "ids": [ +```ruby +list_products_filter = ListProductsFilter.new( + ids: [ 1, 2, 3 ], - "prepaid_product_price_point": { - "product_price_point_id": "product_price_point_id2" - }, - "use_site_exchange_rate": false -} + prepaid_product_price_point: PrepaidProductPricePointFilter.new( + product_price_point_id: 'product_price_point_id2' + ), + use_site_exchange_rate: false +) ``` diff --git a/doc/models/list-products-include.md b/doc/models/list-products-include.md index f2847330..0a642751 100644 --- a/doc/models/list-products-include.md +++ b/doc/models/list-products-include.md @@ -13,7 +13,7 @@ ## Example -``` -prepaid_product_price_point +```ruby +list_products_include = ListProductsInclude::PREPAID_PRODUCT_PRICE_POINT ``` diff --git a/doc/models/list-products-price-points-include.md b/doc/models/list-products-price-points-include.md index 99e40235..bdebfd72 100644 --- a/doc/models/list-products-price-points-include.md +++ b/doc/models/list-products-price-points-include.md @@ -13,7 +13,7 @@ ## Example -``` -currency_prices +```ruby +list_products_price_points_include = ListProductsPricePointsInclude::CURRENCY_PRICES ``` diff --git a/doc/models/list-proforma-invoices-meta.md b/doc/models/list-proforma-invoices-meta.md index 0dd08f67..5578211f 100644 --- a/doc/models/list-proforma-invoices-meta.md +++ b/doc/models/list-proforma-invoices-meta.md @@ -14,14 +14,14 @@ | `total_pages` | `Integer` | Optional | - | | `status_code` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "total_count": 226, - "current_page": 202, - "total_pages": 214, - "status_code": 244 -} +## Example + +```ruby +list_proforma_invoices_meta = ListProformaInvoicesMeta.new( + total_count: 84, + current_page: 60, + total_pages: 72, + status_code: 102 +) ``` diff --git a/doc/models/list-proforma-invoices-response.md b/doc/models/list-proforma-invoices-response.md index 8c55bb81..7994f65b 100644 --- a/doc/models/list-proforma-invoices-response.md +++ b/doc/models/list-proforma-invoices-response.md @@ -12,39 +12,39 @@ | `proforma_invoices` | [`Array[ProformaInvoice]`](../../doc/models/proforma-invoice.md) | Optional | - | | `meta` | [`ListProformaInvoicesMeta`](../../doc/models/list-proforma-invoices-meta.md) | Optional | - | -## Example (as JSON) - -```json -{ - "proforma_invoices": [ - { - "uid": "uid0", - "site_id": 140, - "customer_id": 252, - "subscription_id": 68, - "number": 56 - }, - { - "uid": "uid0", - "site_id": 140, - "customer_id": 252, - "subscription_id": 68, - "number": 56 - }, - { - "uid": "uid0", - "site_id": 140, - "customer_id": 252, - "subscription_id": 68, - "number": 56 - } +## Example + +```ruby +list_proforma_invoices_response = ListProformaInvoicesResponse.new( + proforma_invoices: [ + ProformaInvoice.new( + uid: 'uid0', + site_id: 140, + customer_id: 252, + subscription_id: 68, + number: 56 + ), + ProformaInvoice.new( + uid: 'uid0', + site_id: 140, + customer_id: 252, + subscription_id: 68, + number: 56 + ), + ProformaInvoice.new( + uid: 'uid0', + site_id: 140, + customer_id: 252, + subscription_id: 68, + number: 56 + ) ], - "meta": { - "total_count": 150, - "current_page": 126, - "total_pages": 138, - "status_code": 168 - } -} + meta: ListProformaInvoicesMeta.new( + total_count: 150, + current_page: 126, + total_pages: 138, + status_code: 168 + ) +) ``` diff --git a/doc/models/list-public-keys-meta.md b/doc/models/list-public-keys-meta.md index f7b15c44..06d5bb0f 100644 --- a/doc/models/list-public-keys-meta.md +++ b/doc/models/list-public-keys-meta.md @@ -14,14 +14,14 @@ | `total_pages` | `Integer` | Optional | - | | `per_page` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "total_count": 22, - "current_page": 254, - "total_pages": 10, - "per_page": 24 -} +## Example + +```ruby +list_public_keys_meta = ListPublicKeysMeta.new( + total_count: 240, + current_page: 216, + total_pages: 228, + per_page: 62 +) ``` diff --git a/doc/models/list-public-keys-response.md b/doc/models/list-public-keys-response.md index 2764b331..3c81a1ac 100644 --- a/doc/models/list-public-keys-response.md +++ b/doc/models/list-public-keys-response.md @@ -12,28 +12,28 @@ | `chargify_js_keys` | [`Array[PublicKey]`](../../doc/models/public-key.md) | Optional | - | | `meta` | [`ListPublicKeysMeta`](../../doc/models/list-public-keys-meta.md) | Optional | - | -## Example (as JSON) - -```json -{ - "chargify_js_keys": [ - { - "public_key": "public_key8", - "requires_security_token": false, - "created_at": "2016-03-13T12:52:32.123Z" - }, - { - "public_key": "public_key8", - "requires_security_token": false, - "created_at": "2016-03-13T12:52:32.123Z" - } +## Example + +```ruby +list_public_keys_response = ListPublicKeysResponse.new( + chargify_js_keys: [ + PublicKey.new( + public_key: 'public_key8', + requires_security_token: false, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ), + PublicKey.new( + public_key: 'public_key8', + requires_security_token: false, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) ], - "meta": { - "total_count": 150, - "current_page": 126, - "total_pages": 138, - "per_page": 152 - } -} + meta: ListPublicKeysMeta.new( + total_count: 150, + current_page: 126, + total_pages: 138, + per_page: 152 + ) +) ``` diff --git a/doc/models/list-sale-rep-item.md b/doc/models/list-sale-rep-item.md index 6ead2309..1a817e59 100644 --- a/doc/models/list-sale-rep-item.md +++ b/doc/models/list-sale-rep-item.md @@ -15,31 +15,31 @@ | `mrr_data` | [`Hash[String, SaleRepItemMrr]`](../../doc/models/sale-rep-item-mrr.md) | Optional | - | | `test_mode` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) - -```json -{ - "mrr_data": { - "november_2019": { - "mrr": "$0.00", - "usage": "$0.00", - "recurring": "$0.00" - }, - "december_2019": { - "mrr": "$0.00", - "usage": "$0.00", - "recurring": "$0.00" - }, - "january_2020": { - "mrr": "$400.00", - "usage": "$0.00", - "recurring": "$400.00" - } +## Example + +```ruby +list_sale_rep_item = ListSaleRepItem.new( + id: 124, + full_name: 'full_name8', + subscriptions_count: 56, + mrr_data: { + 'november_2019': SaleRepItemMrr.new( + mrr: '$0.00', + usage: '$0.00', + recurring: '$0.00' + ), + 'december_2019': SaleRepItemMrr.new( + mrr: '$0.00', + usage: '$0.00', + recurring: '$0.00' + ), + 'january_2020': SaleRepItemMrr.new( + mrr: '$400.00', + usage: '$0.00', + recurring: '$400.00' + ) }, - "id": 26, - "full_name": "full_name8", - "subscriptions_count": 154, - "test_mode": false -} + test_mode: false +) ``` diff --git a/doc/models/list-segments-filter.md b/doc/models/list-segments-filter.md index 74afb013..b37d9d13 100644 --- a/doc/models/list-segments-filter.md +++ b/doc/models/list-segments-filter.md @@ -14,14 +14,14 @@ | `segment_property_3_value` | `String` | Optional | The value passed here would be used to filter segments. Pass a value related to `segment_property_3` on attached Metric. If empty string is passed, this filter would be rejected. | | `segment_property_4_value` | `String` | Optional | The value passed here would be used to filter segments. Pass a value related to `segment_property_4` on attached Metric. If empty string is passed, this filter would be rejected. | -## Example (as JSON) - -```json -{ - "segment_property_1_value": "EU", - "segment_property_2_value": "segment_property_2_value4", - "segment_property_3_value": "segment_property_3_value2", - "segment_property_4_value": "segment_property_4_value6" -} +## Example + +```ruby +list_segments_filter = ListSegmentsFilter.new( + segment_property_1_value: 'EU', + segment_property_2_value: 'segment_property_2_value4', + segment_property_3_value: 'segment_property_3_value8', + segment_property_4_value: 'segment_property_4_value6' +) ``` diff --git a/doc/models/list-segments-response.md b/doc/models/list-segments-response.md index a1e5fd63..8ff9580e 100644 --- a/doc/models/list-segments-response.md +++ b/doc/models/list-segments-response.md @@ -11,19 +11,19 @@ | --- | --- | --- | --- | | `segments` | [`Array[Segment]`](../../doc/models/segment.md) | Optional | - | -## Example (as JSON) - -```json -{ - "segments": [ - { - "id": 50, - "component_id": 160, - "price_point_id": 184, - "event_based_billing_metric_id": 244, - "pricing_scheme": "stairstep" - } +## Example + +```ruby +list_segments_response = ListSegmentsResponse.new( + segments: [ + Segment.new( + id: 50, + component_id: 160, + price_point_id: 184, + event_based_billing_metric_id: 244, + pricing_scheme: PricingScheme::STAIRSTEP + ) ] -} +) ``` diff --git a/doc/models/list-service-credits-response.md b/doc/models/list-service-credits-response.md index 1e21dd71..fdfa3ce6 100644 --- a/doc/models/list-service-credits-response.md +++ b/doc/models/list-service-credits-response.md @@ -11,26 +11,19 @@ | --- | --- | --- | --- | | `service_credits` | [`Array[ServiceCredit1]`](../../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" - } +## Example + +```ruby +list_service_credits_response = ListServiceCreditsResponse.new( + service_credits: [ + ServiceCredit1.new( + id: 224, + amount_in_cents: 54, + ending_balance_in_cents: 94, + entry_type: ServiceCreditType::CREDIT, + memo: 'memo2' + ) ] -} +) ``` diff --git a/doc/models/list-subscription-components-filter.md b/doc/models/list-subscription-components-filter.md index 41ee066c..5c661077 100644 --- a/doc/models/list-subscription-components-filter.md +++ b/doc/models/list-subscription-components-filter.md @@ -12,15 +12,15 @@ | `currencies` | `Array[String]` | 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) +## Example -```json -{ - "currencies": [ - "EUR", - "USD" +```ruby +list_subscription_components_filter = ListSubscriptionComponentsFilter.new( + currencies: [ + 'EUR', + 'USD' ], - "use_site_exchange_rate": false -} + use_site_exchange_rate: false +) ``` diff --git a/doc/models/list-subscription-components-for-site-filter.md b/doc/models/list-subscription-components-for-site-filter.md index 44a6a3a8..e81f4bfa 100644 --- a/doc/models/list-subscription-components-for-site-filter.md +++ b/doc/models/list-subscription-components-for-site-filter.md @@ -13,26 +13,26 @@ | `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 | -## Example (as JSON) +## Example -```json -{ - "currencies": [ - "EUR", - "USD" +```ruby +list_subscription_components_for_site_filter = ListSubscriptionComponentsForSiteFilter.new( + currencies: [ + 'EUR', + 'USD' ], - "use_site_exchange_rate": false, - "subscription": { - "states": [ - "active", - "canceled", - "expired" + use_site_exchange_rate: false, + subscription: SubscriptionFilter.new( + states: [ + SubscriptionStateFilter::TRIALING, + SubscriptionStateFilter::UNPAID, + SubscriptionStateFilter::ACTIVE ], - "date_field": "updated_at", - "start_date": "2016-03-13", - "end_date": "2016-03-13", - "start_datetime": "2016-03-13T12:52:32.123Z" - } -} + date_field: SubscriptionListDateField::UPDATED_AT, + start_date: Date.iso8601('2016-03-13'), + end_date: Date.iso8601('2016-03-13'), + start_datetime: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/list-subscription-components-include.md b/doc/models/list-subscription-components-include.md index 4bb14dd1..c69aed9c 100644 --- a/doc/models/list-subscription-components-include.md +++ b/doc/models/list-subscription-components-include.md @@ -14,7 +14,7 @@ ## Example -``` -subscription +```ruby +list_subscription_components_include = ListSubscriptionComponentsInclude::SUBSCRIPTION ``` diff --git a/doc/models/list-subscription-components-response.md b/doc/models/list-subscription-components-response.md index 4974b23a..0783b128 100644 --- a/doc/models/list-subscription-components-response.md +++ b/doc/models/list-subscription-components-response.md @@ -11,19 +11,19 @@ | --- | --- | --- | --- | | `subscriptions_components` | [`Array[SubscriptionComponent]`](../../doc/models/subscription-component.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscriptions_components": [ - { - "id": 138, - "name": "name2", - "kind": "metered_component", - "unit_name": "unit_name4", - "enabled": false - } +## Example + +```ruby +list_subscription_components_response = ListSubscriptionComponentsResponse.new( + subscriptions_components: [ + SubscriptionComponent.new( + id: 138, + name: 'name2', + kind: ComponentKind::METERED_COMPONENT, + unit_name: 'unit_name4', + enabled: false + ) ] -} +) ``` diff --git a/doc/models/list-subscription-components-sort.md b/doc/models/list-subscription-components-sort.md index 03af5d15..bb663578 100644 --- a/doc/models/list-subscription-components-sort.md +++ b/doc/models/list-subscription-components-sort.md @@ -14,7 +14,7 @@ ## Example -``` -updated_at +```ruby +list_subscription_components_sort = ListSubscriptionComponentsSort::ID ``` diff --git a/doc/models/list-subcription-group-prepayment-item.md b/doc/models/list-subscription-group-prepayment-item.md similarity index 63% rename from doc/models/list-subcription-group-prepayment-item.md rename to doc/models/list-subscription-group-prepayment-item.md index 5a4bfb09..37ff8c79 100644 --- a/doc/models/list-subcription-group-prepayment-item.md +++ b/doc/models/list-subscription-group-prepayment-item.md @@ -1,9 +1,9 @@ -# List Subcription Group Prepayment Item +# List Subscription Group Prepayment Item ## Structure -`ListSubcriptionGroupPrepaymentItem` +`ListSubscriptionGroupPrepaymentItem` ## Fields @@ -19,15 +19,15 @@ | `payment_type` | [`PrepaymentMethod`](../../doc/models/prepayment-method.md) | Optional | - | | `created_at` | `DateTime` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "id": 254, - "subscription_group_uid": "subscription_group_uid6", - "amount_in_cents": 172, - "remaining_amount_in_cents": 142, - "details": "details2" -} +```ruby +list_subscription_group_prepayment_item = ListSubscriptionGroupPrepaymentItem.new( + id: 96, + subscription_group_uid: 'subscription_group_uid6', + amount_in_cents: 74, + remaining_amount_in_cents: 240, + details: 'details2' +) ``` diff --git a/doc/models/list-subscription-group-prepayment-response.md b/doc/models/list-subscription-group-prepayment-response.md index b1d942d2..bbf6f4d5 100644 --- a/doc/models/list-subscription-group-prepayment-response.md +++ b/doc/models/list-subscription-group-prepayment-response.md @@ -11,21 +11,21 @@ | --- | --- | --- | --- | | `prepayments` | [`Array[ListSubscriptionGroupPrepayment]`](../../doc/models/list-subscription-group-prepayment.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepayments": [ - { - "prepayment": { - "id": 38, - "subscription_group_uid": "subscription_group_uid2", - "amount_in_cents": 124, - "remaining_amount_in_cents": 182, - "details": "details8" - } - } +## Example + +```ruby +list_subscription_group_prepayment_response = ListSubscriptionGroupPrepaymentResponse.new( + prepayments: [ + ListSubscriptionGroupPrepayment.new( + prepayment: ListSubscriptionGroupPrepaymentItem.new( + id: 38, + subscription_group_uid: 'subscription_group_uid2', + amount_in_cents: 124, + remaining_amount_in_cents: 182, + details: 'details8' + ) + ) ] -} +) ``` diff --git a/doc/models/list-subscription-group-prepayment.md b/doc/models/list-subscription-group-prepayment.md index efcb4788..1552076a 100644 --- a/doc/models/list-subscription-group-prepayment.md +++ b/doc/models/list-subscription-group-prepayment.md @@ -9,19 +9,19 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `prepayment` | [`ListSubcriptionGroupPrepaymentItem`](../../doc/models/list-subcription-group-prepayment-item.md) | Required | - | - -## Example (as JSON) - -```json -{ - "prepayment": { - "id": 38, - "subscription_group_uid": "subscription_group_uid2", - "amount_in_cents": 124, - "remaining_amount_in_cents": 182, - "details": "details8" - } -} +| `prepayment` | [`ListSubscriptionGroupPrepaymentItem`](../../doc/models/list-subscription-group-prepayment-item.md) | Required | - | + +## Example + +```ruby +list_subscription_group_prepayment = ListSubscriptionGroupPrepayment.new( + prepayment: ListSubscriptionGroupPrepaymentItem.new( + id: 38, + subscription_group_uid: 'subscription_group_uid2', + amount_in_cents: 124, + remaining_amount_in_cents: 182, + details: 'details8' + ) +) ``` diff --git a/doc/models/list-subscription-groups-item.md b/doc/models/list-subscription-groups-item.md index 7d38ee3e..f2a2ed14 100644 --- a/doc/models/list-subscription-groups-item.md +++ b/doc/models/list-subscription-groups-item.md @@ -21,17 +21,19 @@ | `account_balances` | [`SubscriptionGroupBalances`](../../doc/models/subscription-group-balances.md) | Optional | - | | `group_type` | [`GroupType`](../../doc/models/group-type.md) | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid0", - "scheme": 124, - "customer_id": 144, - "payment_profile_id": 52, - "subscription_ids": [ - 254 +## Example + +```ruby +list_subscription_groups_item = ListSubscriptionGroupsItem.new( + uid: 'uid0', + scheme: 62, + customer_id: 82, + payment_profile_id: 246, + subscription_ids: [ + 192, + 193, + 194 ] -} +) ``` diff --git a/doc/models/list-subscription-groups-meta.md b/doc/models/list-subscription-groups-meta.md index c575c248..847446f5 100644 --- a/doc/models/list-subscription-groups-meta.md +++ b/doc/models/list-subscription-groups-meta.md @@ -12,12 +12,12 @@ | `current_page` | `Integer` | Optional | - | | `total_count` | `Integer` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "current_page": 14, - "total_count": 38 -} +```ruby +list_subscription_groups_meta = ListSubscriptionGroupsMeta.new( + current_page: 110, + total_count: 134 +) ``` diff --git a/doc/models/list-subscription-groups-response.md b/doc/models/list-subscription-groups-response.md index 55f31591..e59a4f8e 100644 --- a/doc/models/list-subscription-groups-response.md +++ b/doc/models/list-subscription-groups-response.md @@ -12,43 +12,34 @@ | `subscription_groups` | [`Array[ListSubscriptionGroupsItem]`](../../doc/models/list-subscription-groups-item.md) | Optional | - | | `meta` | [`ListSubscriptionGroupsMeta`](../../doc/models/list-subscription-groups-meta.md) | Optional | - | -## Example (as JSON) - -```json -{ - "subscription_groups": [ - { - "uid": "uid2", - "scheme": 166, - "customer_id": 186, - "payment_profile_id": 162, - "subscription_ids": [ +## Example + +```ruby +list_subscription_groups_response = ListSubscriptionGroupsResponse.new( + subscription_groups: [ + ListSubscriptionGroupsItem.new( + uid: 'uid2', + scheme: 166, + customer_id: 186, + payment_profile_id: 162, + subscription_ids: [ 40 ] - }, - { - "uid": "uid2", - "scheme": 166, - "customer_id": 186, - "payment_profile_id": 162, - "subscription_ids": [ + ), + ListSubscriptionGroupsItem.new( + uid: 'uid2', + scheme: 166, + customer_id: 186, + payment_profile_id: 162, + subscription_ids: [ 40 ] - }, - { - "uid": "uid2", - "scheme": 166, - "customer_id": 186, - "payment_profile_id": 162, - "subscription_ids": [ - 40 - ] - } + ) ], - "meta": { - "current_page": 126, - "total_count": 150 - } -} + meta: ListSubscriptionGroupsMeta.new( + current_page: 126, + total_count: 150 + ) +) ``` diff --git a/doc/models/metadata.md b/doc/models/metadata.md index fd53873a..133f3e4e 100644 --- a/doc/models/metadata.md +++ b/doc/models/metadata.md @@ -16,15 +16,15 @@ | `deleted_at` | `DateTime` | Optional | - | | `metafield_id` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 12, - "value": "value0", - "resource_id": 96, - "name": "name8", - "deleted_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +metadata = Metadata.new( + id: 50, + value: 'value8', + resource_id: 134, + name: 'name6', + deleted_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/metafield-input.md b/doc/models/metafield-input.md index 75443bd3..0a4f7b33 100644 --- a/doc/models/metafield-input.md +++ b/doc/models/metafield-input.md @@ -1,7 +1,7 @@ # Metafield Input -Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. +Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. ## Enumeration @@ -16,3 +16,9 @@ Indicates the type of metafield. A text metafield allows any string value. Dropd | `RADIO` | | `DROPDOWN` | +## Example + +```ruby +metafield_input = MetafieldInput::RADIO +``` + diff --git a/doc/models/metafield-scope.md b/doc/models/metafield-scope.md index 3c2ca83d..f5e8fac2 100644 --- a/doc/models/metafield-scope.md +++ b/doc/models/metafield-scope.md @@ -19,15 +19,15 @@ Warning: When updating a metafield's scope attribute, all scope attributes must | `public_edit` | [`IncludeOption`](../../doc/models/include-option.md) | Optional | Include (1) or exclude (0) metafields used in [Embeddable Components](page:development-tools/embeddable-components/overview) from being editable by your ecosystem. | | `hosted` | `Array[String]` | Optional | - | -## Example (as JSON) - -```json -{ - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0" -} +## Example + +```ruby +metafield_scope = MetafieldScope.new( + csv: IncludeOption::EXCLUDE, + invoices: IncludeOption::EXCLUDE, + statements: IncludeOption::EXCLUDE, + portal: IncludeOption::EXCLUDE, + public_show: IncludeOption::EXCLUDE +) ``` diff --git a/doc/models/metafield.md b/doc/models/metafield.md index 7b74131a..62dd1627 100644 --- a/doc/models/metafield.md +++ b/doc/models/metafield.md @@ -13,24 +13,24 @@ | `name` | `String` | Optional | - | | `scope` | [`MetafieldScope`](../../doc/models/metafield-scope.md) | Optional | Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. | | `data_count` | `Integer` | Optional | The amount of subscriptions this metafield has been applied to in Advanced Billing. | -| `input_type` | [`MetafieldInput`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | +| `input_type` | [`MetafieldInput`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | | `enum` | String \| Array[String] \| nil | Optional | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "id": 52, - "name": "name8", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0" - }, - "data_count": 216, - "input_type": "radio" -} +## Example + +```ruby +metafield = Metafield.new( + id: 242, + name: 'name4', + scope: MetafieldScope.new( + csv: IncludeOption::EXCLUDE, + invoices: IncludeOption::EXCLUDE, + statements: IncludeOption::EXCLUDE, + portal: IncludeOption::EXCLUDE, + public_show: IncludeOption::EXCLUDE + ), + data_count: 26, + input_type: MetafieldInput::BALANCE_TRACKER +) ``` diff --git a/doc/models/metered-component.md b/doc/models/metered-component.md index e89c965c..68e01528 100644 --- a/doc/models/metered-component.md +++ b/doc/models/metered-component.md @@ -9,10 +9,10 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `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 | +| `name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "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. e.g., “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 in 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[Price]`](../../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. | @@ -23,35 +23,60 @@ | `display_on_hosted_page` | `TrueClass \| FalseClass` | Optional | - | | `allow_fractional_quantities` | `TrueClass \| FalseClass` | Optional | - | | `public_signup_page_ids` | `Array[Integer]` | Optional | - | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component's default 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 component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. | +| `unspsc_code` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | -## Example (as JSON) - -```json -{ - "name": "name4", - "unit_name": "unit_name6", - "description": "description6", - "handle": "handle0", - "taxable": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +## Example + +```ruby +metered_component = MeteredComponent.new( + name: 'name0', + unit_name: 'unit_name2', + pricing_scheme: PricingScheme::STAIRSTEP, + description: 'description0', + handle: 'handle6', + taxable: false, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "price_points": [ - { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" - } + price_points: [ + ComponentPricePointItem.new( + name: 'name2', + handle: 'handle8', + pricing_scheme: PricingScheme::PER_UNIT, + interval: 92, + interval_unit: IntervalUnit::DAY + ), + ComponentPricePointItem.new( + name: 'name2', + handle: 'handle8', + pricing_scheme: PricingScheme::PER_UNIT, + interval: 92, + interval_unit: IntervalUnit::DAY + ), + ComponentPricePointItem.new( + name: 'name2', + handle: 'handle8', + pricing_scheme: PricingScheme::PER_UNIT, + interval: 92, + interval_unit: IntervalUnit::DAY + ) ] -} +) ``` diff --git a/doc/models/metered-usage.md b/doc/models/metered-usage.md index 1da62e19..153c7a9d 100644 --- a/doc/models/metered-usage.md +++ b/doc/models/metered-usage.md @@ -10,22 +10,22 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `previous_unit_balance` | `String` | Required | **Constraints**: *Minimum Length*: `1` | -| `new_unit_balance` | `Integer` | Required | - | +| `new_unit_balance` | Integer \| String | Required | This is a container for one-of cases. | | `usage_quantity` | `Integer` | Required | - | | `component_id` | `Integer` | Required | - | | `component_handle` | `String` | Required | - | | `memo` | `String` | Required | - | -## Example (as JSON) - -```json -{ - "previous_unit_balance": "previous_unit_balance6", - "new_unit_balance": 80, - "usage_quantity": 42, - "component_id": 4, - "component_handle": "component_handle8", - "memo": "memo2" -} +## Example + +```ruby +metered_usage = MeteredUsage.new( + previous_unit_balance: 'previous_unit_balance2', + new_unit_balance: 244, + usage_quantity: 28, + component_id: 246, + component_handle: 'component_handle2', + memo: 'memo6' +) ``` diff --git a/doc/models/movement-line-item.md b/doc/models/movement-line-item.md index 341656d8..a7d05ae0 100644 --- a/doc/models/movement-line-item.md +++ b/doc/models/movement-line-item.md @@ -19,15 +19,15 @@ | `prev_quantity` | `Integer` | Optional | - | | `recurring` | `TrueClass \| FalseClass` | Optional | When `true`, the line item's MRR value will contribute to the `plan` breakout. When `false`, the line item contributes to the `usage` breakout. | -## Example (as JSON) - -```json -{ - "product_id": 156, - "component_id": 68, - "price_point_id": 164, - "name": "name6", - "mrr": 154 -} +## Example + +```ruby +movement_line_item = MovementLineItem.new( + product_id: 60, + component_id: 228, + price_point_id: 4, + name: 'name0', + mrr: 250 +) ``` diff --git a/doc/models/movement.md b/doc/models/movement.md index 5c7956ed..8508e94f 100644 --- a/doc/models/movement.md +++ b/doc/models/movement.md @@ -19,15 +19,15 @@ | `subscription_id` | `Integer` | Optional | - | | `subscriber_name` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "timestamp": "2016-03-13T12:52:32.123Z", - "amount_in_cents": 174, - "amount_formatted": "amount_formatted4", - "description": "description2", - "category": "category0" -} +## Example + +```ruby +movement = Movement.new( + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + amount_in_cents: 34, + amount_formatted: 'amount_formatted6', + description: 'description4', + category: 'category2' +) ``` diff --git a/doc/models/mrr-movement.md b/doc/models/mrr-movement.md index ef67268e..1f36627d 100644 --- a/doc/models/mrr-movement.md +++ b/doc/models/mrr-movement.md @@ -14,14 +14,14 @@ | `subscriber_delta` | `Integer` | Optional | - | | `lead_delta` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "amount": 210, - "category": "category0", - "subscriber_delta": 170, - "lead_delta": 198 -} +## Example + +```ruby +mrr_movement = MRRMovement.new( + amount: 74, + category: 'category0', + subscriber_delta: 34, + lead_delta: 62 +) ``` diff --git a/doc/models/mrr-response.md b/doc/models/mrr-response.md index ff4f7ddd..7ae95681 100644 --- a/doc/models/mrr-response.md +++ b/doc/models/mrr-response.md @@ -11,22 +11,22 @@ | --- | --- | --- | --- | | `mrr` | [`MRR`](../../doc/models/mrr.md) | Required | - | -## Example (as JSON) - -```json -{ - "mrr": { - "amount_in_cents": 198, - "amount_formatted": "amount_formatted6", - "currency": "currency4", - "currency_symbol": "currency_symbol2", - "breakouts": { - "plan_amount_in_cents": 254, - "plan_amount_formatted": "plan_amount_formatted0", - "usage_amount_in_cents": 106, - "usage_amount_formatted": "usage_amount_formatted8" - } - } -} +## Example + +```ruby +mrr_response = MRRResponse.new( + mrr: MRR.new( + amount_in_cents: 198, + amount_formatted: 'amount_formatted6', + currency: 'currency4', + currency_symbol: 'currency_symbol2', + breakouts: Breakouts.new( + plan_amount_in_cents: 254, + plan_amount_formatted: 'plan_amount_formatted0', + usage_amount_in_cents: 106, + usage_amount_formatted: 'usage_amount_formatted8' + ) + ) +) ``` diff --git a/doc/models/mrr.md b/doc/models/mrr.md index df28aa85..2841842b 100644 --- a/doc/models/mrr.md +++ b/doc/models/mrr.md @@ -16,20 +16,20 @@ | `breakouts` | [`Breakouts`](../../doc/models/breakouts.md) | Optional | - | | `at_time` | `DateTime` | Optional | ISO8601 timestamp | -## Example (as JSON) - -```json -{ - "amount_in_cents": 208, - "amount_formatted": "amount_formatted2", - "currency": "currency0", - "currency_symbol": "currency_symbol8", - "breakouts": { - "plan_amount_in_cents": 254, - "plan_amount_formatted": "plan_amount_formatted0", - "usage_amount_in_cents": 106, - "usage_amount_formatted": "usage_amount_formatted8" - } -} +## Example + +```ruby +mrr = MRR.new( + amount_in_cents: 198, + amount_formatted: 'amount_formatted6', + currency: 'currency4', + currency_symbol: 'currency_symbol2', + breakouts: Breakouts.new( + plan_amount_in_cents: 254, + plan_amount_formatted: 'plan_amount_formatted0', + usage_amount_in_cents: 106, + usage_amount_formatted: 'usage_amount_formatted8' + ) +) ``` diff --git a/doc/models/multi-invoice-payment-response.md b/doc/models/multi-invoice-payment-response.md index 6d917ff1..db0cd929 100644 --- a/doc/models/multi-invoice-payment-response.md +++ b/doc/models/multi-invoice-payment-response.md @@ -11,32 +11,32 @@ | --- | --- | --- | --- | | `payment` | [`MultiInvoicePayment`](../../doc/models/multi-invoice-payment.md) | Required | - | -## Example (as JSON) - -```json -{ - "payment": { - "transaction_id": 224, - "total_amount": "total_amount2", - "currency_code": "currency_code2", - "applications": [ - { - "invoice_uid": "invoice_uid8", - "application_uid": "application_uid8", - "applied_amount": "applied_amount0" - }, - { - "invoice_uid": "invoice_uid8", - "application_uid": "application_uid8", - "applied_amount": "applied_amount0" - }, - { - "invoice_uid": "invoice_uid8", - "application_uid": "application_uid8", - "applied_amount": "applied_amount0" - } +## Example + +```ruby +multi_invoice_payment_response = MultiInvoicePaymentResponse.new( + payment: MultiInvoicePayment.new( + transaction_id: 224, + total_amount: 'total_amount2', + currency_code: 'currency_code2', + applications: [ + InvoicePaymentApplication.new( + invoice_uid: 'invoice_uid8', + application_uid: 'application_uid8', + applied_amount: 'applied_amount0' + ), + InvoicePaymentApplication.new( + invoice_uid: 'invoice_uid8', + application_uid: 'application_uid8', + applied_amount: 'applied_amount0' + ), + InvoicePaymentApplication.new( + invoice_uid: 'invoice_uid8', + application_uid: 'application_uid8', + applied_amount: 'applied_amount0' + ) ] - } -} + ) +) ``` diff --git a/doc/models/multi-invoice-payment.md b/doc/models/multi-invoice-payment.md index 489a2ae6..1d7277dc 100644 --- a/doc/models/multi-invoice-payment.md +++ b/doc/models/multi-invoice-payment.md @@ -14,20 +14,20 @@ | `currency_code` | `String` | Optional | The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. | | `applications` | [`Array[InvoicePaymentApplication]`](../../doc/models/invoice-payment-application.md) | Optional | - | -## Example (as JSON) - -```json -{ - "transaction_id": 144, - "total_amount": "total_amount2", - "currency_code": "currency_code2", - "applications": [ - { - "invoice_uid": "invoice_uid8", - "application_uid": "application_uid8", - "applied_amount": "applied_amount0" - } +## Example + +```ruby +multi_invoice_payment = MultiInvoicePayment.new( + transaction_id: 238, + total_amount: 'total_amount0', + currency_code: 'currency_code0', + applications: [ + InvoicePaymentApplication.new( + invoice_uid: 'invoice_uid8', + application_uid: 'application_uid8', + applied_amount: 'applied_amount0' + ) ] -} +) ``` diff --git a/doc/models/nested-subscription-group.md b/doc/models/nested-subscription-group.md index 05c4d2fd..9524abf6 100644 --- a/doc/models/nested-subscription-group.md +++ b/doc/models/nested-subscription-group.md @@ -14,14 +14,14 @@ | `primary_subscription_id` | `Integer` | Optional | The subscription ID of the primary within the group. Applicable to scheme 1. | | `primary` | `TrueClass \| FalseClass` | Optional | A boolean indicating whether the subscription is the primary in the group. Applicable to scheme 1. | -## Example (as JSON) - -```json -{ - "uid": "uid2", - "scheme": 62, - "primary_subscription_id": 10, - "primary": false -} +## Example + +```ruby +nested_subscription_group = NestedSubscriptionGroup.new( + uid: 'uid2', + scheme: 254, + primary_subscription_id: 202, + primary: false +) ``` diff --git a/doc/models/net-terms.md b/doc/models/net-terms.md index 81d3767a..a5a6e3a4 100644 --- a/doc/models/net-terms.md +++ b/doc/models/net-terms.md @@ -15,15 +15,15 @@ | `net_terms_on_remittance_signups_enabled` | `TrueClass \| FalseClass` | Optional | **Default**: `false` | | `custom_net_terms_enabled` | `TrueClass \| FalseClass` | Optional | **Default**: `false` | -## Example (as JSON) - -```json -{ - "default_net_terms": 0, - "automatic_net_terms": 0, - "remittance_net_terms": 0, - "net_terms_on_remittance_signups_enabled": false, - "custom_net_terms_enabled": false -} +## Example + +```ruby +net_terms = NetTerms.new( + default_net_terms: 0, + automatic_net_terms: 0, + remittance_net_terms: 0, + net_terms_on_remittance_signups_enabled: false, + custom_net_terms_enabled: false +) ``` diff --git a/doc/models/offer-discount.md b/doc/models/offer-discount.md index 5b99e8f5..b892aa29 100644 --- a/doc/models/offer-discount.md +++ b/doc/models/offer-discount.md @@ -13,13 +13,13 @@ | `coupon_id` | `Integer` | Optional | - | | `coupon_name` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "coupon_code": "coupon_code8", - "coupon_id": 86, - "coupon_name": "coupon_name4" -} +## Example + +```ruby +offer_discount = OfferDiscount.new( + coupon_code: 'coupon_code4', + coupon_id: 106, + coupon_name: 'coupon_name6' +) ``` diff --git a/doc/models/offer-item.md b/doc/models/offer-item.md index 10c52bdd..73b1c48b 100644 --- a/doc/models/offer-item.md +++ b/doc/models/offer-item.md @@ -17,18 +17,18 @@ | `component_name` | `String` | Optional | - | | `price_point_name` | `String` | Optional | - | | `currency_prices` | [`Array[CurrencyPrice]`](../../doc/models/currency-price.md) | Optional | - | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of '30' coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of '30' coupled with an interval_unit of day would mean this component 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 component price point, either month or day. This property is only available for sites with Multifrequency enabled. | -## Example (as JSON) +## Example -```json -{ - "component_id": 216, - "price_point_id": 16, - "starting_quantity": "starting_quantity0", - "editable": false, - "component_unit_price": "component_unit_price8" -} +```ruby +offer_item = OfferItem.new( + component_id: 216, + price_point_id: 16, + starting_quantity: 'starting_quantity0', + editable: false, + component_unit_price: 'component_unit_price8' +) ``` diff --git a/doc/models/offer-response.md b/doc/models/offer-response.md index fc01f447..44dd7115 100644 --- a/doc/models/offer-response.md +++ b/doc/models/offer-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `offer` | [`Offer`](../../doc/models/offer.md) | Optional | - | -## Example (as JSON) - -```json -{ - "offer": { - "id": 28, - "site_id": 210, - "product_family_id": 224, - "product_id": 30, - "product_price_point_id": 150 - } -} +## Example + +```ruby +offer_response = OfferResponse.new( + offer: Offer.new( + id: 28, + site_id: 210, + product_family_id: 224, + product_id: 30, + product_price_point_id: 150 + ) +) ``` diff --git a/doc/models/offer-signup-page.md b/doc/models/offer-signup-page.md index ce27c3d8..cb7c85f4 100644 --- a/doc/models/offer-signup-page.md +++ b/doc/models/offer-signup-page.md @@ -16,15 +16,15 @@ | `return_params` | `String` | Optional | - | | `url` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 50, - "nickname": "nickname8", - "enabled": false, - "return_url": "return_url2", - "return_params": "return_params0" -} +## Example + +```ruby +offer_signup_page = OfferSignupPage.new( + id: 78, + nickname: 'nickname0', + enabled: false, + return_url: 'return_url0', + return_params: 'return_params2' +) ``` diff --git a/doc/models/offer.md b/doc/models/offer.md index d0834e19..6a835cde 100644 --- a/doc/models/offer.md +++ b/doc/models/offer.md @@ -29,15 +29,15 @@ | `product_price_in_cents` | `Integer` | Optional | - | | `offer_signup_pages` | [`Array[OfferSignupPage]`](../../doc/models/offer-signup-page.md) | Optional | - | -## Example (as JSON) - -```json -{ - "id": 154, - "site_id": 80, - "product_family_id": 158, - "product_id": 96, - "product_price_point_id": 20 -} +## Example + +```ruby +offer = Offer.new( + id: 28, + site_id: 210, + product_family_id: 224, + product_id: 30, + product_price_point_id: 150 +) ``` diff --git a/doc/models/ok-response.md b/doc/models/ok-response.md index a0b7ef00..4277fdcf 100644 --- a/doc/models/ok-response.md +++ b/doc/models/ok-response.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `ok` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "ok": "ok4" -} +```ruby +ok_response = OkResponse.new( + ok: 'ok8' +) ``` diff --git a/doc/models/on-off-component.md b/doc/models/on-off-component.md index b83794a3..d9312c8c 100644 --- a/doc/models/on-off-component.md +++ b/doc/models/on-off-component.md @@ -9,9 +9,9 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | +| `name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "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 in 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. | | `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. | @@ -22,20 +22,21 @@ | `display_on_hosted_page` | `TrueClass \| FalseClass` | Optional | - | | `allow_fractional_quantities` | `TrueClass \| FalseClass` | Optional | - | | `public_signup_page_ids` | `Array[Integer]` | Optional | - | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component's default 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 component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. | - -## Example (as JSON) - -```json -{ - "name": "name2", - "description": "description2", - "handle": "handle8", - "taxable": false, - "upgrade_charge": "prorated", - "downgrade_credit": "prorated", - "unit_price": "String1" -} +| `unspsc_code` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | + +## Example + +```ruby +on_off_component = OnOffComponent.new( + name: 'name6', + unit_price: 'String5', + description: 'description6', + handle: 'handle2', + taxable: false, + upgrade_charge: CreditType::FULL, + downgrade_credit: CreditType::FULL +) ``` diff --git a/doc/models/organization-address.md b/doc/models/organization-address.md index d949b2ec..3fe3e902 100644 --- a/doc/models/organization-address.md +++ b/doc/models/organization-address.md @@ -18,15 +18,15 @@ | `name` | `String` | Optional | - | | `phone` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "street": "street4", - "line2": "line28", - "city": "city4", - "state": "state0", - "zip": "zip2" -} +## Example + +```ruby +organization_address = OrganizationAddress.new( + street: 'street6', + line2: 'line20', + city: 'city6', + state: 'state2', + zip: 'zip0' +) ``` diff --git a/doc/models/origin-invoice.md b/doc/models/origin-invoice.md index b47e4ba6..ac92ec67 100644 --- a/doc/models/origin-invoice.md +++ b/doc/models/origin-invoice.md @@ -12,12 +12,12 @@ | `uid` | `String` | Optional | The UID of the invoice serving as an origin invoice. | | `number` | `String` | Optional | The number of the invoice serving as an origin invoice. | -## Example (as JSON) +## Example -```json -{ - "uid": "uid0", - "number": "number8" -} +```ruby +origin_invoice = OriginInvoice.new( + uid: 'uid8', + number: 'number4' +) ``` diff --git a/doc/models/overage-pricing.md b/doc/models/overage-pricing.md index 12225092..a055514d 100644 --- a/doc/models/overage-pricing.md +++ b/doc/models/overage-pricing.md @@ -12,28 +12,18 @@ | `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[Price]`](../../doc/models/price.md) | Optional | - | -## Example (as JSON) - -```json -{ - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +## Example + +```ruby +overage_pricing = OveragePricing.new( + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ] -} +) ``` diff --git a/doc/models/override-subscription-request.md b/doc/models/override-subscription-request.md index 7666cf01..5a0522be 100644 --- a/doc/models/override-subscription-request.md +++ b/doc/models/override-subscription-request.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `subscription` | [`OverrideSubscription`](../../doc/models/override-subscription.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscription": { - "activated_at": "2016-03-13T12:52:32.123Z", - "canceled_at": "2016-03-13T12:52:32.123Z", - "cancellation_message": "cancellation_message2", - "expires_at": "2016-03-13T12:52:32.123Z", - "current_period_starts_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ruby +override_subscription_request = OverrideSubscriptionRequest.new( + subscription: OverrideSubscription.new( + activated_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + canceled_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + cancellation_message: 'cancellation_message2', + expires_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + current_period_starts_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/override-subscription.md b/doc/models/override-subscription.md index 7259de2b..1b1ec726 100644 --- a/doc/models/override-subscription.md +++ b/doc/models/override-subscription.md @@ -15,15 +15,15 @@ | `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) - -```json -{ - "activated_at": "2016-03-13T12:52:32.123Z", - "canceled_at": "2016-03-13T12:52:32.123Z", - "cancellation_message": "cancellation_message4", - "expires_at": "2016-03-13T12:52:32.123Z", - "current_period_starts_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +override_subscription = OverrideSubscription.new( + activated_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + canceled_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + cancellation_message: 'cancellation_message2', + expires_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + current_period_starts_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/paginated-metadata.md b/doc/models/paginated-metadata.md index a982a0c5..e6475945 100644 --- a/doc/models/paginated-metadata.md +++ b/doc/models/paginated-metadata.md @@ -15,30 +15,37 @@ | `per_page` | `Integer` | Optional | - | | `metadata` | [`Array[Metadata]`](../../doc/models/metadata.md) | Optional | - | -## Example (as JSON) - -```json -{ - "total_count": 26, - "current_page": 2, - "total_pages": 14, - "per_page": 20, - "metadata": [ - { - "id": 50, - "value": "value8", - "resource_id": 134, - "name": "name6", - "deleted_at": "2016-03-13T12:52:32.123Z" - }, - { - "id": 50, - "value": "value8", - "resource_id": 134, - "name": "name6", - "deleted_at": "2016-03-13T12:52:32.123Z" - } +## Example + +```ruby +paginated_metadata = PaginatedMetadata.new( + total_count: 144, + current_page: 120, + total_pages: 132, + per_page: 158, + metadata: [ + Metadata.new( + id: 50, + value: 'value8', + resource_id: 134, + name: 'name6', + deleted_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ), + Metadata.new( + id: 50, + value: 'value8', + resource_id: 134, + name: 'name6', + deleted_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ), + Metadata.new( + id: 50, + value: 'value8', + resource_id: 134, + name: 'name6', + deleted_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) ] -} +) ``` diff --git a/doc/models/paid-invoice.md b/doc/models/paid-invoice.md index 022fb1e7..08a53ea2 100644 --- a/doc/models/paid-invoice.md +++ b/doc/models/paid-invoice.md @@ -14,14 +14,14 @@ | `due_amount` | `String` | Optional | The remaining due amount on the invoice | | `paid_amount` | `String` | Optional | The total amount paid on this invoice (including any prior payments) | -## Example (as JSON) - -```json -{ - "invoice_id": "invoice_id6", - "status": "open", - "due_amount": "due_amount8", - "paid_amount": "paid_amount8" -} +## Example + +```ruby +paid_invoice = PaidInvoice.new( + invoice_id: 'invoice_id6', + status: InvoiceStatus::PAID, + due_amount: 'due_amount6', + paid_amount: 'paid_amount4' +) ``` diff --git a/doc/models/pause-request.md b/doc/models/pause-request.md index 01abe5f3..db687cce 100644 --- a/doc/models/pause-request.md +++ b/doc/models/pause-request.md @@ -1,7 +1,7 @@ # Pause Request -Allows to pause a Subscription +Allows you to pause a Subscription. ## Structure @@ -13,13 +13,13 @@ Allows to pause a Subscription | --- | --- | --- | --- | | `hold` | [`AutoResume`](../../doc/models/auto-resume.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "hold": { - "automatically_resume_at": "2016-03-13T12:52:32.123Z" - } -} +```ruby +pause_request = PauseRequest.new( + hold: AutoResume.new( + automatically_resume_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/pay-pal-vault.md b/doc/models/pay-pal-vault.md index 00445c6c..7533c923 100644 --- a/doc/models/pay-pal-vault.md +++ b/doc/models/pay-pal-vault.md @@ -16,3 +16,9 @@ The vault that stores the payment profile with the provided vault_token. | `MODUSLINK` | | `PAYPAL_COMPLETE` | +## Example + +```ruby +pay_pal_vault = PayPalVault::MODUSLINK +``` + diff --git a/doc/models/payer-attributes.md b/doc/models/payer-attributes.md index 7019edf9..c6c2c3ab 100644 --- a/doc/models/payer-attributes.md +++ b/doc/models/payer-attributes.md @@ -28,19 +28,19 @@ | `tax_exempt_reason` | `String` | Optional | - | | `metafields` | `Hash[String, String]` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | -## Example (as JSON) - -```json -{ - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" - }, - "first_name": "first_name4", - "last_name": "last_name2", - "email": "email2", - "cc_emails": "cc_emails4", - "organization": "organization8" -} +## Example + +```ruby +payer_attributes = PayerAttributes.new( + first_name: 'first_name2', + last_name: 'last_name0', + email: 'email4', + cc_emails: 'cc_emails2', + organization: 'organization6', + metafields: { + 'custom_field_name_1': 'custom_field_value_1', + 'custom_field_name_2': 'custom_field_value_2' + } +) ``` diff --git a/doc/models/payer-error.md b/doc/models/payer-error.md index d963da36..71bd9d2a 100644 --- a/doc/models/payer-error.md +++ b/doc/models/payer-error.md @@ -13,22 +13,23 @@ | `first_name` | `Array[String]` | Optional | - | | `email` | `Array[String]` | Optional | - | -## Example (as JSON) - -```json -{ - "last_name": [ - "last_name1", - "last_name2", - "last_name3" +## Example + +```ruby +payer_error = PayerError.new( + last_name: [ + 'last_name9' ], - "first_name": [ - "first_name4", - "first_name5" + first_name: [ + 'first_name2', + 'first_name3', + 'first_name4' ], - "email": [ - "email4" + email: [ + 'email4', + 'email3', + 'email2' ] -} +) ``` diff --git a/doc/models/payment-collection-method-changed.md b/doc/models/payment-collection-method-changed.md index 73a20d34..8aced04e 100644 --- a/doc/models/payment-collection-method-changed.md +++ b/doc/models/payment-collection-method-changed.md @@ -12,12 +12,12 @@ | `previous_value` | `String` | Required | - | | `current_value` | `String` | Required | - | -## Example (as JSON) +## Example -```json -{ - "previous_value": "previous_value4", - "current_value": "current_value2" -} +```ruby +payment_collection_method_changed = PaymentCollectionMethodChanged.new( + previous_value: 'previous_value2', + current_value: 'current_value0' +) ``` diff --git a/doc/models/payment-for-allocation.md b/doc/models/payment-for-allocation.md index ff0c3a13..722acb11 100644 --- a/doc/models/payment-for-allocation.md +++ b/doc/models/payment-for-allocation.md @@ -16,14 +16,14 @@ Information for captured payment, if applicable | `success` | `TrueClass \| FalseClass` | Optional | - | | `memo` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 72, - "amount_in_cents": 158, - "success": false, - "memo": "memo6" -} +## Example + +```ruby +payment_for_allocation = PaymentForAllocation.new( + id: 232, + amount_in_cents: 194, + success: false, + memo: 'memo6' +) ``` diff --git a/doc/models/payment-method-apple-pay.md b/doc/models/payment-method-apple-pay.md index a7bd9027..5f08af83 100644 --- a/doc/models/payment-method-apple-pay.md +++ b/doc/models/payment-method-apple-pay.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `type` | [`InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "type": "apple_pay" -} +```ruby +payment_method_apple_pay = PaymentMethodApplePay.new( + type: InvoiceEventPaymentMethod::APPLE_PAY +) ``` diff --git a/doc/models/payment-method-bank-account.md b/doc/models/payment-method-bank-account.md index 76efc5a6..651b19bd 100644 --- a/doc/models/payment-method-bank-account.md +++ b/doc/models/payment-method-bank-account.md @@ -13,13 +13,13 @@ | `masked_routing_number` | `String` | Required | - | | `type` | [`InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | -## Example (as JSON) - -```json -{ - "masked_account_number": "masked_account_number2", - "masked_routing_number": "masked_routing_number2", - "type": "bank_account" -} +## Example + +```ruby +payment_method_bank_account = PaymentMethodBankAccount.new( + masked_account_number: 'masked_account_number6', + masked_routing_number: 'masked_routing_number6', + type: InvoiceEventPaymentMethod::BANK_ACCOUNT +) ``` diff --git a/doc/models/payment-method-credit-card.md b/doc/models/payment-method-credit-card.md index ef07011a..7c231e3c 100644 --- a/doc/models/payment-method-credit-card.md +++ b/doc/models/payment-method-credit-card.md @@ -15,15 +15,15 @@ | `masked_card_number` | `String` | Required | - | | `type` | [`InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | -## Example (as JSON) - -```json -{ - "card_brand": "card_brand4", - "masked_card_number": "masked_card_number0", - "type": "credit_card", - "card_expiration": "card_expiration2", - "last_four": "last_four4" -} +## Example + +```ruby +payment_method_credit_card = PaymentMethodCreditCard.new( + card_brand: 'card_brand2', + masked_card_number: 'masked_card_number2', + type: InvoiceEventPaymentMethod::CREDIT_CARD, + card_expiration: 'card_expiration0', + last_four: 'last_four8' +) ``` diff --git a/doc/models/payment-method-external.md b/doc/models/payment-method-external.md index 58e19228..9f9683a6 100644 --- a/doc/models/payment-method-external.md +++ b/doc/models/payment-method-external.md @@ -14,14 +14,14 @@ | `memo` | `String` | Required | - | | `type` | [`InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | -## Example (as JSON) - -```json -{ - "details": "details4", - "kind": "kind2", - "memo": "memo8", - "type": "external" -} +## Example + +```ruby +payment_method_external = PaymentMethodExternal.new( + details: 'details8', + kind: 'kind6', + memo: 'memo2', + type: InvoiceEventPaymentMethod::EXTERNAL +) ``` diff --git a/doc/models/payment-method-paypal.md b/doc/models/payment-method-paypal.md index f31e23a2..bcff7767 100644 --- a/doc/models/payment-method-paypal.md +++ b/doc/models/payment-method-paypal.md @@ -12,12 +12,12 @@ | `email` | `String` | Required | - | | `type` | [`InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "email": "email2", - "type": "paypal_account" -} +```ruby +payment_method_paypal = PaymentMethodPaypal.new( + email: 'email6', + type: InvoiceEventPaymentMethod::PAYPAL_ACCOUNT +) ``` diff --git a/doc/models/payment-profile-attributes.md b/doc/models/payment-profile-attributes.md index d352438b..68a4eb4d 100644 --- a/doc/models/payment-profile-attributes.md +++ b/doc/models/payment-profile-attributes.md @@ -11,22 +11,22 @@ alias to credit_card_attributes | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `chargify_token` | `String` | Optional | (Optional) Token received after sending billing information using Maxio.js (formerly Chargify.js). This token must be passed as a sole attribute of `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) | +| `chargify_token` | `String` | Optional | (Optional) Token received after sending billing information using Maxio.js (formerly Chargify.js). This token must be passed as a sole attribute of `payment_profile_attributes` (e.g., tok_9g6hw85pnpt6knmskpwp4ttt). | | `id` | `Integer` | Optional | - | | `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Optional | - | | `first_name` | `String` | Optional | (Optional) First name on card or bank account. If omitted, the first_name from customer attributes will be used. | | `last_name` | `String` | Optional | (Optional) Last name on card or bank account. If omitted, the last_name from customer attributes will be used. | | `masked_card_number` | `String` | Optional | - | -| `full_number` | `String` | Optional | The full credit card number (string representation, i.e. 5424000000000015) | -| `card_type` | [`CardType`](../../doc/models/card-type.md) | Optional | (Optional, used only for Subscription Import) If you know the card type (i.e. Visa, MC, etc) you may supply it here so that we may display the card type in the UI. | +| `full_number` | `String` | Optional | The full credit card number (string representation, e.g., 5424000000000015) | +| `card_type` | [`CardType`](../../doc/models/card-type.md) | Optional | (Optional, used only for Subscription Import) If you know the card type (e.g., Visa, MC, etc.) you may supply it here so that we may display the card type in the UI. | | `expiration_month` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `expiration_year` | Integer \| String \| nil | Optional | This is a container for one-of cases. | -| `billing_address` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. | -| `billing_address_2` | `String` | Optional | (Optional) Second line of the customer’s billing address i.e. Apt. 100 | -| `billing_city` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. | -| `billing_state` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | -| `billing_country` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | -| `billing_zip` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. | +| `billing_address` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing street address (e.g., 123 Main St.). This value is merely passed through to the payment gateway. | +| `billing_address_2` | `String` | Optional | (Optional) Second line of the customer’s billing address, e.g., Apt. 100 | +| `billing_city` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address city (e.g., “Boston”). This value is merely passed through to the payment gateway. | +| `billing_state` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address state (e.g., MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | +| `billing_country` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | +| `billing_zip` | `String` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address zip code (e.g., 12345). This value is merely passed through to the payment gateway. | | `current_vault` | [`AllVaults`](../../doc/models/all-vaults.md) | Optional | (Optional, used only for Subscription Import) The vault that stores the payment profile with the provided vault_token. | | `vault_token` | `String` | Optional | (Optional, used only for Subscription Import) The “token” provided by your vault storage for an already stored payment profile | | `customer_vault_token` | `String` | Optional | (Optional, used only for Subscription Import) (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token | @@ -35,17 +35,17 @@ alias to credit_card_attributes | `payment_method_nonce` | `String` | Optional | (Required for Square unless importing with vault_token and customer_vault_token) The nonce generated by the Square Javascript library (SqPaymentForm) | | `gateway_handle` | `String` | Optional | (Optional) This attribute is only available if MultiGateway feature is enabled for your Site. This feature is in the Private Beta currently. gateway_handle is used to directly select a gateway where a payment profile will be stored in. Every connected gateway must have a unique gateway handle specified. Read [Multigateway description](https://chargify.zendesk.com/hc/en-us/articles/4407761759643#connecting-with-multiple-gateways) to learn more about new concepts that MultiGateway introduces and the default behavior when this attribute is not passed. | | `cvv` | `String` | Optional | (Optional, may be required by your gateway settings) The 3- or 4-digit Card Verification Value. This value is merely passed through to the payment gateway. | -| `last_four` | `String` | Optional | (Optional, used only for Subscription Import) If you have the last 4 digits of the credit card number, you may supply them here so that we may create a masked card number (i.e. XXXX-XXXX-XXXX-1234) for display in the UI. Last 4 digits are required for refunds in Auth.Net. | - -## Example (as JSON) - -```json -{ - "chargify_token": "chargify_token8", - "id": 80, - "payment_type": "credit_card", - "first_name": "first_name0", - "last_name": "last_name8" -} +| `last_four` | `String` | Optional | (Optional, used only for Subscription Import) If you have the last 4 digits of the credit card number, you may supply them here so that we may create a masked card number (e.g., XXXX-XXXX-XXXX-1234) for display in the UI. Last 4 digits are required for refunds in Auth.Net. | + +## Example + +```ruby +payment_profile_attributes = PaymentProfileAttributes.new( + chargify_token: 'chargify_token4', + id: 102, + payment_type: PaymentType::PAYPAL_ACCOUNT, + first_name: 'first_name6', + last_name: 'last_name4' +) ``` diff --git a/doc/models/payment-profile-params.md b/doc/models/payment-profile-params.md index 1fe97b66..f935fbaa 100644 --- a/doc/models/payment-profile-params.md +++ b/doc/models/payment-profile-params.md @@ -15,13 +15,13 @@ PCI-safe cardholder fields only. Full card numbers, CVV, and billing address are | `last_name` | `String` | Optional | - | | `card_type` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "first_name": "first_name2", - "last_name": "last_name0", - "card_type": "card_type8" -} +## Example + +```ruby +payment_profile_params = PaymentProfileParams.new( + first_name: 'first_name2', + last_name: 'last_name0', + card_type: 'card_type2' +) ``` diff --git a/doc/models/payment-profile-response.md b/doc/models/payment-profile-response.md index 8a552ce2..2a81b9cf 100644 --- a/doc/models/payment-profile-response.md +++ b/doc/models/payment-profile-response.md @@ -11,18 +11,18 @@ | --- | --- | --- | --- | | `payment_profile` | [ApplePay Payment Profile](../../doc/models/apple-pay-payment-profile.md) \| [Bank Account Payment Profile](../../doc/models/bank-account-payment-profile.md) \| [Credit Card Payment Profile](../../doc/models/credit-card-payment-profile.md) \| [Paypal Payment Profile](../../doc/models/paypal-payment-profile.md) | Required | - | -## Example (as JSON) - -```json -{ - "payment_profile": { - "payment_type": "apple_pay", - "id": 60, - "first_name": "first_name2", - "last_name": "last_name0", - "customer_id": 98, - "current_vault": "braintree_blue" - } -} +## Example + +```ruby +payment_profile_response = PaymentProfileResponse.new( + payment_profile: ApplePayPaymentProfile.new( + payment_type: PaymentType::APPLE_PAY, + id: 60, + first_name: 'first_name2', + last_name: 'last_name0', + customer_id: 98, + current_vault: ApplePayVault::BRAINTREE_BLUE + ) +) ``` diff --git a/doc/models/payment-related-events.md b/doc/models/payment-related-events.md index c4060b39..fb432bb5 100644 --- a/doc/models/payment-related-events.md +++ b/doc/models/payment-related-events.md @@ -12,12 +12,12 @@ | `product_id` | `Integer` | Required | - | | `account_transaction_id` | `Integer` | Required | - | -## Example (as JSON) +## Example -```json -{ - "product_id": 42, - "account_transaction_id": 58 -} +```ruby +payment_related_events = PaymentRelatedEvents.new( + product_id: 208, + account_transaction_id: 52 +) ``` diff --git a/doc/models/payment-type.md b/doc/models/payment-type.md index 44b7cba6..5b1d2835 100644 --- a/doc/models/payment-type.md +++ b/doc/models/payment-type.md @@ -14,3 +14,9 @@ | `PAYPAL_ACCOUNT` | | `APPLE_PAY` | +## Example + +```ruby +payment_type = PaymentType::CREDIT_CARD +``` + diff --git a/doc/models/paypal-payment-profile.md b/doc/models/paypal-payment-profile.md index d9d0abdc..7db7ea01 100644 --- a/doc/models/paypal-payment-profile.md +++ b/doc/models/paypal-payment-profile.md @@ -29,16 +29,16 @@ | `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) - -```json -{ - "payment_type": "paypal_account", - "id": 10, - "first_name": "first_name0", - "last_name": "last_name8", - "customer_id": 48, - "current_vault": "moduslink" -} +## Example + +```ruby +paypal_payment_profile = PaypalPaymentProfile.new( + payment_type: PaymentType::PAYPAL_ACCOUNT, + id: 182, + first_name: 'first_name4', + last_name: 'last_name2', + customer_id: 220, + current_vault: PayPalVault::MODUSLINK +) ``` diff --git a/doc/models/pending-cancellation-change.md b/doc/models/pending-cancellation-change.md index 125ccf51..b40c18d8 100644 --- a/doc/models/pending-cancellation-change.md +++ b/doc/models/pending-cancellation-change.md @@ -12,12 +12,12 @@ | `cancellation_state` | `String` | Required | - | | `cancels_at` | `DateTime` | Required | - | -## Example (as JSON) +## Example -```json -{ - "cancellation_state": "cancellation_state8", - "cancels_at": "2016-03-13T12:52:32.123Z" -} +```ruby +pending_cancellation_change = PendingCancellationChange.new( + cancellation_state: 'cancellation_state2', + cancels_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/portal-management-link.md b/doc/models/portal-management-link.md index 656e506f..42650ac8 100644 --- a/doc/models/portal-management-link.md +++ b/doc/models/portal-management-link.md @@ -16,15 +16,15 @@ | `expires_at` | `DateTime` | Optional | - | | `last_invite_sent_at` | `DateTime` | Optional | - | -## Example (as JSON) - -```json -{ - "url": "url0", - "fetch_count": 222, - "created_at": "2016-03-13T12:52:32.123Z", - "new_link_available_at": "2016-03-13T12:52:32.123Z", - "expires_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +portal_management_link = PortalManagementLink.new( + url: 'url0', + fetch_count: 46, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + new_link_available_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + expires_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/prepaid-configuration-response.md b/doc/models/prepaid-configuration-response.md index 708062bf..9e635d7e 100644 --- a/doc/models/prepaid-configuration-response.md +++ b/doc/models/prepaid-configuration-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `prepaid_configuration` | [`PrepaidConfiguration`](../../doc/models/prepaid-configuration.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepaid_configuration": { - "id": 142, - "initial_funding_amount_in_cents": 74, - "replenish_to_amount_in_cents": 76, - "auto_replenish": false, - "replenish_threshold_amount_in_cents": 20 - } -} +## Example + +```ruby +prepaid_configuration_response = PrepaidConfigurationResponse.new( + prepaid_configuration: PrepaidConfiguration.new( + id: 142, + initial_funding_amount_in_cents: 74, + replenish_to_amount_in_cents: 76, + auto_replenish: false, + replenish_threshold_amount_in_cents: 20 + ) +) ``` diff --git a/doc/models/prepaid-configuration.md b/doc/models/prepaid-configuration.md index 6bab807f..0ea9eae6 100644 --- a/doc/models/prepaid-configuration.md +++ b/doc/models/prepaid-configuration.md @@ -15,15 +15,15 @@ | `auto_replenish` | `TrueClass \| FalseClass` | Optional | - | | `replenish_threshold_amount_in_cents` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 156, - "initial_funding_amount_in_cents": 88, - "replenish_to_amount_in_cents": 166, - "auto_replenish": false, - "replenish_threshold_amount_in_cents": 222 -} +## Example + +```ruby +prepaid_configuration = PrepaidConfiguration.new( + id: 142, + initial_funding_amount_in_cents: 74, + replenish_to_amount_in_cents: 76, + auto_replenish: false, + replenish_threshold_amount_in_cents: 20 +) ``` diff --git a/doc/models/prepaid-product-price-point-filter.md b/doc/models/prepaid-product-price-point-filter.md index 41f04c9f..7307281c 100644 --- a/doc/models/prepaid-product-price-point-filter.md +++ b/doc/models/prepaid-product-price-point-filter.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `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) +## Example -```json -{ - "product_price_point_id": "not_null" -} +```ruby +prepaid_product_price_point_filter = PrepaidProductPricePointFilter.new( + product_price_point_id: 'not_null' +) ``` diff --git a/doc/models/prepaid-subscription-balance-changed.md b/doc/models/prepaid-subscription-balance-changed.md index 222c9b33..083fda1d 100644 --- a/doc/models/prepaid-subscription-balance-changed.md +++ b/doc/models/prepaid-subscription-balance-changed.md @@ -14,14 +14,14 @@ | `prepayment_account_balance_in_cents` | `Integer` | Required | - | | `current_usage_amount_in_cents` | `Integer` | Required | - | -## Example (as JSON) - -```json -{ - "reason": "reason8", - "current_account_balance_in_cents": 250, - "prepayment_account_balance_in_cents": 44, - "current_usage_amount_in_cents": 242 -} +## Example + +```ruby +prepaid_subscription_balance_changed = PrepaidSubscriptionBalanceChanged.new( + reason: 'reason4', + current_account_balance_in_cents: 24, + prepayment_account_balance_in_cents: 242, + current_usage_amount_in_cents: 16 +) ``` diff --git a/doc/models/prepaid-usage-allocation-detail.md b/doc/models/prepaid-usage-allocation-detail.md index 15eaa4f9..3986a345 100644 --- a/doc/models/prepaid-usage-allocation-detail.md +++ b/doc/models/prepaid-usage-allocation-detail.md @@ -13,13 +13,13 @@ | `charge_id` | `Integer` | Optional | - | | `usage_quantity` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "allocation_id": 72, - "charge_id": 30, - "usage_quantity": 212 -} +## Example + +```ruby +prepaid_usage_allocation_detail = PrepaidUsageAllocationDetail.new( + allocation_id: 18, + charge_id: 84, + usage_quantity: 10 +) ``` diff --git a/doc/models/prepaid-usage-component.md b/doc/models/prepaid-usage-component.md index 57cd75b0..ac75dbcc 100644 --- a/doc/models/prepaid-usage-component.md +++ b/doc/models/prepaid-usage-component.md @@ -9,10 +9,10 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `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 | +| `name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "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. e.g., “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 in 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[Price]`](../../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. | @@ -23,47 +23,43 @@ | `tax_code` | `String` | Optional | A string representing the tax code related to the component type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | | `hide_date_range_on_invoice` | `TrueClass \| FalseClass` | Optional | (Only available on Relationship Invoicing sites) Boolean flag describing if the service date range should show for the component on generated invoices. | | `overage_pricing` | [`OveragePricing`](../../doc/models/overage-pricing.md) | Required | - | -| `rollover_prepaid_remainder` | `TrueClass \| FalseClass` | Optional | Boolean which controls whether or not remaining units should be rolled over to the next period | -| `renew_prepaid_allocation` | `TrueClass \| FalseClass` | Optional | Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period | +| `rollover_prepaid_remainder` | `TrueClass \| FalseClass` | Optional | Boolean which controls whether or not remaining units should be rolled over to the next period. | +| `renew_prepaid_allocation` | `TrueClass \| FalseClass` | Optional | 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 | | `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | - | | `display_on_hosted_page` | `TrueClass \| FalseClass` | Optional | - | | `allow_fractional_quantities` | `TrueClass \| FalseClass` | Optional | - | | `public_signup_page_ids` | `Array[Integer]` | Optional | - | +| `unspsc_code` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | -## Example (as JSON) +## Example -```json -{ - "name": "name2", - "unit_name": "unit_name4", - "description": "description8", - "handle": "handle8", - "taxable": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "upgrade_charge": "prorated", - "overage_pricing": { - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +```ruby +prepaid_usage_component = PrepaidUsageComponent.new( + name: 'name2', + unit_name: 'unit_name4', + pricing_scheme: PricingScheme::PER_UNIT, + overage_pricing: OveragePricing.new( + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ] - } -} + ), + description: 'description2', + handle: 'handle8', + taxable: false, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + upgrade_charge: CreditType::FULL +) ``` diff --git a/doc/models/prepaid-usage.md b/doc/models/prepaid-usage.md index f3af4fd9..71818679 100644 --- a/doc/models/prepaid-usage.md +++ b/doc/models/prepaid-usage.md @@ -11,8 +11,8 @@ | --- | --- | --- | --- | | `previous_unit_balance` | `String` | Required | **Constraints**: *Minimum Length*: `1` | | `previous_overage_unit_balance` | `String` | Required | **Constraints**: *Minimum Length*: `1` | -| `new_unit_balance` | `Integer` | Required | - | -| `new_overage_unit_balance` | `Integer` | Required | - | +| `new_unit_balance` | Integer \| String | Required | This is a container for one-of cases. | +| `new_overage_unit_balance` | Integer \| String | Required | This is a container for one-of cases. | | `usage_quantity` | `Integer` | Required | - | | `overage_usage_quantity` | `Integer` | Required | - | | `component_id` | `Integer` | Required | - | @@ -20,26 +20,26 @@ | `memo` | `String` | Required | - | | `allocation_details` | [`Array[PrepaidUsageAllocationDetail]`](../../doc/models/prepaid-usage-allocation-detail.md) | Required | - | -## Example (as JSON) - -```json -{ - "previous_unit_balance": "previous_unit_balance0", - "previous_overage_unit_balance": "previous_overage_unit_balance4", - "new_unit_balance": 252, - "new_overage_unit_balance": 224, - "usage_quantity": 214, - "overage_usage_quantity": 106, - "component_id": 176, - "component_handle": "component_handle4", - "memo": "memo8", - "allocation_details": [ - { - "allocation_id": 18, - "charge_id": 84, - "usage_quantity": 10 - } +## Example + +```ruby +prepaid_usage = PrepaidUsage.new( + previous_unit_balance: 'previous_unit_balance2', + previous_overage_unit_balance: 'previous_overage_unit_balance2', + new_unit_balance: 180, + new_overage_unit_balance: 204, + usage_quantity: 220, + overage_usage_quantity: 144, + component_id: 182, + component_handle: 'component_handle2', + memo: 'memo6', + allocation_details: [ + PrepaidUsageAllocationDetail.new( + allocation_id: 18, + charge_id: 84, + usage_quantity: 10 + ) ] -} +) ``` diff --git a/doc/models/prepayment-account-balance-changed.md b/doc/models/prepayment-account-balance-changed.md index 52c2e30e..a129a356 100644 --- a/doc/models/prepayment-account-balance-changed.md +++ b/doc/models/prepayment-account-balance-changed.md @@ -14,14 +14,14 @@ | `prepayment_balance_change_in_cents` | `Integer` | Required | - | | `currency_code` | `String` | Required | - | -## Example (as JSON) - -```json -{ - "reason": "reason4", - "prepayment_account_balance_in_cents": 182, - "prepayment_balance_change_in_cents": 206, - "currency_code": "currency_code4" -} +## Example + +```ruby +prepayment_account_balance_changed = PrepaymentAccountBalanceChanged.new( + reason: 'reason8', + prepayment_account_balance_in_cents: 6, + prepayment_balance_change_in_cents: 18, + currency_code: 'currency_code2' +) ``` diff --git a/doc/models/prepayment-method.md b/doc/models/prepayment-method.md index adbddd85..e58fe8dc 100644 --- a/doc/models/prepayment-method.md +++ b/doc/models/prepayment-method.md @@ -17,3 +17,9 @@ | `CREDIT_CARD` | | `OTHER` | +## Example + +```ruby +prepayment_method = PrepaymentMethod::CASH +``` + diff --git a/doc/models/prepayment-response.md b/doc/models/prepayment-response.md index f0b045af..89c5b8f6 100644 --- a/doc/models/prepayment-response.md +++ b/doc/models/prepayment-response.md @@ -11,22 +11,22 @@ | --- | --- | --- | --- | | `prepayment` | [`Prepayment`](../../doc/models/prepayment.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepayment": { - "id": 38, - "subscription_id": 148, - "amount_in_cents": 124, - "remaining_amount_in_cents": 182, - "refunded_amount_in_cents": 132, - "details": "details8", - "external": false, - "memo": "memo2", - "payment_type": "credit_card", - "created_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ruby +prepayment_response = PrepaymentResponse.new( + prepayment: Prepayment.new( + id: 38, + subscription_id: 148, + amount_in_cents: 124, + remaining_amount_in_cents: 182, + external: false, + memo: 'memo2', + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + refunded_amount_in_cents: 132, + details: 'details8', + payment_type: PrepaymentMethod::CREDIT_CARD + ) +) ``` diff --git a/doc/models/prepayment.md b/doc/models/prepayment.md index 570ecb5c..1f86ec2a 100644 --- a/doc/models/prepayment.md +++ b/doc/models/prepayment.md @@ -20,20 +20,20 @@ | `payment_type` | [`PrepaymentMethod`](../../doc/models/prepayment-method.md) | Optional | The payment type of the prepayment. | | `created_at` | `DateTime` | Required | - | -## Example (as JSON) - -```json -{ - "id": 50, - "subscription_id": 160, - "amount_in_cents": 120, - "remaining_amount_in_cents": 194, - "refunded_amount_in_cents": 144, - "details": "details4", - "external": false, - "memo": "memo8", - "payment_type": "cash", - "created_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +prepayment = Prepayment.new( + id: 38, + subscription_id: 148, + amount_in_cents: 124, + remaining_amount_in_cents: 182, + external: false, + memo: 'memo2', + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + refunded_amount_in_cents: 132, + details: 'details8', + payment_type: PrepaymentMethod::CREDIT_CARD +) ``` diff --git a/doc/models/prepayments-response.md b/doc/models/prepayments-response.md index ca4ad487..37cab904 100644 --- a/doc/models/prepayments-response.md +++ b/doc/models/prepayments-response.md @@ -11,36 +11,48 @@ | --- | --- | --- | --- | | `prepayments` | [`Array[Prepayment]`](../../doc/models/prepayment.md) | Optional | **Constraints**: *Unique Items Required* | -## Example (as JSON) - -```json -{ - "prepayments": [ - { - "id": 76, - "subscription_id": 186, - "amount_in_cents": 94, - "remaining_amount_in_cents": 220, - "refunded_amount_in_cents": 170, - "details": "details6", - "external": false, - "memo": "memo0", - "payment_type": "cash", - "created_at": "2016-03-13T12:52:32.123Z" - }, - { - "id": 76, - "subscription_id": 186, - "amount_in_cents": 94, - "remaining_amount_in_cents": 220, - "refunded_amount_in_cents": 170, - "details": "details6", - "external": false, - "memo": "memo0", - "payment_type": "cash", - "created_at": "2016-03-13T12:52:32.123Z" - } +## Example + +```ruby +prepayments_response = PrepaymentsResponse.new( + prepayments: [ + Prepayment.new( + id: 76, + subscription_id: 186, + amount_in_cents: 94, + remaining_amount_in_cents: 220, + external: false, + memo: 'memo0', + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + refunded_amount_in_cents: 170, + details: 'details6', + payment_type: PrepaymentMethod::CASH + ), + Prepayment.new( + id: 76, + subscription_id: 186, + amount_in_cents: 94, + remaining_amount_in_cents: 220, + external: false, + memo: 'memo0', + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + refunded_amount_in_cents: 170, + details: 'details6', + payment_type: PrepaymentMethod::CASH + ), + Prepayment.new( + id: 76, + subscription_id: 186, + amount_in_cents: 94, + remaining_amount_in_cents: 220, + external: false, + memo: 'memo0', + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + refunded_amount_in_cents: 170, + details: 'details6', + payment_type: PrepaymentMethod::CASH + ) ] -} +) ``` diff --git a/doc/models/preview-allocations-request.md b/doc/models/preview-allocations-request.md index 3aec22f4..0fc46230 100644 --- a/doc/models/preview-allocations-request.md +++ b/doc/models/preview-allocations-request.md @@ -14,23 +14,23 @@ | `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. | | `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. | -## Example (as JSON) - -```json -{ - "allocations": [ - { - "quantity": 26.48, - "decimal_quantity": "decimal_quantity8", - "previous_quantity": 55.5, - "decimal_previous_quantity": "decimal_previous_quantity2", - "component_id": 242, - "memo": "memo6" - } +## Example + +```ruby +preview_allocations_request = PreviewAllocationsRequest.new( + allocations: [ + CreateAllocation.new( + quantity: 26.48, + decimal_quantity: 'decimal_quantity8', + previous_quantity: 55.5, + decimal_previous_quantity: 'decimal_previous_quantity2', + component_id: 242, + memo: 'memo6' + ) ], - "effective_proration_date": "2023-12-01", - "upgrade_charge": "none", - "downgrade_credit": "prorated" -} + effective_proration_date: Date.iso8601('2023-12-01'), + upgrade_charge: CreditType::FULL, + downgrade_credit: CreditType::FULL +) ``` diff --git a/doc/models/price-point-type.md b/doc/models/price-point-type.md index c6155a3e..54dafd9c 100644 --- a/doc/models/price-point-type.md +++ b/doc/models/price-point-type.md @@ -19,3 +19,9 @@ Price point type. We expose the following types: | `DEFAULT` | | `CUSTOM` | +## Example + +```ruby +price_point_type = PricePointType::CUSTOM +``` + diff --git a/doc/models/price.md b/doc/models/price.md index 5a1133bf..2e266b39 100644 --- a/doc/models/price.md +++ b/doc/models/price.md @@ -13,13 +13,13 @@ | `ending_quantity` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `unit_price` | Float \| String | Required | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "starting_quantity": 40, - "ending_quantity": 14, - "unit_price": 125.12 -} +## Example + +```ruby +price = Price.new( + starting_quantity: 132, + unit_price: 70.44, + ending_quantity: 6 +) ``` diff --git a/doc/models/pricing-scheme.md b/doc/models/pricing-scheme.md index 6be09a7a..e09f9108 100644 --- a/doc/models/pricing-scheme.md +++ b/doc/models/pricing-scheme.md @@ -16,3 +16,9 @@ The identifier for the pricing scheme. See [Product Components](https://help.cha | `PER_UNIT` | | `TIERED` | +## Example + +```ruby +pricing_scheme = PricingScheme::PER_UNIT +``` + diff --git a/doc/models/product-family-response.md b/doc/models/product-family-response.md index e90f0430..5192b3df 100644 --- a/doc/models/product-family-response.md +++ b/doc/models/product-family-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `product_family` | [`ProductFamily`](../../doc/models/product-family.md) | Optional | - | -## Example (as JSON) - -```json -{ - "product_family": { - "id": 14, - "name": "name0", - "handle": "handle6", - "accounting_code": "accounting_code6", - "description": "description0" - } -} +## Example + +```ruby +product_family_response = ProductFamilyResponse.new( + product_family: ProductFamily.new( + id: 14, + name: 'name0', + handle: 'handle6', + accounting_code: 'accounting_code6', + description: 'description0' + ) +) ``` diff --git a/doc/models/product-family.md b/doc/models/product-family.md index e04a0b05..9afa2840 100644 --- a/doc/models/product-family.md +++ b/doc/models/product-family.md @@ -14,19 +14,20 @@ | `handle` | `String` | Optional | - | | `accounting_code` | `String` | Optional | - | | `description` | `String` | Optional | - | +| `surcharging` | `TrueClass \| FalseClass` | Optional | Whether surcharging applies to this product family. Only included on sites where surcharging is enabled. | | `created_at` | `DateTime` | Optional | - | | `updated_at` | `DateTime` | Optional | - | | `archived_at` | `DateTime` | Optional | Timestamp indicating when this product family was archived. `null` if the product family is not archived. | -## Example (as JSON) +## Example -```json -{ - "id": 194, - "name": "name2", - "handle": "handle8", - "accounting_code": "accounting_code8", - "description": "description8" -} +```ruby +product_family = ProductFamily.new( + id: 14, + name: 'name0', + handle: 'handle6', + accounting_code: 'accounting_code6', + description: 'description0' +) ``` diff --git a/doc/models/product-price-point-error-response-exception.md b/doc/models/product-price-point-error-response-exception.md index e7a5745a..9ef6c75c 100644 --- a/doc/models/product-price-point-error-response-exception.md +++ b/doc/models/product-price-point-error-response-exception.md @@ -11,31 +11,13 @@ | --- | --- | --- | --- | | `errors` | [`ProductPricePointErrors`](../../doc/models/product-price-point-errors.md) | Required | - | -## Example (as JSON) - -```json -{ - "errors": { - "price_point": "can't be blank", - "interval": [ - "Recurring Interval: cannot be blank.", - "Recurring Interval: must be greater than or equal to 1." - ], - "interval_unit": [ - "Interval unit: cannot be blank.", - "Interval unit: must be 'month' or 'day'." - ], - "name": [ - "Name: cannot be blank." - ], - "price": [ - "Price: is not a number.", - "Price: must be greater than or equal to 0." - ], - "price_in_cents": [ - "Price in cents: cannot be blank." - ] - } -} +## Example + +```ruby +begin + # make the API call +rescue ProductPricePointErrorResponseException => e + puts "Caught ProductPricePointErrorResponseException: #{e.message}" +end ``` diff --git a/doc/models/product-price-point-errors.md b/doc/models/product-price-point-errors.md index 8bf1c314..10ad1d5b 100644 --- a/doc/models/product-price-point-errors.md +++ b/doc/models/product-price-point-errors.md @@ -16,29 +16,29 @@ | `price` | `Array[String]` | Optional | - | | `price_in_cents` | `Array[String]` | Optional | - | -## Example (as JSON) - -```json -{ - "price_point": "can't be blank", - "interval": [ - "Recurring Interval: cannot be blank.", - "Recurring Interval: must be greater than or equal to 1." +## Example + +```ruby +product_price_point_errors = ProductPricePointErrors.new( + price_point: 'can\'t be blank', + interval: [ + 'Recurring Interval: cannot be blank.', + 'Recurring Interval: must be greater than or equal to 1.' ], - "interval_unit": [ - "Interval unit: cannot be blank.", - "Interval unit: must be 'month' or 'day'." + interval_unit: [ + 'Interval unit: cannot be blank.', + 'Interval unit: must be \'month\' or \'day\'.' ], - "name": [ - "Name: cannot be blank." + name: [ + 'Name: cannot be blank.' ], - "price": [ - "Price: is not a number.", - "Price: must be greater than or equal to 0." + price: [ + 'Price: is not a number.', + 'Price: must be greater than or equal to 0.' ], - "price_in_cents": [ - "Price in cents: cannot be blank." + price_in_cents: [ + 'Price in cents: cannot be blank.' ] -} +) ``` diff --git a/doc/models/product-price-point-response.md b/doc/models/product-price-point-response.md index 33f69f3e..bb61c19a 100644 --- a/doc/models/product-price-point-response.md +++ b/doc/models/product-price-point-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `price_point` | [`ProductPricePoint`](../../doc/models/product-price-point.md) | Required | - | -## Example (as JSON) - -```json -{ - "price_point": { - "id": 248, - "name": "name0", - "handle": "handle6", - "price_in_cents": 196, - "interval": 44 - } -} +## Example + +```ruby +product_price_point_response = ProductPricePointResponse.new( + price_point: ProductPricePoint.new( + id: 248, + name: 'name0', + handle: 'handle6', + price_in_cents: 196, + interval: 44 + ) +) ``` diff --git a/doc/models/product-price-point.md b/doc/models/product-price-point.md index 2709500f..60601f98 100644 --- a/doc/models/product-price-point.md +++ b/doc/models/product-price-point.md @@ -13,16 +13,16 @@ | `name` | `String` | Optional | The product price point name | | `handle` | `String` | Optional | The product price point API handle | | `price_in_cents` | `Integer` | Optional | The product price point price, in integer cents | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this product price point, either month or day | | `trial_price_in_cents` | `Integer` | Optional | The product price point trial price, in integer cents | -| `trial_interval` | `Integer` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days | +| `trial_interval` | `Integer` | Optional | The numerical trial interval. e.g., an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days. | | `trial_interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product price point, either month or day | -| `trial_type` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | +| `trial_type` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | | `introductory_offer` | `TrueClass \| FalseClass` | Optional | reserved for future use | | `initial_charge_in_cents` | `Integer` | Optional | The product price point initial charge, in integer cents | | `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` | `Integer` | Optional | The numerical expiration interval. e.g., 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 | | `product_id` | `Integer` | Optional | The product id this price point belongs to | | `archived_at` | `DateTime` | Optional | Timestamp indicating when this price point was archived | @@ -34,15 +34,15 @@ | `subscription_id` | `Integer` | Optional | The subscription id this price point belongs to | | `currency_prices` | [`Array[CurrencyPrice]`](../../doc/models/currency-price.md) | Optional | An array of currency pricing data is available when multiple currencies are defined for the site. It varies based on the use_site_exchange_rate setting for the price point. This parameter is present only in the response of read endpoints, after including the appropriate query parameter. | -## Example (as JSON) +## Example -```json -{ - "id": 196, - "name": "name6", - "handle": "handle2", - "price_in_cents": 248, - "interval": 8 -} +```ruby +product_price_point = ProductPricePoint.new( + id: 84, + name: 'name8', + handle: 'handle4', + price_in_cents: 152, + interval: 136 +) ``` diff --git a/doc/models/product-response.md b/doc/models/product-response.md index a0e513ed..3172fa5e 100644 --- a/doc/models/product-response.md +++ b/doc/models/product-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `product` | [`Product`](../../doc/models/product.md) | Required | - | -## Example (as JSON) - -```json -{ - "product": { - "id": 134, - "name": "name0", - "handle": "handle6", - "description": "description0", - "accounting_code": "accounting_code6" - } -} +## Example + +```ruby +product_response = ProductResponse.new( + product: Product.new( + id: 134, + name: 'name0', + handle: 'handle6', + description: 'description0', + accounting_code: 'accounting_code6' + ) +) ``` diff --git a/doc/models/product.md b/doc/models/product.md index b1a0ce4c..f1f572d4 100644 --- a/doc/models/product.md +++ b/doc/models/product.md @@ -13,18 +13,18 @@ | `name` | `String` | Optional | The product name | | `handle` | `String` | Optional | The product API handle | | `description` | `String` | Optional | The product description | -| `accounting_code` | `String` | Optional | E.g. Internal ID or SKU Number | +| `accounting_code` | `String` | Optional | E.g., Internal ID or SKU Number | | `request_credit_card` | `TrueClass \| FalseClass` | Optional | Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, read this attribute from under the signup page. | -| `expiration_interval` | `Integer` | Optional | A numerical interval for the length a subscription to this product will run before it expires. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval | +| `expiration_interval` | `Integer` | Optional | A numerical interval for the length a subscription to this product will run before it expires. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval. | | `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 | | `created_at` | `DateTime` | Optional | Timestamp indicating when this product was created | | `updated_at` | `DateTime` | Optional | Timestamp indicating when this product was last updated | | `price_in_cents` | `Integer` | Optional | The product price, in integer cents | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days. | | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this product, either month or day | | `initial_charge_in_cents` | `Integer` | Optional | The up front charge you have specified. | | `trial_price_in_cents` | `Integer` | Optional | The price of the trial period for a subscription to this product, in integer cents. | -| `trial_interval` | `Integer` | Optional | A numerical interval for the length of the trial period of a subscription to this product. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval | +| `trial_interval` | `Integer` | Optional | A numerical interval for the length of the trial period of a subscription to this product. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval. | | `trial_interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product, either month or day | | `archived_at` | `DateTime` | Optional | Timestamp indicating when this product was archived | | `require_credit_card` | `TrueClass \| FalseClass` | Optional | Boolean that controls whether a payment profile is required to be entered for customers wishing to sign up on this product. | @@ -33,7 +33,7 @@ | `update_return_url` | `String` | Optional | The url to which a customer will be returned after a successful account update | | `initial_charge_after_trial` | `TrueClass \| FalseClass` | Optional | - | | `version_number` | `Integer` | Optional | The version of the product | -| `update_return_params` | `String` | Optional | The parameters will append to the url after a successful account update. See [help documentation](https://help.chargify.com/products/product-editing.html#return-parameters-after-account-update) | +| `update_return_params` | `String` | Optional | The parameters will append to the url after a successful account update. See [help documentation](https://help.chargify.com/products/product-editing.html#return-parameters-after-account-update). | | `product_family` | [`ProductFamily`](../../doc/models/product-family.md) | Optional | - | | `public_signup_pages` | [`Array[PublicSignupPage]`](../../doc/models/public-signup-page.md) | Optional | - | | `product_price_point_name` | `String` | Optional | - | @@ -46,16 +46,17 @@ | `item_category` | `String` | Optional | One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other | | `product_price_point_id` | `Integer` | Optional | - | | `product_price_point_handle` | `String` | Optional | - | - -## Example (as JSON) - -```json -{ - "id": 180, - "name": "name4", - "handle": "handle0", - "description": "description4", - "accounting_code": "accounting_code0" -} +| `unspsc_code` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this product instead of the default derived from item_category. | + +## Example + +```ruby +product = Product.new( + id: 134, + name: 'name0', + handle: 'handle6', + description: 'description0', + accounting_code: 'accounting_code6' +) ``` diff --git a/doc/models/proforma-bad-request-error-response-exception.md b/doc/models/proforma-bad-request-error-response-exception.md index e9549ffd..76fa9a06 100644 --- a/doc/models/proforma-bad-request-error-response-exception.md +++ b/doc/models/proforma-bad-request-error-response-exception.md @@ -11,18 +11,13 @@ | --- | --- | --- | --- | | `errors` | [`ProformaError`](../../doc/models/proforma-error.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": { - "subscription": { - "base": [ - "base3", - "base4" - ] - } - } -} +## Example + +```ruby +begin + # make the API call +rescue ProformaBadRequestErrorResponseException => e + puts "Caught ProformaBadRequestErrorResponseException: #{e.message}" +end ``` diff --git a/doc/models/proforma-error.md b/doc/models/proforma-error.md index f9e1ef3e..71f6e9d1 100644 --- a/doc/models/proforma-error.md +++ b/doc/models/proforma-error.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `subscription` | [`BaseStringError`](../../doc/models/base-string-error.md) | Optional | The error is base if it is not directly associated with a single attribute. | -## Example (as JSON) - -```json -{ - "subscription": { - "base": [ - "base3", - "base4" +## Example + +```ruby +proforma_error = ProformaError.new( + subscription: BaseStringError.new( + base: [ + 'base3', + 'base4' ] - } -} + ) +) ``` diff --git a/doc/models/proforma-invoice-credit.md b/doc/models/proforma-invoice-credit.md index a5bb2b14..c33f4cfc 100644 --- a/doc/models/proforma-invoice-credit.md +++ b/doc/models/proforma-invoice-credit.md @@ -14,14 +14,14 @@ | `original_amount` | `String` | Optional | **Constraints**: *Minimum Length*: `1` | | `applied_amount` | `String` | Optional | **Constraints**: *Minimum Length*: `1` | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "memo": "memo2", - "original_amount": "original_amount2", - "applied_amount": "applied_amount0" -} +## Example + +```ruby +proforma_invoice_credit = ProformaInvoiceCredit.new( + uid: 'uid0', + memo: 'memo4', + original_amount: 'original_amount4', + applied_amount: 'applied_amount8' +) ``` diff --git a/doc/models/proforma-invoice-discount-source-type.md b/doc/models/proforma-invoice-discount-source-type.md index 9ca7d08f..501ee2fb 100644 --- a/doc/models/proforma-invoice-discount-source-type.md +++ b/doc/models/proforma-invoice-discount-source-type.md @@ -12,3 +12,9 @@ | `COUPON` | | `REFERRAL` | +## Example + +```ruby +proforma_invoice_discount_source_type = ProformaInvoiceDiscountSourceType::COUPON +``` + diff --git a/doc/models/proforma-invoice-discount.md b/doc/models/proforma-invoice-discount.md index c24ab980..f8fd37e9 100644 --- a/doc/models/proforma-invoice-discount.md +++ b/doc/models/proforma-invoice-discount.md @@ -18,15 +18,15 @@ | `discount_amount` | `String` | Optional | **Constraints**: *Minimum Length*: `1` | | `line_item_breakouts` | [`Array[InvoiceDiscountBreakout]`](../../doc/models/invoice-discount-breakout.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | -## Example (as JSON) - -```json -{ - "uid": "uid2", - "title": "title8", - "code": "code0", - "source_type": "Coupon", - "discount_type": "percentage" -} +## Example + +```ruby +proforma_invoice_discount = ProformaInvoiceDiscount.new( + uid: 'uid0', + title: 'title6', + code: 'code8', + source_type: ProformaInvoiceDiscountSourceType::COUPON, + discount_type: InvoiceDiscountType::ROLLOVER +) ``` diff --git a/doc/models/proforma-invoice-issued.md b/doc/models/proforma-invoice-issued.md index 14490bee..f6bcf5bd 100644 --- a/doc/models/proforma-invoice-issued.md +++ b/doc/models/proforma-invoice-issued.md @@ -21,29 +21,29 @@ | `product_name` | `String` | Required | - | | `line_items` | [`Array[InvoiceLineItemEventData]`](../../doc/models/invoice-line-item-event-data.md) | Required | - | -## Example (as JSON) - -```json -{ - "uid": "uid0", - "number": "number2", - "role": "role6", - "delivery_date": "2016-03-13", - "created_at": "2016-03-13T12:52:32.123Z", - "due_amount": "due_amount2", - "paid_amount": "paid_amount8", - "tax_amount": "tax_amount6", - "total_amount": "total_amount6", - "product_name": "product_name6", - "line_items": [ - { - "uid": "uid8", - "title": "title4", - "description": "description8", - "quantity": 102, - "quantity_delta": 204 - } +## Example + +```ruby +proforma_invoice_issued = ProformaInvoiceIssued.new( + uid: 'uid8', + number: 'number4', + role: 'role8', + delivery_date: Date.iso8601('2016-03-13'), + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + due_amount: 'due_amount0', + paid_amount: 'paid_amount0', + tax_amount: 'tax_amount8', + total_amount: 'total_amount4', + product_name: 'product_name4', + line_items: [ + InvoiceLineItemEventData.new( + uid: 'uid8', + title: 'title4', + description: 'description8', + quantity: 102, + quantity_delta: 204 + ) ] -} +) ``` diff --git a/doc/models/proforma-invoice-payment.md b/doc/models/proforma-invoice-payment.md index b44a2af9..366767a4 100644 --- a/doc/models/proforma-invoice-payment.md +++ b/doc/models/proforma-invoice-payment.md @@ -14,14 +14,14 @@ | `applied_amount` | `String` | Optional | **Constraints**: *Minimum Length*: `1` | | `prepayment` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) - -```json -{ - "memo": "memo4", - "original_amount": "original_amount4", - "applied_amount": "applied_amount8", - "prepayment": false -} +## Example + +```ruby +proforma_invoice_payment = ProformaInvoicePayment.new( + memo: 'memo2', + original_amount: 'original_amount2', + applied_amount: 'applied_amount0', + prepayment: false +) ``` diff --git a/doc/models/proforma-invoice-role.md b/doc/models/proforma-invoice-role.md index 1ccf553b..3228b313 100644 --- a/doc/models/proforma-invoice-role.md +++ b/doc/models/proforma-invoice-role.md @@ -1,7 +1,7 @@ # Proforma Invoice Role -'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic +'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic. ## Enumeration @@ -16,3 +16,9 @@ | `PROFORMA_ADHOC` | | `PROFORMA_AUTOMATIC` | +## Example + +```ruby +proforma_invoice_role = ProformaInvoiceRole::PROFORMA_ADHOC +``` + diff --git a/doc/models/proforma-invoice-status.md b/doc/models/proforma-invoice-status.md index 73e3ddef..e836e858 100644 --- a/doc/models/proforma-invoice-status.md +++ b/doc/models/proforma-invoice-status.md @@ -13,3 +13,9 @@ | `VOIDED` | | `ARCHIVED` | +## Example + +```ruby +proforma_invoice_status = ProformaInvoiceStatus::VOIDED +``` + diff --git a/doc/models/proforma-invoice-tax-source-type.md b/doc/models/proforma-invoice-tax-source-type.md index fab176de..3fbd244e 100644 --- a/doc/models/proforma-invoice-tax-source-type.md +++ b/doc/models/proforma-invoice-tax-source-type.md @@ -12,3 +12,9 @@ | `TAX` | | `AVALARA` | +## Example + +```ruby +proforma_invoice_tax_source_type = ProformaInvoiceTaxSourceType::TAX +``` + diff --git a/doc/models/proforma-invoice-tax.md b/doc/models/proforma-invoice-tax.md index 56d5501a..e862d490 100644 --- a/doc/models/proforma-invoice-tax.md +++ b/doc/models/proforma-invoice-tax.md @@ -17,15 +17,15 @@ | `tax_amount` | `String` | Optional | **Constraints**: *Minimum Length*: `1` | | `line_item_breakouts` | [`Array[InvoiceTaxBreakout]`](../../doc/models/invoice-tax-breakout.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "title": "title4", - "source_type": "Tax", - "percentage": "percentage6", - "taxable_amount": "taxable_amount2" -} +## Example + +```ruby +proforma_invoice_tax = ProformaInvoiceTax.new( + uid: 'uid4', + title: 'title0', + source_type: ProformaInvoiceTaxSourceType::TAX, + percentage: 'percentage2', + taxable_amount: 'taxable_amount8' +) ``` diff --git a/doc/models/proforma-invoice.md b/doc/models/proforma-invoice.md index 33850164..ae2001cb 100644 --- a/doc/models/proforma-invoice.md +++ b/doc/models/proforma-invoice.md @@ -21,12 +21,12 @@ | `collection_method` | [`CollectionMethod`](../../doc/models/collection-method.md) | Optional | The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - `invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`. | | `payment_instructions` | `String` | Optional | - | | `currency` | `String` | Optional | - | -| `consolidation_level` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | +| `consolidation_level` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | | `product_name` | `String` | Optional | - | | `product_family_name` | `String` | Optional | - | -| `role` | [`ProformaInvoiceRole`](../../doc/models/proforma-invoice-role.md) | Optional | 'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic | +| `role` | [`ProformaInvoiceRole`](../../doc/models/proforma-invoice-role.md) | Optional | 'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic. | | `seller` | [`InvoiceSeller`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the invoice. | -| `customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the invoiced subscription. | +| `customer` | [`InvoiceCustomer`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient of the invoiced subscription. | | `memo` | `String` | Optional | - | | `billing_address` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | - | | `shipping_address` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | - | @@ -47,15 +47,15 @@ | `public_url` | `String` | Optional | - | | `available_actions` | [`AvailableActions`](../../doc/models/available-actions.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "uid": "uid6", - "site_id": 196, - "customer_id": 52, - "subscription_id": 124, - "number": 0 -} +```ruby +proforma_invoice = ProformaInvoice.new( + uid: 'uid2', + site_id: 240, + customer_id: 96, + subscription_id: 168, + number: 44 +) ``` diff --git a/doc/models/proration.md b/doc/models/proration.md index e6f115d2..5061c31f 100644 --- a/doc/models/proration.md +++ b/doc/models/proration.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `preserve_period` | `TrueClass \| FalseClass` | Optional | The alternative to sending preserve_period as a direct attribute to migration | -## Example (as JSON) +## Example -```json -{ - "preserve_period": false -} +```ruby +proration = Proration.new( + preserve_period: false +) ``` diff --git a/doc/models/public-key.md b/doc/models/public-key.md index bfeb8704..713ddc0f 100644 --- a/doc/models/public-key.md +++ b/doc/models/public-key.md @@ -13,13 +13,13 @@ | `requires_security_token` | `TrueClass \| FalseClass` | Optional | - | | `created_at` | `DateTime` | Optional | - | -## Example (as JSON) - -```json -{ - "public_key": "public_key8", - "requires_security_token": false, - "created_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +public_key = PublicKey.new( + public_key: 'public_key0', + requires_security_token: false, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/public-signup-page.md b/doc/models/public-signup-page.md index ed8a835f..3bea2431 100644 --- a/doc/models/public-signup-page.md +++ b/doc/models/public-signup-page.md @@ -10,18 +10,18 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `id` | `Integer` | Optional | The id of the signup page (public_signup_pages only) | -| `return_url` | `String` | Optional | The url to which a customer will be returned after a successful signup (public_signup_pages only) | +| `return_url` | `String` | Optional | The url to which a customer will be returned after a successful signup (public_signup_pages only). | | `return_params` | `String` | Optional | The params to be appended to the return_url (public_signup_pages only) | -| `url` | `String` | Optional | The url where the signup page can be viewed (public_signup_pages only) | +| `url` | `String` | Optional | The url where the signup page can be viewed (public_signup_pages only). | -## Example (as JSON) +## Example -```json -{ - "id": 6, - "return_url": "return_url0", - "return_params": "return_params2", - "url": "url8" -} +```ruby +public_signup_page = PublicSignupPage.new( + id: 196, + return_url: 'return_url2', + return_params: 'return_params4', + url: 'url0' +) ``` diff --git a/doc/models/q-scope.md b/doc/models/q-scope.md new file mode 100644 index 00000000..9e9a0257 --- /dev/null +++ b/doc/models/q-scope.md @@ -0,0 +1,24 @@ + +# Q Scope + +## Enumeration + +`QScope` + +## Fields + +| Name | +| --- | +| `FULL_NAME` | +| `FIRST_NAME` | +| `LAST_NAME` | +| `ORGANIZATION` | +| `CUSTOMER_REFERENCE` | +| `SUBSCRIPTION_REFERENCE` | + +## Example + +```ruby +q_scope = QScope::LAST_NAME +``` + diff --git a/doc/models/quantity-based-component.md b/doc/models/quantity-based-component.md index f9fd4ca8..ae6ba2c4 100644 --- a/doc/models/quantity-based-component.md +++ b/doc/models/quantity-based-component.md @@ -9,10 +9,10 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `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 | +| `name` | `String` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "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. e.g., “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 in 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[Price]`](../../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. | @@ -26,27 +26,33 @@ | `display_on_hosted_page` | `TrueClass \| FalseClass` | Optional | - | | `allow_fractional_quantities` | `TrueClass \| FalseClass` | Optional | - | | `public_signup_page_ids` | `Array[Integer]` | Optional | - | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component's default price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component’s default 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 component's default price point, either month or day. This property is only available for sites with Multifrequency enabled. | - -## Example (as JSON) - -```json -{ - "name": "name8", - "unit_name": "unit_name0", - "description": "description8", - "handle": "handle4", - "taxable": false, - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +| `unspsc_code` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | + +## Example + +```ruby +quantity_based_component = QuantityBasedComponent.new( + name: 'name0', + unit_name: 'unit_name2', + pricing_scheme: PricingScheme::STAIRSTEP, + description: 'description0', + handle: 'handle6', + taxable: false, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "upgrade_charge": "full" -} + upgrade_charge: CreditType::PRORATED +) ``` diff --git a/doc/models/reactivate-subscription-group-request.md b/doc/models/reactivate-subscription-group-request.md index abe55bf9..87819b17 100644 --- a/doc/models/reactivate-subscription-group-request.md +++ b/doc/models/reactivate-subscription-group-request.md @@ -12,12 +12,12 @@ | `resume` | `TrueClass \| FalseClass` | Optional | - | | `resume_members` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "resume": false, - "resume_members": false -} +```ruby +reactivate_subscription_group_request = ReactivateSubscriptionGroupRequest.new( + resume: false, + resume_members: false +) ``` diff --git a/doc/models/reactivate-subscription-group-response.md b/doc/models/reactivate-subscription-group-response.md index 879ceedb..d7fd8cec 100644 --- a/doc/models/reactivate-subscription-group-response.md +++ b/doc/models/reactivate-subscription-group-response.md @@ -19,18 +19,19 @@ | `state` | `String` | Optional | - | | `cancel_at_end_of_period` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid4", - "scheme": 66, - "customer_id": 86, - "payment_profile_id": 250, - "subscription_ids": [ - 196, - 197 +## Example + +```ruby +reactivate_subscription_group_response = ReactivateSubscriptionGroupResponse.new( + uid: 'uid8', + scheme: 220, + customer_id: 240, + payment_profile_id: 148, + subscription_ids: [ + 94, + 95, + 96 ] -} +) ``` diff --git a/doc/models/reactivate-subscription-request.md b/doc/models/reactivate-subscription-request.md index f07490c9..04438f1f 100644 --- a/doc/models/reactivate-subscription-request.md +++ b/doc/models/reactivate-subscription-request.md @@ -9,24 +9,24 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `calendar_billing` | [`ReactivationBilling`](../../doc/models/reactivation-billing.md) | Optional | These values are only applicable to subscriptions using calendar billing | +| `calendar_billing` | [`ReactivationBilling`](../../doc/models/reactivation-billing.md) | Optional | These values are only applicable to subscriptions using calendar billing. | | `include_trial` | `TrueClass \| FalseClass` | Optional | If `true` is sent, the reactivated Subscription will include a trial if one is available. If `false` is sent, the trial period will be ignored. | | `preserve_balance` | `TrueClass \| FalseClass` | Optional | If `true` is passed, the existing subscription balance will NOT be cleared/reset before adding the additional reactivation charges. | | `coupon_code` | `String` | Optional | The coupon code to be applied during reactivation. | | `use_credits_and_prepayments` | `TrueClass \| FalseClass` | Optional | If true is sent, Advanced Billing will use service credits and prepayments upon reactivation. If false is sent, the service credits and prepayments will be ignored. | | `resume` | TrueClass \| FalseClass \| [Resume Options](../../doc/models/resume-options.md) \| nil | Optional | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "calendar_billing": { - "reactivation_charge": "prorated" - }, - "include_trial": false, - "preserve_balance": false, - "coupon_code": "coupon_code6", - "use_credits_and_prepayments": false -} +## Example + +```ruby +reactivate_subscription_request = ReactivateSubscriptionRequest.new( + calendar_billing: ReactivationBilling.new( + reactivation_charge: ReactivationCharge::PRORATED + ), + include_trial: false, + preserve_balance: false, + coupon_code: 'coupon_code8', + use_credits_and_prepayments: false +) ``` diff --git a/doc/models/reactivation-billing.md b/doc/models/reactivation-billing.md index 79bb07c9..be6c2d75 100644 --- a/doc/models/reactivation-billing.md +++ b/doc/models/reactivation-billing.md @@ -1,7 +1,7 @@ # Reactivation Billing -These values are only applicable to subscriptions using calendar billing +These values are only applicable to subscriptions using calendar billing. ## Structure @@ -11,13 +11,13 @@ 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 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) +## Example -```json -{ - "reactivation_charge": "prorated" -} +```ruby +reactivation_billing = ReactivationBilling.new( + reactivation_charge: ReactivationCharge::PRORATED +) ``` diff --git a/doc/models/reactivation-charge.md b/doc/models/reactivation-charge.md index dbe0bc6e..a7021fa6 100644 --- a/doc/models/reactivation-charge.md +++ b/doc/models/reactivation-charge.md @@ -1,7 +1,7 @@ # Reactivation Charge -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 +You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A prorated charge for the product price will be attempted 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. ## Enumeration @@ -15,3 +15,9 @@ You may choose how to handle the reactivation charge for that subscription: 1) ` | `IMMEDIATE` | | `DELAYED` | +## Example + +```ruby +reactivation_charge = ReactivationCharge::IMMEDIATE +``` + diff --git a/doc/models/reason-code-response.md b/doc/models/reason-code-response.md index defe592d..ff2bba1d 100644 --- a/doc/models/reason-code-response.md +++ b/doc/models/reason-code-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `reason_code` | [`ReasonCode`](../../doc/models/reason-code.md) | Required | - | -## Example (as JSON) - -```json -{ - "reason_code": { - "id": 240, - "site_id": 166, - "code": "code4", - "description": "description6", - "position": 14 - } -} +## Example + +```ruby +reason_code_response = ReasonCodeResponse.new( + reason_code: ReasonCode.new( + id: 240, + site_id: 166, + code: 'code4', + description: 'description6', + position: 14 + ) +) ``` diff --git a/doc/models/reason-code.md b/doc/models/reason-code.md index 1fc73bb8..1065d6a8 100644 --- a/doc/models/reason-code.md +++ b/doc/models/reason-code.md @@ -17,15 +17,15 @@ | `created_at` | `DateTime` | Optional | - | | `updated_at` | `DateTime` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 164, - "site_id": 90, - "code": "code0", - "description": "description2", - "position": 194 -} +## Example + +```ruby +reason_code = ReasonCode.new( + id: 240, + site_id: 166, + code: 'code4', + description: 'description6', + position: 14 +) ``` diff --git a/doc/models/record-payment-request.md b/doc/models/record-payment-request.md index 897dea4e..344a49b6 100644 --- a/doc/models/record-payment-request.md +++ b/doc/models/record-payment-request.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `payment` | [`CreatePayment`](../../doc/models/create-payment.md) | Required | - | -## Example (as JSON) - -```json -{ - "payment": { - "amount": "amount8", - "memo": "memo0", - "payment_details": "payment_details6", - "payment_method": "cash" - } -} +## Example + +```ruby +record_payment_request = RecordPaymentRequest.new( + payment: CreatePayment.new( + amount: 'amount8', + memo: 'memo0', + payment_details: 'payment_details6', + payment_method: InvoicePaymentMethodType::CASH + ) +) ``` diff --git a/doc/models/record-payment-response.md b/doc/models/record-payment-response.md index 265ec52b..b5a4e72d 100644 --- a/doc/models/record-payment-response.md +++ b/doc/models/record-payment-response.md @@ -12,35 +12,23 @@ | `paid_invoices` | [`Array[PaidInvoice]`](../../doc/models/paid-invoice.md) | Optional | - | | `prepayment` | [`InvoicePrePayment`](../../doc/models/invoice-pre-payment.md) | Optional | - | -## Example (as JSON) - -```json -{ - "paid_invoices": [ - { - "invoice_id": "invoice_id8", - "status": "draft", - "due_amount": "due_amount0", - "paid_amount": "paid_amount0" - }, - { - "invoice_id": "invoice_id8", - "status": "draft", - "due_amount": "due_amount0", - "paid_amount": "paid_amount0" - }, - { - "invoice_id": "invoice_id8", - "status": "draft", - "due_amount": "due_amount0", - "paid_amount": "paid_amount0" - } +## Example + +```ruby +record_payment_response = RecordPaymentResponse.new( + paid_invoices: [ + PaidInvoice.new( + invoice_id: 'invoice_id8', + status: InvoiceStatus::DRAFT, + due_amount: 'due_amount0', + paid_amount: 'paid_amount0' + ) ], - "prepayment": { - "subscription_id": 148, - "amount_in_cents": 124, - "ending_balance_in_cents": 164 - } -} + prepayment: InvoicePrePayment.new( + subscription_id: 148, + amount_in_cents: 124, + ending_balance_in_cents: 164 + ) +) ``` diff --git a/doc/models/recurring-scheme.md b/doc/models/recurring-scheme.md index 8e378217..58bcea18 100644 --- a/doc/models/recurring-scheme.md +++ b/doc/models/recurring-scheme.md @@ -13,3 +13,9 @@ | `RECUR_INDEFINITELY` | | `RECUR_WITH_DURATION` | +## Example + +```ruby +recurring_scheme = RecurringScheme::RECUR_WITH_DURATION +``` + diff --git a/doc/models/referral-code.md b/doc/models/referral-code.md index d8a48290..fcc0dfdf 100644 --- a/doc/models/referral-code.md +++ b/doc/models/referral-code.md @@ -14,14 +14,14 @@ | `subscription_id` | `Integer` | Optional | - | | `code` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 42, - "site_id": 224, - "subscription_id": 152, - "code": "code6" -} +## Example + +```ruby +referral_code = ReferralCode.new( + id: 46, + site_id: 228, + subscription_id: 156, + code: 'code0' +) ``` diff --git a/doc/models/referral-validation-response.md b/doc/models/referral-validation-response.md index 7c5a83ba..d71d2842 100644 --- a/doc/models/referral-validation-response.md +++ b/doc/models/referral-validation-response.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `referral_code` | [`ReferralCode`](../../doc/models/referral-code.md) | Optional | - | -## Example (as JSON) - -```json -{ - "referral_code": { - "id": 46, - "site_id": 228, - "subscription_id": 156, - "code": "code0" - } -} +## Example + +```ruby +referral_validation_response = ReferralValidationResponse.new( + referral_code: ReferralCode.new( + id: 46, + site_id: 228, + subscription_id: 156, + code: 'code0' + ) +) ``` diff --git a/doc/models/refund-consolidated-invoice.md b/doc/models/refund-consolidated-invoice.md index 5292dbd8..2301b024 100644 --- a/doc/models/refund-consolidated-invoice.md +++ b/doc/models/refund-consolidated-invoice.md @@ -1,7 +1,7 @@ # Refund Consolidated Invoice -Refund consolidated invoice +Refund consolidated invoice. ## Structure @@ -18,19 +18,20 @@ Refund consolidated invoice | `apply_credit` | `TrueClass \| FalseClass` | Optional | If set to true, creates credit and applies it to an invoice. Defaults to `false`. | | `amount` | `String` | Optional | The amount of payment to be refunded in decimal format. Example: "10.50". This will default to the full amount of the payment if not provided. | -## Example (as JSON) +## Example -```json -{ - "memo": "memo0", - "payment_id": 46, - "segment_uids": [ - "String0", - "String1" +```ruby +refund_consolidated_invoice = RefundConsolidatedInvoice.new( + memo: 'memo2', + payment_id: 66, + segment_uids: [ + 'String2', + 'String3', + 'String4' ], - "external": false, - "apply_credit": false, - "amount": "amount8" -} + external: false, + apply_credit: false, + amount: 'amount0' +) ``` diff --git a/doc/models/refund-invoice-event-data.md b/doc/models/refund-invoice-event-data.md index 134ead1c..c3430e8f 100644 --- a/doc/models/refund-invoice-event-data.md +++ b/doc/models/refund-invoice-event-data.md @@ -12,7 +12,7 @@ Example schema for an `refund_invoice` event | Name | Type | Tags | Description | | --- | --- | --- | --- | | `apply_credit` | `TrueClass \| FalseClass` | Required | If true, credit was created and applied it to the invoice. | -| `consolidation_level` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | +| `consolidation_level` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | | `credit_note_attributes` | [`CreditNote`](../../doc/models/credit-note.md) | Required | - | | `memo` | `String` | Optional | The refund memo. | | `original_amount` | `String` | Optional | The full, original amount of the refund. | @@ -21,25 +21,25 @@ Example schema for an `refund_invoice` event | `refund_id` | `Integer` | Required | The ID of the refund transaction. | | `transaction_time` | `DateTime` | Required | The time the refund was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" | -## Example (as JSON) - -```json -{ - "apply_credit": false, - "consolidation_level": "parent", - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" - }, - "memo": "memo0", - "original_amount": "original_amount0", - "payment_id": 114, - "refund_amount": "refund_amount8", - "refund_id": 158, - "transaction_time": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +refund_invoice_event_data = RefundInvoiceEventData.new( + apply_credit: false, + credit_note_attributes: CreditNote.new( + uid: 'uid2', + site_id: 72, + customer_id: 184, + subscription_id: 0, + number: 'number0' + ), + payment_id: 150, + refund_amount: 'refund_amount0', + refund_id: 194, + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + consolidation_level: InvoiceConsolidationLevel::NONE, + memo: 'memo8', + original_amount: 'original_amount8' +) ``` diff --git a/doc/models/refund-invoice-event.md b/doc/models/refund-invoice-event.md index 9155cf2e..2b7a6fee 100644 --- a/doc/models/refund-invoice-event.md +++ b/doc/models/refund-invoice-event.md @@ -15,41 +15,41 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::REFUND_INVOICE` | | `event_data` | [`RefundInvoiceEventData`](../../doc/models/refund-invoice-event-data.md) | Required | Example schema for an `refund_invoice` event | -## Example (as JSON) - -```json -{ - "id": 54, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "refund_invoice", - "event_data": { - "apply_credit": false, - "consolidation_level": "child", - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" - }, - "memo": "memo0", - "original_amount": "original_amount0", - "payment_id": 204, - "refund_amount": "refund_amount8", - "refund_id": 248, - "transaction_time": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ruby +refund_invoice_event = RefundInvoiceEvent.new( + id: 142, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::REFUND_INVOICE, + event_data: RefundInvoiceEventData.new( + apply_credit: false, + credit_note_attributes: CreditNote.new( + uid: 'uid2', + site_id: 72, + customer_id: 184, + subscription_id: 0, + number: 'number0' + ), + payment_id: 204, + refund_amount: 'refund_amount8', + refund_id: 248, + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + consolidation_level: InvoiceConsolidationLevel::CHILD, + memo: 'memo0', + original_amount: 'original_amount0' + ) +) ``` diff --git a/doc/models/refund-invoice-request.md b/doc/models/refund-invoice-request.md index 6e45de37..60d6fe17 100644 --- a/doc/models/refund-invoice-request.md +++ b/doc/models/refund-invoice-request.md @@ -11,18 +11,18 @@ | --- | --- | --- | --- | | `refund` | [Refund Invoice](../../doc/models/refund-invoice.md) \| [Refund Consolidated Invoice](../../doc/models/refund-consolidated-invoice.md) | Required | This is a container for any-of cases. | -## Example (as JSON) - -```json -{ - "refund": { - "amount": "amount8", - "memo": "memo0", - "payment_id": 0, - "external": false, - "apply_credit": false, - "void_invoice": false - } -} +## Example + +```ruby +refund_invoice_request = RefundInvoiceRequest.new( + refund: RefundInvoice.new( + amount: 'amount8', + memo: 'memo0', + payment_id: 0, + external: false, + apply_credit: false, + void_invoice: false + ) +) ``` diff --git a/doc/models/refund-invoice.md b/doc/models/refund-invoice.md index 8abb7b97..467754d5 100644 --- a/doc/models/refund-invoice.md +++ b/doc/models/refund-invoice.md @@ -16,18 +16,18 @@ Refund an invoice or a segment of a consolidated invoice. | `payment_id` | `Integer` | Required | The ID of the payment to be refunded | | `external` | `TrueClass \| FalseClass` | Optional | Flag that marks refund as external (no money is returned to the customer). Defaults to `false`. | | `apply_credit` | `TrueClass \| FalseClass` | Optional | If set to true, creates credit and applies it to an invoice. Defaults to `false`. | -| `void_invoice` | `TrueClass \| FalseClass` | Optional | If `apply_credit` set to false and refunding full amount, if `void_invoice` set to true, invoice will be voided after refund. Defaults to `false`. | - -## Example (as JSON) - -```json -{ - "amount": "amount8", - "memo": "memo0", - "payment_id": 0, - "external": false, - "apply_credit": false, - "void_invoice": false -} +| `void_invoice` | `TrueClass \| FalseClass` | Optional | If `apply_credit` is set to false and refunding full amount, if `void_invoice` is set to true, invoice will be voided after refund. Defaults to `false`. | + +## Example + +```ruby +refund_invoice = RefundInvoice.new( + amount: 'amount6', + memo: 'memo8', + payment_id: 74, + external: false, + apply_credit: false, + void_invoice: false +) ``` diff --git a/doc/models/refund-prepayment-base-errors-response-exception.md b/doc/models/refund-prepayment-base-errors-response-exception.md index fc66364a..d8347355 100644 --- a/doc/models/refund-prepayment-base-errors-response-exception.md +++ b/doc/models/refund-prepayment-base-errors-response-exception.md @@ -13,20 +13,13 @@ Errors returned on creating a refund prepayment when bad request | --- | --- | --- | --- | | `errors` | [`RefundPrepaymentBaseRefundError`](../../doc/models/refund-prepayment-base-refund-error.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": { - "refund": { - "base": [ - { - "key1": "val1", - "key2": "val2" - } - ] - } - } -} +## Example + +```ruby +begin + # make the API call +rescue RefundPrepaymentBaseErrorsResponseException => e + puts "Caught RefundPrepaymentBaseErrorsResponseException: #{e.message}" +end ``` diff --git a/doc/models/refund-prepayment-base-refund-error.md b/doc/models/refund-prepayment-base-refund-error.md index cd1d7290..51ba38f4 100644 --- a/doc/models/refund-prepayment-base-refund-error.md +++ b/doc/models/refund-prepayment-base-refund-error.md @@ -11,18 +11,15 @@ | --- | --- | --- | --- | | `refund` | [`BaseRefundError`](../../doc/models/base-refund-error.md) | Optional | - | -## Example (as JSON) - -```json -{ - "refund": { - "base": [ - { - "key1": "val1", - "key2": "val2" - } +## Example + +```ruby +refund_prepayment_base_refund_error = RefundPrepaymentBaseRefundError.new( + refund: BaseRefundError.new( + base: [ + { 'key1' => 'val1', 'key2' => 'val2' } ] - } -} + ) +) ``` diff --git a/doc/models/refund-prepayment-request.md b/doc/models/refund-prepayment-request.md index 2d4ac5a8..13fa192c 100644 --- a/doc/models/refund-prepayment-request.md +++ b/doc/models/refund-prepayment-request.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `refund` | [`RefundPrepayment`](../../doc/models/refund-prepayment.md) | Required | - | -## Example (as JSON) - -```json -{ - "refund": { - "amount_in_cents": 132, - "amount": "String1", - "memo": "memo2", - "external": false - } -} +## Example + +```ruby +refund_prepayment_request = RefundPrepaymentRequest.new( + refund: RefundPrepayment.new( + amount_in_cents: 132, + amount: 'String1', + memo: 'memo2', + external: false + ) +) ``` diff --git a/doc/models/refund-prepayment.md b/doc/models/refund-prepayment.md index a30809fe..957dddc7 100644 --- a/doc/models/refund-prepayment.md +++ b/doc/models/refund-prepayment.md @@ -14,14 +14,14 @@ | `memo` | `String` | Required | **Constraints**: *Minimum Length*: `1` | | `external` | `TrueClass \| FalseClass` | Optional | Specify the type of refund you wish to initiate. When the prepayment is external, the `external` flag is optional. But if the prepayment was made through a payment profile, the `external` flag is required. | -## Example (as JSON) - -```json -{ - "amount_in_cents": 110, - "amount": "String3", - "memo": "memo4", - "external": false -} +## Example + +```ruby +refund_prepayment = RefundPrepayment.new( + amount_in_cents: 188, + amount: 'String7', + memo: 'memo8', + external: false +) ``` diff --git a/doc/models/refund-success.md b/doc/models/refund-success.md index 66118609..d4a877ee 100644 --- a/doc/models/refund-success.md +++ b/doc/models/refund-success.md @@ -13,13 +13,13 @@ | `gateway_transaction_id` | `Integer` | Required | - | | `product_id` | `Integer` | Required | - | -## Example (as JSON) - -```json -{ - "refund_id": 12, - "gateway_transaction_id": 182, - "product_id": 168 -} +## Example + +```ruby +refund_success = RefundSuccess.new( + refund_id: 194, + gateway_transaction_id: 0, + product_id: 162 +) ``` diff --git a/doc/models/register.md b/doc/models/register.md index e7e9592f..b00e6d19 100644 --- a/doc/models/register.md +++ b/doc/models/register.md @@ -12,16 +12,16 @@ | `id` | `Integer` | Optional | - | | `maxio_id` | `String` | Optional | - | | `name` | `String` | Optional | - | -| `currency_code` | `String` | Optional | The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. | +| `currency_code` | `String` | Optional | The ISO 4217 currency code (3 character string) representing the currency of an invoice transaction. | -## Example (as JSON) +## Example -```json -{ - "id": 90, - "maxio_id": "maxio_id0", - "name": "name6", - "currency_code": "currency_code2" -} +```ruby +register = Register.new( + id: 54, + maxio_id: 'maxio_id4', + name: 'name2', + currency_code: 'currency_code2' +) ``` diff --git a/doc/models/remove-payment-event-data.md b/doc/models/remove-payment-event-data.md index 69c0236f..4542da9b 100644 --- a/doc/models/remove-payment-event-data.md +++ b/doc/models/remove-payment-event-data.md @@ -19,19 +19,19 @@ Example schema for an `remove_payment` event | `payment_method` | [Payment Method Apple Pay](../../doc/models/payment-method-apple-pay.md) \| [Payment Method Bank Account](../../doc/models/payment-method-bank-account.md) \| [Payment Method Credit Card](../../doc/models/payment-method-credit-card.md) \| [Payment Method External](../../doc/models/payment-method-external.md) \| [Payment Method Paypal](../../doc/models/payment-method-paypal.md) | Required | A nested data structure detailing the method of payment | | `prepayment` | `TrueClass \| FalseClass` | Required | The flag that shows whether the original payment was a prepayment or not | -## Example (as JSON) - -```json -{ - "transaction_id": 180, - "memo": "memo0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "payment_method": { - "type": "apple_pay" - }, - "prepayment": false, - "original_amount": "original_amount0" -} +## Example + +```ruby +remove_payment_event_data = RemovePaymentEventData.new( + transaction_id: 50, + memo: 'memo0', + applied_amount: 'applied_amount2', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + payment_method: PaymentMethodApplePay.new( + type: InvoiceEventPaymentMethod::APPLE_PAY + ), + prepayment: false, + original_amount: 'original_amount0' +) ``` diff --git a/doc/models/remove-payment-event.md b/doc/models/remove-payment-event.md index 3974a688..2b2f5761 100644 --- a/doc/models/remove-payment-event.md +++ b/doc/models/remove-payment-event.md @@ -15,35 +15,35 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::REMOVE_PAYMENT` | | `event_data` | [`RemovePaymentEventData`](../../doc/models/remove-payment-event-data.md) | Required | Example schema for an `remove_payment` event | -## Example (as JSON) - -```json -{ - "id": 236, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "remove_payment", - "event_data": { - "transaction_id": 78, - "memo": "memo0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "payment_method": { - "type": "apple_pay" - }, - "prepayment": false, - "original_amount": "original_amount0" - } -} +## Example + +```ruby +remove_payment_event = RemovePaymentEvent.new( + id: 4, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::REMOVE_PAYMENT, + event_data: RemovePaymentEventData.new( + transaction_id: 78, + memo: 'memo0', + applied_amount: 'applied_amount2', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + payment_method: PaymentMethodApplePay.new( + type: InvoiceEventPaymentMethod::APPLE_PAY + ), + prepayment: false, + original_amount: 'original_amount0' + ) +) ``` diff --git a/doc/models/renewal-preview-component.md b/doc/models/renewal-preview-component.md index d726dabf..256dc1b0 100644 --- a/doc/models/renewal-preview-component.md +++ b/doc/models/renewal-preview-component.md @@ -13,13 +13,13 @@ | `quantity` | `Integer` | Optional | The quantity for which you wish to preview billing. This is useful if you want to preview a predicted, higher usage value than is currently present on the subscription.

This quantity represents:

- Whether or not an on/off component is enabled - use 0 for disabled or 1 for enabled
- The desired allocated_quantity for a quantity-based component
- The desired unit_balance for a metered component
- The desired metric quantity for an events-based component | | `price_point_id` | String \| Integer \| nil | Optional | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "component_id": "String7", - "quantity": 174, - "price_point_id": "String1" -} +## Example + +```ruby +renewal_preview_component = RenewalPreviewComponent.new( + component_id: 'String7', + quantity: 170, + price_point_id: 'String1' +) ``` diff --git a/doc/models/renewal-preview-line-item.md b/doc/models/renewal-preview-line-item.md index 64a66b91..3df2203a 100644 --- a/doc/models/renewal-preview-line-item.md +++ b/doc/models/renewal-preview-line-item.md @@ -24,15 +24,15 @@ | `period_range_start` | `String` | Optional | - | | `period_range_end` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "transaction_type": "charge", - "kind": "prepaid_usage_component", - "amount_in_cents": 154, - "memo": "memo0", - "discount_amount_in_cents": 214 -} +## Example + +```ruby +renewal_preview_line_item = RenewalPreviewLineItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: LineItemKind::TRIAL, + amount_in_cents: 254, + memo: 'memo8', + discount_amount_in_cents: 194 +) ``` diff --git a/doc/models/renewal-preview-request.md b/doc/models/renewal-preview-request.md index 50307e78..be98dd99 100644 --- a/doc/models/renewal-preview-request.md +++ b/doc/models/renewal-preview-request.md @@ -9,29 +9,24 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `components` | [`Array[RenewalPreviewComponent]`](../../doc/models/renewal-preview-component.md) | Optional | An optional array of component definitions to preview. Providing any component definitions here will override the actual components on the subscription (and their quantities), and the billing preview will contain only these components (in addition to any product base fees). | - -## Example (as JSON) - -```json -{ - "components": [ - { - "component_id": "String5", - "quantity": 210, - "price_point_id": "String3" - }, - { - "component_id": "String5", - "quantity": 210, - "price_point_id": "String3" - }, - { - "component_id": "String5", - "quantity": 210, - "price_point_id": "String3" - } +| `components` | [`Array[RenewalPreviewComponent]`](../../doc/models/renewal-preview-component.md) | Optional | (Optional) Array of component definitions to preview. Providing any component definitions here will override the actual components on the subscription (and their quantities), and the billing preview will contain only these components (in addition to any product base fees). | + +## Example + +```ruby +renewal_preview_request = RenewalPreviewRequest.new( + components: [ + RenewalPreviewComponent.new( + component_id: 'String5', + quantity: 210, + price_point_id: 'String3' + ), + RenewalPreviewComponent.new( + component_id: 'String5', + quantity: 210, + price_point_id: 'String3' + ) ] -} +) ``` diff --git a/doc/models/renewal-preview-response.md b/doc/models/renewal-preview-response.md index 9ac06c46..89117104 100644 --- a/doc/models/renewal-preview-response.md +++ b/doc/models/renewal-preview-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `renewal_preview` | [`RenewalPreview`](../../doc/models/renewal-preview.md) | Required | - | -## Example (as JSON) - -```json -{ - "renewal_preview": { - "next_assessment_at": "2016-03-13T12:52:32.123Z", - "subtotal_in_cents": 132, - "total_tax_in_cents": 0, - "total_discount_in_cents": 250, - "total_in_cents": 20 - } -} +## Example + +```ruby +renewal_preview_response = RenewalPreviewResponse.new( + renewal_preview: RenewalPreview.new( + next_assessment_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + subtotal_in_cents: 132, + total_tax_in_cents: 0, + total_discount_in_cents: 250, + total_in_cents: 20 + ) +) ``` diff --git a/doc/models/renewal-preview.md b/doc/models/renewal-preview.md index 59c1a917..33b14b77 100644 --- a/doc/models/renewal-preview.md +++ b/doc/models/renewal-preview.md @@ -19,15 +19,15 @@ | `uncalculated_taxes` | `TrueClass \| FalseClass` | Optional | A boolean indicating whether or not additional taxes will be calculated at the time of renewal. This will be true if you are using Avalara and the address of the subscription is in one of your defined taxable regions. | | `line_items` | [`Array[RenewalPreviewLineItem]`](../../doc/models/renewal-preview-line-item.md) | Optional | An array of objects representing the individual transactions that will be created at the next renewal | -## Example (as JSON) - -```json -{ - "next_assessment_at": "2016-03-13T12:52:32.123Z", - "subtotal_in_cents": 160, - "total_tax_in_cents": 28, - "total_discount_in_cents": 34, - "total_in_cents": 48 -} +## Example + +```ruby +renewal_preview = RenewalPreview.new( + next_assessment_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + subtotal_in_cents: 132, + total_tax_in_cents: 0, + total_discount_in_cents: 250, + total_in_cents: 20 +) ``` diff --git a/doc/models/replay-webhooks-request.md b/doc/models/replay-webhooks-request.md index c7a996d6..88086da8 100644 --- a/doc/models/replay-webhooks-request.md +++ b/doc/models/replay-webhooks-request.md @@ -11,13 +11,15 @@ | --- | --- | --- | --- | | `ids` | `Array[Integer]` | Required | - | -## Example (as JSON) - -```json -{ - "ids": [ - 15 +## Example + +```ruby +replay_webhooks_request = ReplayWebhooksRequest.new( + ids: [ + 233, + 234, + 235 ] -} +) ``` diff --git a/doc/models/replay-webhooks-response.md b/doc/models/replay-webhooks-response.md index 74aeca4d..aa1ab89c 100644 --- a/doc/models/replay-webhooks-response.md +++ b/doc/models/replay-webhooks-response.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `status` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "status": "status4" -} +```ruby +replay_webhooks_response = ReplayWebhooksResponse.new( + status: 'status0' +) ``` diff --git a/doc/models/resent-invitation.md b/doc/models/resent-invitation.md index 9758b1c6..84070d39 100644 --- a/doc/models/resent-invitation.md +++ b/doc/models/resent-invitation.md @@ -16,16 +16,16 @@ | `last_invite_sent_at` | `DateTime` | Optional | - | | `last_invite_accepted_at` | `DateTime` | Optional | - | -## Example (as JSON) - -```json -{ - "last_invite_sent_at": "01/01/2024 04:30:00", - "last_invite_accepted_at": "01/01/2024 04:35:00", - "last_sent_at": "last_sent_at8", - "last_accepted_at": "last_accepted_at8", - "send_invite_link_text": "send_invite_link_text6", - "uninvited_count": 6 -} +## Example + +```ruby +resent_invitation = ResentInvitation.new( + last_sent_at: 'last_sent_at6', + last_accepted_at: 'last_accepted_at6', + send_invite_link_text: 'send_invite_link_text4', + uninvited_count: 78, + last_invite_sent_at: DateTimeHelper.from_rfc3339('2024-01-01T04:30:00+00:00'), + last_invite_accepted_at: DateTimeHelper.from_rfc3339('2024-01-01T04:35:00+00:00') +) ``` diff --git a/doc/models/resource-type.md b/doc/models/resource-type.md index 1490b923..a7821b4c 100644 --- a/doc/models/resource-type.md +++ b/doc/models/resource-type.md @@ -12,3 +12,9 @@ | `SUBSCRIPTIONS` | | `CUSTOMERS` | +## Example + +```ruby +resource_type = ResourceType::SUBSCRIPTIONS +``` + diff --git a/doc/models/restriction-type.md b/doc/models/restriction-type.md index 816172f6..4f67ccee 100644 --- a/doc/models/restriction-type.md +++ b/doc/models/restriction-type.md @@ -12,3 +12,9 @@ | `COMPONENT` | | `PRODUCT` | +## Example + +```ruby +restriction_type = RestrictionType::COMPONENT +``` + diff --git a/doc/models/resume-options.md b/doc/models/resume-options.md index db156b6f..df7f58d9 100644 --- a/doc/models/resume-options.md +++ b/doc/models/resume-options.md @@ -12,12 +12,12 @@ | `require_resume` | `TrueClass \| FalseClass` | Optional | Chargify will only attempt to resume the subscription's billing period. If not resumable, the subscription will be left in its current state. | | `forgive_balance` | `TrueClass \| FalseClass` | Optional | Indicates whether or not Chargify should clear the subscription's existing balance before attempting to resume the subscription. If subscription cannot be resumed, the balance will remain as it was before the attempt to resume was made. | -## Example (as JSON) +## Example -```json -{ - "require_resume": false, - "forgive_balance": false -} +```ruby +resume_options = ResumeOptions.new( + require_resume: false, + forgive_balance: false +) ``` diff --git a/doc/models/resumption-charge.md b/doc/models/resumption-charge.md index 799f3d35..1d494d19 100644 --- a/doc/models/resumption-charge.md +++ b/doc/models/resumption-charge.md @@ -15,3 +15,9 @@ | `IMMEDIATE` | | `DELAYED` | +## Example + +```ruby +resumption_charge = ResumptionCharge::PRORATED +``` + diff --git a/doc/models/revoked-invitation.md b/doc/models/revoked-invitation.md index b1e0bdab..2b534809 100644 --- a/doc/models/revoked-invitation.md +++ b/doc/models/revoked-invitation.md @@ -13,13 +13,13 @@ | `last_accepted_at` | `String` | Optional | - | | `uninvited_count` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "last_sent_at": "last_sent_at2", - "last_accepted_at": "last_accepted_at2", - "uninvited_count": 226 -} +## Example + +```ruby +revoked_invitation = RevokedInvitation.new( + last_sent_at: 'last_sent_at4', + last_accepted_at: 'last_accepted_at4', + uninvited_count: 58 +) ``` diff --git a/doc/models/sale-rep-item-mrr.md b/doc/models/sale-rep-item-mrr.md index 87630ab9..95de154e 100644 --- a/doc/models/sale-rep-item-mrr.md +++ b/doc/models/sale-rep-item-mrr.md @@ -13,13 +13,13 @@ | `usage` | `String` | Optional | - | | `recurring` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "mrr": "mrr2", - "usage": "usage0", - "recurring": "recurring4" -} +## Example + +```ruby +sale_rep_item_mrr = SaleRepItemMrr.new( + mrr: 'mrr8', + usage: 'usage4', + recurring: 'recurring0' +) ``` diff --git a/doc/models/sale-rep-settings.md b/doc/models/sale-rep-settings.md index efcb1e3a..0f16903a 100644 --- a/doc/models/sale-rep-settings.md +++ b/doc/models/sale-rep-settings.md @@ -17,15 +17,15 @@ | `sales_rep_id` | `Integer` | Optional | - | | `sales_rep_name` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "customer_name": "customer_name8", - "subscription_id": 200, - "site_link": "site_link4", - "site_name": "site_name8", - "subscription_mrr": "subscription_mrr6" -} +## Example + +```ruby +sale_rep_settings = SaleRepSettings.new( + customer_name: 'customer_name4', + subscription_id: 168, + site_link: 'site_link0', + site_name: 'site_name6', + subscription_mrr: 'subscription_mrr2' +) ``` diff --git a/doc/models/sale-rep-subscription.md b/doc/models/sale-rep-subscription.md index 6c86ab0e..3b096733 100644 --- a/doc/models/sale-rep-subscription.md +++ b/doc/models/sale-rep-subscription.md @@ -20,15 +20,15 @@ | `last_payment` | `String` | Optional | - | | `churn_date` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 18, - "site_name": "site_name2", - "subscription_url": "subscription_url6", - "customer_name": "customer_name2", - "created_at": "created_at8" -} +## Example + +```ruby +sale_rep_subscription = SaleRepSubscription.new( + id: 126, + site_name: 'site_name2', + subscription_url: 'subscription_url6', + customer_name: 'customer_name2', + created_at: 'created_at8' +) ``` diff --git a/doc/models/sale-rep.md b/doc/models/sale-rep.md index e76b7862..77eb3662 100644 --- a/doc/models/sale-rep.md +++ b/doc/models/sale-rep.md @@ -15,30 +15,30 @@ | `test_mode` | `TrueClass \| FalseClass` | Optional | - | | `subscriptions` | [`Array[SaleRepSubscription]`](../../doc/models/sale-rep-subscription.md) | Optional | - | -## Example (as JSON) - -```json -{ - "id": 18, - "full_name": "full_name0", - "subscriptions_count": 162, - "test_mode": false, - "subscriptions": [ - { - "id": 202, - "site_name": "site_name8", - "subscription_url": "subscription_url2", - "customer_name": "customer_name8", - "created_at": "created_at4" - }, - { - "id": 202, - "site_name": "site_name8", - "subscription_url": "subscription_url2", - "customer_name": "customer_name8", - "created_at": "created_at4" - } +## Example + +```ruby +sale_rep = SaleRep.new( + id: 214, + full_name: 'full_name0', + subscriptions_count: 34, + test_mode: false, + subscriptions: [ + SaleRepSubscription.new( + id: 202, + site_name: 'site_name8', + subscription_url: 'subscription_url2', + customer_name: 'customer_name8', + created_at: 'created_at4' + ), + SaleRepSubscription.new( + id: 202, + site_name: 'site_name8', + subscription_url: 'subscription_url2', + customer_name: 'customer_name8', + created_at: 'created_at4' + ) ] -} +) ``` diff --git a/doc/models/scheduled-renewal-component-custom-price.md b/doc/models/scheduled-renewal-component-custom-price.md index 9f1bf922..6971e922 100644 --- a/doc/models/scheduled-renewal-component-custom-price.md +++ b/doc/models/scheduled-renewal-component-custom-price.md @@ -12,22 +12,22 @@ Custom pricing for a component within a scheduled renewal. | Name | Type | Tags | Description | | --- | --- | --- | --- | | `tax_included` | `TrueClass \| FalseClass` | Optional | Whether or not the price point includes tax | -| `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | Omit for On/Off components | +| `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | Omit for On/Off components. | | `prices` | [`Array[Price]`](../../doc/models/price.md) | Required | On/off components only need one price bracket starting at 1. | -## Example (as JSON) - -```json -{ - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +## Example + +```ruby +scheduled_renewal_component_custom_price = ScheduledRenewalComponentCustomPrice.new( + pricing_scheme: PricingScheme::PER_UNIT, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "tax_included": false -} + tax_included: false +) ``` diff --git a/doc/models/scheduled-renewal-configuration-item-request.md b/doc/models/scheduled-renewal-configuration-item-request.md index 1c50749a..3e639364 100644 --- a/doc/models/scheduled-renewal-configuration-item-request.md +++ b/doc/models/scheduled-renewal-configuration-item-request.md @@ -11,32 +11,32 @@ | --- | --- | --- | --- | | `renewal_configuration_item` | [Scheduled Renewal Item Request Body Component](../../doc/models/scheduled-renewal-item-request-body-component.md) \| [Scheduled Renewal Item Request Body Product](../../doc/models/scheduled-renewal-item-request-body-product.md) | Required | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "renewal_configuration_item": { - "item_type": "Component", - "item_id": 108, - "price_point_id": 122, - "quantity": 212, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } - } -} +## Example + +```ruby +scheduled_renewal_configuration_item_request = ScheduledRenewalConfigurationItemRequest.new( + renewal_configuration_item: ScheduledRenewalItemRequestBodyComponent.new( + item_type: 'Component', + item_id: 108, + price_point_id: 122, + quantity: 212, + custom_price: ScheduledRenewalComponentCustomPrice.new( + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false + ) + ) +) ``` diff --git a/doc/models/scheduled-renewal-configuration-item-response.md b/doc/models/scheduled-renewal-configuration-item-response.md index ec6dbeda..e253eac8 100644 --- a/doc/models/scheduled-renewal-configuration-item-response.md +++ b/doc/models/scheduled-renewal-configuration-item-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `scheduled_renewal_configuration_item` | [`ScheduledRenewalConfigurationItem`](../../doc/models/scheduled-renewal-configuration-item.md) | Optional | - | -## Example (as JSON) - -```json -{ - "scheduled_renewal_configuration_item": { - "id": 98, - "subscription_id": 208, - "subscription_renewal_configuration_id": 108, - "item_id": 246, - "item_type": "item_type2" - } -} +## Example + +```ruby +scheduled_renewal_configuration_item_response = ScheduledRenewalConfigurationItemResponse.new( + scheduled_renewal_configuration_item: ScheduledRenewalConfigurationItem.new( + id: 98, + subscription_id: 208, + subscription_renewal_configuration_id: 108, + item_id: 246, + item_type: 'item_type2' + ) +) ``` diff --git a/doc/models/scheduled-renewal-configuration-item.md b/doc/models/scheduled-renewal-configuration-item.md index f575e91c..5b9628f4 100644 --- a/doc/models/scheduled-renewal-configuration-item.md +++ b/doc/models/scheduled-renewal-configuration-item.md @@ -21,15 +21,15 @@ | `decimal_quantity` | `String` | Optional | - | | `created_at` | `DateTime` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 146, - "subscription_id": 0, - "subscription_renewal_configuration_id": 156, - "item_id": 38, - "item_type": "item_type4" -} +## Example + +```ruby +scheduled_renewal_configuration_item = ScheduledRenewalConfigurationItem.new( + id: 98, + subscription_id: 208, + subscription_renewal_configuration_id: 108, + item_id: 246, + item_type: 'item_type2' +) ``` diff --git a/doc/models/scheduled-renewal-configuration-request-body.md b/doc/models/scheduled-renewal-configuration-request-body.md index e5f82598..0d6d15aa 100644 --- a/doc/models/scheduled-renewal-configuration-request-body.md +++ b/doc/models/scheduled-renewal-configuration-request-body.md @@ -15,15 +15,15 @@ | `contract_id` | `Integer` | Optional | (Optional) Existing contract to associate with the scheduled renewal. Contracts must be enabled for your site. | | `create_new_contract` | `TrueClass \| FalseClass` | Optional | (Optional) Set to true to create a new contract when contracts are enabled. Contracts must be enabled for your site. | -## Example (as JSON) - -```json -{ - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z", - "lock_in_at": "2016-03-13T12:52:32.123Z", - "contract_id": 110, - "create_new_contract": false -} +## Example + +```ruby +scheduled_renewal_configuration_request_body = ScheduledRenewalConfigurationRequestBody.new( + starts_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + ends_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + lock_in_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + contract_id: 88, + create_new_contract: false +) ``` diff --git a/doc/models/scheduled-renewal-configuration-request.md b/doc/models/scheduled-renewal-configuration-request.md index a3e40f78..a54ba50e 100644 --- a/doc/models/scheduled-renewal-configuration-request.md +++ b/doc/models/scheduled-renewal-configuration-request.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `renewal_configuration` | [`ScheduledRenewalConfigurationRequestBody`](../../doc/models/scheduled-renewal-configuration-request-body.md) | Required | - | -## Example (as JSON) - -```json -{ - "renewal_configuration": { - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z", - "lock_in_at": "2016-03-13T12:52:32.123Z", - "contract_id": 244, - "create_new_contract": false - } -} +## Example + +```ruby +scheduled_renewal_configuration_request = ScheduledRenewalConfigurationRequest.new( + renewal_configuration: ScheduledRenewalConfigurationRequestBody.new( + starts_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + ends_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + lock_in_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + contract_id: 244, + create_new_contract: false + ) +) ``` diff --git a/doc/models/scheduled-renewal-configuration-response.md b/doc/models/scheduled-renewal-configuration-response.md index 8869eaba..9b7a28e9 100644 --- a/doc/models/scheduled-renewal-configuration-response.md +++ b/doc/models/scheduled-renewal-configuration-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `scheduled_renewal_configuration` | [`ScheduledRenewalConfiguration`](../../doc/models/scheduled-renewal-configuration.md) | Optional | - | -## Example (as JSON) - -```json -{ - "scheduled_renewal_configuration": { - "id": 134, - "site_id": 60, - "subscription_id": 244, - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ruby +scheduled_renewal_configuration_response = ScheduledRenewalConfigurationResponse.new( + scheduled_renewal_configuration: ScheduledRenewalConfiguration.new( + id: 134, + site_id: 60, + subscription_id: 244, + starts_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + ends_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/scheduled-renewal-configuration.md b/doc/models/scheduled-renewal-configuration.md index 422d42d6..ac36451a 100644 --- a/doc/models/scheduled-renewal-configuration.md +++ b/doc/models/scheduled-renewal-configuration.md @@ -20,15 +20,15 @@ | `scheduled_renewal_configuration_items` | [`Array[ScheduledRenewalConfigurationItem]`](../../doc/models/scheduled-renewal-configuration-item.md) | Optional | - | | `contract` | [`Contract`](../../doc/models/contract.md) | Optional | Contract linked to the scheduled renewal configuration. | -## Example (as JSON) - -```json -{ - "id": 152, - "site_id": 78, - "subscription_id": 6, - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +scheduled_renewal_configuration = ScheduledRenewalConfiguration.new( + id: 134, + site_id: 60, + subscription_id: 244, + starts_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + ends_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/scheduled-renewal-configurations-response.md b/doc/models/scheduled-renewal-configurations-response.md index 5fd02f6d..bb3ca67f 100644 --- a/doc/models/scheduled-renewal-configurations-response.md +++ b/doc/models/scheduled-renewal-configurations-response.md @@ -11,33 +11,26 @@ | --- | --- | --- | --- | | `scheduled_renewal_configurations` | [`Array[ScheduledRenewalConfiguration]`](../../doc/models/scheduled-renewal-configuration.md) | Optional | - | -## Example (as JSON) - -```json -{ - "scheduled_renewal_configurations": [ - { - "id": 122, - "site_id": 48, - "subscription_id": 232, - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z" - }, - { - "id": 122, - "site_id": 48, - "subscription_id": 232, - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z" - }, - { - "id": 122, - "site_id": 48, - "subscription_id": 232, - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z" - } +## Example + +```ruby +scheduled_renewal_configurations_response = ScheduledRenewalConfigurationsResponse.new( + scheduled_renewal_configurations: [ + ScheduledRenewalConfiguration.new( + id: 122, + site_id: 48, + subscription_id: 232, + starts_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + ends_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ), + ScheduledRenewalConfiguration.new( + id: 122, + site_id: 48, + subscription_id: 232, + starts_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + ends_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) ] -} +) ``` diff --git a/doc/models/scheduled-renewal-item-request-body-component.md b/doc/models/scheduled-renewal-item-request-body-component.md index 5ed650ea..5843b188 100644 --- a/doc/models/scheduled-renewal-item-request-body-component.md +++ b/doc/models/scheduled-renewal-item-request-body-component.md @@ -12,33 +12,33 @@ | `item_type` | `String` | Required, Constant | Item type to add. Either Product or Component.

**Value**: `'Component'` | | `item_id` | `Integer` | Required | Product or component identifier. | | `price_point_id` | `Integer` | Optional | Price point identifier. | -| `quantity` | `Integer` | Optional | Optional quantity for the item. | +| `quantity` | `Integer` | Optional | (Optional) Quantity for the item. | | `custom_price` | [`ScheduledRenewalComponentCustomPrice`](../../doc/models/scheduled-renewal-component-custom-price.md) | Optional | Custom pricing for a component within a scheduled renewal. | -## Example (as JSON) - -```json -{ - "item_type": "Component", - "item_id": 108, - "price_point_id": 122, - "quantity": 212, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } -} +## Example + +```ruby +scheduled_renewal_item_request_body_component = ScheduledRenewalItemRequestBodyComponent.new( + item_type: 'Component', + item_id: 228, + price_point_id: 214, + quantity: 36, + custom_price: ScheduledRenewalComponentCustomPrice.new( + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false + ) +) ``` diff --git a/doc/models/scheduled-renewal-item-request-body-product.md b/doc/models/scheduled-renewal-item-request-body-product.md index da25a6c6..a0ef3105 100644 --- a/doc/models/scheduled-renewal-item-request-body-product.md +++ b/doc/models/scheduled-renewal-item-request-body-product.md @@ -12,27 +12,27 @@ | `item_type` | `String` | Required, Constant | Item type to add. Either Product or Component.

**Value**: `'Product'` | | `item_id` | `Integer` | Required | Product or component identifier. | | `price_point_id` | `Integer` | Optional | Price point identifier. | -| `quantity` | `Integer` | Optional | Optional quantity for the item. | +| `quantity` | `Integer` | Optional | (Optional) Quantity for the item. | | `custom_price` | [`ScheduledRenewalProductPricePoint`](../../doc/models/scheduled-renewal-product-price-point.md) | Optional | Custom pricing for a product within a scheduled renewal. | -## Example (as JSON) - -```json -{ - "item_type": "Product", - "item_id": 32, - "price_point_id": 18, - "quantity": 96, - "custom_price": { - "name": "name4", - "handle": "handle0", - "price_in_cents": "String3", - "interval": "String3", - "interval_unit": "day", - "tax_included": false, - "initial_charge_in_cents": 30, - "expiration_interval": 52 - } -} +## Example + +```ruby +scheduled_renewal_item_request_body_product = ScheduledRenewalItemRequestBodyProduct.new( + item_type: 'Product', + item_id: 18, + price_point_id: 4, + quantity: 82, + custom_price: ScheduledRenewalProductPricePoint.new( + price_in_cents: 'String3', + interval: 'String3', + interval_unit: IntervalUnit::DAY, + name: 'name4', + handle: 'handle0', + tax_included: false, + initial_charge_in_cents: 30, + expiration_interval: 52 + ) +) ``` diff --git a/doc/models/scheduled-renewal-lock-in-request.md b/doc/models/scheduled-renewal-lock-in-request.md index 4a2fcaf5..8baefb24 100644 --- a/doc/models/scheduled-renewal-lock-in-request.md +++ b/doc/models/scheduled-renewal-lock-in-request.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `lock_in_at` | `Date` | Required | Date to lock in the renewal. | -## Example (as JSON) +## Example -```json -{ - "lock_in_at": "2016-03-13" -} +```ruby +scheduled_renewal_lock_in_request = ScheduledRenewalLockInRequest.new( + lock_in_at: Date.iso8601('2016-03-13') +) ``` diff --git a/doc/models/scheduled-renewal-product-price-point.md b/doc/models/scheduled-renewal-product-price-point.md index 22fc2eb4..ab63692e 100644 --- a/doc/models/scheduled-renewal-product-price-point.md +++ b/doc/models/scheduled-renewal-product-price-point.md @@ -18,21 +18,21 @@ Custom pricing for a product within a scheduled renewal. | `interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Required | Required if using `custom_price` attribute. | | `tax_included` | `TrueClass \| FalseClass` | Optional | (Optional) | | `initial_charge_in_cents` | `Integer` | Optional | The product price point initial charge, in integer cents. | -| `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` | `Integer` | Optional | The numerical expiration interval. e.g., 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 | -## Example (as JSON) - -```json -{ - "name": "name4", - "handle": "handle0", - "price_in_cents": "String3", - "interval": "String9", - "interval_unit": "day", - "tax_included": false, - "initial_charge_in_cents": 86, - "expiration_interval": 108 -} +## Example + +```ruby +scheduled_renewal_product_price_point = ScheduledRenewalProductPricePoint.new( + price_in_cents: 'String1', + interval: 'String5', + interval_unit: IntervalUnit::DAY, + name: 'name6', + handle: 'handle2', + tax_included: false, + initial_charge_in_cents: 4, + expiration_interval: 26 +) ``` diff --git a/doc/models/scheduled-renewal-update-request.md b/doc/models/scheduled-renewal-update-request.md index 01fa85c0..9d8b0c83 100644 --- a/doc/models/scheduled-renewal-update-request.md +++ b/doc/models/scheduled-renewal-update-request.md @@ -11,32 +11,32 @@ | --- | --- | --- | --- | | `renewal_configuration_item` | [Scheduled Renewal Item Request Body Component](../../doc/models/scheduled-renewal-item-request-body-component.md) \| [Scheduled Renewal Item Request Body Product](../../doc/models/scheduled-renewal-item-request-body-product.md) | Required | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "renewal_configuration_item": { - "item_type": "Component", - "item_id": 108, - "price_point_id": 122, - "quantity": 212, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } - } -} +## Example + +```ruby +scheduled_renewal_update_request = ScheduledRenewalUpdateRequest.new( + renewal_configuration_item: ScheduledRenewalItemRequestBodyComponent.new( + item_type: 'Component', + item_id: 108, + price_point_id: 122, + quantity: 212, + custom_price: ScheduledRenewalComponentCustomPrice.new( + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false + ) + ) +) ``` diff --git a/doc/models/segment-price.md b/doc/models/segment-price.md index 9c839b00..477ba744 100644 --- a/doc/models/segment-price.md +++ b/doc/models/segment-price.md @@ -18,15 +18,15 @@ | `formatted_unit_price` | `String` | Optional | - | | `segment_id` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 220, - "component_id": 74, - "starting_quantity": 118, - "ending_quantity": 92, - "unit_price": "unit_price0" -} +## Example + +```ruby +segment_price = SegmentPrice.new( + id: 38, + component_id: 148, + starting_quantity: 44, + ending_quantity: 238, + unit_price: 'unit_price0' +) ``` diff --git a/doc/models/segment-response.md b/doc/models/segment-response.md index 3a808c32..4d9fd651 100644 --- a/doc/models/segment-response.md +++ b/doc/models/segment-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `segment` | [`Segment`](../../doc/models/segment.md) | Optional | - | -## Example (as JSON) - -```json -{ - "segment": { - "id": 118, - "component_id": 228, - "price_point_id": 4, - "event_based_billing_metric_id": 56, - "pricing_scheme": "stairstep" - } -} +## Example + +```ruby +segment_response = SegmentResponse.new( + segment: Segment.new( + id: 118, + component_id: 228, + price_point_id: 4, + event_based_billing_metric_id: 56, + pricing_scheme: PricingScheme::STAIRSTEP + ) +) ``` diff --git a/doc/models/segment.md b/doc/models/segment.md index 1ce932b7..248bc300 100644 --- a/doc/models/segment.md +++ b/doc/models/segment.md @@ -22,15 +22,15 @@ | `updated_at` | `DateTime` | Optional | - | | `prices` | [`Array[SegmentPrice]`](../../doc/models/segment-price.md) | Optional | **Constraints**: *Minimum Items*: `1` | -## Example (as JSON) - -```json -{ - "id": 6, - "component_id": 116, - "price_point_id": 140, - "event_based_billing_metric_id": 200, - "pricing_scheme": "stairstep" -} +## Example + +```ruby +segment = Segment.new( + id: 118, + component_id: 228, + price_point_id: 4, + event_based_billing_metric_id: 56, + pricing_scheme: PricingScheme::STAIRSTEP +) ``` diff --git a/doc/models/send-email.md b/doc/models/send-email.md index a49726ae..f26b8531 100644 --- a/doc/models/send-email.md +++ b/doc/models/send-email.md @@ -12,12 +12,12 @@ | `can_execute` | `TrueClass \| FalseClass` | Required | - | | `url` | `String` | Required | - | -## Example (as JSON) +## Example -```json -{ - "can_execute": false, - "url": "url2" -} +```ruby +send_email = SendEmail.new( + can_execute: false, + url: 'url0' +) ``` diff --git a/doc/models/send-invoice-request.md b/doc/models/send-invoice-request.md index d1e4356b..00257de4 100644 --- a/doc/models/send-invoice-request.md +++ b/doc/models/send-invoice-request.md @@ -14,25 +14,29 @@ | `bcc_recipient_emails` | `Array[String]` | Optional | **Constraints**: *Maximum Items*: `5` | | `attachment_urls` | `Array[String]` | Optional | Array of URLs to files to attach to the invoice email. Max 10 files, 10MB each.

**Constraints**: *Maximum Items*: `10` | -## Example (as JSON) - -```json -{ - "recipient_emails": [ - "recipient_emails3", - "recipient_emails4" +## Example + +```ruby +send_invoice_request = SendInvoiceRequest.new( + recipient_emails: [ + 'recipient_emails9', + 'recipient_emails0', + 'recipient_emails1' ], - "cc_recipient_emails": [ - "cc_recipient_emails6", - "cc_recipient_emails5" + cc_recipient_emails: [ + 'cc_recipient_emails2', + 'cc_recipient_emails3' ], - "bcc_recipient_emails": [ - "bcc_recipient_emails6" + bcc_recipient_emails: [ + 'bcc_recipient_emails2', + 'bcc_recipient_emails1', + 'bcc_recipient_emails0' ], - "attachment_urls": [ - "attachment_urls0", - "attachment_urls1" + attachment_urls: [ + 'attachment_urls6', + 'attachment_urls7', + 'attachment_urls8' ] -} +) ``` diff --git a/doc/models/service-credit-1.md b/doc/models/service-credit-1.md index 1183b1b3..a43cb6f2 100644 --- a/doc/models/service-credit-1.md +++ b/doc/models/service-credit-1.md @@ -14,19 +14,19 @@ | `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 | +| `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) +## Example -```json -{ - "id": 174, - "amount_in_cents": 4, - "ending_balance_in_cents": 44, - "entry_type": "Credit", - "memo": "memo8" -} +```ruby +service_credit1 = ServiceCredit1.new( + id: 118, + amount_in_cents: 52, + ending_balance_in_cents: 244, + entry_type: ServiceCreditType::CREDIT, + memo: 'memo6' +) ``` diff --git a/doc/models/service-credit-response.md b/doc/models/service-credit-response.md index 3df9020f..c9cb5623 100644 --- a/doc/models/service-credit-response.md +++ b/doc/models/service-credit-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `service_credit` | [`ServiceCredit`](../../doc/models/service-credit.md) | Required | - | -## Example (as JSON) - -```json -{ - "service_credit": { - "id": 38, - "amount_in_cents": 124, - "ending_balance_in_cents": 164, - "entry_type": "Credit", - "memo": "memo0" - } -} +## Example + +```ruby +service_credit_response = ServiceCreditResponse.new( + service_credit: ServiceCredit.new( + id: 38, + amount_in_cents: 124, + ending_balance_in_cents: 164, + entry_type: ServiceCreditType::CREDIT, + memo: 'memo0' + ) +) ``` diff --git a/doc/models/service-credit-type.md b/doc/models/service-credit-type.md index e4763845..4ce2a9bf 100644 --- a/doc/models/service-credit-type.md +++ b/doc/models/service-credit-type.md @@ -14,3 +14,9 @@ The type of entry | `CREDIT` | | `DEBIT` | +## Example + +```ruby +service_credit_type = ServiceCreditType::CREDIT +``` + diff --git a/doc/models/service-credit.md b/doc/models/service-credit.md index dc1d6715..524abbfd 100644 --- a/doc/models/service-credit.md +++ b/doc/models/service-credit.md @@ -15,15 +15,15 @@ | `entry_type` | [`ServiceCreditType`](../../doc/models/service-credit-type.md) | Optional | The type of entry | | `memo` | `String` | Optional | The memo attached to the entry | -## Example (as JSON) - -```json -{ - "id": 216, - "amount_in_cents": 210, - "ending_balance_in_cents": 86, - "entry_type": "Credit", - "memo": "memo2" -} +## Example + +```ruby +service_credit = ServiceCredit.new( + id: 38, + amount_in_cents: 124, + ending_balance_in_cents: 164, + entry_type: ServiceCreditType::CREDIT, + memo: 'memo0' +) ``` diff --git a/doc/models/signup-proforma-preview-response.md b/doc/models/signup-proforma-preview-response.md index e7c24281..e706234f 100644 --- a/doc/models/signup-proforma-preview-response.md +++ b/doc/models/signup-proforma-preview-response.md @@ -11,26 +11,26 @@ | --- | --- | --- | --- | | `proforma_invoice_preview` | [`SignupProformaPreview`](../../doc/models/signup-proforma-preview.md) | Required | - | -## Example (as JSON) - -```json -{ - "proforma_invoice_preview": { - "current_proforma_invoice": { - "uid": "uid6", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": 132 - }, - "next_proforma_invoice": { - "uid": "uid8", - "site_id": 212, - "customer_id": 68, - "subscription_id": 140, - "number": 16 - } - } -} +## Example + +```ruby +signup_proforma_preview_response = SignupProformaPreviewResponse.new( + proforma_invoice_preview: SignupProformaPreview.new( + current_proforma_invoice: ProformaInvoice.new( + uid: 'uid6', + site_id: 72, + customer_id: 184, + subscription_id: 0, + number: 132 + ), + next_proforma_invoice: ProformaInvoice.new( + uid: 'uid8', + site_id: 212, + customer_id: 68, + subscription_id: 140, + number: 16 + ) + ) +) ``` diff --git a/doc/models/signup-proforma-preview.md b/doc/models/signup-proforma-preview.md index b575eef8..a1d0f3e2 100644 --- a/doc/models/signup-proforma-preview.md +++ b/doc/models/signup-proforma-preview.md @@ -12,24 +12,24 @@ | `current_proforma_invoice` | [`ProformaInvoice`](../../doc/models/proforma-invoice.md) | Optional | - | | `next_proforma_invoice` | [`ProformaInvoice`](../../doc/models/proforma-invoice.md) | Optional | - | -## Example (as JSON) - -```json -{ - "current_proforma_invoice": { - "uid": "uid6", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": 132 - }, - "next_proforma_invoice": { - "uid": "uid8", - "site_id": 212, - "customer_id": 68, - "subscription_id": 140, - "number": 16 - } -} +## Example + +```ruby +signup_proforma_preview = SignupProformaPreview.new( + current_proforma_invoice: ProformaInvoice.new( + uid: 'uid6', + site_id: 72, + customer_id: 184, + subscription_id: 0, + number: 132 + ), + next_proforma_invoice: ProformaInvoice.new( + uid: 'uid8', + site_id: 212, + customer_id: 68, + subscription_id: 140, + number: 16 + ) +) ``` diff --git a/doc/models/single-error-response-exception.md b/doc/models/single-error-response-exception.md index e81876cf..9d93dd56 100644 --- a/doc/models/single-error-response-exception.md +++ b/doc/models/single-error-response-exception.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `error` | `String` | Required | - | -## Example (as JSON) - -```json -{ - "error": "error2" -} +## Example + +```ruby +begin + # make the API call +rescue SingleErrorResponseException => e + puts "Caught SingleErrorResponseException: #{e.message}" +end ``` diff --git a/doc/models/single-string-error-response-exception.md b/doc/models/single-string-error-response-exception.md index a680d203..1193a973 100644 --- a/doc/models/single-string-error-response-exception.md +++ b/doc/models/single-string-error-response-exception.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `errors` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "errors": "errors4" -} +## Example + +```ruby +begin + # make the API call +rescue SingleStringErrorResponseException => e + puts "Caught SingleStringErrorResponseException: #{e.message}" +end ``` diff --git a/doc/models/site-response.md b/doc/models/site-response.md index 26c6eb66..0a7875c3 100644 --- a/doc/models/site-response.md +++ b/doc/models/site-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `site` | [`Site`](../../doc/models/site.md) | Required | - | -## Example (as JSON) - -```json -{ - "site": { - "id": 64, - "name": "name4", - "subdomain": "subdomain0", - "currency": "currency4", - "seller_id": 228 - } -} +## Example + +```ruby +site_response = SiteResponse.new( + site: Site.new( + id: 64, + name: 'name4', + subdomain: 'subdomain0', + currency: 'currency4', + seller_id: 228 + ) +) ``` diff --git a/doc/models/site-statistics.md b/doc/models/site-statistics.md index fc9eb1af..04564f55 100644 --- a/doc/models/site-statistics.md +++ b/doc/models/site-statistics.md @@ -21,15 +21,15 @@ | `total_unpaid_subscriptions` | `Integer` | Optional | - | | `total_dunning_subscriptions` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "total_subscriptions": 204, - "subscriptions_today": 134, - "total_revenue": "total_revenue6", - "revenue_today": "revenue_today4", - "revenue_this_month": "revenue_this_month4" -} +## Example + +```ruby +site_statistics = SiteStatistics.new( + total_subscriptions: 186, + subscriptions_today: 152, + total_revenue: 'total_revenue6', + revenue_today: 'revenue_today4', + revenue_this_month: 'revenue_this_month4' +) ``` diff --git a/doc/models/site-summary.md b/doc/models/site-summary.md index feac9c3d..265bdfb2 100644 --- a/doc/models/site-summary.md +++ b/doc/models/site-summary.md @@ -15,21 +15,21 @@ | `site_currency` | `String` | Optional | - | | `stats` | [`SiteStatistics`](../../doc/models/site-statistics.md) | Optional | - | -## Example (as JSON) - -```json -{ - "seller_name": "seller_name0", - "site_name": "site_name4", - "site_id": 218, - "site_currency": "site_currency6", - "stats": { - "total_subscriptions": 110, - "subscriptions_today": 228, - "total_revenue": "total_revenue6", - "revenue_today": "revenue_today4", - "revenue_this_month": "revenue_this_month4" - } -} +## Example + +```ruby +site_summary = SiteSummary.new( + seller_name: 'seller_name8', + site_name: 'site_name4', + site_id: 170, + site_currency: 'site_currency2', + stats: SiteStatistics.new( + total_subscriptions: 110, + subscriptions_today: 228, + total_revenue: 'total_revenue6', + revenue_today: 'revenue_today4', + revenue_this_month: 'revenue_this_month4' + ) +) ``` diff --git a/doc/models/site.md b/doc/models/site.md index 2b1f82d1..3cfd4f9d 100644 --- a/doc/models/site.md +++ b/doc/models/site.md @@ -30,15 +30,15 @@ | `portal_enabled` | `TrueClass \| FalseClass` | Optional | Whether the Billing Portal is enabled for this site. | | `test` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 34, - "name": "name0", - "subdomain": "subdomain4", - "currency": "currency0", - "seller_id": 198 -} +## Example + +```ruby +site = Site.new( + id: 64, + name: 'name4', + subdomain: 'subdomain0', + currency: 'currency4', + seller_id: 228 +) ``` diff --git a/doc/models/sorting-direction.md b/doc/models/sorting-direction.md index 547aa444..d727ded0 100644 --- a/doc/models/sorting-direction.md +++ b/doc/models/sorting-direction.md @@ -14,3 +14,9 @@ Used for sorting results. | `ASC` | | `DESC` | +## Example + +```ruby +sorting_direction = SortingDirection::ASC +``` + diff --git a/doc/models/status.md b/doc/models/status.md index 3531d2ce..263113b6 100644 --- a/doc/models/status.md +++ b/doc/models/status.md @@ -16,3 +16,9 @@ | `ACTIVE` | | `FULFILLED` | +## Example + +```ruby +status = Status::PENDING +``` + diff --git a/doc/models/subscription-add-coupon-error-exception.md b/doc/models/subscription-add-coupon-error-exception.md index f449428a..32ba6277 100644 --- a/doc/models/subscription-add-coupon-error-exception.md +++ b/doc/models/subscription-add-coupon-error-exception.md @@ -14,25 +14,13 @@ | `coupon_codes` | `Array[String]` | Optional | - | | `subscription` | `Array[String]` | Optional | - | -## Example (as JSON) - -```json -{ - "codes": [ - "codes6", - "codes7", - "codes8" - ], - "coupon_code": [ - "coupon_code8", - "coupon_code7" - ], - "coupon_codes": [ - "coupon_codes2" - ], - "subscription": [ - "subscription8" - ] -} +## Example + +```ruby +begin + # make the API call +rescue SubscriptionAddCouponErrorException => e + puts "Caught SubscriptionAddCouponErrorException: #{e.message}" +end ``` diff --git a/doc/models/subscription-component-allocation-error-exception.md b/doc/models/subscription-component-allocation-error-exception.md index 87bc6b70..98219ef5 100644 --- a/doc/models/subscription-component-allocation-error-exception.md +++ b/doc/models/subscription-component-allocation-error-exception.md @@ -11,16 +11,13 @@ | --- | --- | --- | --- | | `errors` | [`Array[SubscriptionComponentAllocationErrorItem]`](../../doc/models/subscription-component-allocation-error-item.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": [ - { - "kind": "kind8", - "message": "message0" - } - ] -} +## Example + +```ruby +begin + # make the API call +rescue SubscriptionComponentAllocationErrorException => e + puts "Caught SubscriptionComponentAllocationErrorException: #{e.message}" +end ``` diff --git a/doc/models/subscription-component-allocation-error-item.md b/doc/models/subscription-component-allocation-error-item.md index 29c93768..d789d4f7 100644 --- a/doc/models/subscription-component-allocation-error-item.md +++ b/doc/models/subscription-component-allocation-error-item.md @@ -12,12 +12,12 @@ | `kind` | `String` | Optional | - | | `message` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "kind": "kind0", - "message": "message8" -} +```ruby +subscription_component_allocation_error_item = SubscriptionComponentAllocationErrorItem.new( + kind: 'kind0', + message: 'message2' +) ``` diff --git a/doc/models/subscription-component-response.md b/doc/models/subscription-component-response.md index 984a88f1..ba841299 100644 --- a/doc/models/subscription-component-response.md +++ b/doc/models/subscription-component-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `component` | [`SubscriptionComponent`](../../doc/models/subscription-component.md) | Optional | - | -## Example (as JSON) - -```json -{ - "component": { - "id": 80, - "name": "name8", - "kind": "quantity_based_component", - "unit_name": "unit_name0", - "enabled": false - } -} +## Example + +```ruby +subscription_component_response = SubscriptionComponentResponse.new( + component: SubscriptionComponent.new( + id: 80, + name: 'name8', + kind: ComponentKind::QUANTITY_BASED_COMPONENT, + unit_name: 'unit_name0', + enabled: false + ) +) ``` diff --git a/doc/models/subscription-component-subscription.md b/doc/models/subscription-component-subscription.md index 98b697e8..03e63fbe 100644 --- a/doc/models/subscription-component-subscription.md +++ b/doc/models/subscription-component-subscription.md @@ -1,7 +1,7 @@ # Subscription Component Subscription -An optional object, will be returned if provided `include=subscription` query param. +(Optional) Object that will be returned if the `include=subscription` query param is provided. ## Structure @@ -14,12 +14,12 @@ An optional object, will be returned if provided `include=subscription` query pa | `state` | [`SubscriptionState`](../../doc/models/subscription-state.md) | Optional | The state of a subscription.

* **Live States**
* `active` - A normal, active subscription. It is not in a trial and is paid and up to date.
* `assessing` - An internal (transient) state that indicates a subscription is in the middle of periodic assessment. Do not base any access decisions in your app on this state, as it may not always be exposed.
* `pending` - An internal (transient) state that indicates a subscription is in the creation process. Do not base any access decisions in your app on this state, as it may not always be exposed.
* `trialing` - A subscription in trialing state has a valid trial subscription. This type of subscription may transition to active once payment is received when the trial has ended. Otherwise, it may go to a Problem or End of Life state.
* `paused` - An internal state that indicates that your account with Advanced Billing is in arrears.
* **Problem States**
* `past_due` - Indicates that the most recent payment has failed, and payment is past due for this subscription. If you have enabled our automated dunning, this subscription will be in the dunning process (additional status and callbacks from the dunning process will be available in the future). If you are handling dunning and payment updates yourself, you will want to use this state to initiate a payment update from your customers.
* `soft_failure` - Indicates that normal assessment/processing of the subscription has failed for a reason that cannot be fixed by the Customer. For example, a Soft Fail may result from a timeout at the gateway or incorrect credentials on your part. The subscriptions should be retried automatically. An interface is being built for you to review problems resulting from these events to take manual action when needed.
* `unpaid` - Indicates an unpaid subscription. A subscription is marked unpaid if the retry period expires and you have configured your [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunning-Overview) settings to have a Final Action of `mark the subscription unpaid`.
* **End of Life States**
* `canceled` - Indicates a canceled subscription. This may happen at your request (via the API or the web interface) or due to the expiration of the [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunning-Overview) process without payment. See the [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-Reactivating-and-Resuming) documentation for info on how to restart a canceled subscription.
While a subscription is canceled, its period will not advance, it will not accrue any new charges, and Advanced Billing will not attempt to collect the overdue balance.
* `expired` - Indicates a subscription that has expired due to running its normal life cycle. Some products may be configured to have an expiration period. An expired subscription then is one that stayed active until it fulfilled its full period.
* `failed_to_create` - Indicates that signup has failed. (You may see this state in a signup_failure webhook.)
* `on_hold` - Indicates that a subscription’s billing has been temporarily stopped. While it is expected that the subscription will resume and return to active status, this is still treated as an “End of Life” state because the customer is not paying for services during this time.
* `suspended` - Indicates that a prepaid subscription has used up all their prepayment balance. If a prepayment is applied, it will return to an active state.
* `trial_ended` - A subscription in a trial_ended state is a subscription that completed a no-obligation trial and did not have a card on file at the expiration of the trial period. See [Product Pricing – No Obligation Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869-Product-Editing) for more details.

See [Subscription States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853-Subscription-States) for more info about subscription states and state transitions. | | `updated_at` | `DateTime` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "state": "paused", - "updated_at": "2016-03-13T12:52:32.123Z" -} +```ruby +subscription_component_subscription = SubscriptionComponentSubscription.new( + state: SubscriptionState::PAUSED, + updated_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/subscription-component.md b/doc/models/subscription-component.md index 354c45c6..f09431e4 100644 --- a/doc/models/subscription-component.md +++ b/doc/models/subscription-component.md @@ -13,8 +13,8 @@ | `name` | `String` | Optional | - | | `kind` | [`ComponentKind`](../../doc/models/component-kind.md) | Optional | A handle for the component type | | `unit_name` | `String` | Optional | - | -| `enabled` | `TrueClass \| FalseClass` | Optional | (for on/off components) indicates if the component is enabled for the subscription | -| `unit_balance` | `Integer` | Optional | - | +| `enabled` | `TrueClass \| FalseClass` | Optional | (for on/off components) indicates if the component is enabled for the subscription. | +| `unit_balance` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `currency` | `String` | Optional | - | | `allocated_quantity` | Integer \| String \| nil | Optional | This is a container for one-of cases. | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | - | @@ -36,21 +36,21 @@ | `use_site_exchange_rate` | `TrueClass \| FalseClass` | Optional | - | | `description` | `String` | Optional | - | | `allow_fractional_quantities` | `TrueClass \| FalseClass` | Optional | - | -| `subscription` | [`SubscriptionComponentSubscription`](../../doc/models/subscription-component-subscription.md) | Optional | An optional object, will be returned if provided `include=subscription` query param. | +| `subscription` | [`SubscriptionComponentSubscription`](../../doc/models/subscription-component-subscription.md) | Optional | (Optional) Object that will be returned if the `include=subscription` query param is provided. | | `historic_usages` | [`Array[HistoricUsage]`](../../doc/models/historic-usage.md) | Optional | - | | `display_on_hosted_page` | `TrueClass \| FalseClass` | Optional | - | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of '30' coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of '30' coupled with an interval_unit of day would mean this component 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 component price point, either month or day. This property is only available for sites with Multifrequency enabled. | -## Example (as JSON) +## Example -```json -{ - "id": 20, - "name": "name8", - "kind": "quantity_based_component", - "unit_name": "unit_name0", - "enabled": false -} +```ruby +subscription_component = SubscriptionComponent.new( + id: 8, + name: 'name8', + kind: ComponentKind::QUANTITY_BASED_COMPONENT, + unit_name: 'unit_name0', + enabled: false +) ``` diff --git a/doc/models/subscription-custom-price.md b/doc/models/subscription-custom-price.md index 895eea6c..236eda1a 100644 --- a/doc/models/subscription-custom-price.md +++ b/doc/models/subscription-custom-price.md @@ -19,25 +19,25 @@ | `trial_price_in_cents` | String \| Integer \| nil | Optional | This is a container for one-of cases. | | `trial_interval` | String \| Integer \| nil | Optional | This is a container for one-of cases. | | `trial_interval_unit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Optional | (Optional) | -| `trial_type` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | +| `trial_type` | [`TrialType`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | | `initial_charge_in_cents` | String \| Integer \| nil | Optional | This is a container for one-of cases. | | `initial_charge_after_trial` | `TrueClass \| FalseClass` | Optional | (Optional) | | `expiration_interval` | String \| Integer \| nil | Optional | This is a container for one-of cases. | | `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | (Optional) | | `tax_included` | `TrueClass \| FalseClass` | Optional | (Optional) | -## Example (as JSON) - -```json -{ - "name": "name4", - "handle": "handle0", - "price_in_cents": "String3", - "interval": "String3", - "interval_unit": "day", - "trial_price_in_cents": "String3", - "trial_interval": "String5", - "trial_interval_unit": "day" -} +## Example + +```ruby +subscription_custom_price = SubscriptionCustomPrice.new( + price_in_cents: 'String7', + interval: 'String1', + interval_unit: IntervalUnit::DAY, + name: 'name2', + handle: 'handle8', + trial_price_in_cents: 'String7', + trial_interval: 'String3', + trial_interval_unit: IntervalUnit::DAY +) ``` diff --git a/doc/models/subscription-date-field.md b/doc/models/subscription-date-field.md index 3de7f3b6..c4de8d97 100644 --- a/doc/models/subscription-date-field.md +++ b/doc/models/subscription-date-field.md @@ -19,3 +19,9 @@ | `TRIAL_ENDED_AT` | | `UPDATED_AT` | +## Example + +```ruby +subscription_date_field = SubscriptionDateField::CURRENT_PERIOD_STARTS_AT +``` + diff --git a/doc/models/subscription-filter.md b/doc/models/subscription-filter.md index c699b8f0..716b6f99 100644 --- a/doc/models/subscription-filter.md +++ b/doc/models/subscription-filter.md @@ -18,19 +18,19 @@ Nested filter used for List Subscription Components For Site Filter | `start_datetime` | `DateTime` | Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components that belong to the subscription 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. To use this filter you also have to include the following param in the request `include=subscription`. | | `end_datetime` | `DateTime` | Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components that belong to the subscription 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. To use this filter you also have to include the following param in the request `include=subscription`. | -## Example (as JSON) +## Example -```json -{ - "states": [ - "active", - "canceled" +```ruby +subscription_filter = SubscriptionFilter.new( + states: [ + SubscriptionStateFilter::ACTIVE, + SubscriptionStateFilter::CANCELED ], - "start_date": "2024-01-17", - "end_date": "2024-01-31", - "start_datetime": "01/17/2024 09:15:30", - "end_datetime": "01/17/2024 17:20:06", - "date_field": "updated_at" -} + date_field: SubscriptionListDateField::UPDATED_AT, + start_date: Date.iso8601('2024-01-17'), + end_date: Date.iso8601('2024-01-31'), + start_datetime: DateTimeHelper.from_rfc3339('2024-01-17T09:15:30+00:00'), + end_datetime: DateTimeHelper.from_rfc3339('2024-01-17T17:20:06Z') +) ``` diff --git a/doc/models/subscription-group-balances.md b/doc/models/subscription-group-balances.md index b267f235..150149b1 100644 --- a/doc/models/subscription-group-balances.md +++ b/doc/models/subscription-group-balances.md @@ -14,30 +14,30 @@ | `open_invoices` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | - | | `pending_discounts` | [`AccountBalance`](../../doc/models/account-balance.md) | Optional | - | -## Example (as JSON) - -```json -{ - "prepayments": { - "balance_in_cents": 192, - "automatic_balance_in_cents": 178, - "remittance_balance_in_cents": 146 - }, - "service_credits": { - "balance_in_cents": 84, - "automatic_balance_in_cents": 70, - "remittance_balance_in_cents": 38 - }, - "open_invoices": { - "balance_in_cents": 40, - "automatic_balance_in_cents": 202, - "remittance_balance_in_cents": 170 - }, - "pending_discounts": { - "balance_in_cents": 88, - "automatic_balance_in_cents": 154, - "remittance_balance_in_cents": 134 - } -} +## Example + +```ruby +subscription_group_balances = SubscriptionGroupBalances.new( + prepayments: AccountBalance.new( + balance_in_cents: 192, + automatic_balance_in_cents: 178, + remittance_balance_in_cents: 146 + ), + service_credits: AccountBalance.new( + balance_in_cents: 84, + automatic_balance_in_cents: 70, + remittance_balance_in_cents: 38 + ), + open_invoices: AccountBalance.new( + balance_in_cents: 40, + automatic_balance_in_cents: 202, + remittance_balance_in_cents: 170 + ), + pending_discounts: AccountBalance.new( + balance_in_cents: 88, + automatic_balance_in_cents: 154, + remittance_balance_in_cents: 134 + ) +) ``` diff --git a/doc/models/subscription-group-bank-account.md b/doc/models/subscription-group-bank-account.md index 207d3a1e..39a346fd 100644 --- a/doc/models/subscription-group-bank-account.md +++ b/doc/models/subscription-group-bank-account.md @@ -11,9 +11,9 @@ | --- | --- | --- | --- | | `bank_name` | `String` | Optional | (Required when creating a subscription with ACH or GoCardless) The name of the bank where the customer’s account resides | | `bank_account_number` | `String` | Optional | (Required when creating a subscription with ACH. Required when creating a subscription with GoCardless and bank_iban is blank) The customerʼs bank account number | -| `bank_routing_number` | `String` | Optional | (Required when creating a subscription with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API | -| `bank_iban` | `String` | Optional | (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided | -| `bank_branch_code` | `String` | Optional | (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided | +| `bank_routing_number` | `String` | Optional | (Required when creating a subscription with ACH. Optional when creating a subscription with GoCardless.) The routing number of the bank. It becomes bank_code while passing via GoCardless API. | +| `bank_iban` | `String` | Optional | (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided. | +| `bank_branch_code` | `String` | Optional | (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided. | | `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) | Optional | - | @@ -26,15 +26,15 @@ | `current_vault` | [`BankAccountVault`](../../doc/models/bank-account-vault.md) | Optional | The vault that stores the payment profile with the provided vault_token. Use `bogus` for testing. | | `gateway_handle` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "bank_name": "bank_name2", - "bank_account_number": "bank_account_number4", - "bank_routing_number": "bank_routing_number8", - "bank_iban": "bank_iban6", - "bank_branch_code": "bank_branch_code6" -} +```ruby +subscription_group_bank_account = SubscriptionGroupBankAccount.new( + bank_name: 'bank_name4', + bank_account_number: 'bank_account_number2', + bank_routing_number: 'bank_routing_number6', + bank_iban: 'bank_iban8', + bank_branch_code: 'bank_branch_code4' +) ``` diff --git a/doc/models/subscription-group-component-custom-price.md b/doc/models/subscription-group-component-custom-price.md index 745aaa61..3e3c7d03 100644 --- a/doc/models/subscription-group-component-custom-price.md +++ b/doc/models/subscription-group-component-custom-price.md @@ -15,34 +15,53 @@ Used in place of `price_point_id` to define a custom price point unique to the s | `prices` | [`Array[Price]`](../../doc/models/price.md) | Optional | - | | `overage_pricing` | [`Array[ComponentCustomPrice]`](../../doc/models/component-custom-price.md) | Optional | - | -## Example (as JSON) - -```json -{ - "pricing_scheme": "per_unit", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +## Example + +```ruby +subscription_group_component_custom_price = SubscriptionGroupComponentCustomPrice.new( + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "overage_pricing": [ - { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 230, - "interval_unit": "day", - "list_price_point_id": 10, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } + overage_pricing: [ + ComponentCustomPrice.new( + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false, + pricing_scheme: PricingScheme::STAIRSTEP, + interval: 230, + interval_unit: IntervalUnit::DAY, + list_price_point_id: 10 + ), + ComponentCustomPrice.new( + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false, + pricing_scheme: PricingScheme::STAIRSTEP, + interval: 230, + interval_unit: IntervalUnit::DAY, + list_price_point_id: 10 + ) ] -} +) ``` diff --git a/doc/models/subscription-group-create-error-response-exception.md b/doc/models/subscription-group-create-error-response-exception.md index fc22b782..fbe7669c 100644 --- a/doc/models/subscription-group-create-error-response-exception.md +++ b/doc/models/subscription-group-create-error-response-exception.md @@ -11,15 +11,13 @@ | --- | --- | --- | --- | | `errors` | [Subscription Group Members Array Error](../../doc/models/subscription-group-members-array-error.md) \| [Subscription Group Single Error](../../doc/models/subscription-group-single-error.md) \| String | Required | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "errors": { - "members": [ - "members6" - ] - } -} +## Example + +```ruby +begin + # make the API call +rescue SubscriptionGroupCreateErrorResponseException => e + puts "Caught SubscriptionGroupCreateErrorResponseException: #{e.message}" +end ``` diff --git a/doc/models/subscription-group-credit-card.md b/doc/models/subscription-group-credit-card.md index 88238180..cc81a533 100644 --- a/doc/models/subscription-group-credit-card.md +++ b/doc/models/subscription-group-credit-card.md @@ -30,16 +30,16 @@ | `cvv` | `String` | Optional | - | | `payment_type` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "chargify_token": "tok_592nf92ng0sjd4300p", - "full_number": 4111111111111111, - "vault_token": "vault_token6", - "current_vault": "braintree_blue", - "gateway_handle": "gateway_handle6", - "first_name": "first_name4" -} +## Example + +```ruby +subscription_group_credit_card = SubscriptionGroupCreditCard.new( + chargify_token: 'tok_592nf92ng0sjd4300p', + vault_token: 'vault_token8', + current_vault: CreditCardVault::PAYMILL, + gateway_handle: 'gateway_handle2', + first_name: 'first_name6', + full_number: 4111111111111111 +) ``` diff --git a/doc/models/subscription-group-customer.md b/doc/models/subscription-group-customer.md index 9efc5f77..41b9bf1a 100644 --- a/doc/models/subscription-group-customer.md +++ b/doc/models/subscription-group-customer.md @@ -15,15 +15,15 @@ | `email` | `String` | Optional | - | | `reference` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "first_name": "first_name4", - "last_name": "last_name2", - "organization": "organization2", - "email": "email2", - "reference": "reference0" -} +## Example + +```ruby +subscription_group_customer = SubscriptionGroupCustomer.new( + first_name: 'first_name2', + last_name: 'last_name0', + organization: 'organization4', + email: 'email4', + reference: 'reference2' +) ``` diff --git a/doc/models/subscription-group-include.md b/doc/models/subscription-group-include.md index 3225e28e..14c76e4e 100644 --- a/doc/models/subscription-group-include.md +++ b/doc/models/subscription-group-include.md @@ -11,3 +11,9 @@ | --- | | `CURRENT_BILLING_AMOUNT_IN_CENTS` | +## Example + +```ruby +subscription_group_include = SubscriptionGroupInclude::CURRENT_BILLING_AMOUNT_IN_CENTS +``` + diff --git a/doc/models/subscription-group-item.md b/doc/models/subscription-group-item.md index 3ed91a88..e54cd3ed 100644 --- a/doc/models/subscription-group-item.md +++ b/doc/models/subscription-group-item.md @@ -20,15 +20,15 @@ | `total_revenue_in_cents` | `Integer` | Optional | - | | `balance_in_cents` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 16, - "reference": "reference8", - "product_id": 214, - "product_handle": "product_handle4", - "product_price_point_id": 138 -} +## Example + +```ruby +subscription_group_item = SubscriptionGroupItem.new( + id: 214, + reference: 'reference2', + product_id: 156, + product_handle: 'product_handle6', + product_price_point_id: 80 +) ``` diff --git a/doc/models/subscription-group-members-array-error.md b/doc/models/subscription-group-members-array-error.md index 6d9321c1..69ddc7f1 100644 --- a/doc/models/subscription-group-members-array-error.md +++ b/doc/models/subscription-group-members-array-error.md @@ -11,13 +11,13 @@ | --- | --- | --- | --- | | `members` | `Array[String]` | Required | - | -## Example (as JSON) +## Example -```json -{ - "members": [ - "members6" +```ruby +subscription_group_members_array_error = SubscriptionGroupMembersArrayError.new( + members: [ + 'members2' ] -} +) ``` diff --git a/doc/models/subscription-group-payment-profile.md b/doc/models/subscription-group-payment-profile.md index 265deeec..e4fb4a48 100644 --- a/doc/models/subscription-group-payment-profile.md +++ b/doc/models/subscription-group-payment-profile.md @@ -14,14 +14,14 @@ | `last_name` | `String` | Optional | - | | `masked_card_number` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 22, - "first_name": "first_name4", - "last_name": "last_name2", - "masked_card_number": "masked_card_number2" -} +## Example + +```ruby +subscription_group_payment_profile = SubscriptionGroupPaymentProfile.new( + id: 112, + first_name: 'first_name8', + last_name: 'last_name6', + masked_card_number: 'masked_card_number6' +) ``` diff --git a/doc/models/subscription-group-prepayment-method.md b/doc/models/subscription-group-prepayment-method.md index dc41027f..d1617518 100644 --- a/doc/models/subscription-group-prepayment-method.md +++ b/doc/models/subscription-group-prepayment-method.md @@ -16,3 +16,9 @@ | `PAYPAL_ACCOUNT` | | `OTHER` | +## Example + +```ruby +subscription_group_prepayment_method = SubscriptionGroupPrepaymentMethod::MONEY_ORDER +``` + diff --git a/doc/models/subscription-group-prepayment-request.md b/doc/models/subscription-group-prepayment-request.md index 1325febe..465ee14e 100644 --- a/doc/models/subscription-group-prepayment-request.md +++ b/doc/models/subscription-group-prepayment-request.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `prepayment` | [`SubscriptionGroupPrepayment`](../../doc/models/subscription-group-prepayment.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepayment": { - "amount": 136, - "details": "details8", - "memo": "memo2", - "method": "paypal_account" - } -} +## Example + +```ruby +subscription_group_prepayment_request = SubscriptionGroupPrepaymentRequest.new( + prepayment: SubscriptionGroupPrepayment.new( + amount: 136, + details: 'details8', + memo: 'memo2', + method: SubscriptionGroupPrepaymentMethod::PAYPAL_ACCOUNT + ) +) ``` diff --git a/doc/models/subscription-group-prepayment-response.md b/doc/models/subscription-group-prepayment-response.md index e4e980d4..782ab2dd 100644 --- a/doc/models/subscription-group-prepayment-response.md +++ b/doc/models/subscription-group-prepayment-response.md @@ -15,15 +15,15 @@ | `entry_type` | [`ServiceCreditType`](../../doc/models/service-credit-type.md) | Optional | The type of entry | | `memo` | `String` | Optional | A memo attached to the entry. | -## Example (as JSON) - -```json -{ - "id": 110, - "amount_in_cents": 196, - "ending_balance_in_cents": 236, - "entry_type": "Credit", - "memo": "memo2" -} +## Example + +```ruby +subscription_group_prepayment_response = SubscriptionGroupPrepaymentResponse.new( + id: 28, + amount_in_cents: 114, + ending_balance_in_cents: 154, + entry_type: ServiceCreditType::CREDIT, + memo: 'memo2' +) ``` diff --git a/doc/models/subscription-group-prepayment.md b/doc/models/subscription-group-prepayment.md index c45c0236..cd7d8d05 100644 --- a/doc/models/subscription-group-prepayment.md +++ b/doc/models/subscription-group-prepayment.md @@ -14,14 +14,14 @@ | `memo` | `String` | Required | - | | `method` | [`SubscriptionGroupPrepaymentMethod`](../../doc/models/subscription-group-prepayment-method.md) | Required | - | -## Example (as JSON) - -```json -{ - "amount": 96, - "details": "details2", - "memo": "memo6", - "method": "money_order" -} +## Example + +```ruby +subscription_group_prepayment = SubscriptionGroupPrepayment.new( + amount: 118, + details: 'details8', + memo: 'memo2', + method: SubscriptionGroupPrepaymentMethod::CHECK +) ``` diff --git a/doc/models/subscription-group-response.md b/doc/models/subscription-group-response.md index 34401973..be2c1eb6 100644 --- a/doc/models/subscription-group-response.md +++ b/doc/models/subscription-group-response.md @@ -11,25 +11,25 @@ | --- | --- | --- | --- | | `subscription_group` | [`SubscriptionGroup`](../../doc/models/subscription-group.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscription_group": { - "uid": "uid8", - "customer_id": 220, - "payment_profile": { - "id": 44, - "first_name": "first_name4", - "last_name": "last_name2", - "masked_card_number": "masked_card_number2" - }, - "payment_collection_method": "prepaid", - "subscription_ids": [ +## Example + +```ruby +subscription_group_response = SubscriptionGroupResponse.new( + subscription_group: SubscriptionGroup.new( + uid: 'uid8', + customer_id: 220, + payment_profile: SubscriptionGroupPaymentProfile.new( + id: 44, + first_name: 'first_name4', + last_name: 'last_name2', + masked_card_number: 'masked_card_number2' + ), + payment_collection_method: CollectionMethod::PREPAID, + subscription_ids: [ 74, 75 ] - } -} + ) +) ``` diff --git a/doc/models/subscription-group-signup-component.md b/doc/models/subscription-group-signup-component.md index 38fbdb0d..1dac02ff 100644 --- a/doc/models/subscription-group-signup-component.md +++ b/doc/models/subscription-group-signup-component.md @@ -15,73 +15,73 @@ | `price_point_id` | String \| Integer \| nil | Optional | This is a container for one-of cases. | | `custom_price` | [`SubscriptionGroupComponentCustomPrice`](../../doc/models/subscription-group-component-custom-price.md) | Optional | Used in place of `price_point_id` to define a custom price point unique to the subscription. You still need to provide `component_id`. | -## Example (as JSON) +## Example -```json -{ - "component_id": "String1", - "allocated_quantity": "String5", - "unit_balance": "String9", - "price_point_id": "String5", - "custom_price": { - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } +```ruby +subscription_group_signup_component = SubscriptionGroupSignupComponent.new( + component_id: 'String9', + allocated_quantity: 'String3', + unit_balance: 'String7', + price_point_id: 'String9', + custom_price: SubscriptionGroupComponentCustomPrice.new( + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) ], - "overage_pricing": [ - { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 230, - "interval_unit": "day", - "list_price_point_id": 10, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - }, - { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 230, - "interval_unit": "day", - "list_price_point_id": 10, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - }, - { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 230, - "interval_unit": "day", - "list_price_point_id": 10, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } + overage_pricing: [ + ComponentCustomPrice.new( + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false, + pricing_scheme: PricingScheme::STAIRSTEP, + interval: 230, + interval_unit: IntervalUnit::DAY, + list_price_point_id: 10 + ), + ComponentCustomPrice.new( + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false, + pricing_scheme: PricingScheme::STAIRSTEP, + interval: 230, + interval_unit: IntervalUnit::DAY, + list_price_point_id: 10 + ), + ComponentCustomPrice.new( + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false, + pricing_scheme: PricingScheme::STAIRSTEP, + interval: 230, + interval_unit: IntervalUnit::DAY, + list_price_point_id: 10 + ) ] - } -} + ) +) ``` diff --git a/doc/models/subscription-group-signup-error-response-exception.md b/doc/models/subscription-group-signup-error-response-exception.md index d96c43c3..dec642dc 100644 --- a/doc/models/subscription-group-signup-error-response-exception.md +++ b/doc/models/subscription-group-signup-error-response-exception.md @@ -11,60 +11,13 @@ | --- | --- | --- | --- | | `errors` | [`SubscriptionGroupSignupError`](../../doc/models/subscription-group-signup-error.md) | Required | - | -## Example (as JSON) - -```json -{ - "errors": { - "subscriptions": { - "0": { - "payment_profile.chargify_token": [ - "Chargify token not found" - ], - "product": [ - "Product must be among the Products for this Site" - ], - "product_price_point_id": [ - "Product price point must belong to product." - ], - "base": [ - "No payment method was on file for the $30.00 balance'" - ], - "payment_profile.expiration_month": [ - "Credit card expiration month: cannot be blank." - ], - "payment_profile.expiration_year": [ - "Credit card expiration year: cannot be blank." - ], - "payment_profile.full_number": [ - "Credit card number: cannot be blank." - ], - "payment_profile": [ - "payment_profile2" - ] - } - }, - "payer_reference": "payer_reference4", - "payer": { - "last_name": [ - "last_name5", - "last_name6" - ], - "first_name": [ - "first_name8" - ], - "email": [ - "email0", - "email9" - ] - }, - "subscription_group": [ - "subscription_group7", - "subscription_group8", - "subscription_group9" - ], - "payment_profile_id": "payment_profile_id8" - } -} +## Example + +```ruby +begin + # make the API call +rescue SubscriptionGroupSignupErrorResponseException => e + puts "Caught SubscriptionGroupSignupErrorResponseException: #{e.message}" +end ``` diff --git a/doc/models/subscription-group-signup-error.md b/doc/models/subscription-group-signup-error.md index ab4b9140..565ea84f 100644 --- a/doc/models/subscription-group-signup-error.md +++ b/doc/models/subscription-group-signup-error.md @@ -16,67 +16,67 @@ | `payment_profile_id` | `String` | Optional | - | | `payer_id` | `String` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "subscriptions": { - "key0": { - "product": [ - "product9" +```ruby +subscription_group_signup_error = SubscriptionGroupSignupError.new( + subscriptions: { + 'key0': SubscriptionGroupSubscriptionError.new( + product: [ + 'product9' ], - "product_price_point_id": [ - "product_price_point_id7" + product_price_point_id: [ + 'product_price_point_id7' ], - "payment_profile": [ - "payment_profile2" + payment_profile: [ + 'payment_profile2' ], - "payment_profile.chargify_token": [ - "payment_profile.chargify_token6" + payment_profile_chargify_token: [ + 'payment_profile.chargify_token6' ], - "base": [ - "base5", - "base6" + base: [ + 'base5', + 'base6' ] - }, - "key1": { - "product": [ - "product9" + ), + 'key1': SubscriptionGroupSubscriptionError.new( + product: [ + 'product9' ], - "product_price_point_id": [ - "product_price_point_id7" + product_price_point_id: [ + 'product_price_point_id7' ], - "payment_profile": [ - "payment_profile2" + payment_profile: [ + 'payment_profile2' ], - "payment_profile.chargify_token": [ - "payment_profile.chargify_token6" + payment_profile_chargify_token: [ + 'payment_profile.chargify_token6' ], - "base": [ - "base5", - "base6" + base: [ + 'base5', + 'base6' ] - } + ) }, - "payer_reference": "payer_reference0", - "payer": { - "last_name": [ - "last_name5", - "last_name6" + payer_reference: 'payer_reference6', + payer: PayerError.new( + last_name: [ + 'last_name5', + 'last_name6' ], - "first_name": [ - "first_name8" + first_name: [ + 'first_name8' ], - "email": [ - "email0", - "email9" + email: [ + 'email0', + 'email9' ] - }, - "subscription_group": [ - "subscription_group1", - "subscription_group2" + ), + subscription_group: [ + 'subscription_group7', + 'subscription_group8' ], - "payment_profile_id": "payment_profile_id2" -} + payment_profile_id: 'payment_profile_id8' +) ``` diff --git a/doc/models/subscription-group-signup-event-data.md b/doc/models/subscription-group-signup-event-data.md index ac30e581..ea9c3e74 100644 --- a/doc/models/subscription-group-signup-event-data.md +++ b/doc/models/subscription-group-signup-event-data.md @@ -12,30 +12,30 @@ | `subscription_group` | [`SubscriptionGroupSignupFailureData`](../../doc/models/subscription-group-signup-failure-data.md) | Required | - | | `customer` | [`Customer`](../../doc/models/customer.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscription_group": { - "payer_id": 150, - "payer_reference": "payer_reference6", - "payment_profile_id": 128, - "payment_collection_method": "payment_collection_method8", - "payer_attributes": { - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails2", - "organization": "organization6" - } - }, - "customer": { - "first_name": "first_name0", - "last_name": "last_name8", - "email": "email6", - "cc_emails": "cc_emails0", - "organization": "organization6" - } -} +## Example + +```ruby +subscription_group_signup_event_data = SubscriptionGroupSignupEventData.new( + subscription_group: SubscriptionGroupSignupFailureData.new( + payer_id: 150, + payer_reference: 'payer_reference6', + payment_profile_id: 128, + payment_collection_method: 'payment_collection_method8', + payer_attributes: PayerAttributes.new( + first_name: 'first_name2', + last_name: 'last_name0', + email: 'email4', + cc_emails: 'cc_emails2', + organization: 'organization6' + ) + ), + customer: Customer.new( + first_name: 'first_name0', + last_name: 'last_name8', + email: 'email6', + cc_emails: 'cc_emails0', + organization: 'organization6' + ) +) ``` diff --git a/doc/models/subscription-group-signup-failure-data.md b/doc/models/subscription-group-signup-failure-data.md index 75682b99..0cec55c6 100644 --- a/doc/models/subscription-group-signup-failure-data.md +++ b/doc/models/subscription-group-signup-failure-data.md @@ -18,21 +18,21 @@ | `bank_account_attributes` | [`SubscriptionGroupBankAccount`](../../doc/models/subscription-group-bank-account.md) | Optional | - | | `subscriptions` | [`Array[SubscriptionGroupSignupItem]`](../../doc/models/subscription-group-signup-item.md) | Optional | - | -## Example (as JSON) - -```json -{ - "payer_id": 16, - "payer_reference": "payer_reference8", - "payment_profile_id": 6, - "payment_collection_method": "payment_collection_method0", - "payer_attributes": { - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails2", - "organization": "organization6" - } -} +## Example + +```ruby +subscription_group_signup_failure_data = SubscriptionGroupSignupFailureData.new( + payer_id: 218, + payer_reference: 'payer_reference2', + payment_profile_id: 196, + payment_collection_method: 'payment_collection_method0', + payer_attributes: PayerAttributes.new( + first_name: 'first_name2', + last_name: 'last_name0', + email: 'email4', + cc_emails: 'cc_emails2', + organization: 'organization6' + ) +) ``` diff --git a/doc/models/subscription-group-signup-item.md b/doc/models/subscription-group-signup-item.md index 4a810245..2684af42 100644 --- a/doc/models/subscription-group-signup-item.md +++ b/doc/models/subscription-group-signup-item.md @@ -13,29 +13,29 @@ | `product_id` | `Integer` | Optional | The Product ID of the product for which you are creating a subscription. You can pass either `product_id` or `product_handle`. | | `product_price_point_id` | `Integer` | Optional | The ID of the particular price point on the product. | | `product_price_point_handle` | `String` | Optional | The user-friendly API handle of a product's particular price point. | -| `offer_id` | `Integer` | Optional | Use in place of passing product and component information to set up the subscription with an existing offer. May be either the Chargify ID of the offer or its handle prefixed with `handle:` | -| `reference` | `String` | Optional | The reference value (provided by your app) for the subscription itelf. | +| `offer_id` | `Integer` | Optional | Use in place of passing product and component information to set up the subscription with an existing offer. May be either the Chargify ID of the offer or its handle prefixed with `handle:`. | +| `reference` | `String` | Optional | The reference value (provided by your app) for the subscription itself. | | `primary` | `TrueClass \| FalseClass` | Optional | One of the subscriptions must be marked as primary in the group. | | `currency` | `String` | Optional | (Optional) If Multi-Currency is enabled and the currency is configured in Chargify, pass it at signup to create a subscription on a non-default currency. Note that you cannot update the currency of an existing subscription. | | `coupon_codes` | `Array[String]` | Optional | An array for all the coupons attached to the subscription. | | `components` | [`Array[SubscriptionGroupSignupComponent]`](../../doc/models/subscription-group-signup-component.md) | Optional | - | | `custom_price` | [`SubscriptionCustomPrice`](../../doc/models/subscription-custom-price.md) | Optional | (Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription. A subscription can have up to 30 custom price points. Exceeding this limit will result in an API error. | -| `calendar_billing` | [`CalendarBilling`](../../doc/models/calendar-billing.md) | Optional | (Optional). Cannot be used when also specifying next_billing_at | +| `calendar_billing` | [`CalendarBilling`](../../doc/models/calendar-billing.md) | Optional | (Optional). Cannot be used when also specifying next_billing_at. | | `metafields` | `Hash[String, String]` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | -## Example (as JSON) - -```json -{ - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" - }, - "product_handle": "product_handle2", - "product_id": 34, - "product_price_point_id": 214, - "product_price_point_handle": "product_price_point_handle4", - "offer_id": 150 -} +## Example + +```ruby +subscription_group_signup_item = SubscriptionGroupSignupItem.new( + product_handle: 'product_handle2', + product_id: 216, + product_price_point_id: 140, + product_price_point_handle: 'product_price_point_handle4', + offer_id: 224, + metafields: { + 'custom_field_name_1': 'custom_field_value_1', + 'custom_field_name_2': 'custom_field_value_2' + } +) ``` diff --git a/doc/models/subscription-group-signup-request.md b/doc/models/subscription-group-signup-request.md index 3258d8fb..1df064ab 100644 --- a/doc/models/subscription-group-signup-request.md +++ b/doc/models/subscription-group-signup-request.md @@ -11,36 +11,36 @@ | --- | --- | --- | --- | | `subscription_group` | [`SubscriptionGroupSignup`](../../doc/models/subscription-group-signup.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscription_group": { - "subscriptions": [ - { - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" - }, - "product_handle": "product_handle8", - "product_id": 144, - "product_price_point_id": 68, - "product_price_point_handle": "product_price_point_handle4", - "offer_id": 40 - } +## Example + +```ruby +subscription_group_signup_request = SubscriptionGroupSignupRequest.new( + subscription_group: SubscriptionGroupSignup.new( + subscriptions: [ + SubscriptionGroupSignupItem.new( + product_handle: 'product_handle8', + product_id: 144, + product_price_point_id: 68, + product_price_point_handle: 'product_price_point_handle4', + offer_id: 40, + metafields: { + 'custom_field_name_1': 'custom_field_value_1', + 'custom_field_name_2': 'custom_field_value_2' + } + ) ], - "payment_profile_id": 128, - "payer_id": 150, - "payer_reference": "payer_reference6", - "payment_collection_method": "prepaid", - "payer_attributes": { - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails2", - "organization": "organization6" - } - } -} + payment_profile_id: 128, + payer_id: 150, + payer_reference: 'payer_reference6', + payment_collection_method: CollectionMethod::PREPAID, + payer_attributes: PayerAttributes.new( + first_name: 'first_name2', + last_name: 'last_name0', + email: 'email4', + cc_emails: 'cc_emails2', + organization: 'organization6' + ) + ) +) ``` diff --git a/doc/models/subscription-group-signup-response.md b/doc/models/subscription-group-signup-response.md index ad0bfeba..1ade5d01 100644 --- a/doc/models/subscription-group-signup-response.md +++ b/doc/models/subscription-group-signup-response.md @@ -21,19 +21,19 @@ | `subscriptions` | [`Array[SubscriptionGroupItem]`](../../doc/models/subscription-group-item.md) | Optional | - | | `payment_collection_method` | [`CollectionMethod`](../../doc/models/collection-method.md) | Optional | The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - `invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`. | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "scheme": 28, - "customer_id": 48, - "payment_profile_id": 44, - "subscription_ids": [ - 158, - 159, - 160 +## Example + +```ruby +subscription_group_signup_response = SubscriptionGroupSignupResponse.new( + uid: 'uid8', + scheme: 62, + customer_id: 82, + payment_profile_id: 10, + subscription_ids: [ + 192, + 193, + 194 ] -} +) ``` diff --git a/doc/models/subscription-group-signup.md b/doc/models/subscription-group-signup.md index a4b1fac5..f90339b0 100644 --- a/doc/models/subscription-group-signup.md +++ b/doc/models/subscription-group-signup.md @@ -18,34 +18,34 @@ | `bank_account_attributes` | [`SubscriptionGroupBankAccount`](../../doc/models/subscription-group-bank-account.md) | Optional | - | | `subscriptions` | [`Array[SubscriptionGroupSignupItem]`](../../doc/models/subscription-group-signup-item.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscriptions": [ - { - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" - }, - "product_handle": "product_handle8", - "product_id": 144, - "product_price_point_id": 68, - "product_price_point_handle": "product_price_point_handle4", - "offer_id": 40 - } +## Example + +```ruby +subscription_group_signup = SubscriptionGroupSignup.new( + subscriptions: [ + SubscriptionGroupSignupItem.new( + product_handle: 'product_handle8', + product_id: 144, + product_price_point_id: 68, + product_price_point_handle: 'product_price_point_handle4', + offer_id: 40, + metafields: { + 'custom_field_name_1': 'custom_field_value_1', + 'custom_field_name_2': 'custom_field_value_2' + } + ) ], - "payment_profile_id": 42, - "payer_id": 64, - "payer_reference": "payer_reference8", - "payment_collection_method": "automatic", - "payer_attributes": { - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails2", - "organization": "organization6" - } -} + payment_profile_id: 232, + payer_id: 254, + payer_reference: 'payer_reference2', + payment_collection_method: CollectionMethod::PREPAID, + payer_attributes: PayerAttributes.new( + first_name: 'first_name2', + last_name: 'last_name0', + email: 'email4', + cc_emails: 'cc_emails2', + organization: 'organization6' + ) +) ``` diff --git a/doc/models/subscription-group-single-error.md b/doc/models/subscription-group-single-error.md index 9eb0e03a..ff3d18bc 100644 --- a/doc/models/subscription-group-single-error.md +++ b/doc/models/subscription-group-single-error.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `subscription_group` | `String` | Required | - | -## Example (as JSON) +## Example -```json -{ - "subscription_group": "subscription_group2" -} +```ruby +subscription_group_single_error = SubscriptionGroupSingleError.new( + subscription_group: 'subscription_group4' +) ``` diff --git a/doc/models/subscription-group-subscription-error.md b/doc/models/subscription-group-subscription-error.md index 19409689..1d3e393b 100644 --- a/doc/models/subscription-group-subscription-error.md +++ b/doc/models/subscription-group-subscription-error.md @@ -20,31 +20,26 @@ Object which contains subscription errors. | `payment_profile_expiration_year` | `Array[String]` | Optional | - | | `payment_profile_full_number` | `Array[String]` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "product": [ - "product7", - "product6" +```ruby +subscription_group_subscription_error = SubscriptionGroupSubscriptionError.new( + product: [ + 'product1' ], - "product_price_point_id": [ - "product_price_point_id9", - "product_price_point_id0" + product_price_point_id: [ + 'product_price_point_id7' ], - "payment_profile": [ - "payment_profile4", - "payment_profile5" + payment_profile: [ + 'payment_profile2' ], - "payment_profile.chargify_token": [ - "payment_profile.chargify_token8", - "payment_profile.chargify_token9" + payment_profile_chargify_token: [ + 'payment_profile.chargify_token6' ], - "base": [ - "base7", - "base8", - "base9" + base: [ + 'base5', + 'base6' ] -} +) ``` diff --git a/doc/models/subscription-group-update-error-response-exception.md b/doc/models/subscription-group-update-error-response-exception.md index a5889eb8..20e022c6 100644 --- a/doc/models/subscription-group-update-error-response-exception.md +++ b/doc/models/subscription-group-update-error-response-exception.md @@ -11,16 +11,13 @@ | --- | --- | --- | --- | | `errors` | [`SubscriptionGroupUpdateError`](../../doc/models/subscription-group-update-error.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": { - "members": [ - "members2", - "members1" - ] - } -} +## Example + +```ruby +begin + # make the API call +rescue SubscriptionGroupUpdateErrorResponseException => e + puts "Caught SubscriptionGroupUpdateErrorResponseException: #{e.message}" +end ``` diff --git a/doc/models/subscription-group-update-error.md b/doc/models/subscription-group-update-error.md index 13309af2..0606cfa0 100644 --- a/doc/models/subscription-group-update-error.md +++ b/doc/models/subscription-group-update-error.md @@ -11,15 +11,15 @@ | --- | --- | --- | --- | | `members` | `Array[String]` | Optional | - | -## Example (as JSON) - -```json -{ - "members": [ - "members4", - "members5", - "members6" +## Example + +```ruby +subscription_group_update_error = SubscriptionGroupUpdateError.new( + members: [ + 'members6', + 'members5', + 'members4' ] -} +) ``` diff --git a/doc/models/subscription-group.md b/doc/models/subscription-group.md index cf6ea592..c97d6560 100644 --- a/doc/models/subscription-group.md +++ b/doc/models/subscription-group.md @@ -16,24 +16,23 @@ | `subscription_ids` | `Array[Integer]` | Optional | - | | `created_at` | `DateTime` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid4", - "customer_id": 36, - "payment_profile": { - "id": 44, - "first_name": "first_name4", - "last_name": "last_name2", - "masked_card_number": "masked_card_number2" - }, - "payment_collection_method": "prepaid", - "subscription_ids": [ - 146, - 147, - 148 +## Example + +```ruby +subscription_group = SubscriptionGroup.new( + uid: 'uid8', + customer_id: 220, + payment_profile: SubscriptionGroupPaymentProfile.new( + id: 44, + first_name: 'first_name4', + last_name: 'last_name2', + masked_card_number: 'masked_card_number2' + ), + payment_collection_method: CollectionMethod::PREPAID, + subscription_ids: [ + 74, + 75 ] -} +) ``` diff --git a/doc/models/subscription-groups-list-include.md b/doc/models/subscription-groups-list-include.md index 27d18a04..43435a67 100644 --- a/doc/models/subscription-groups-list-include.md +++ b/doc/models/subscription-groups-list-include.md @@ -11,3 +11,9 @@ | --- | | `ACCOUNT_BALANCES` | +## Example + +```ruby +subscription_groups_list_include = SubscriptionGroupsListInclude::ACCOUNT_BALANCES +``` + diff --git a/doc/models/subscription-include.md b/doc/models/subscription-include.md index 639f7da2..d2c67b49 100644 --- a/doc/models/subscription-include.md +++ b/doc/models/subscription-include.md @@ -12,3 +12,9 @@ | `COUPONS` | | `SELF_SERVICE_PAGE_TOKEN` | +## Example + +```ruby +subscription_include = SubscriptionInclude::COUPONS +``` + diff --git a/doc/models/subscription-included-coupon.md b/doc/models/subscription-included-coupon.md index d35a6f0f..6ddd743e 100644 --- a/doc/models/subscription-included-coupon.md +++ b/doc/models/subscription-included-coupon.md @@ -17,17 +17,17 @@ | `amount_in_cents` | `Integer` | Optional | **Constraints**: `>= 0` | | `percentage` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "code": "\"ABCD_10\"", - "use_count": 2, - "uses_allowed": 10, - "expires_at": "\"2023-07-13T05:18:58-04:00\"", - "amount_in_cents": 1000, - "percentage": "\"15.0\"", - "recurring": false -} +## Example + +```ruby +subscription_included_coupon = SubscriptionIncludedCoupon.new( + code: '"ABCD_10"', + use_count: 2, + uses_allowed: 10, + expires_at: '"2023-07-13T05:18:58-04:00"', + recurring: false, + amount_in_cents: 1000, + percentage: '"15.0"' +) ``` diff --git a/doc/models/subscription-list-date-field.md b/doc/models/subscription-list-date-field.md index dc18409d..76fcbc96 100644 --- a/doc/models/subscription-list-date-field.md +++ b/doc/models/subscription-list-date-field.md @@ -13,7 +13,7 @@ ## Example -``` -updated_at +```ruby +subscription_list_date_field = SubscriptionListDateField::UPDATED_AT ``` diff --git a/doc/models/subscription-list-include.md b/doc/models/subscription-list-include.md index 27fb9c1d..cfced666 100644 --- a/doc/models/subscription-list-include.md +++ b/doc/models/subscription-list-include.md @@ -10,4 +10,13 @@ | Name | | --- | | `SELF_SERVICE_PAGE_TOKEN` | +| `CURRENT_ACCOUNT_BALANCE_IN_CENTS` | +| `CURRENT_BILLING_AMOUNT` | +| `COUPONS` | + +## Example + +```ruby +subscription_list_include = SubscriptionListInclude::SELF_SERVICE_PAGE_TOKEN +``` diff --git a/doc/models/subscription-migration-preview-options.md b/doc/models/subscription-migration-preview-options.md index 7fe2066a..2cea3a63 100644 --- a/doc/models/subscription-migration-preview-options.md +++ b/doc/models/subscription-migration-preview-options.md @@ -20,16 +20,16 @@ | `proration` | [`Proration`](../../doc/models/proration.md) | Optional | - | | `proration_date` | `DateTime` | Optional | The date that the proration is calculated from for the preview | -## Example (as JSON) - -```json -{ - "include_trial": false, - "include_initial_charge": false, - "include_coupons": true, - "preserve_period": false, - "product_id": 242, - "product_price_point_id": 166 -} +## Example + +```ruby +subscription_migration_preview_options = SubscriptionMigrationPreviewOptions.new( + product_id: 8, + product_price_point_id: 188, + include_trial: false, + include_initial_charge: false, + include_coupons: true, + preserve_period: false +) ``` diff --git a/doc/models/subscription-migration-preview-request.md b/doc/models/subscription-migration-preview-request.md index bc501732..9380acc7 100644 --- a/doc/models/subscription-migration-preview-request.md +++ b/doc/models/subscription-migration-preview-request.md @@ -11,18 +11,18 @@ | --- | --- | --- | --- | | `migration` | [`SubscriptionMigrationPreviewOptions`](../../doc/models/subscription-migration-preview-options.md) | Required | - | -## Example (as JSON) - -```json -{ - "migration": { - "include_trial": false, - "include_initial_charge": false, - "include_coupons": true, - "preserve_period": false, - "product_id": 158, - "product_price_point_id": 82 - } -} +## Example + +```ruby +subscription_migration_preview_request = SubscriptionMigrationPreviewRequest.new( + migration: SubscriptionMigrationPreviewOptions.new( + product_id: 158, + product_price_point_id: 82, + include_trial: false, + include_initial_charge: false, + include_coupons: true, + preserve_period: false + ) +) ``` diff --git a/doc/models/subscription-migration-preview-response.md b/doc/models/subscription-migration-preview-response.md index a46b86d2..13ec1650 100644 --- a/doc/models/subscription-migration-preview-response.md +++ b/doc/models/subscription-migration-preview-response.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `migration` | [`SubscriptionMigrationPreview`](../../doc/models/subscription-migration-preview.md) | Required | - | -## Example (as JSON) - -```json -{ - "migration": { - "prorated_adjustment_in_cents": 196, - "charge_in_cents": 78, - "payment_due_in_cents": 250, - "credit_applied_in_cents": 210 - } -} +## Example + +```ruby +subscription_migration_preview_response = SubscriptionMigrationPreviewResponse.new( + migration: SubscriptionMigrationPreview.new( + prorated_adjustment_in_cents: 196, + charge_in_cents: 78, + payment_due_in_cents: 250, + credit_applied_in_cents: 210 + ) +) ``` diff --git a/doc/models/subscription-migration-preview.md b/doc/models/subscription-migration-preview.md index 41f08c12..8ff6e392 100644 --- a/doc/models/subscription-migration-preview.md +++ b/doc/models/subscription-migration-preview.md @@ -14,14 +14,14 @@ | `payment_due_in_cents` | `Integer` | Optional | The amount of the payment due in the case of an upgrade. | | `credit_applied_in_cents` | `Integer` | Optional | Represents a credit in cents that is applied to your subscription as part of a migration process for a specific product, which reduces the amount owed for the subscription. | -## Example (as JSON) - -```json -{ - "prorated_adjustment_in_cents": 134, - "charge_in_cents": 16, - "payment_due_in_cents": 188, - "credit_applied_in_cents": 148 -} +## Example + +```ruby +subscription_migration_preview = SubscriptionMigrationPreview.new( + prorated_adjustment_in_cents: 176, + charge_in_cents: 58, + payment_due_in_cents: 230, + credit_applied_in_cents: 190 +) ``` diff --git a/doc/models/subscription-mrr-breakout.md b/doc/models/subscription-mrr-breakout.md index f8ba7e40..2bc61bd9 100644 --- a/doc/models/subscription-mrr-breakout.md +++ b/doc/models/subscription-mrr-breakout.md @@ -12,12 +12,12 @@ | `plan_amount_in_cents` | `Integer` | Required | - | | `usage_amount_in_cents` | `Integer` | Required | - | -## Example (as JSON) +## Example -```json -{ - "plan_amount_in_cents": 208, - "usage_amount_in_cents": 60 -} +```ruby +subscription_mrr_breakout = SubscriptionMRRBreakout.new( + plan_amount_in_cents: 214, + usage_amount_in_cents: 66 +) ``` diff --git a/doc/models/subscription-mrr-response.md b/doc/models/subscription-mrr-response.md index 830ca6c0..21465851 100644 --- a/doc/models/subscription-mrr-response.md +++ b/doc/models/subscription-mrr-response.md @@ -11,20 +11,20 @@ | --- | --- | --- | --- | | `subscriptions_mrr` | [`Array[SubscriptionMRR]`](../../doc/models/subscription-mrr.md) | Required | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | -## Example (as JSON) - -```json -{ - "subscriptions_mrr": [ - { - "subscription_id": 0, - "mrr_amount_in_cents": 0, - "breakouts": { - "plan_amount_in_cents": 0, - "usage_amount_in_cents": 0 - } - } +## Example + +```ruby +subscription_mrr_response = SubscriptionMRRResponse.new( + subscriptions_mrr: [ + SubscriptionMRR.new( + subscription_id: 0, + mrr_amount_in_cents: 0, + breakouts: SubscriptionMRRBreakout.new( + plan_amount_in_cents: 0, + usage_amount_in_cents: 0 + ) + ) ] -} +) ``` diff --git a/doc/models/subscription-mrr.md b/doc/models/subscription-mrr.md index f94116a8..e02bf32e 100644 --- a/doc/models/subscription-mrr.md +++ b/doc/models/subscription-mrr.md @@ -13,16 +13,16 @@ | `mrr_amount_in_cents` | `Integer` | Required | - | | `breakouts` | [`SubscriptionMRRBreakout`](../../doc/models/subscription-mrr-breakout.md) | Optional | - | -## Example (as JSON) - -```json -{ - "subscription_id": 4, - "mrr_amount_in_cents": 22, - "breakouts": { - "plan_amount_in_cents": 254, - "usage_amount_in_cents": 106 - } -} +## Example + +```ruby +subscription_mrr = SubscriptionMRR.new( + subscription_id: 186, + mrr_amount_in_cents: 204, + breakouts: SubscriptionMRRBreakout.new( + plan_amount_in_cents: 254, + usage_amount_in_cents: 106 + ) +) ``` diff --git a/doc/models/subscription-note-response.md b/doc/models/subscription-note-response.md index aaf77947..5a46523f 100644 --- a/doc/models/subscription-note-response.md +++ b/doc/models/subscription-note-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `note` | [`SubscriptionNote`](../../doc/models/subscription-note.md) | Required | - | -## Example (as JSON) - -```json -{ - "note": { - "id": 28, - "body": "body0", - "subscription_id": 138, - "created_at": "2016-03-13T12:52:32.123Z", - "updated_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ruby +subscription_note_response = SubscriptionNoteResponse.new( + note: SubscriptionNote.new( + id: 28, + body: 'body0', + subscription_id: 138, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + updated_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/subscription-note.md b/doc/models/subscription-note.md index 93a0bcd2..e1da9be6 100644 --- a/doc/models/subscription-note.md +++ b/doc/models/subscription-note.md @@ -16,15 +16,15 @@ | `updated_at` | `DateTime` | Optional | - | | `sticky` | `TrueClass \| FalseClass` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 36, - "body": "body4", - "subscription_id": 146, - "created_at": "2016-03-13T12:52:32.123Z", - "updated_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +subscription_note = SubscriptionNote.new( + id: 114, + body: 'body0', + subscription_id: 224, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + updated_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/subscription-preview-response.md b/doc/models/subscription-preview-response.md index cb4ea150..9831f25c 100644 --- a/doc/models/subscription-preview-response.md +++ b/doc/models/subscription-preview-response.md @@ -11,56 +11,56 @@ | --- | --- | --- | --- | | `subscription_preview` | [`SubscriptionPreview`](../../doc/models/subscription-preview.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "subscription_preview": { - "current_billing_manifest": { - "line_items": [ - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - } +```ruby +subscription_preview_response = SubscriptionPreviewResponse.new( + subscription_preview: SubscriptionPreview.new( + current_billing_manifest: BillingManifest.new( + line_items: [ + BillingManifestItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: BillingManifestLineItemKind::COMPONENT, + amount_in_cents: 24, + memo: 'memo2', + discount_amount_in_cents: 172 + ) ], - "total_in_cents": 38, - "total_discount_in_cents": 24, - "total_tax_in_cents": 18, - "subtotal_in_cents": 150 - }, - "next_billing_manifest": { - "line_items": [ - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - }, - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - }, - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - } + total_in_cents: 38, + total_discount_in_cents: 24, + total_tax_in_cents: 18, + subtotal_in_cents: 150 + ), + next_billing_manifest: BillingManifest.new( + line_items: [ + BillingManifestItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: BillingManifestLineItemKind::COMPONENT, + amount_in_cents: 24, + memo: 'memo2', + discount_amount_in_cents: 172 + ), + BillingManifestItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: BillingManifestLineItemKind::COMPONENT, + amount_in_cents: 24, + memo: 'memo2', + discount_amount_in_cents: 172 + ), + BillingManifestItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: BillingManifestLineItemKind::COMPONENT, + amount_in_cents: 24, + memo: 'memo2', + discount_amount_in_cents: 172 + ) ], - "total_in_cents": 62, - "total_discount_in_cents": 208, - "total_tax_in_cents": 42, - "subtotal_in_cents": 174 - } - } -} + total_in_cents: 62, + total_discount_in_cents: 208, + total_tax_in_cents: 42, + subtotal_in_cents: 174 + ) + ) +) ``` diff --git a/doc/models/subscription-preview.md b/doc/models/subscription-preview.md index 0ceb3da4..3f5723e5 100644 --- a/doc/models/subscription-preview.md +++ b/doc/models/subscription-preview.md @@ -12,54 +12,54 @@ | `current_billing_manifest` | [`BillingManifest`](../../doc/models/billing-manifest.md) | Optional | - | | `next_billing_manifest` | [`BillingManifest`](../../doc/models/billing-manifest.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "current_billing_manifest": { - "line_items": [ - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - } +```ruby +subscription_preview = SubscriptionPreview.new( + current_billing_manifest: BillingManifest.new( + line_items: [ + BillingManifestItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: BillingManifestLineItemKind::COMPONENT, + amount_in_cents: 24, + memo: 'memo2', + discount_amount_in_cents: 172 + ) ], - "total_in_cents": 38, - "total_discount_in_cents": 24, - "total_tax_in_cents": 18, - "subtotal_in_cents": 150 - }, - "next_billing_manifest": { - "line_items": [ - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - }, - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - }, - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - } + total_in_cents: 38, + total_discount_in_cents: 24, + total_tax_in_cents: 18, + subtotal_in_cents: 150 + ), + next_billing_manifest: BillingManifest.new( + line_items: [ + BillingManifestItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: BillingManifestLineItemKind::COMPONENT, + amount_in_cents: 24, + memo: 'memo2', + discount_amount_in_cents: 172 + ), + BillingManifestItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: BillingManifestLineItemKind::COMPONENT, + amount_in_cents: 24, + memo: 'memo2', + discount_amount_in_cents: 172 + ), + BillingManifestItem.new( + transaction_type: LineItemTransactionType::CREDIT, + kind: BillingManifestLineItemKind::COMPONENT, + amount_in_cents: 24, + memo: 'memo2', + discount_amount_in_cents: 172 + ) ], - "total_in_cents": 62, - "total_discount_in_cents": 208, - "total_tax_in_cents": 42, - "subtotal_in_cents": 174 - } -} + total_in_cents: 62, + total_discount_in_cents: 208, + total_tax_in_cents: 42, + subtotal_in_cents: 174 + ) +) ``` diff --git a/doc/models/subscription-product-change.md b/doc/models/subscription-product-change.md index 8490bc77..db0774f9 100644 --- a/doc/models/subscription-product-change.md +++ b/doc/models/subscription-product-change.md @@ -1,6 +1,8 @@ # Subscription Product Change +Event data for both `subscription_product_change` and `subscription_product_change_scheduled`. The price point and `effective_at` fields are only populated for scheduled changes. + ## Structure `SubscriptionProductChange` @@ -11,13 +13,19 @@ | --- | --- | --- | --- | | `previous_product_id` | `Integer` | Required | - | | `new_product_id` | `Integer` | Required | - | - -## Example (as JSON) - -```json -{ - "previous_product_id": 126, - "new_product_id": 12 -} +| `previous_product_price_point_id` | `Integer` | Optional | - | +| `new_product_price_point_id` | `Integer` | Optional | - | +| `effective_at` | `DateTime` | Optional | When the scheduled product change takes effect (the subscription's next renewal). Only sent for `subscription_product_change_scheduled`. | + +## Example + +```ruby +subscription_product_change = SubscriptionProductChange.new( + previous_product_id: 250, + new_product_id: 120, + previous_product_price_point_id: 118, + new_product_price_point_id: 112, + effective_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/subscription-product-migration-request.md b/doc/models/subscription-product-migration-request.md index 5b269939..96bf66e9 100644 --- a/doc/models/subscription-product-migration-request.md +++ b/doc/models/subscription-product-migration-request.md @@ -11,18 +11,18 @@ | --- | --- | --- | --- | | `migration` | [`SubscriptionProductMigration`](../../doc/models/subscription-product-migration.md) | Required | - | -## Example (as JSON) - -```json -{ - "migration": { - "include_trial": false, - "include_initial_charge": false, - "include_coupons": true, - "preserve_period": false, - "product_id": 158, - "product_price_point_id": 82 - } -} +## Example + +```ruby +subscription_product_migration_request = SubscriptionProductMigrationRequest.new( + migration: SubscriptionProductMigration.new( + product_id: 158, + product_price_point_id: 82, + include_trial: false, + include_initial_charge: false, + include_coupons: true, + preserve_period: false + ) +) ``` diff --git a/doc/models/subscription-product-migration.md b/doc/models/subscription-product-migration.md index 1b28420e..6b921c97 100644 --- a/doc/models/subscription-product-migration.md +++ b/doc/models/subscription-product-migration.md @@ -19,16 +19,16 @@ | `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 | - | -## Example (as JSON) - -```json -{ - "include_trial": false, - "include_initial_charge": false, - "include_coupons": true, - "preserve_period": false, - "product_id": 8, - "product_price_point_id": 172 -} +## Example + +```ruby +subscription_product_migration = SubscriptionProductMigration.new( + product_id: 234, + product_price_point_id: 158, + include_trial: false, + include_initial_charge: false, + include_coupons: true, + preserve_period: false +) ``` diff --git a/doc/models/subscription-purge-type.md b/doc/models/subscription-purge-type.md index cd25299c..7423cfa4 100644 --- a/doc/models/subscription-purge-type.md +++ b/doc/models/subscription-purge-type.md @@ -12,3 +12,9 @@ | `CUSTOMER` | | `PAYMENT_PROFILE` | +## Example + +```ruby +subscription_purge_type = SubscriptionPurgeType::CUSTOMER +``` + diff --git a/doc/models/subscription-remove-coupon-errors-exception.md b/doc/models/subscription-remove-coupon-errors-exception.md index 360c938c..0dde962f 100644 --- a/doc/models/subscription-remove-coupon-errors-exception.md +++ b/doc/models/subscription-remove-coupon-errors-exception.md @@ -11,13 +11,13 @@ | --- | --- | --- | --- | | `subscription` | `Array[String]` | Required | - | -## Example (as JSON) - -```json -{ - "subscription": [ - "subscription0" - ] -} +## Example + +```ruby +begin + # make the API call +rescue SubscriptionRemoveCouponErrorsException => e + puts "Caught SubscriptionRemoveCouponErrorsException: #{e.message}" +end ``` diff --git a/doc/models/subscription-response-error-exception.md b/doc/models/subscription-response-error-exception.md index 7431e8a4..d5c397d5 100644 --- a/doc/models/subscription-response-error-exception.md +++ b/doc/models/subscription-response-error-exception.md @@ -11,17 +11,13 @@ | --- | --- | --- | --- | | `subscription` | [`Subscription`](../../doc/models/subscription.md) | Optional | - | -## Example (as JSON) - -```json -{ - "subscription": { - "id": 8, - "state": "paused", - "balance_in_cents": 124, - "total_revenue_in_cents": 48, - "product_price_in_cents": 238 - } -} +## Example + +```ruby +begin + # make the API call +rescue SubscriptionResponseErrorException => e + puts "Caught SubscriptionResponseErrorException: #{e.message}" +end ``` diff --git a/doc/models/subscription-response.md b/doc/models/subscription-response.md index 90a394a6..356a0729 100644 --- a/doc/models/subscription-response.md +++ b/doc/models/subscription-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `subscription` | [`Subscription`](../../doc/models/subscription.md) | Optional | - | -## Example (as JSON) - -```json -{ - "subscription": { - "id": 8, - "state": "paused", - "balance_in_cents": 124, - "total_revenue_in_cents": 48, - "product_price_in_cents": 238 - } -} +## Example + +```ruby +subscription_response = SubscriptionResponse.new( + subscription: Subscription.new( + id: 8, + state: SubscriptionState::PAUSED, + balance_in_cents: 124, + total_revenue_in_cents: 48, + product_price_in_cents: 238 + ) +) ``` diff --git a/doc/models/subscription-sort.md b/doc/models/subscription-sort.md index b07e8ee0..0a2773de 100644 --- a/doc/models/subscription-sort.md +++ b/doc/models/subscription-sort.md @@ -20,3 +20,9 @@ | `OPEN_BALANCE` | | `EXPIRES_AT` | +## Example + +```ruby +subscription_sort = SubscriptionSort::OPEN_BALANCE +``` + diff --git a/doc/models/subscription-state-change.md b/doc/models/subscription-state-change.md index 1431d7dd..68065e26 100644 --- a/doc/models/subscription-state-change.md +++ b/doc/models/subscription-state-change.md @@ -12,12 +12,12 @@ | `previous_subscription_state` | `String` | Required | **Constraints**: *Minimum Length*: `1` | | `new_subscription_state` | `String` | Required | **Constraints**: *Minimum Length*: `1` | -## Example (as JSON) +## Example -```json -{ - "previous_subscription_state": "previous_subscription_state2", - "new_subscription_state": "new_subscription_state6" -} +```ruby +subscription_state_change = SubscriptionStateChange.new( + previous_subscription_state: 'previous_subscription_state4', + new_subscription_state: 'new_subscription_state8' +) ``` diff --git a/doc/models/subscription-state-filter.md b/doc/models/subscription-state-filter.md index 148d4118..6b986335 100644 --- a/doc/models/subscription-state-filter.md +++ b/doc/models/subscription-state-filter.md @@ -15,12 +15,23 @@ Allowed values for filtering by the current state of the subscription. | `CANCELED` | | `EXPIRED` | | `EXPIRED_CARDS` | +| `ENUM_EXPIRED_CARDS_LIVE_SUBSCRIPTIONS` | +| `ENUM_EXPIRED_CARDS_ALL_SUBSCRIPTIONS` | | `ON_HOLD` | +| `AWAITING_SIGNUP` | +| `AWAITING_SIGNUP_DATE` | | `PAST_DUE` | | `PENDING_CANCELLATION` | | `PENDING_RENEWAL` | +| `PREPAID_DUNNING` | | `SUSPENDED` | | `TRIAL_ENDED` | | `TRIALING` | | `UNPAID` | +## Example + +```ruby +subscription_state_filter = SubscriptionStateFilter::SUSPENDED +``` + diff --git a/doc/models/subscription-state.md b/doc/models/subscription-state.md index 6e893623..5e5e1ff1 100644 --- a/doc/models/subscription-state.md +++ b/doc/models/subscription-state.md @@ -48,3 +48,9 @@ See [Subscription States](https://maxio.zendesk.com/hc/en-us/articles/2425211902 | `ON_HOLD` | | `AWAITING_SIGNUP` | +## Example + +```ruby +subscription_state = SubscriptionState::ACTIVE +``` + diff --git a/doc/models/subscription.md b/doc/models/subscription.md index f48bbf2e..de85052a 100644 --- a/doc/models/subscription.md +++ b/doc/models/subscription.md @@ -13,13 +13,13 @@ | `state` | [`SubscriptionState`](../../doc/models/subscription-state.md) | Optional | The state of a subscription.

* **Live States**
* `active` - A normal, active subscription. It is not in a trial and is paid and up to date.
* `assessing` - An internal (transient) state that indicates a subscription is in the middle of periodic assessment. Do not base any access decisions in your app on this state, as it may not always be exposed.
* `pending` - An internal (transient) state that indicates a subscription is in the creation process. Do not base any access decisions in your app on this state, as it may not always be exposed.
* `trialing` - A subscription in trialing state has a valid trial subscription. This type of subscription may transition to active once payment is received when the trial has ended. Otherwise, it may go to a Problem or End of Life state.
* `paused` - An internal state that indicates that your account with Advanced Billing is in arrears.
* **Problem States**
* `past_due` - Indicates that the most recent payment has failed, and payment is past due for this subscription. If you have enabled our automated dunning, this subscription will be in the dunning process (additional status and callbacks from the dunning process will be available in the future). If you are handling dunning and payment updates yourself, you will want to use this state to initiate a payment update from your customers.
* `soft_failure` - Indicates that normal assessment/processing of the subscription has failed for a reason that cannot be fixed by the Customer. For example, a Soft Fail may result from a timeout at the gateway or incorrect credentials on your part. The subscriptions should be retried automatically. An interface is being built for you to review problems resulting from these events to take manual action when needed.
* `unpaid` - Indicates an unpaid subscription. A subscription is marked unpaid if the retry period expires and you have configured your [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunning-Overview) settings to have a Final Action of `mark the subscription unpaid`.
* **End of Life States**
* `canceled` - Indicates a canceled subscription. This may happen at your request (via the API or the web interface) or due to the expiration of the [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunning-Overview) process without payment. See the [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-Reactivating-and-Resuming) documentation for info on how to restart a canceled subscription.
While a subscription is canceled, its period will not advance, it will not accrue any new charges, and Advanced Billing will not attempt to collect the overdue balance.
* `expired` - Indicates a subscription that has expired due to running its normal life cycle. Some products may be configured to have an expiration period. An expired subscription then is one that stayed active until it fulfilled its full period.
* `failed_to_create` - Indicates that signup has failed. (You may see this state in a signup_failure webhook.)
* `on_hold` - Indicates that a subscription’s billing has been temporarily stopped. While it is expected that the subscription will resume and return to active status, this is still treated as an “End of Life” state because the customer is not paying for services during this time.
* `suspended` - Indicates that a prepaid subscription has used up all their prepayment balance. If a prepayment is applied, it will return to an active state.
* `trial_ended` - A subscription in a trial_ended state is a subscription that completed a no-obligation trial and did not have a card on file at the expiration of the trial period. See [Product Pricing – No Obligation Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869-Product-Editing) for more details.

See [Subscription States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853-Subscription-States) for more info about subscription states and state transitions. | | `balance_in_cents` | `Integer` | Optional | Gives the current outstanding subscription balance in the number of cents. | | `total_revenue_in_cents` | `Integer` | Optional | Gives the total revenue from the subscription in the number of cents. | -| `product_price_in_cents` | `Integer` | Optional | (Added Nov 5 2013) The recurring amount of the product (and version),currently subscribed. NOTE: this may differ from the current price of,the product, if you’ve changed the price of the product but haven’t,moved this subscription to a newer version. | +| `product_price_in_cents` | `Integer` | Optional | (Added Nov 5 2013) The recurring amount of the product (and version), currently subscribed. NOTE: this may differ from the current price of the product, if you’ve changed the price of the product but haven’t moved this subscription to a newer version. | | `product_version_number` | `Integer` | Optional | The version of the product for the subscription. Note that this is a deprecated field kept for backwards-compatibility. | -| `current_period_ends_at` | `DateTime` | Optional | Timestamp relating to the end of the current (recurring) period (i.e.,when the next regularly scheduled attempted charge will occur) | -| `next_assessment_at` | `DateTime` | Optional | Timestamp that indicates when capture of payment will be tried or,retried. This value will usually track the current_period_ends_at, but,will diverge if a renewal payment fails and must be retried. In that,case, the current_period_ends_at will advance to the end of the next,period (time doesn’t stop because a payment was missed) but the,next_assessment_at will be scheduled for the auto-retry time (i.e. 24,hours in the future, in some cases) | +| `current_period_ends_at` | `DateTime` | Optional | Timestamp relating to the end of the current (recurring) period (i.e., when the next regularly scheduled attempted charge will occur) | +| `next_assessment_at` | `DateTime` | Optional | Timestamp that indicates when capture of payment will be tried or retried. This value will usually track the current_period_ends_at, but will diverge if a renewal payment fails and must be retried. In that case, the current_period_ends_at will advance to the end of the next period (time doesn’t stop because a payment was missed) but the next_assessment_at will be scheduled for the auto-retry time (e.g., 24 hours in the future, in some cases). | | `trial_started_at` | `DateTime` | Optional | Timestamp for when the trial period (if any) began | | `trial_ended_at` | `DateTime` | Optional | Timestamp for when the trial period (if any) ended | -| `activated_at` | `DateTime` | Optional | Timestamp for when the subscription began (i.e. when it came out of trial, or when it began in the case of no trial) | +| `activated_at` | `DateTime` | Optional | Timestamp for when the subscription began (i.e., when it came out of trial, or when it began in the case of no trial) | | `expires_at` | `DateTime` | Optional | Timestamp giving the expiration date of this subscription (if any) | | `created_at` | `DateTime` | Optional | The creation date for this subscription | | `updated_at` | `DateTime` | Optional | The date of last update for this subscription | @@ -28,9 +28,9 @@ | `cancel_at_end_of_period` | `TrueClass \| FalseClass` | Optional | Whether or not the subscription will (or has) canceled at the end of the period. | | `canceled_at` | `DateTime` | Optional | The timestamp of the most recent cancellation | | `current_period_started_at` | `DateTime` | Optional | Timestamp relating to the start of the current (recurring) period | -| `previous_state` | [`SubscriptionState`](../../doc/models/subscription-state.md) | Optional | Only valid for webhook payloads The previous state for webhooks that have indicated a change in state. For normal API calls, this will always be the same as the state (current state) | +| `previous_state` | [`SubscriptionState`](../../doc/models/subscription-state.md) | Optional | Only valid for webhook payloads The previous state for webhooks that have indicated a change in state. For normal API calls, this will always be the same as the state (current state). | | `signup_payment_id` | `Integer` | Optional | The ID of the transaction that generated the revenue | -| `signup_revenue` | `String` | Optional | The revenue, formatted as a string of decimal separated dollars and,cents, from the subscription signup ($50.00 would be formatted as,50.00) | +| `signup_revenue` | `String` | Optional | The revenue, formatted as a string of decimal separated dollars and cents, from the subscription signup ($50.00 would be formatted as 50.00) | | `delayed_cancel_at` | `DateTime` | Optional | Timestamp for when the subscription is currently set to cancel. | | `coupon_code` | `String` | Optional | (deprecated) The coupon code of the single coupon currently applied to the subscription. See coupon_codes instead as subscriptions can now have more than one coupon. | | `snap_day` | `String` | Optional | A day of month that subscription will be processed on. Can be 1 up to 28 or 'end'. | @@ -46,7 +46,7 @@ | `next_product_handle` | `String` | Optional | If a delayed product change is scheduled, the handle of the product that the subscription will be changed to at the next renewal. | | `coupon_use_count` | `Integer` | Optional | (deprecated) How many times the subscription's single coupon has been used. This field has no replacement for multiple coupons. | | `coupon_uses_allowed` | `Integer` | Optional | (deprecated) How many times the subscription's single coupon may be used. This field has no replacement for multiple coupons. | -| `reason_code` | `String` | Optional | The churn reason code associated to a cancelled subscription. | +| `reason_code` | `String` | Optional | The churn reason code associated to a canceled subscription. | | `automatically_resume_at` | `DateTime` | Optional | The date the subscription is scheduled to automatically resume from the on_hold state. | | `coupon_codes` | `Array[String]` | Optional | An array for all the coupons attached to the subscription. | | `offer_id` | `Integer` | Optional | The ID of the offer associated with the subscription. | @@ -57,10 +57,10 @@ | `next_product_price_point_id` | `Integer` | Optional | If a delayed product change is scheduled, the ID of the product price point that the subscription will be changed to at the next renewal. | | `net_terms` | `Integer` | Optional | On Relationship Invoicing, the number of days before a renewal invoice is due. | | `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. | -| `reference` | `String` | Optional | The reference value (provided by your app) for the subscription istelf. | +| `reference` | `String` | Optional | The reference value (provided by your app) for the subscription itself. | | `on_hold_at` | `DateTime` | Optional | The timestamp of the most recent on hold action. | -| `prepaid_dunning` | `TrueClass \| FalseClass` | Optional | Boolean representing whether the subscription is prepaid and currently in dunning. Only returned for Relationship Invoicing sites with the feature enabled | -| `coupons` | [`Array[SubscriptionIncludedCoupon]`](../../doc/models/subscription-included-coupon.md) | Optional | Additional coupon data. To use this data you also have to include the following param in the request`include[]=coupons`.
Only in Read Subscription Endpoint. | +| `prepaid_dunning` | `TrueClass \| FalseClass` | Optional | Boolean representing whether the subscription is prepaid and currently in dunning. Only returned for Relationship Invoicing sites with the feature enabled. | +| `coupons` | [`Array[SubscriptionIncludedCoupon]`](../../doc/models/subscription-included-coupon.md) | Optional | Additional coupon data. To use this data you also have to include the following param in the request: `include[]=coupons`.
Only in Read Subscription Endpoint. | | `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. | | `dunning_communication_delay_time_zone` | `String` | Optional | Time zone for the Dunning Communication Delay feature. | | `receives_invoice_emails` | `TrueClass \| FalseClass` | Optional | - | @@ -72,38 +72,38 @@ | `prepaid_configuration` | [`PrepaidConfiguration`](../../doc/models/prepaid-configuration.md) | Optional | - | | `self_service_page_token` | `String` | Optional | Returned only for list/read Subscription operation when `include[]=self_service_page_token` parameter is provided. | -## Example (as JSON) +## Example -```json -{ - "credit_card": { - "id": 10088716, - "first_name": "Test", - "last_name": "Subscription", - "masked_card_number": "XXXX-XXXX-XXXX-1", - "card_type": "bogus", - "expiration_month": 1, - "expiration_year": 2022, - "customer_id": 14543792, - "current_vault": "bogus", - "vault_token": "1", - "billing_address": "123 Montana Way", - "billing_city": "Billings", - "billing_state": "MT", - "billing_zip": "59101", - "billing_country": "US", - "customer_vault_token": null, - "billing_address_2": "", - "payment_type": "credit_card", - "site_gateway_setting_id": 1, - "gateway_handle": null - }, - "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", - "id": 96, - "state": "soft_failure", - "balance_in_cents": 212, - "total_revenue_in_cents": 136, - "product_price_in_cents": 70 -} +```ruby +subscription = Subscription.new( + id: 8, + state: SubscriptionState::PAUSED, + balance_in_cents: 124, + total_revenue_in_cents: 48, + product_price_in_cents: 238, + credit_card: CreditCardPaymentProfile.new( + payment_type: PaymentType::CREDIT_CARD, + id: 10088716, + first_name: 'Test', + last_name: 'Subscription', + masked_card_number: 'XXXX-XXXX-XXXX-1', + card_type: CardType::BOGUS, + expiration_month: 1, + expiration_year: 2022, + customer_id: 14543792, + current_vault: CreditCardVault::BOGUS, + vault_token: '1', + billing_address: '123 Montana Way', + billing_city: 'Billings', + billing_state: 'MT', + billing_zip: '59101', + billing_country: 'US', + customer_vault_token: 'customer_vault_token2', + billing_address_2: '', + site_gateway_setting_id: 1, + gateway_handle: 'gateway_handle8' + ), + dunning_communication_delay_time_zone: '"Eastern Time (US & Canada)"' +) ``` diff --git a/doc/models/subscriptions-mrr-error-response-exception.md b/doc/models/subscriptions-mrr-error-response-exception.md index 5e2aa63a..936ea4d7 100644 --- a/doc/models/subscriptions-mrr-error-response-exception.md +++ b/doc/models/subscriptions-mrr-error-response-exception.md @@ -11,15 +11,13 @@ | --- | --- | --- | --- | | `errors` | [`AttributeError`](../../doc/models/attribute-error.md) | Required | - | -## Example (as JSON) - -```json -{ - "errors": { - "attribute": [ - "supplied value is invalid, expected ISO 8601 format" - ] - } -} +## Example + +```ruby +begin + # make the API call +rescue SubscriptionsMrrErrorResponseException => e + puts "Caught SubscriptionsMrrErrorResponseException: #{e.message}" +end ``` diff --git a/doc/models/tax-configuration-kind.md b/doc/models/tax-configuration-kind.md index ef95cf08..2492d7da 100644 --- a/doc/models/tax-configuration-kind.md +++ b/doc/models/tax-configuration-kind.md @@ -14,3 +14,9 @@ | `ENUM_LINKED_AVALARA` | | `ENUM_DIGITAL_RIVER` | +## Example + +```ruby +tax_configuration_kind = TaxConfigurationKind::CUSTOM +``` + diff --git a/doc/models/tax-configuration.md b/doc/models/tax-configuration.md index dbf1ab59..3f991abe 100644 --- a/doc/models/tax-configuration.md +++ b/doc/models/tax-configuration.md @@ -13,13 +13,13 @@ | `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` | -## Example (as JSON) - -```json -{ - "kind": "custom", - "fully_configured": false, - "destination_address": "shipping_only" -} +## Example + +```ruby +tax_configuration = TaxConfiguration.new( + kind: TaxConfigurationKind::CUSTOM, + destination_address: TaxDestinationAddress::SHIPPING_THEN_BILLING, + fully_configured: false +) ``` diff --git a/doc/models/tax-destination-address.md b/doc/models/tax-destination-address.md index f2a5b2ac..dd80eac2 100644 --- a/doc/models/tax-destination-address.md +++ b/doc/models/tax-destination-address.md @@ -14,3 +14,9 @@ | `SHIPPING_ONLY` | | `BILLING_ONLY` | +## Example + +```ruby +tax_destination_address = TaxDestinationAddress::SHIPPING_ONLY +``` + diff --git a/doc/models/tokenized-payment-profile.md b/doc/models/tokenized-payment-profile.md index b0304641..13ad980e 100644 --- a/doc/models/tokenized-payment-profile.md +++ b/doc/models/tokenized-payment-profile.md @@ -14,14 +14,14 @@ | `gateway_handle` | `String` | Optional | - | | `customer_vault_token` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 72, - "vault_token": "vault_token2", - "gateway_handle": "gateway_handle8", - "customer_vault_token": "customer_vault_token8" -} +## Example + +```ruby +tokenized_payment_profile = TokenizedPaymentProfile.new( + id: 216, + vault_token: 'vault_token4', + gateway_handle: 'gateway_handle6', + customer_vault_token: 'customer_vault_token0' +) ``` diff --git a/doc/models/too-many-management-link-requests-error-exception.md b/doc/models/too-many-management-link-requests-error-exception.md index b3ec6345..c6451dfd 100644 --- a/doc/models/too-many-management-link-requests-error-exception.md +++ b/doc/models/too-many-management-link-requests-error-exception.md @@ -11,14 +11,13 @@ | --- | --- | --- | --- | | `errors` | [`TooManyManagementLinkRequests`](../../doc/models/too-many-management-link-requests.md) | Required | - | -## Example (as JSON) - -```json -{ - "errors": { - "error": "error4", - "new_link_available_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ruby +begin + # make the API call +rescue TooManyManagementLinkRequestsErrorException => e + puts "Caught TooManyManagementLinkRequestsErrorException: #{e.message}" +end ``` diff --git a/doc/models/too-many-management-link-requests.md b/doc/models/too-many-management-link-requests.md index cc9eb628..648b5061 100644 --- a/doc/models/too-many-management-link-requests.md +++ b/doc/models/too-many-management-link-requests.md @@ -12,12 +12,12 @@ | `error` | `String` | Required | - | | `new_link_available_at` | `DateTime` | Required | - | -## Example (as JSON) +## Example -```json -{ - "error": "error2", - "new_link_available_at": "2016-03-13T12:52:32.123Z" -} +```ruby +too_many_management_link_requests = TooManyManagementLinkRequests.new( + error: 'error4', + new_link_available_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/trial-type.md b/doc/models/trial-type.md index 1298d99b..ad5ec70c 100644 --- a/doc/models/trial-type.md +++ b/doc/models/trial-type.md @@ -1,7 +1,7 @@ # Trial Type -Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. +Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. ## Enumeration @@ -14,3 +14,9 @@ Indicates how a trial is handled when the trail period ends and there is no cred | `NO_OBLIGATION` | | `PAYMENT_EXPECTED` | +## Example + +```ruby +trial_type = TrialType::NO_OBLIGATION +``` + diff --git a/doc/models/update-allocation-expiration-date.md b/doc/models/update-allocation-expiration-date.md index 09af6774..11c884a9 100644 --- a/doc/models/update-allocation-expiration-date.md +++ b/doc/models/update-allocation-expiration-date.md @@ -11,13 +11,13 @@ | --- | --- | --- | --- | | `allocation` | [`AllocationExpirationDate`](../../doc/models/allocation-expiration-date.md) | Optional | - | -## Example (as JSON) - -```json -{ - "allocation": { - "expires_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ruby +update_allocation_expiration_date = UpdateAllocationExpirationDate.new( + allocation: AllocationExpirationDate.new( + expires_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/update-component-price-point-request.md b/doc/models/update-component-price-point-request.md index 20d0bc64..0a754782 100644 --- a/doc/models/update-component-price-point-request.md +++ b/doc/models/update-component-price-point-request.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `price_point` | [`UpdateComponentPricePoint`](../../doc/models/update-component-price-point.md) | Optional | - | -## Example (as JSON) - -```json -{ - "price_point": { - "name": "name0", - "handle": "handle6", - "pricing_scheme": "per_unit", - "use_site_exchange_rate": false, - "tax_included": false - } -} +## Example + +```ruby +update_component_price_point_request = UpdateComponentPricePointRequest.new( + price_point: UpdateComponentPricePoint.new( + name: 'name0', + handle: 'handle6', + pricing_scheme: PricingScheme::PER_UNIT, + use_site_exchange_rate: false, + tax_included: false + ) +) ``` diff --git a/doc/models/update-component-price-point.md b/doc/models/update-component-price-point.md index beff7fd6..70380f66 100644 --- a/doc/models/update-component-price-point.md +++ b/doc/models/update-component-price-point.md @@ -14,19 +14,19 @@ | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. | | `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. | | `tax_included` | `TrueClass \| FalseClass` | Optional | Whether or not the price point includes tax | -| `interval` | `Integer` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled. | +| `interval` | `Integer` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this component 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 component price point, either month or day. This property is only available for sites with Multifrequency enabled. | | `prices` | [`Array[UpdatePrice]`](../../doc/models/update-price.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "use_site_exchange_rate": false, - "tax_included": false -} +```ruby +update_component_price_point = UpdateComponentPricePoint.new( + name: 'name2', + handle: 'handle8', + pricing_scheme: PricingScheme::PER_UNIT, + use_site_exchange_rate: false, + tax_included: false +) ``` diff --git a/doc/models/update-component-request.md b/doc/models/update-component-request.md index 843437a0..6adb67ad 100644 --- a/doc/models/update-component-request.md +++ b/doc/models/update-component-request.md @@ -11,18 +11,18 @@ | --- | --- | --- | --- | | `component` | [`UpdateComponent`](../../doc/models/update-component.md) | Required | - | -## Example (as JSON) - -```json -{ - "component": { - "item_category": "Business Software", - "handle": "handle4", - "name": "name8", - "description": "description2", - "accounting_code": "accounting_code4", - "taxable": false - } -} +## Example + +```ruby +update_component_request = UpdateComponentRequest.new( + component: UpdateComponent.new( + handle: 'handle4', + name: 'name8', + description: 'description2', + accounting_code: 'accounting_code4', + taxable: false, + item_category: ItemCategory::ENUM_BUSINESS_SOFTWARE + ) +) ``` diff --git a/doc/models/update-component.md b/doc/models/update-component.md index e0e8e332..facbddbe 100644 --- a/doc/models/update-component.md +++ b/doc/models/update-component.md @@ -10,7 +10,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `handle` | `String` | Optional | - | -| `name` | `String` | Optional | The name of the Component, suitable for display on statements. i.e. Text Messages. | +| `name` | `String` | Optional | The name of the Component, suitable for display on statements. e.g., Text Messages. | | `description` | `String` | Optional | The description of the component. | | `accounting_code` | `String` | Optional | - | | `taxable` | `TrueClass \| FalseClass` | Optional | Boolean flag describing whether a component is taxable or not. | @@ -18,17 +18,18 @@ | `item_category` | [`ItemCategory`](../../doc/models/item-category.md) | Optional | One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other | | `display_on_hosted_page` | `TrueClass \| FalseClass` | Optional | - | | `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. | - -## Example (as JSON) - -```json -{ - "item_category": "Business Software", - "handle": "handle6", - "name": "name0", - "description": "description0", - "accounting_code": "accounting_code6", - "taxable": false -} +| `unspsc_code` | `String` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | + +## Example + +```ruby +update_component = UpdateComponent.new( + handle: 'handle2', + name: 'name6', + description: 'description4', + accounting_code: 'accounting_code2', + taxable: false, + item_category: ItemCategory::ENUM_BUSINESS_SOFTWARE +) ``` diff --git a/doc/models/update-coupon-currency.md b/doc/models/update-coupon-currency.md index 9b132abb..4a0e2bff 100644 --- a/doc/models/update-coupon-currency.md +++ b/doc/models/update-coupon-currency.md @@ -12,12 +12,12 @@ | `currency` | `String` | Required | ISO code for the site defined currency. | | `price` | `Integer` | Required | Price for the given currency. | -## Example (as JSON) +## Example -```json -{ - "currency": "currency4", - "price": 146 -} +```ruby +update_coupon_currency = UpdateCouponCurrency.new( + currency: 'currency6', + price: 14 +) ``` diff --git a/doc/models/update-currency-price.md b/doc/models/update-currency-price.md index 4c33c3f6..cd70a016 100644 --- a/doc/models/update-currency-price.md +++ b/doc/models/update-currency-price.md @@ -12,12 +12,12 @@ | `id` | `Integer` | Required | ID of the currency price record being updated | | `price` | `Float` | Required | New price for the given currency | -## Example (as JSON) +## Example -```json -{ - "id": 146, - "price": 71.86 -} +```ruby +update_currency_price = UpdateCurrencyPrice.new( + id: 186, + price: 72.26 +) ``` diff --git a/doc/models/update-currency-prices-request.md b/doc/models/update-currency-prices-request.md index 29e7fbe5..5ff0b11d 100644 --- a/doc/models/update-currency-prices-request.md +++ b/doc/models/update-currency-prices-request.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `currency_prices` | [`Array[UpdateCurrencyPrice]`](../../doc/models/update-currency-price.md) | Required | - | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "id": 50, - "price": 233.74 - } +## Example + +```ruby +update_currency_prices_request = UpdateCurrencyPricesRequest.new( + currency_prices: [ + UpdateCurrencyPrice.new( + id: 50, + price: 233.74 + ) ] -} +) ``` diff --git a/doc/models/update-customer-request.md b/doc/models/update-customer-request.md index 1fa229e0..58d0ca1a 100644 --- a/doc/models/update-customer-request.md +++ b/doc/models/update-customer-request.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `customer` | [`UpdateCustomer`](../../doc/models/update-customer.md) | Required | - | -## Example (as JSON) - -```json -{ - "customer": { - "first_name": "first_name0", - "last_name": "last_name8", - "email": "email6", - "cc_emails": "cc_emails0", - "organization": "organization6" - } -} +## Example + +```ruby +update_customer_request = UpdateCustomerRequest.new( + customer: UpdateCustomer.new( + first_name: 'first_name0', + last_name: 'last_name8', + email: 'email6', + cc_emails: 'cc_emails0', + organization: 'organization6' + ) +) ``` diff --git a/doc/models/update-customer.md b/doc/models/update-customer.md index 33f6879e..97ab3a7d 100644 --- a/doc/models/update-customer.md +++ b/doc/models/update-customer.md @@ -25,20 +25,22 @@ | `locale` | `String` | Optional | Set a specific language on a customer record. | | `vat_number` | `String` | Optional | - | | `tax_exempt` | `TrueClass \| FalseClass` | Optional | - | +| `surcharging` | `TrueClass \| FalseClass` | Optional | Whether surcharging is enabled for the customer. Only applied on sites where surcharging control is enabled. | | `tax_exempt_reason` | `String` | Optional | - | | `parent_id` | `Integer` | Optional | - | -| `verified` | `TrueClass \| FalseClass` | Optional | Is the customer verified to use ACH as a payment method. Available only on Authorize.Net gateway | +| `verified` | `TrueClass \| FalseClass` | Optional | Is the customer verified to use ACH as a payment method. Available only on the Authorize.Net gateway. | | `salesforce_id` | `String` | Optional | The Salesforce ID of the customer | - -## Example (as JSON) - -```json -{ - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails8", - "organization": "organization6" -} +| `branding_theme_id` | `Integer` | Optional | The ID of the Branding Theme assigned to this customer as the customer's default Branding Theme. This customer-level Branding Theme is used when a subscription does not have its own subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. | + +## Example + +```ruby +update_customer = UpdateCustomer.new( + first_name: 'first_name4', + last_name: 'last_name2', + email: 'email2', + cc_emails: 'cc_emails6', + organization: 'organization8' +) ``` diff --git a/doc/models/update-invoice-item.md b/doc/models/update-invoice-item.md new file mode 100644 index 00000000..a73f139c --- /dev/null +++ b/doc/models/update-invoice-item.md @@ -0,0 +1,40 @@ + +# Update Invoice Item + +A line item change for a draft ad hoc invoice. Supports the same attributes as line items on invoice creation, plus `uid` and `_destroy` for updating or removing existing line items. + +## Structure + +`UpdateInvoiceItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `title` | `String` | Optional | - | +| `quantity` | Float \| String \| nil | Optional | This is a container for one-of cases. | +| `unit_price` | Float \| String \| nil | Optional | This is a container for one-of cases. | +| `taxable` | `TrueClass \| FalseClass` | Optional | Set to true to automatically calculate taxes. Site must be configured to use and calculate taxes. If using AvaTax, a tax_code parameter must also be sent. | +| `tax_code` | `String` | Optional | A string representing the tax code related to the product type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | +| `period_range_start` | `String` | Optional | YYYY-MM-DD | +| `period_range_end` | `String` | Optional | YYYY-MM-DD | +| `product_id` | String \| Integer \| nil | Optional | This is a container for one-of cases. | +| `component_id` | String \| Integer \| nil | Optional | This is a container for one-of cases. | +| `price_point_id` | String \| Integer \| nil | Optional | This is a container for one-of cases. | +| `product_price_point_id` | String \| Integer \| nil | Optional | This is a container for one-of cases. | +| `description` | `String` | Optional | **Constraints**: *Maximum Length*: `255` | +| `uid` | `String` | Optional | Unique identifier of an existing line item on the invoice. When provided, the matching line item is updated with the submitted attributes. When omitted, a new line item is added to the invoice. | +| `destroy` | `TrueClass \| FalseClass` | Optional | Set to `true` together with `uid` to remove the matching line item from the invoice. Line items not referenced in the request remain unchanged. | + +## Example + +```ruby +update_invoice_item = UpdateInvoiceItem.new( + title: 'title4', + quantity: 29.28, + unit_price: 12.5, + taxable: false, + tax_code: 'tax_code6' +) +``` + diff --git a/doc/models/update-invoice-request.md b/doc/models/update-invoice-request.md new file mode 100644 index 00000000..06cb045e --- /dev/null +++ b/doc/models/update-invoice-request.md @@ -0,0 +1,51 @@ + +# Update Invoice Request + +Request payload for updating a draft ad hoc invoice. + +## Structure + +`UpdateInvoiceRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `invoice` | [`UpdateInvoice`](../../doc/models/update-invoice.md) | Required | Attributes of a draft ad hoc invoice which can be updated. Only the submitted attributes are changed. | + +## Example + +```ruby +update_invoice_request = UpdateInvoiceRequest.new( + invoice: UpdateInvoice.new( + line_items: [ + UpdateInvoiceItem.new( + title: 'title4', + quantity: 56.68, + unit_price: 39.9, + taxable: false, + tax_code: 'tax_code6' + ), + UpdateInvoiceItem.new( + title: 'title4', + quantity: 56.68, + unit_price: 39.9, + taxable: false, + tax_code: 'tax_code6' + ), + UpdateInvoiceItem.new( + title: 'title4', + quantity: 56.68, + unit_price: 39.9, + taxable: false, + tax_code: 'tax_code6' + ) + ], + issue_date: Date.iso8601('2024-01-01'), + net_terms: 144, + payment_instructions: 'payment_instructions6', + memo: 'memo0' + ) +) +``` + diff --git a/doc/models/update-invoice.md b/doc/models/update-invoice.md new file mode 100644 index 00000000..0fabeb46 --- /dev/null +++ b/doc/models/update-invoice.md @@ -0,0 +1,50 @@ + +# Update Invoice + +Attributes of a draft ad hoc invoice which can be updated. Only the submitted attributes are changed. + +## Structure + +`UpdateInvoice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `line_items` | [`Array[UpdateInvoiceItem]`](../../doc/models/update-invoice-item.md) | Optional | Line item changes to apply. Line items without a `uid` are added, line items with a `uid` are updated, and line items with a `uid` and `_destroy` set to `true` are removed. Existing line items not referenced in the array remain unchanged. | +| `issue_date` | `Date` | Optional | New issue date for the invoice (format YYYY-MM-DD). This date is interpreted and validated in your site's time zone. It must be today or a date in the past — future dates are not accepted. The due date is recalculated from the issue date and net terms. | +| `net_terms` | `Integer` | Optional | Number of days after the issue date on which the invoice is due. The due date is recalculated when net terms or the issue date change. | +| `payment_instructions` | `String` | Optional | Custom payment instructions displayed on the invoice. | +| `memo` | `String` | Optional | A custom memo displayed on the invoice. | +| `seller_address` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Replaces the seller address on the invoice | +| `billing_address` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Replaces the billing address on the invoice | +| `shipping_address` | [`CreateInvoiceAddress`](../../doc/models/create-invoice-address.md) | Optional | Replaces the shipping address on the invoice | +| `coupons` | [`Array[CreateInvoiceCoupon]`](../../doc/models/create-invoice-coupon.md) | Optional | When present, replaces all discounts currently applied to the invoice. Send an empty array to remove all discounts. | + +## Example + +```ruby +update_invoice = UpdateInvoice.new( + line_items: [ + UpdateInvoiceItem.new( + title: 'title4', + quantity: 56.68, + unit_price: 39.9, + taxable: false, + tax_code: 'tax_code6' + ), + UpdateInvoiceItem.new( + title: 'title4', + quantity: 56.68, + unit_price: 39.9, + taxable: false, + tax_code: 'tax_code6' + ) + ], + issue_date: Date.iso8601('2024-01-01'), + net_terms: 130, + payment_instructions: 'payment_instructions4', + memo: 'memo2' +) +``` + diff --git a/doc/models/update-metadata-request.md b/doc/models/update-metadata-request.md index b9f775ed..425ec4b1 100644 --- a/doc/models/update-metadata-request.md +++ b/doc/models/update-metadata-request.md @@ -11,15 +11,15 @@ | --- | --- | --- | --- | | `metadata` | [`UpdateMetadata`](../../doc/models/update-metadata.md) | Optional | - | -## Example (as JSON) - -```json -{ - "metadata": { - "current_name": "current_name0", - "name": "name6", - "value": "value8" - } -} +## Example + +```ruby +update_metadata_request = UpdateMetadataRequest.new( + metadata: UpdateMetadata.new( + current_name: 'current_name0', + name: 'name6', + value: 'value8' + ) +) ``` diff --git a/doc/models/update-metadata.md b/doc/models/update-metadata.md index b6fc3345..2fb48bd2 100644 --- a/doc/models/update-metadata.md +++ b/doc/models/update-metadata.md @@ -13,13 +13,13 @@ | `name` | `String` | Optional | - | | `value` | `String` | Optional | - | -## Example (as JSON) - -```json -{ - "current_name": "current_name4", - "name": "name0", - "value": "value2" -} +## Example + +```ruby +update_metadata = UpdateMetadata.new( + current_name: 'current_name4', + name: 'name0', + value: 'value2' +) ``` diff --git a/doc/models/update-metafield.md b/doc/models/update-metafield.md index 5de4d166..5ab24212 100644 --- a/doc/models/update-metafield.md +++ b/doc/models/update-metafield.md @@ -12,26 +12,27 @@ | `current_name` | `String` | Optional | - | | `name` | `String` | Optional | - | | `scope` | [`MetafieldScope`](../../doc/models/metafield-scope.md) | Optional | Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. | -| `input_type` | [`MetafieldInput`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | +| `input_type` | [`MetafieldInput`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | | `enum` | `Array[String]` | Optional | Only applicable when input_type is radio or dropdown. | -## Example (as JSON) - -```json -{ - "current_name": "current_name0", - "name": "name6", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0" - }, - "input_type": "balance_tracker", - "enum": [ - "enum2" +## Example + +```ruby +update_metafield = UpdateMetafield.new( + current_name: 'current_name0', + name: 'name6', + scope: MetafieldScope.new( + csv: IncludeOption::EXCLUDE, + invoices: IncludeOption::EXCLUDE, + statements: IncludeOption::EXCLUDE, + portal: IncludeOption::EXCLUDE, + public_show: IncludeOption::EXCLUDE + ), + input_type: MetafieldInput::RADIO, + enum: [ + 'enum2', + 'enum3' ] -} +) ``` diff --git a/doc/models/update-metafields-request.md b/doc/models/update-metafields-request.md index 629e0dd9..86eb68be 100644 --- a/doc/models/update-metafields-request.md +++ b/doc/models/update-metafields-request.md @@ -11,25 +11,25 @@ | --- | --- | --- | --- | | `metafields` | [Update Metafield](../../doc/models/update-metafield.md) \| Array[[Update Metafield](../../doc/models/update-metafield.md)] \| nil | Optional | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "metafields": { - "current_name": "current_name0", - "name": "name6", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0" - }, - "input_type": "balance_tracker", - "enum": [ - "enum2" +## Example + +```ruby +update_metafields_request = UpdateMetafieldsRequest.new( + metafields: UpdateMetafield.new( + current_name: 'current_name0', + name: 'name6', + scope: MetafieldScope.new( + csv: IncludeOption::EXCLUDE, + invoices: IncludeOption::EXCLUDE, + statements: IncludeOption::EXCLUDE, + portal: IncludeOption::EXCLUDE, + public_show: IncludeOption::EXCLUDE + ), + input_type: MetafieldInput::BALANCE_TRACKER, + enum: [ + 'enum2' ] - } -} + ) +) ``` diff --git a/doc/models/update-payment-profile-request.md b/doc/models/update-payment-profile-request.md index 959d612e..9d1aa215 100644 --- a/doc/models/update-payment-profile-request.md +++ b/doc/models/update-payment-profile-request.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `payment_profile` | [`UpdatePaymentProfile`](../../doc/models/update-payment-profile.md) | Required | - | -## Example (as JSON) - -```json -{ - "payment_profile": { - "full_number": "5424000000000015", - "first_name": "first_name4", - "last_name": "last_name2", - "card_type": "bogus", - "expiration_month": "expiration_month0" - } -} +## Example + +```ruby +update_payment_profile_request = UpdatePaymentProfileRequest.new( + payment_profile: UpdatePaymentProfile.new( + first_name: 'first_name4', + last_name: 'last_name2', + full_number: '5424000000000015', + card_type: CardType::BOGUS, + expiration_month: 'expiration_month0' + ) +) ``` diff --git a/doc/models/update-payment-profile.md b/doc/models/update-payment-profile.md index 64c07894..a6192b2b 100644 --- a/doc/models/update-payment-profile.md +++ b/doc/models/update-payment-profile.md @@ -13,25 +13,25 @@ | `last_name` | `String` | Optional | The last name of the card holder. | | `full_number` | `String` | Optional | The full credit card number | | `card_type` | [`CardType`](../../doc/models/card-type.md) | Optional | The type of card used. | -| `expiration_month` | `String` | Optional | (Optional when performing an Import via vault_token, required otherwise) The 1- or 2-digit credit card expiration month, as an integer or string, i.e. 5 | -| `expiration_year` | `String` | Optional | (Optional when performing a Import via vault_token, required otherwise) The 4-digit credit card expiration year, as an integer or string, i.e. 2012 | +| `expiration_month` | `String` | Optional | (Optional when performing an Import via vault_token, required otherwise) The 1- or 2-digit credit card expiration month, as an integer or string, e.g., 5 | +| `expiration_year` | `String` | Optional | (Optional when performing an Import via vault_token, required otherwise) The 4-digit credit card expiration year, as an integer or string, e.g., 2012 | | `current_vault` | [`AllVaults`](../../doc/models/all-vaults.md) | Optional | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | -| `billing_address` | `String` | Optional | The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. | -| `billing_city` | `String` | Optional | The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. | -| `billing_state` | `String` | Optional | The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | -| `billing_zip` | `String` | Optional | The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. | -| `billing_country` | `String` | Optional | The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | -| `billing_address_2` | `String` | Optional | Second line of the customer’s billing address i.e. Apt. 100 | - -## Example (as JSON) - -```json -{ - "full_number": "5424000000000015", - "first_name": "first_name2", - "last_name": "last_name0", - "card_type": "carnet", - "expiration_month": "expiration_month2" -} +| `billing_address` | `String` | Optional | The credit card or bank account billing street address (e.g., 123 Main St.). This value is merely passed through to the payment gateway. | +| `billing_city` | `String` | Optional | The credit card or bank account billing address city (e.g., “Boston”). This value is merely passed through to the payment gateway. | +| `billing_state` | `String` | Optional | The credit card or bank account billing address state (e.g., MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | +| `billing_zip` | `String` | Optional | The credit card or bank account billing address zip code (e.g., 12345). This value is merely passed through to the payment gateway. | +| `billing_country` | `String` | Optional | The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | +| `billing_address_2` | `String` | Optional | Second line of the customer’s billing address, e.g., Apt. 100 | + +## Example + +```ruby +update_payment_profile = UpdatePaymentProfile.new( + first_name: 'first_name0', + last_name: 'last_name8', + full_number: '5424000000000015', + card_type: CardType::BOGUS, + expiration_month: 'expiration_month6' +) ``` diff --git a/doc/models/update-price.md b/doc/models/update-price.md index 6b60d573..631f8ac4 100644 --- a/doc/models/update-price.md +++ b/doc/models/update-price.md @@ -15,15 +15,15 @@ | `destroy` | `TrueClass \| FalseClass` | Optional | - | | `starting_quantity` | Integer \| String \| nil | Optional | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "id": 18, - "ending_quantity": 216, - "unit_price": 166.62, - "_destroy": false, - "starting_quantity": 242 -} +## Example + +```ruby +update_price = UpdatePrice.new( + id: 94, + ending_quantity: 216, + unit_price: 118.74, + destroy: false, + starting_quantity: 90 +) ``` diff --git a/doc/models/update-product-price-point-request.md b/doc/models/update-product-price-point-request.md index 163338c5..94fc6e1f 100644 --- a/doc/models/update-product-price-point-request.md +++ b/doc/models/update-product-price-point-request.md @@ -11,14 +11,14 @@ | --- | --- | --- | --- | | `price_point` | [`UpdateProductPricePoint`](../../doc/models/update-product-price-point.md) | Required | - | -## Example (as JSON) - -```json -{ - "price_point": { - "handle": "handle6", - "price_in_cents": 196 - } -} +## Example + +```ruby +update_product_price_point_request = UpdateProductPricePointRequest.new( + price_point: UpdateProductPricePoint.new( + handle: 'handle6', + price_in_cents: 196 + ) +) ``` diff --git a/doc/models/update-product-price-point.md b/doc/models/update-product-price-point.md index 922ee1ca..5e75df74 100644 --- a/doc/models/update-product-price-point.md +++ b/doc/models/update-product-price-point.md @@ -12,12 +12,12 @@ | `handle` | `String` | Optional | - | | `price_in_cents` | `Integer` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "handle": "handle6", - "price_in_cents": 220 -} +```ruby +update_product_price_point = UpdateProductPricePoint.new( + handle: 'handle2', + price_in_cents: 190 +) ``` diff --git a/doc/models/update-reason-code-request.md b/doc/models/update-reason-code-request.md index c8ef00ba..3f5a87e7 100644 --- a/doc/models/update-reason-code-request.md +++ b/doc/models/update-reason-code-request.md @@ -11,15 +11,15 @@ | --- | --- | --- | --- | | `reason_code` | [`UpdateReasonCode`](../../doc/models/update-reason-code.md) | Required | - | -## Example (as JSON) - -```json -{ - "reason_code": { - "code": "code4", - "description": "description6", - "position": 14 - } -} +## Example + +```ruby +update_reason_code_request = UpdateReasonCodeRequest.new( + reason_code: UpdateReasonCode.new( + code: 'code4', + description: 'description6', + position: 14 + ) +) ``` diff --git a/doc/models/update-reason-code.md b/doc/models/update-reason-code.md index 52f41e2a..6288bbb6 100644 --- a/doc/models/update-reason-code.md +++ b/doc/models/update-reason-code.md @@ -13,13 +13,13 @@ | `description` | `String` | Optional | The friendly summary of what the code signifies | | `position` | `Integer` | Optional | The order that code appears in lists | -## Example (as JSON) - -```json -{ - "code": "code0", - "description": "description8", - "position": 118 -} +## Example + +```ruby +update_reason_code = UpdateReasonCode.new( + code: 'code2', + description: 'description4', + position: 12 +) ``` diff --git a/doc/models/update-segment-request.md b/doc/models/update-segment-request.md index c84e55d1..0320c2cb 100644 --- a/doc/models/update-segment-request.md +++ b/doc/models/update-segment-request.md @@ -11,30 +11,30 @@ | --- | --- | --- | --- | | `segment` | [`UpdateSegment`](../../doc/models/update-segment.md) | Required | - | -## Example (as JSON) - -```json -{ - "segment": { - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } +## Example + +```ruby +update_segment_request = UpdateSegmentRequest.new( + segment: UpdateSegment.new( + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ) ] - } -} + ) +) ``` diff --git a/doc/models/update-segment.md b/doc/models/update-segment.md index cd4bf25f..9c8f033e 100644 --- a/doc/models/update-segment.md +++ b/doc/models/update-segment.md @@ -12,18 +12,23 @@ | `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[CreateOrUpdateSegmentPrice]`](../../doc/models/create-or-update-segment-price.md) | Optional | - | -## Example (as JSON) - -```json -{ - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - } +## Example + +```ruby +update_segment = UpdateSegment.new( + pricing_scheme: PricingScheme::STAIRSTEP, + prices: [ + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ), + CreateOrUpdateSegmentPrice.new( + unit_price: 'String3', + starting_quantity: 64, + ending_quantity: 38 + ) ] -} +) ``` diff --git a/doc/models/update-subscription-component.md b/doc/models/update-subscription-component.md index b17ca839..f56422ab 100644 --- a/doc/models/update-subscription-component.md +++ b/doc/models/update-subscription-component.md @@ -12,30 +12,30 @@ | `component_id` | `Integer` | Optional | - | | `custom_price` | [`ComponentCustomPrice`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | -## Example (as JSON) - -```json -{ - "component_id": 244, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 66, - "interval_unit": "day", - "list_price_point_id": 174, - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } -} +## Example + +```ruby +update_subscription_component = UpdateSubscriptionComponent.new( + component_id: 76, + custom_price: ComponentCustomPrice.new( + prices: [ + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ), + Price.new( + starting_quantity: 242, + unit_price: 23.26, + ending_quantity: 40 + ) + ], + tax_included: false, + pricing_scheme: PricingScheme::STAIRSTEP, + interval: 66, + interval_unit: IntervalUnit::DAY, + list_price_point_id: 174 + ) +) ``` diff --git a/doc/models/update-subscription-group-request.md b/doc/models/update-subscription-group-request.md index 439e31c4..8f30a18c 100644 --- a/doc/models/update-subscription-group-request.md +++ b/doc/models/update-subscription-group-request.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `subscription_group` | [`UpdateSubscriptionGroup`](../../doc/models/update-subscription-group.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "subscription_group": { - "member_ids": [ +```ruby +update_subscription_group_request = UpdateSubscriptionGroupRequest.new( + subscription_group: UpdateSubscriptionGroup.new( + member_ids: [ 164, 165 ] - } -} + ) +) ``` diff --git a/doc/models/update-subscription-group.md b/doc/models/update-subscription-group.md index fa720d9c..902fce7a 100644 --- a/doc/models/update-subscription-group.md +++ b/doc/models/update-subscription-group.md @@ -11,15 +11,14 @@ | --- | --- | --- | --- | | `member_ids` | `Array[Integer]` | Optional | - | -## Example (as JSON) - -```json -{ - "member_ids": [ - 52, - 53, - 54 +## Example + +```ruby +update_subscription_group = UpdateSubscriptionGroup.new( + member_ids: [ + 54, + 55 ] -} +) ``` diff --git a/doc/models/update-subscription-note-request.md b/doc/models/update-subscription-note-request.md index 05d27d6e..96366f7e 100644 --- a/doc/models/update-subscription-note-request.md +++ b/doc/models/update-subscription-note-request.md @@ -13,14 +13,14 @@ Updatable fields for Subscription Note | --- | --- | --- | --- | | `note` | [`UpdateSubscriptionNote`](../../doc/models/update-subscription-note.md) | Required | Updatable fields for Subscription Note | -## Example (as JSON) - -```json -{ - "note": { - "body": "body0", - "sticky": false - } -} +## Example + +```ruby +update_subscription_note_request = UpdateSubscriptionNoteRequest.new( + note: UpdateSubscriptionNote.new( + body: 'body0', + sticky: false + ) +) ``` diff --git a/doc/models/update-subscription-note.md b/doc/models/update-subscription-note.md index f33b53b2..cdbf420b 100644 --- a/doc/models/update-subscription-note.md +++ b/doc/models/update-subscription-note.md @@ -14,12 +14,12 @@ Updatable fields for Subscription Note | `body` | `String` | Required | - | | `sticky` | `TrueClass \| FalseClass` | Required | - | -## Example (as JSON) +## Example -```json -{ - "body": "body8", - "sticky": false -} +```ruby +update_subscription_note = UpdateSubscriptionNote.new( + body: 'body8', + sticky: false +) ``` diff --git a/doc/models/update-subscription-request.md b/doc/models/update-subscription-request.md index ede8dd80..eafb4937 100644 --- a/doc/models/update-subscription-request.md +++ b/doc/models/update-subscription-request.md @@ -11,23 +11,23 @@ | --- | --- | --- | --- | | `subscription` | [`UpdateSubscription`](../../doc/models/update-subscription.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscription": { - "defer_signup": false, - "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", - "credit_card_attributes": { - "full_number": "full_number2", - "expiration_month": "expiration_month6", - "expiration_year": "expiration_year2" - }, - "product_handle": "product_handle6", - "product_id": 206, - "product_change_delayed": false, - "next_product_id": "next_product_id6" - } -} +## Example + +```ruby +update_subscription_request = UpdateSubscriptionRequest.new( + subscription: UpdateSubscription.new( + credit_card_attributes: CreditCardAttributes.new( + full_number: 'full_number2', + expiration_month: 'expiration_month6', + expiration_year: 'expiration_year2' + ), + product_handle: 'product_handle6', + product_id: 206, + product_change_delayed: false, + next_product_id: 'next_product_id6', + defer_signup: false, + dunning_communication_delay_time_zone: '"Eastern Time (US & Canada)"' + ) +) ``` diff --git a/doc/models/update-subscription.md b/doc/models/update-subscription.md index b59bf88c..1618948e 100644 --- a/doc/models/update-subscription.md +++ b/doc/models/update-subscription.md @@ -10,15 +10,16 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `credit_card_attributes` | [`CreditCardAttributes`](../../doc/models/credit-card-attributes.md) | Optional | - | -| `product_handle` | `String` | Optional | Set to the handle of a different product to change the subscription's product | -| `product_id` | `Integer` | Optional | Set to the id of a different product to change the subscription's product | +| `product_handle` | `String` | Optional | Set to the handle of a different product to change the subscription's product. | +| `product_id` | `Integer` | Optional | Set to the id of a different product to change the subscription's product. | | `product_change_delayed` | `TrueClass \| FalseClass` | Optional | - | | `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` | String \| 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. | +| `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 | - | +| `branding_theme_id` | `Integer` | Optional | The ID of the Branding Theme to assign to this subscription. When set, this subscription-level Branding Theme is used instead of the customer's default Branding Theme for subscription-related documents and communications that use subscription theming. Pass null or an empty value to clear the subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. Not returned in the response. | | `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 | - | @@ -32,21 +33,21 @@ | `product_price_point_id` | `Integer` | Optional | Set to change the current product's price point. | | `product_price_point_handle` | `String` | Optional | Set to change the current product's price point. | -## Example (as JSON) - -```json -{ - "defer_signup": false, - "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", - "credit_card_attributes": { - "full_number": "full_number2", - "expiration_month": "expiration_month6", - "expiration_year": "expiration_year2" - }, - "product_handle": "product_handle2", - "product_id": 114, - "product_change_delayed": false, - "next_product_id": "next_product_id8" -} +## Example + +```ruby +update_subscription = UpdateSubscription.new( + credit_card_attributes: CreditCardAttributes.new( + full_number: 'full_number2', + expiration_month: 'expiration_month6', + expiration_year: 'expiration_year2' + ), + product_handle: 'product_handle0', + product_id: 234, + product_change_delayed: false, + next_product_id: 'next_product_id0', + defer_signup: false, + dunning_communication_delay_time_zone: '"Eastern Time (US & Canada)"' +) ``` diff --git a/doc/models/upgrade-charge-credit-type.md b/doc/models/upgrade-charge-credit-type.md index 3bc95abc..5a80e644 100644 --- a/doc/models/upgrade-charge-credit-type.md +++ b/doc/models/upgrade-charge-credit-type.md @@ -21,3 +21,9 @@ The type of credit to be created when upgrading/downgrading. Defaults to the com | `PRORATED` | | `NONE` | +## Example + +```ruby +upgrade_charge_credit_type = UpgradeChargeCreditType::PRORATED +``` + diff --git a/doc/models/upsert-prepaid-configuration-request.md b/doc/models/upsert-prepaid-configuration-request.md index 02823952..74c8d2dc 100644 --- a/doc/models/upsert-prepaid-configuration-request.md +++ b/doc/models/upsert-prepaid-configuration-request.md @@ -11,16 +11,16 @@ | --- | --- | --- | --- | | `prepaid_configuration` | [`UpsertPrepaidConfiguration`](../../doc/models/upsert-prepaid-configuration.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepaid_configuration": { - "initial_funding_amount_in_cents": 74, - "replenish_to_amount_in_cents": 76, - "auto_replenish": false, - "replenish_threshold_amount_in_cents": 20 - } -} +## Example + +```ruby +upsert_prepaid_configuration_request = UpsertPrepaidConfigurationRequest.new( + prepaid_configuration: UpsertPrepaidConfiguration.new( + initial_funding_amount_in_cents: 74, + replenish_to_amount_in_cents: 76, + auto_replenish: false, + replenish_threshold_amount_in_cents: 20 + ) +) ``` diff --git a/doc/models/upsert-prepaid-configuration.md b/doc/models/upsert-prepaid-configuration.md index 6c5a2edb..b40d08e1 100644 --- a/doc/models/upsert-prepaid-configuration.md +++ b/doc/models/upsert-prepaid-configuration.md @@ -14,14 +14,14 @@ | `auto_replenish` | `TrueClass \| FalseClass` | Optional | - | | `replenish_threshold_amount_in_cents` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "initial_funding_amount_in_cents": 40, - "replenish_to_amount_in_cents": 42, - "auto_replenish": false, - "replenish_threshold_amount_in_cents": 242 -} +## Example + +```ruby +upsert_prepaid_configuration = UpsertPrepaidConfiguration.new( + initial_funding_amount_in_cents: 104, + replenish_to_amount_in_cents: 106, + auto_replenish: false, + replenish_threshold_amount_in_cents: 206 +) ``` diff --git a/doc/models/usage-response.md b/doc/models/usage-response.md index 6afbae64..f9c0000d 100644 --- a/doc/models/usage-response.md +++ b/doc/models/usage-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `usage` | [`Usage`](../../doc/models/usage.md) | Required | - | -## Example (as JSON) - -```json -{ - "usage": { - "id": 150, - "memo": "memo2", - "created_at": "2016-03-13T12:52:32.123Z", - "price_point_id": 28, - "quantity": 28 - } -} +## Example + +```ruby +usage_response = UsageResponse.new( + usage: Usage.new( + id: 150, + memo: 'memo2', + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + price_point_id: 28, + quantity: 28 + ) +) ``` diff --git a/doc/models/usage.md b/doc/models/usage.md index 467f2d33..644a2825 100644 --- a/doc/models/usage.md +++ b/doc/models/usage.md @@ -19,15 +19,15 @@ | `component_handle` | `String` | Optional | - | | `subscription_id` | `Integer` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 252, - "memo": "memo8", - "created_at": "2016-03-13T12:52:32.123Z", - "price_point_id": 126, - "quantity": 130 -} +## Example + +```ruby +usage = Usage.new( + id: 150, + memo: 'memo2', + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + price_point_id: 28, + quantity: 28 +) ``` diff --git a/doc/models/void-invoice-event-data.md b/doc/models/void-invoice-event-data.md index 2b29f485..1ebf433a 100644 --- a/doc/models/void-invoice-event-data.md +++ b/doc/models/void-invoice-event-data.md @@ -18,22 +18,22 @@ Example schema for an `void_invoice` event | `is_advance_invoice` | `TrueClass \| FalseClass` | Required | If true, the invoice is an advance invoice. | | `reason` | `String` | Required | The reason for the void. | -## Example (as JSON) - -```json -{ - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" - }, - "memo": "memo6", - "applied_amount": "applied_amount6", - "transaction_time": "2016-03-13T12:52:32.123Z", - "is_advance_invoice": false, - "reason": "reason8" -} +## Example + +```ruby +void_invoice_event_data = VoidInvoiceEventData.new( + credit_note_attributes: CreditNote.new( + uid: 'uid2', + site_id: 72, + customer_id: 184, + subscription_id: 0, + number: 'number0' + ), + memo: 'memo6', + applied_amount: 'applied_amount6', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + is_advance_invoice: false, + reason: 'reason2' +) ``` diff --git a/doc/models/void-invoice-event.md b/doc/models/void-invoice-event.md index fb4a9782..33c2586d 100644 --- a/doc/models/void-invoice-event.md +++ b/doc/models/void-invoice-event.md @@ -15,38 +15,38 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::VOID_INVOICE` | | `event_data` | [`VoidInvoiceEventData`](../../doc/models/void-invoice-event-data.md) | Required | Example schema for an `void_invoice` event | -## Example (as JSON) - -```json -{ - "id": 16, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "void_invoice", - "event_data": { - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" - }, - "memo": "memo0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "is_advance_invoice": false, - "reason": "reason2" - } -} +## Example + +```ruby +void_invoice_event = VoidInvoiceEvent.new( + id: 220, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::VOID_INVOICE, + event_data: VoidInvoiceEventData.new( + credit_note_attributes: CreditNote.new( + uid: 'uid2', + site_id: 72, + customer_id: 184, + subscription_id: 0, + number: 'number0' + ), + memo: 'memo0', + applied_amount: 'applied_amount2', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + is_advance_invoice: false, + reason: 'reason2' + ) +) ``` diff --git a/doc/models/void-invoice-request.md b/doc/models/void-invoice-request.md index f8ac4547..b5cc78d3 100644 --- a/doc/models/void-invoice-request.md +++ b/doc/models/void-invoice-request.md @@ -11,13 +11,13 @@ | --- | --- | --- | --- | | `void` | [`VoidInvoice`](../../doc/models/void-invoice.md) | Required | - | -## Example (as JSON) - -```json -{ - "void": { - "reason": "reason6" - } -} +## Example + +```ruby +void_invoice_request = VoidInvoiceRequest.new( + void: VoidInvoice.new( + reason: 'reason6' + ) +) ``` diff --git a/doc/models/void-invoice.md b/doc/models/void-invoice.md index 8ef62bbd..2b8b359d 100644 --- a/doc/models/void-invoice.md +++ b/doc/models/void-invoice.md @@ -11,11 +11,11 @@ | --- | --- | --- | --- | | `reason` | `String` | Required | **Constraints**: *Minimum Length*: `1` | -## Example (as JSON) +## Example -```json -{ - "reason": "reason2" -} +```ruby +void_invoice = VoidInvoice.new( + reason: 'reason6' +) ``` diff --git a/doc/models/void-remainder-event-data.md b/doc/models/void-remainder-event-data.md index 3fa782a2..45417b48 100644 --- a/doc/models/void-remainder-event-data.md +++ b/doc/models/void-remainder-event-data.md @@ -16,20 +16,20 @@ Example schema for an `void_remainder` event | `applied_amount` | `String` | Required | The amount of the void. | | `transaction_time` | `DateTime` | Required | The time the refund was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" | -## Example (as JSON) - -```json -{ - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" - }, - "memo": "memo6", - "applied_amount": "applied_amount4", - "transaction_time": "2016-03-13T12:52:32.123Z" -} +## Example + +```ruby +void_remainder_event_data = VoidRemainderEventData.new( + credit_note_attributes: CreditNote.new( + uid: 'uid2', + site_id: 72, + customer_id: 184, + subscription_id: 0, + number: 'number0' + ), + memo: 'memo0', + applied_amount: 'applied_amount2', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/void-remainder-event.md b/doc/models/void-remainder-event.md index 2b6e250a..bae21640 100644 --- a/doc/models/void-remainder-event.md +++ b/doc/models/void-remainder-event.md @@ -15,36 +15,36 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType::VOID_REMAINDER` | | `event_data` | [`VoidRemainderEventData`](../../doc/models/void-remainder-event-data.md) | Required | Example schema for an `void_remainder` event | -## Example (as JSON) - -```json -{ - "id": 128, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - }, - "event_type": "void_remainder", - "event_data": { - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" - }, - "memo": "memo0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ruby +void_remainder_event = VoidRemainderEvent.new( + id: 204, + timestamp: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + invoice: Invoice.new( + id: 166, + uid: 'uid6', + site_id: 92, + customer_id: 204, + subscription_id: 20, + issue_date: Date.iso8601('2024-01-01'), + due_date: Date.iso8601('2024-01-01'), + paid_date: Date.iso8601('2024-01-01'), + public_url_expires_on: Date.iso8601('2024-01-21') + ), + event_type: InvoiceEventType::VOID_REMAINDER, + event_data: VoidRemainderEventData.new( + credit_note_attributes: CreditNote.new( + uid: 'uid2', + site_id: 72, + customer_id: 184, + subscription_id: 0, + number: 'number0' + ), + memo: 'memo0', + applied_amount: 'applied_amount2', + transaction_time: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/webhook-order.md b/doc/models/webhook-order.md index 528b979f..4471edd0 100644 --- a/doc/models/webhook-order.md +++ b/doc/models/webhook-order.md @@ -12,3 +12,9 @@ | `NEWEST_FIRST` | | `OLDEST_FIRST` | +## Example + +```ruby +webhook_order = WebhookOrder::NEWEST_FIRST +``` + diff --git a/doc/models/webhook-response.md b/doc/models/webhook-response.md index 86aa8c6c..a08742c0 100644 --- a/doc/models/webhook-response.md +++ b/doc/models/webhook-response.md @@ -11,17 +11,17 @@ | --- | --- | --- | --- | | `webhook` | [`Webhook`](../../doc/models/webhook.md) | Optional | - | -## Example (as JSON) - -```json -{ - "webhook": { - "event": "event2", - "id": 18, - "created_at": "2016-03-13T12:52:32.123Z", - "last_error": "last_error4", - "last_error_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ruby +webhook_response = WebhookResponse.new( + webhook: Webhook.new( + event: 'event2', + id: 18, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + last_error: 'last_error4', + last_error_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/webhook-status.md b/doc/models/webhook-status.md index 9202a9bf..ebdb7985 100644 --- a/doc/models/webhook-status.md +++ b/doc/models/webhook-status.md @@ -14,3 +14,9 @@ | `PENDING` | | `PAUSED` | +## Example + +```ruby +webhook_status = WebhookStatus::PENDING +``` + diff --git a/doc/models/webhook-subscription.md b/doc/models/webhook-subscription.md index 85990e59..27e08fd7 100644 --- a/doc/models/webhook-subscription.md +++ b/doc/models/webhook-subscription.md @@ -39,6 +39,7 @@ | `SUBSCRIPTION_CARD_UPDATE` | | `SUBSCRIPTION_GROUP_CARD_UPDATE` | | `SUBSCRIPTION_PRODUCT_CHANGE` | +| `SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED` | | `SUBSCRIPTION_STATE_CHANGE` | | `TRIAL_END_NOTICE` | | `UPCOMING_RENEWAL_NOTICE` | @@ -48,3 +49,9 @@ | `SUBSCRIPTION_PREPAYMENT_ACCOUNT_BALANCE_CHANGED` | | `SUBSCRIPTION_SERVICE_CREDIT_ACCOUNT_BALANCE_CHANGED` | +## Example + +```ruby +webhook_subscription = WebhookSubscription::CHJS_TOKENIZATION_SUCCESS +``` + diff --git a/doc/models/webhook.md b/doc/models/webhook.md index 290a9a07..c644294e 100644 --- a/doc/models/webhook.md +++ b/doc/models/webhook.md @@ -10,27 +10,27 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `event` | `String` | Optional | A string describing which event type produced the given webhook | -| `id` | `Integer` | Optional | The unique identifier for the webhooks (unique across all of Chargify). This is not changed on a retry/replay of the same webhook, so it may be used to avoid duplicate action for the same event. | +| `id` | `Integer` | Optional | The unique identifier for the webhook (unique across all of Chargify). This is not changed on a retry/replay of the same webhook, so it may be used to avoid duplicate action for the same event. | | `created_at` | `DateTime` | Optional | Timestamp indicating when the webhook was created | | `last_error` | `String` | Optional | Text describing the status code and/or error from the last failed attempt to send the Webhook. When a webhook is retried and accepted, this field will be cleared. | | `last_error_at` | `DateTime` | Optional | Timestamp indicating when the last non-acceptance occurred. If a webhook is later resent and accepted, this field will be cleared. | | `accepted_at` | `DateTime` | Optional | Timestamp indicating when the webhook was accepted by the merchant endpoint. When a webhook is explicitly replayed by the merchant, this value will be cleared until it is accepted again. | | `last_sent_at` | `DateTime` | Optional | Timestamp indicating when the most recent attempt was made to send the webhook | | `last_sent_url` | `String` | Optional | The url that the endpoint was last sent to. | -| `successful` | `TrueClass \| FalseClass` | Optional | A boolean flag describing whether the webhook was accepted by the webhook endpoint for the most recent attempt. (Acceptance is defined by receiving a “200 OK” HTTP response within a reasonable timeframe, i.e. 15 seconds) | +| `successful` | `TrueClass \| FalseClass` | Optional | “A boolean flag describing whether the webhook was accepted by the webhook endpoint for the most recent attempt. (Acceptance is defined by receiving a “200 OK” HTTP response within a reasonable timeframe, e.g., 15 seconds.)” | | `body` | `String` | Optional | The data sent within the webhook post | | `signature` | `String` | Optional | The calculated webhook signature | | `signature_hmac_sha_256` | `String` | Optional | The calculated HMAC-SHA-256 webhook signature | -## Example (as JSON) +## Example -```json -{ - "event": "event6", - "id": 154, - "created_at": "2016-03-13T12:52:32.123Z", - "last_error": "last_error8", - "last_error_at": "2016-03-13T12:52:32.123Z" -} +```ruby +webhook = Webhook.new( + event: 'event2', + id: 18, + created_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z'), + last_error: 'last_error4', + last_error_at: DateTimeHelper.from_rfc3339('2016-03-13T12:52:32.123Z') +) ``` diff --git a/lib/advanced_billing.rb b/lib/advanced_billing.rb index d89c52b8..4997912c 100644 --- a/lib/advanced_billing.rb +++ b/lib/advanced_billing.rb @@ -249,6 +249,8 @@ require_relative 'advanced_billing/models/event_response' require_relative 'advanced_billing/models/failed_payment_event_data' require_relative 'advanced_billing/models/full_subscription_group_response' +require_relative 'advanced_billing/models/' \ + 'get_one_time_token_bank_account_payment_profile' require_relative 'advanced_billing/models/get_one_time_token_payment_profile' require_relative 'advanced_billing/models/get_one_time_token_request' require_relative 'advanced_billing/models/group_billing' @@ -313,13 +315,13 @@ 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' require_relative 'advanced_billing/models/' \ 'list_subscription_components_for_site_filter' require_relative 'advanced_billing/models/list_subscription_components_response' require_relative 'advanced_billing/models/list_subscription_group_prepayment' +require_relative 'advanced_billing/models/' \ + 'list_subscription_group_prepayment_item' require_relative 'advanced_billing/models/' \ 'list_subscription_group_prepayment_response' require_relative 'advanced_billing/models/list_subscription_groups_item' @@ -537,6 +539,9 @@ require_relative 'advanced_billing/models/update_currency_prices_request' require_relative 'advanced_billing/models/update_customer' require_relative 'advanced_billing/models/update_customer_request' +require_relative 'advanced_billing/models/update_invoice' +require_relative 'advanced_billing/models/update_invoice_item' +require_relative 'advanced_billing/models/update_invoice_request' require_relative 'advanced_billing/models/update_metadata' require_relative 'advanced_billing/models/update_metadata_request' require_relative 'advanced_billing/models/update_metafield' @@ -582,6 +587,7 @@ require_relative 'advanced_billing/models/chargeback_status' require_relative 'advanced_billing/models/cleanup_scope' require_relative 'advanced_billing/models/collection_method' +require_relative 'advanced_billing/models/collection_method1' require_relative 'advanced_billing/models/component_kind' require_relative 'advanced_billing/models/compounding_strategy' require_relative 'advanced_billing/models/create_invoice_status' @@ -605,6 +611,7 @@ require_relative 'advanced_billing/models/first_charge_type' require_relative 'advanced_billing/models/group_target_type' require_relative 'advanced_billing/models/group_type' +require_relative 'advanced_billing/models/group_status' require_relative 'advanced_billing/models/include_not_null' require_relative 'advanced_billing/models/include_null_or_not_null' require_relative 'advanced_billing/models/include_option' @@ -640,6 +647,7 @@ require_relative 'advanced_billing/models/proforma_invoice_role' require_relative 'advanced_billing/models/proforma_invoice_status' require_relative 'advanced_billing/models/proforma_invoice_tax_source_type' +require_relative 'advanced_billing/models/q_scope' require_relative 'advanced_billing/models/reactivation_charge' require_relative 'advanced_billing/models/recurring_scheme' require_relative 'advanced_billing/models/resource_type' diff --git a/lib/advanced_billing/controllers/advance_invoice_controller.rb b/lib/advanced_billing/controllers/advance_invoice_controller.rb index 0bdc1a8b..9317fc4f 100644 --- a/lib/advanced_billing/controllers/advance_invoice_controller.rb +++ b/lib/advanced_billing/controllers/advance_invoice_controller.rb @@ -6,21 +6,20 @@ module AdvancedBilling # AdvanceInvoiceController class AdvanceInvoiceController < BaseController - # Generate an invoice in advance for a subscription's next renewal date. - # [See our - # docs](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Inv - # oice-In-Advance) for more information on advance invoices, including - # eligibility for generating one; for the most part, they function like any - # other invoice, except they are issued early and have special behavior upon - # being voided. - # A subscription may only have one advance invoice per billing period. - # Attempting to issue an advance invoice when one already exists will return - # an error. - # That said, regeneration of the invoice may be forced with the params - # `force: true`, which will void an advance invoice if one exists and - # generate a new one. If no advance invoice exists, a new one will be - # generated. - # We recommend using either the create or preview endpoints for proforma + # Issues an invoice in advance for a subscription's next renewal date. For + # the most part, advance invoices function like any other invoice, except + # they are issued early and have special behavior upon being voided. For + # more information on advance invoices, including eligibility for generating + # one, see [Issue Invoice In + # Advance](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue- + # Invoice-In-Advance). + # A subscription can only have one advance invoice per billing period. + # Attempting to issue an advance invoice when one already exists returns an + # error. + # Regeneration of the invoice can be forced with the params `force: true`, + # which voids an advance invoice if one exists and generates a new one. If + # no advance invoice exists, a new one is generated. + # Consider using either the create or preview endpoints for proforma # invoices to preview this advance invoice before using this endpoint to # generate it. # @param [Integer] subscription_id Required parameter: The Chargify id of @@ -80,12 +79,12 @@ def read_advance_invoice(subscription_id) .execute end - # Void a subscription's existing advance invoice. Once voided, it can later + # Voids a subscription's existing advance invoice. Once voided, it can later # be regenerated if desired. - # A `reason` is required in order to void, and the invoice must have an open - # status. Voiding will cause any prepayments and credits that were applied - # to the invoice to be returned to the subscription. For a full overview of - # the impact of voiding, [see our help docs]($m/Invoice). + # A `reason` is required to void, and the invoice must have an open status. + # Voiding causes any prepayments and credits that were applied to the + # invoice to be returned to the subscription. + # For a full overview of the impact of voiding, see [Invoice]($m/Invoice). # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [VoidInvoiceRequest] body Optional parameter: TODO: type diff --git a/lib/advanced_billing/controllers/api_exports_controller.rb b/lib/advanced_billing/controllers/api_exports_controller.rb index a34874ff..190a71ba 100644 --- a/lib/advanced_billing/controllers/api_exports_controller.rb +++ b/lib/advanced_billing/controllers/api_exports_controller.rb @@ -127,7 +127,7 @@ def list_exported_subscriptions(options = {}) end # Creates a proforma invoices export and returns a batch job object. - # It is only available for Relationship Invoicing architecture. + # Proforma invoices are only available on Relationship Invoicing sites. # @return [BatchJobResponse] Response from the API call. def export_proforma_invoices @api_call @@ -190,7 +190,8 @@ def export_subscriptions .execute end - # Returns a batch job object for a proforma invoices export. + # Returns a batch job object for a proforma invoices export. Proforma + # invoices are only available on Relationship Invoicing sites. # @param [String] batch_id Required parameter: Id of a Batch Job. # @return [BatchJobResponse] Response from the API call. def read_proforma_invoices_export(batch_id) diff --git a/lib/advanced_billing/controllers/base_controller.rb b/lib/advanced_billing/controllers/base_controller.rb index 1f1beee3..e8838d0d 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:9.1.0 on OS {os-info}' + 'AB SDK Ruby:10.0.0 on OS {os-info}' end def self.user_agent_parameters diff --git a/lib/advanced_billing/controllers/billing_portal_controller.rb b/lib/advanced_billing/controllers/billing_portal_controller.rb index 7aca9904..bd1aa484 100644 --- a/lib/advanced_billing/controllers/billing_portal_controller.rb +++ b/lib/advanced_billing/controllers/billing_portal_controller.rb @@ -8,32 +8,24 @@ module AdvancedBilling class BillingPortalController < BaseController # Enables Billing Portal access for a customer, with an option to send an # invitation email at the same time. - # ## Billing Portal Documentation - # Full documentation on how the Billing Portal operates within the Advanced - # Billing UI can be located - # [here](https://maxio.zendesk.com/hc/en-us/articles/24252412965133-Billing- - # Portal-Overview). - # This documentation is focused on how to configure the Billing Portal - # Settings, as well as Subscriber Interaction and Merchant Management of the - # Billing Portal. - # You can use this endpoint to enable Billing Portal access for a Customer, - # with the option of sending the Customer an Invitation email at the same - # time. # ## Billing Portal Security - # If your customer has been invited to the Billing Portal, then they will - # receive a link to manage their subscription (the “Management URL”) - # automatically at the bottom of their statements, invoices, and receipts. - # **This link changes periodically for security and is only valid for 65 - # days.** + # If your customer has been invited to the Billing Portal, they receive a + # link to manage their subscription (the “Management URL”) automatically at + # the bottom of their statements, invoices, and receipts. **This link + # changes periodically for security and is only valid for 65 days.** # If you need to provide your customer their Management URL through other - # means, you can retrieve it via the API. Because the URL is - # cryptographically signed with a timestamp, it is not possible for - # merchants to generate the URL without requesting it from Advanced Billing. - # In order to prevent abuse & overuse, we ask that you request a new URL - # only when absolutely necessary. Management URLs are good for 65 days, so - # you should re-use a previously generated one as much as possible. If you - # use the URL frequently (such as to display on your website), **do not** - # make an API request to Advanced Billing every time. + # means, you can retrieve it [via the + # API]($e/Billing%20Portal/readBillingPortalLink). Because the URL is + # cryptographically signed with a timestamp, merchants cannot generate the + # URL without requesting it through the API. + # To prevent abuse and overuse, request a new URL only when absolutely + # necessary. Management URLs are good for 65 days, so you should re-use a + # previously generated one as much as possible. If you use the URL + # frequently (such as to display on your website), **do not** make an API + # request every time. + # For more information configuring the Billing Portal, see [Billing Portal + # Overview](https://maxio.zendesk.com/hc/en-us/articles/24252412965133-Billi + # ng-Portal-Overview). # @param [Integer] customer_id Required parameter: The Chargify id of the # customer # @param [AutoInvite] auto_invite Optional parameter: When set to 1, an @@ -64,16 +56,16 @@ def enable_billing_portal_for_customer(customer_id, # Returns the exact URL required for a subscriber to access the Billing # Portal. - # ## Rules for Management Link API + # ## Management Link Request Rules # + When retrieving a management URL, multiple requests for the same - # customer in a short period will return the **same** URL - # + We will not generate a new URL for 15 days + # customer in a short period return the **same** URL + # + A new URL is not generated for 15 days # + You must cache and remember this URL if you are going to need it again # within 15 days # + Only request a new URL after the `new_link_available_at` date # + You are limited to 15 requests for the same URL. If you make more than - # 15 requests before `new_link_available_at`, you will be blocked from - # further Management URL requests (with a response code `429`) + # 15 requests before `new_link_available_at`, you are blocked from 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. diff --git a/lib/advanced_billing/controllers/component_price_points_controller.rb b/lib/advanced_billing/controllers/component_price_points_controller.rb index ce9629b7..9b4aab51 100644 --- a/lib/advanced_billing/controllers/component_price_points_controller.rb +++ b/lib/advanced_billing/controllers/component_price_points_controller.rb @@ -73,17 +73,13 @@ def create_component_price_point(component_id, # Lists the price points associated with a component. # You may specify the component by using either the numeric id or the # `handle:gold` syntax. - # When fetching a component'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 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. # @param [Integer] component_id Required parameter: The Advanced Billing id # of the component # @param [TrueClass | FalseClass] currency_prices Optional parameter: - # Include an array of currency price data + # Include an array of currency price data. # @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 @@ -274,7 +270,7 @@ def update_component_price_point(component_id, # `handle:`. Example: `123` for an integer ID, or # `handle:example-price_point-handle` for a string handle. # @param [TrueClass | FalseClass] currency_prices Optional parameter: - # Include an array of currency price data + # Include an array of currency price data. # @return [ComponentPricePointCurrencyOverageResponse] Response from the API call. def read_component_price_point(component_id, price_point_id, diff --git a/lib/advanced_billing/controllers/components_controller.rb b/lib/advanced_billing/controllers/components_controller.rb index a7700ff7..e012eec8 100644 --- a/lib/advanced_billing/controllers/components_controller.rb +++ b/lib/advanced_billing/controllers/components_controller.rb @@ -16,9 +16,21 @@ class ComponentsController < BaseController # which DO NOT reset to zero at the start of every billing period. If you # want to bill for a quantity of something that does not change unless you # change it, then you want quantity components, instead. + # #### Hybrid Pricing + # A `volume`, `tiered`, or `stairstep` metered component can combine its + # primary pricing with a secondary pricing model (the `overage_pricing` + # parameter) so both bill as a single invoice line item instead of two. This + # does not apply to metered components configured for event-based billing + # (metric, meter, or formula). See [Hybrid + # Pricing](page:introduction/basic-concepts/hybrid-pricing) for requirements + # and configuration details. # For more information on components, see our documentation # [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Componen # ts-Overview). + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, taxable components must include a non-blank + # `tax_code`. Sending `"tax_code": ""` returns `422`. # @param [String] product_family_id Required parameter: Either the product # family's id or its handle prefixed with `handle:` # @param [CreateMeteredComponent] body Optional parameter: TODO: type @@ -54,7 +66,7 @@ def create_metered_component(product_family_id, # Creates a Quantity Based component definition under the specified product # family. A Quantity Based component can then be added and “allocated” for a # subscription. - # When defining a Quantity Based component, you can choose one of 2 types: + # When defining a Quantity Based component, you can choose one of two types: # #### Recurring # Recurring quantity-based components are used to bill for the number of # some unit (think monthly software user licenses or the number of pairs of @@ -66,9 +78,22 @@ def create_metered_component(product_family_id, # charge your customer a one-time fee for onboarding or other services. # The allocated quantity for one-time quantity-based components immediately # gets reset back to zero after the allocation is made. + # For more information, see [Components + # Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Compo + # nents-Overview). + # #### Hybrid Pricing + # A `volume`, `tiered`, or `stairstep` component can combine its primary + # pricing with a secondary pricing model (the `overage_pricing` parameter) + # so both bill as a single invoice line item instead of two. See [Hybrid + # Pricing](page:introduction/basic-concepts/hybrid-pricing) for requirements + # and configuration details. # For more information on components, see our documentation # [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Componen # ts-Overview). + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, taxable components must include a non-blank + # `tax_code`. Sending `"tax_code": ""` returns `422`. # @param [String] product_family_id Required parameter: Either the product # family's id or its handle prefixed with `handle:` # @param [CreateQuantityBasedComponent] body Optional parameter: TODO: type @@ -108,6 +133,10 @@ def create_quantity_based_component(product_family_id, # For more information on components, see our documentation # [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Componen # ts-Overview). + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, taxable components must include a non-blank + # `tax_code`. Sending `"tax_code": ""` returns `422`. # @param [String] product_family_id Required parameter: Either the product # family's id or its handle prefixed with `handle:` # @param [CreateOnOffComponent] body Optional parameter: TODO: type @@ -147,11 +176,15 @@ def create_on_off_component(product_family_id, # up over time on their subscription. In a sense, they are the mirror image # of metered components; while metered components charge at the end of the # period for the amount of units used, prepaid components are charged for at - # the time of purchase, and we subsequently keep track of the usage against - # the amount purchased. - # For more information on components, see our documentation - # [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Componen - # ts-Overview). + # the time of purchase, and usage is subsequently tracked against the amount + # purchased. + # For more information, see [Components + # Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Compo + # nents-Overview). + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, taxable components must include a non-blank + # `tax_code`; sending a blank value results in a validation error. # @param [String] product_family_id Required parameter: Either the product # family's id or its handle prefixed with `handle:` # @param [CreatePrepaidComponent] body Optional parameter: TODO: type @@ -196,9 +229,13 @@ def create_prepaid_usage_component(product_family_id, # So, instead of reporting usage directly for each component (as you would # with metered components), the usage is derived from analysis of your # events. - # For more information on components, see our documentation - # [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Componen - # ts-Overview). + # For more information, see [Components + # Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Compo + # nents-Overview). + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, taxable components must include a non-blank + # `tax_code`; sending a blank value results in a validation error. # @param [String] product_family_id Required parameter: Either the product # family's id or its handle prefixed with `handle:` # @param [CreateEBBComponent] body Optional parameter: TODO: type @@ -284,6 +321,10 @@ def read_component(product_family_id, # Updates a component from a specific product family. # You may read the component by either the component's id or handle. When # using the handle, it must be prefixed with `handle:`. + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, taxable components must include a non-blank + # `tax_code`. Sending `"tax_code": ""` returns `422`. # @param [Integer] product_family_id Required parameter: The Advanced # Billing id of the product family to which the component belongs # @param [String] component_id Required parameter: Either the Advanced @@ -373,9 +414,8 @@ def archive_component(product_family_id, # 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 # @param [TrueClass | FalseClass] include_archived Optional parameter: - # Include archived items + # Include archived items. # @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 @@ -417,6 +457,10 @@ def list_components(options = {}) # Updates a component. # You may read the component by either the component's id or handle. When # using the handle, it must be prefixed with `handle:`. + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, taxable components must include a non-blank + # `tax_code`. Sending `"tax_code": ""` returns `422`. # @param [String] component_id Required parameter: The id or handle of the # component # @param [UpdateComponentRequest] body Optional parameter: TODO: type @@ -476,7 +520,6 @@ def update_component(component_id, # 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. # @param [String] start_date Optional parameter: 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 diff --git a/lib/advanced_billing/controllers/coupons_controller.rb b/lib/advanced_billing/controllers/coupons_controller.rb index 072dbcbb..7d1bbe80 100644 --- a/lib/advanced_billing/controllers/coupons_controller.rb +++ b/lib/advanced_billing/controllers/coupons_controller.rb @@ -7,16 +7,8 @@ module AdvancedBilling # CouponsController class CouponsController < BaseController # Creates a coupon under the specified product family. - # You can create either a flat amount coupon by specifying amount_in_cents, - # or a percentage coupon by specifying percentage - # You can restrict a coupon to only apply to specific products / components - # by optionally passing in `restricted_products` and/or - # `restricted_components` objects in the format: - # `{ "": boolean_value }` - # Coupons can be administered in the Advanced Billing application or created - # via API. See [creating - # coupons](https://maxio.zendesk.com/hc/en-us/articles/24261212433165-Creati - # ng-Editing-Deleting-Coupons) for more information. + # You can create either a flat amount coupon, by specifying + # `amount_in_cents`, or percentage coupon by specifying `percentage`. # See [Apply Coupons to # Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101- # Coupons-and-Subscriptions) for information on applying a coupon to a @@ -66,11 +58,10 @@ def create_coupon(product_family_id, # Use in query `per_page=200`. # @param [ListCouponsFilter] filter Optional parameter: Filter to use for # List Coupons operations - # @param [TrueClass | FalseClass] currency_prices Optional parameter: 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`. + # @param [TrueClass | FalseClass] currency_prices Optional parameter: + # (Optional) If you have defined multiple currencies at the site level, you + # can pass `?currency_prices=true` 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. def list_coupons_for_product_family(options = {}) @api_call @@ -94,20 +85,18 @@ def list_coupons_for_product_family(options = {}) .execute end - # Searches for a coupon by code, returning a 404 if no coupon is found. By - # passing a code parameter, the find will attempt to locate a coupon that - # matches that code. + # Searches for a coupon by code. # If you have more than one product family and if the coupon you are trying - # to find does not belong to the default product family in your site, then - # you will need to specify (either in the url or as a query string param) - # the product family id. + # to find does not belong to the default product family in your site, you + # need to specify (either in the URL or as a query string param) the + # `product_family_id`. # @param [Integer] product_family_id Optional parameter: The Advanced # Billing id of the product family to which the coupon belongs # @param [String] code Optional parameter: The code of the coupon - # @param [TrueClass | FalseClass] currency_prices Optional parameter: 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. + # @param [TrueClass | FalseClass] currency_prices Optional parameter: + # (Optional) If you have defined multiple currencies at the site level, you + # can pass `?currency_prices=true` to include an array of currency price + # data in the response. # @return [CouponResponse] Response from the API call. def find_coupon(product_family_id: nil, code: nil, @@ -127,24 +116,21 @@ def find_coupon(product_family_id: nil, .execute end - # Returns a coupon by its Advanced Billing-assigned ID. You must identify - # the Coupon in this call by the ID parameter that Advanced Billing assigns. - # If instead you would like to find a Coupon using a Coupon code, see the - # Coupon Find method. - # When fetching a coupon, 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 coupon 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. + # Returns a coupon by its system-assigned ID. You must identify the Coupon + # in this call by the ID parameter assigned to it. + # If instead you would like to find a Coupon using a Coupon code, use the + # [Find Coupon]($e/Coupons/findCoupon) endpoint. + # If the coupon is set to `use_site_exchange_rate: true`, it returns pricing + # based on the current exchange rate. If the flag is set to false, it + # returns all of the defined prices for each currency. # @param [Integer] product_family_id Required parameter: The Advanced # 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 [TrueClass | FalseClass] currency_prices Optional parameter: 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. + # @param [TrueClass | FalseClass] currency_prices Optional parameter: + # (Optional) If you have defined multiple currencies at the site level, you + # can pass `?currency_prices=true` to include an array of currency price + # data in the response. # @return [CouponResponse] Response from the API call. def read_coupon(product_family_id, coupon_id, @@ -253,11 +239,10 @@ def archive_coupon(product_family_id, # Use in query `per_page=200`. # @param [ListCouponsFilter] filter Optional parameter: Filter to use for # List Coupons operations - # @param [TrueClass | FalseClass] currency_prices Optional parameter: 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`. + # @param [TrueClass | FalseClass] currency_prices Optional parameter: + # (Optional) If you have defined multiple currencies at the site level, you + # can pass `?currency_prices=true` 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. def list_coupons(options = {}) @api_call @@ -306,26 +291,18 @@ def read_coupon_usage(product_family_id, end # Verifies whether a specific coupon code is valid. This method is useful - # for validating coupon codes that are entered by a customer. If the coupon - # is found and is valid, the coupon will be returned with a 200 status code. - # If the coupon is invalid, the status code will be 404 and the response - # will say why it is invalid. If the coupon is valid, the status code will - # be 200 and the coupon will be returned. The following reasons for - # invalidity are supported: - # + Coupon not found - # + Coupon is invalid - # + Coupon expired + # for validating coupon codes that are entered by a customer. # If you have more than one product family and if the coupon you are - # validating does not belong to the first product family in your site, then - # you will need to specify the product family, either in the url or as a - # query string param. This can be done by supplying the id or the handle in - # the `handle:my-family` format. - # Eg. + # validating does not belong to the first product family in your site, you + # need to specify the product family, either in the URL or as a query string + # param. This can be done by supplying the id or the handle in the + # `handle:my-family` format. + # Supplying the `product_family_handle` in the URL: # ``` # https://.chargify.com/product_families/handle:/coupons/validate.?code= # ``` - # Or: + # Supplying the `product_family_id` as a query parameter: # ``` # https://.chargify.com/coupons/validate.?code=&product_family_id= @@ -391,7 +368,6 @@ def create_or_update_coupon_currency_prices(coupon_id, end # Creates subcodes for an existing coupon. - # ## Coupon Subcodes Intro # Coupon Subcodes allow you to create a set of unique codes that allow you # to expand the use of one coupon. # For example: @@ -401,24 +377,11 @@ def create_or_update_coupon_currency_prices(coupon_id, # + SPRING90210 # + DP80302 # + SPRINGBALTIMORE - # Coupon subcodes can be administered in the Admin Interface or via the API. # When creating a coupon subcode, you must specify a coupon to attach it to # using the coupon_id. Valid coupon subcodes are all capital letters, # contain only letters and numbers, and do not have any spaces. Lowercase - # letters will be capitalized before the subcode is created. - # ## Coupon Subcodes Documentation - # Full documentation on how to create coupon subcodes in the Advanced - # Billing UI can be located - # [here](https://maxio.zendesk.com/hc/en-us/articles/24261208729229-Coupon-C - # odes). - # Additionally, for documentation on how to apply a coupon to a Subscription - # within the Advanced Billing UI, see our documentation - # [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons- - # and-Subscriptions). - # ## Create Coupon Subcode - # This request allows you to create specific subcodes underneath an existing - # coupon code. - # *Note*: If you are using any of the allowed special characters ("%", "@", + # letters are capitalized before the subcode is created. + # Note: If you are using any of the allowed special characters ("%", "@", # "+", "-", "_", and "."), you must encode them for use in the URL. # % to %25 # @ to %40 @@ -428,7 +391,13 @@ def create_or_update_coupon_currency_prices(coupon_id, # . to %2E # So, if the coupon subcode is `20%OFF`, the URL to delete this coupon # subcode would be: - # `https://.chargify.com/coupons/567/codes/20%25OFF.` + # `https://.chargify.com/coupons/567/codes/20%25OFF.`. + # For more information on coupon codes and applying coupons to + # subscriptions, see [Coupon + # Codes](https://maxio.zendesk.com/hc/en-us/articles/24261208729229-Coupon-C + # odes) and [Coupons and + # Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101- + # Coupons-and-Subscriptions). # @param [Integer] coupon_id Required parameter: The Advanced Billing id of # the coupon # @param [CouponSubcodes] body Optional parameter: TODO: type description @@ -541,7 +510,7 @@ def update_coupon_subcodes(coupon_id, # ## Percent Encoding Example # Or if the coupon subcode is 20%OFF, the URL to delete this coupon subcode # would be: - # @https://.chargify.com/coupons/567/codes/20%25OFF. + # @https://.chargify.com/coupons/567/codes/20%25OFF.. # @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 diff --git a/lib/advanced_billing/controllers/customers_controller.rb b/lib/advanced_billing/controllers/customers_controller.rb index 76b63aee..d5746a81 100644 --- a/lib/advanced_billing/controllers/customers_controller.rb +++ b/lib/advanced_billing/controllers/customers_controller.rb @@ -7,40 +7,37 @@ module AdvancedBilling # CustomersController class CustomersController < BaseController # Creates a new customer; can also be created alongside a new subscription. - # The only validation restriction is that you may only create one customer + # The only validation restriction is that you can only create one customer # for a given reference value. # If provided, the `reference` value must be unique. It represents a unique # identifier for the customer from your own app, i.e. the customer’s ID. # This allows you to retrieve a given customer via a piece of shared - # information. Alternatively, you may choose to leave `reference` blank, and - # store Advanced Billing’s unique ID for the customer, which is in the `id` + # information. Alternatively, you can choose to leave `reference` blank, and + # store the system-assigned unique ID for the customer, which is in the `id` # attribute. - # Full documentation on how to locate, create and edit Customers in the - # Advanced Billing UI can be located - # [here](https://maxio.zendesk.com/hc/en-us/articles/24252190590093-Customer - # -Details). + # For more information, see [Customer + # Details](https://maxio.zendesk.com/hc/en-us/articles/24252190590093-Custom + # er-Details). # ## Required Country Format - # Advanced Billing requires that you use the ISO Standard Country codes when - # formatting country attribute of the customer. - # Countries should be formatted as 2 characters. For more information, see - # the following wikipedia article on - # [ISO_3166-1.](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) + # Format the country attribute of the customer using the ISO Standard + # Country codes. + # Countries should be formatted as two characters. For more information, see + # [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes). # ## Required State Format - # Advanced Billing requires that you use the ISO Standard State codes when - # formatting state attribute of the customer. - # + US States (2 characters): - # [ISO_3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US) - # + States Outside the US (2-3 characters): To find the correct state codes - # outside of the US, go to - # [ISO_3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) and - # click on the link in the “ISO 3166-2 codes” column next to country you - # wish to populate. + # Format the state attribute of the customer using the ISO Standard State + # codes. + # + US States (two characters): see [ISO + # 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US). + # + States Outside the US (two to three characters): To find the correct + # state codes outside the US, go to [ISO + # 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) and click + # on the link in the “ISO 3166-2 codes” column next to the country you wish + # to populate. # ## Locale - # Advanced Billing allows you to attribute a language/region to your - # customer to deliver invoices in any required language. - # For more: [Customer + # You can attribute a language/region to the customer to deliver invoices in + # any required language. For more information, see [Customer # Locale](https://maxio.zendesk.com/hc/en-us/articles/24286672013709-Custome - # r-Locale) + # r-Locale). # @param [CreateCustomerRequest] body Optional parameter: TODO: type # description here # @return [CustomerResponse] Response from the API call. @@ -230,6 +227,12 @@ def read_customer_by_reference(reference) end # Lists all subscriptions that belong to a customer. + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, subscriptions no longer require an + # associated product. For subscriptions without an associated product, + # 'product', 'product_price_point_id', and 'product_price_point_type' are + # returned as 'null'. # @param [Integer] customer_id Required parameter: The Chargify id of the # customer # @return [Array[SubscriptionResponse]] Response from the API call. 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 9bfe35d7..347bb82d 100644 --- a/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +++ b/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb @@ -104,9 +104,9 @@ def list_segments_for_price_point(options = {}) .execute end - # Updates a single segment for a component with a segmented metric. It - # allows you to update the pricing for the segment. - # You may specify component and/or price point by using either the numeric + # Updates a single segment for a component with a segmented metric. You can + # also update the pricing for the segment. + # You can specify component and/or price point by using either the numeric # ID or the `handle:gold` syntax. # @param [String] component_id Required parameter: ID or Handle of the # Component diff --git a/lib/advanced_billing/controllers/events_controller.rb b/lib/advanced_billing/controllers/events_controller.rb index ea534255..ea2a1302 100644 --- a/lib/advanced_billing/controllers/events_controller.rb +++ b/lib/advanced_billing/controllers/events_controller.rb @@ -7,19 +7,15 @@ module AdvancedBilling # EventsController class EventsController < BaseController # Lists events for a site. - # ## Events Intro - # Advanced Billing Events include various activity that happens around a - # Site. This information is **especially** useful to track down issues that - # arise when subscriptions are not created due to errors. - # Within the Advanced Billing UI, "Events" are referred to as "Site - # Activity". Full documentation on how to view Events / Site Activity in - # the Advanced Billing UI can be located - # [here](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Act - # ivity). - # ## List Events for a Site - # This method will retrieve a list of events for a site. Use query string - # filters to narrow down results. You may use the `key` filter as part of - # your query string to narrow down results. + # Events include various activity that happens around a Site. This + # information is **especially** useful to track down issues that arise when + # subscriptions are not created due to errors. + # Within the UI, Events are referred to as Site Activity. For more + # information, see [Site + # Activity](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site- + # Activity). + # Use query string filters to narrow down results. You can use the `filter` + # parameter to filter by event key. # ### Legacy Filters # The following keys are no longer supported. # + `payment_failure_recreated` @@ -31,8 +27,8 @@ class EventsController < BaseController # + `zferral_revenue_post_success` - (Specific to the deprecated Zferral # integration) # ## Event Key - # The event type is identified by the key property. You can check supported - # keys [here]($m/Event%20Key). + # The event type is identified by the key property. See [Event + # Key]($m/Event%20Key) for a complete list of supported keys. # ## Event Specific Data # Different event types may include additional data in `event_specific_data` # property. @@ -47,7 +43,7 @@ class EventsController < BaseController # "event": { # "id": 351, # "key": "subscription_product_change", - # "message": "Product changed on Marky Mark's subscription from + # "message": "Product changed on Mark Alan's subscription from # 'Basic' to 'Pro'", # "subscription_id": 205, # "event_specific_data": { @@ -64,8 +60,8 @@ class EventsController < BaseController # "event": { # "id": 353, # "key": "subscription_state_change", - # "message": "State changed on Marky Mark's subscription to Pro - # from trialing to active", + # "message": "State changed on Mark Alan's subscription to Pro from + # trialing to active", # "subscription_id": 205, # "event_specific_data": { # "new_subscription_state": "active", @@ -75,6 +71,19 @@ class EventsController < BaseController # } # } # ``` + # ## Enhanced Catalog Experience + # If you’re using the [enhanced Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology), you’ll see updated naming in webhook events and + # messages. + # Event name changes: + # - subscription_product_change → subscription_plan_change + # - component_allocation_change → allocation_change + # - component_billing_date_change → product_billing_date_change + # Message updates: + # - “Plan changed on Subscription from previous plan to new plan” + # - “Successful payment for allocation changes to Product on Subscription” + # - “Failed payment for allocation changes to Product on 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 @@ -87,9 +96,9 @@ class EventsController < BaseController # allowed values is 200; any per_page value over 200 will be changed to 200. # Use in query `per_page=200`. # @param [Integer] since_id Optional parameter: Returns events with an id - # greater than or equal to the one specified + # greater than or equal to the one specified. # @param [Integer] max_id Optional parameter: Returns events with an id less - # than or equal to the one specified + # than or equal to the one specified. # @param [Direction] direction Optional parameter: The sort direction of the # returned events. # @param [Array[EventKey]] filter Optional parameter: You can pass multiple @@ -144,8 +153,8 @@ def list_events(options = {}) # Lists events for a subscription. # ## Event Key - # The event type is identified by the key property. You can check supported - # keys [here]($m/Event%20Key). + # The event type is identified by the key property. See [Event + # Key]($m/Event%20Key) for a complete list of supported keys. # ## Event Specific Data # Different event types may include additional data in `event_specific_data` # property. @@ -153,6 +162,19 @@ def list_events(options = {}) # may not include it at all. # For precise mappings from key to event_specific_data, refer to # [Event]($m/Event). + # ## Enhanced Catalog Experience + # If you’re using the [enhanced Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology), you’ll see updated naming in webhook events and + # messages. + # Event name changes: + # - subscription_product_change → subscription_plan_change + # - component_allocation_change → allocation_change + # - component_billing_date_change → product_billing_date_change + # Message updates: + # - “Successful payment for allocation changes to Product on Subscription” + # - “Failed payment for allocation changes to Product on Subscription” + # - “Plan changed on Subscription from previous plan to new plan” # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [Integer] page Optional parameter: Result records are organized in @@ -167,9 +189,9 @@ def list_events(options = {}) # allowed values is 200; any per_page value over 200 will be changed to 200. # Use in query `per_page=200`. # @param [Integer] since_id Optional parameter: Returns events with an id - # greater than or equal to the one specified + # greater than or equal to the one specified. # @param [Integer] max_id Optional parameter: Returns events with an id less - # than or equal to the one specified + # than or equal to the one specified. # @param [Direction] direction Optional parameter: The sort direction of the # returned events. # @param [Array[EventKey]] filter Optional parameter: You can pass multiple @@ -201,6 +223,18 @@ def list_subscription_events(options = {}) end # Returns the total count of events for a given site. + # If you’re using the [enhanced Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology), you’ll see updated naming in webhook events and + # messages. + # Event name changes: + # - subscription_product_change → subscription_plan_change + # - component_allocation_change → allocation_change + # - component_billing_date_change → product_billing_date_change + # Message updates: + # - “Successful payment for allocation changes to Product on Subscription” + # - “Failed payment for allocation changes to Product on Subscription” + # - “Plan changed on Subscription from previous plan to new plan” # @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 @@ -213,9 +247,9 @@ def list_subscription_events(options = {}) # allowed values is 200; any per_page value over 200 will be changed to 200. # Use in query `per_page=200`. # @param [Integer] since_id Optional parameter: Returns events with an id - # greater than or equal to the one specified + # greater than or equal to the one specified. # @param [Integer] max_id Optional parameter: Returns events with an id less - # than or equal to the one specified + # than or equal to the one specified. # @param [Direction] direction Optional parameter: The sort direction of the # returned events. # @param [Array[EventKey]] filter Optional parameter: You can pass multiple diff --git a/lib/advanced_billing/controllers/insights_controller.rb b/lib/advanced_billing/controllers/insights_controller.rb index 19ace1fd..bbb4c15b 100644 --- a/lib/advanced_billing/controllers/insights_controller.rb +++ b/lib/advanced_billing/controllers/insights_controller.rb @@ -31,9 +31,9 @@ def read_site_stats # Returns your site's current MRR, including plan and usage breakouts. # @param [DateTime] at_time Optional parameter: submit a timestamp in - # ISO8601 format to request MRR for a historic time + # 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 + # subscription in order to limit results. # @return [MRRResponse] Response from the API call. def read_mrr(at_time: nil, subscription_id: nil) @@ -75,8 +75,8 @@ def read_mrr(at_time: nil, # Usage includes revenue from: # * Metered Components # * Prepaid Usage Components - # @param [Integer] subscription_id Optional parameter: optionally filter - # results by subscription + # @param [Integer] subscription_id Optional parameter: (Optional) Filter + # results by 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 @@ -109,8 +109,8 @@ def list_mrr_movements(options = {}) .execute end - # This endpoint returns your site's current MRR, including plan and usage - # breakouts split per subscription. + # Lists your site's current MRR, including plan and usage breakouts split + # per subscription. # @param [ListMrrFilter] filter Optional parameter: Filter to use for List # MRR per subscription operation # @param [String] at_time Optional parameter: Submit a timestamp in ISO8601 diff --git a/lib/advanced_billing/controllers/invoices_controller.rb b/lib/advanced_billing/controllers/invoices_controller.rb index fb9fa83c..0bf3eae9 100644 --- a/lib/advanced_billing/controllers/invoices_controller.rb +++ b/lib/advanced_billing/controllers/invoices_controller.rb @@ -6,7 +6,7 @@ module AdvancedBilling # InvoicesController class InvoicesController < BaseController - # Refund an invoice, segment, or consolidated invoice. + # Refunds an invoice, segment, or consolidated invoice. # ## Partial Refund for Consolidated Invoice # A refund less than the total of a consolidated invoice will be split # across its segments. @@ -42,10 +42,11 @@ def refund_invoice(uid, .execute end - # By default, invoices returned on the index will only include totals, not - # detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, - # `payments`, `custom_fields`, or `refunds`. To include breakdowns, pass the - # specific field as a key in the query with a value set to `true`. + # Lists invoices for a site. By default, invoices returned on the index will + # only include totals, not detailed breakdowns for `line_items`, + # `discounts`, `taxes`, `credits`, `payments`, `custom_fields`, or + # `refunds`. To include breakdowns, pass the specific field as a key in the + # query with a value set to `true`. # @param [String] start_date Optional parameter: The start date (format # YYYY-MM-DD) with which to filter the date_field. Returns invoices with a # timestamp at or after midnight (12:00:00 AM) in your site’s time zone on @@ -79,19 +80,19 @@ def refund_invoice(uid, # @param [Direction] direction Optional parameter: The sort direction of the # returned invoices. # @param [TrueClass | FalseClass] line_items Optional parameter: Include - # line items data + # line items data. # @param [TrueClass | FalseClass] discounts Optional parameter: Include - # discounts data + # discounts data. # @param [TrueClass | FalseClass] taxes Optional parameter: Include taxes - # data + # data. # @param [TrueClass | FalseClass] credits Optional parameter: Include - # credits data + # credits data. # @param [TrueClass | FalseClass] payments Optional parameter: Include - # payments data + # payments data. # @param [TrueClass | FalseClass] custom_fields Optional parameter: Include - # custom fields data + # custom fields data. # @param [TrueClass | FalseClass] refunds Optional parameter: Include - # refunds data + # refunds data. # @param [InvoiceDateField] date_field Optional parameter: The type of # filter you would like to apply to your search. Use in query # `date_field=issue_date`. @@ -158,7 +159,7 @@ def list_invoices(options = {}) .execute end - # Use this endpoint to retrieve the details for an invoice. + # Returns the details for an invoice. # ## PDF Invoice retrieval # Individual PDF Invoices can be retrieved by using the "Accept" header # application/pdf or appending .pdf as the format portion of the URL: @@ -189,9 +190,9 @@ def read_invoice(uid) .execute end - # This endpoint returns a list of invoice events. Each event contains event - # "data" (such as an applied payment) as well as a snapshot of the `invoice` - # at the time of event completion. + # Lists invoice events for a site. Each event contains event "data" (such as + # an applied payment) as well as a snapshot of the `invoice` at the time of + # event completion. # Exposed event types are: # + issue_invoice # + apply_credit_note @@ -264,8 +265,9 @@ def list_invoice_events(options = {}) end # 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. + # like to apply a payment across multiple invoices, you can use the [Record + # Payment for Multiple + # Invoices]($e/Invoices/recordPaymentForMultipleInvoices) 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: TODO: type @@ -295,30 +297,9 @@ def record_payment_for_invoice(uid, .execute end - # This API call should be used when you want to record an external payment - # against multiple invoices. - # To apply a payment to multiple invoices, at minimum, specify the `amount` + # Records an external payment against multiple invoices. + # To apply a payment to multiple invoices, at minimum, specify the `amount` # and `applications` (i.e., `invoice_uid` and `amount`) details. - # ``` - # { - # "payment": { - # "memo": "to pay the bills", - # "details": "check number 8675309", - # "method": "check", - # "amount": "250.00", - # "applications": [ - # { - # "invoice_uid": "inv_8gk5bwkct3gqt", - # "amount": "100.00" - # }, - # { - # "invoice_uid": "inv_7bc6bwkct3lyt", - # "amount": "150.00" - # } - # ] - # } - # } - # ``` # 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: TODO: @@ -344,8 +325,8 @@ def record_payment_for_multiple_invoices(body: nil) .execute end - # Credit Notes are like inverse invoices. They reduce the amount a customer - # owes. + # Lists credit notes for a site. Credit Notes are like inverse invoices. + # They reduce the amount a customer owes. # By default, the credit notes returned by this endpoint will exclude the # arrays of `line_items`, `discounts`, `taxes`, `applications`, or # `refunds`. To include these arrays, pass the specific field as a key in @@ -364,15 +345,15 @@ def record_payment_for_multiple_invoices(body: nil) # allowed values is 200; any per_page value over 200 will be changed to 200. # Use in query `per_page=200`. # @param [TrueClass | FalseClass] line_items Optional parameter: Include - # line items data + # line items data. # @param [TrueClass | FalseClass] discounts Optional parameter: Include - # discounts data + # discounts data. # @param [TrueClass | FalseClass] taxes Optional parameter: Include taxes - # data + # data. # @param [TrueClass | FalseClass] refunds Optional parameter: Include - # refunds data + # refunds data. # @param [TrueClass | FalseClass] applications Optional parameter: Include - # applications data + # applications data. # @return [ListCreditNotesResponse] Response from the API call. def list_credit_notes(options = {}) @api_call @@ -395,7 +376,7 @@ def list_credit_notes(options = {}) .execute end - # Use this endpoint to retrieve the details for a credit note. + # Returns 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. @@ -415,7 +396,7 @@ def read_credit_note(uid) .execute end - # Record an external payment made against a subscription that will pay + # Records an external payment made against a subscription that will pay # partially or in full one or more invoices. # Payment will be applied starting with the oldest open invoice and then # next oldest, and so on until the amount of the payment is fully consumed. @@ -452,10 +433,9 @@ def record_payment_for_subscription(subscription_id, .execute end - # This endpoint allows you to reopen any invoice with the "canceled" status. - # Invoices enter "canceled" status if they were open at the time the - # subscription was canceled (whether through dunning or an intentional - # cancellation). + # Reopens any invoice with the "canceled" status. Invoices enter "canceled" + # status if they were open at the time the subscription was canceled + # (whether through dunning or an intentional cancellation). # Invoices with "canceled" status are no longer considered to be due. Once # reopened, they are considered due for payment. Payment may then be # captured in one of the following ways: @@ -496,9 +476,9 @@ def reopen_invoice(uid) .execute end - # This endpoint allows you to void any invoice with the "open" or "canceled" - # status. It will also allow voiding of an invoice with the "pending" - # status if it is not a consolidated invoice. + # Voids any invoice with the "open" or "canceled" status. It will also + # allow voiding of an invoice with the "pending" 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: TODO: type @@ -531,9 +511,10 @@ def void_invoice(uid, .execute end - # Invoice segments returned on the index will only include totals, not - # detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, - # `payments`, or `custom_fields`. + # Lists segments for a consolidated invoice. Invoice segments returned on + # the index will only include totals, not detailed breakdowns for + # `line_items`, `discounts`, `taxes`, `credits`, `payments`, or + # `custom_fields`. # @param [String] invoice_uid Required parameter: The unique identifier of # the consolidated invoice # @param [Integer] page Optional parameter: Result records are organized in @@ -569,7 +550,7 @@ def list_consolidated_invoice_segments(options = {}) .execute end - # This endpoint will allow you to create an ad hoc invoice. + # Creates an ad hoc invoice. # ### Basic Behavior # You can create a basic invoice by sending an array of line items to this # endpoint. Each line item, at a minimum, must include a title, a quantity @@ -801,11 +782,131 @@ def create_invoice(subscription_id, .execute end - # This endpoint allows for invoices to be programmatically delivered via - # email. This endpoint supports the delivery of both ad-hoc and - # automatically generated invoices. Additionally, this endpoint supports - # email delivery to direct recipients, carbon-copy (cc) recipients, and - # blind carbon-copy (bcc) recipients. + # Updates an ad hoc invoice while it is in the `draft` state. + # **Important: only invoices with the `adhoc` role and `draft` status can be + # updated.** Any other invoice — issued, or with a different role (e.g. + # `renewal`, `signup`) — cannot be updated through this endpoint and the + # request returns a `422` error. If the invoice does not belong to the + # provided subscription, a `404` error is returned. + # Only the attributes submitted in the request are changed — omitted + # attributes keep their current values. + # ### Line Items + # The `line_items` array describes changes to the invoice's line items. Line + # items not referenced in the array remain unchanged. + # #### Adding a line item + # A line item without a `uid` is added to the invoice. The same line item + # types and options as on invoice creation are supported (custom items, + # `product_id`, `component_id`, price points, period date ranges, taxes). + # #### Updating a line item + # A line item with the `uid` of an existing line item updates that line item + # with the submitted attributes. Amounts and taxes are recalculated. + # #### Removing a line item + # A line item with a `uid` and `"_destroy": true` is removed from the + # invoice. Other line items remain unchanged. + # Referencing a `uid` which does not exist on the invoice returns a `422` + # error. + # ### Coupons + # When the `coupons` key is present, the submitted coupons replace all + # discounts currently applied to the invoice. Send an empty array to remove + # all discounts. Coupon options are the same as on invoice creation. + # ### Invoice Options + # #### Issue Date and Net Terms + # The `issue_date` parameter can be sent to change the invoice's issue date. + # Only today or dates in the past are accepted. The date is interpreted and + # validated in your site's time zone, using the `YYYY-MM-DD` format. The + # `net_terms` parameter indicates the number of days after the issue date on + # which the invoice is due. The due date is recalculated whenever the issue + # date or net terms change. + # #### Addresses + # The seller, shipping and billing addresses can be sent to replace the + # addresses on the invoice. Each address requires to send a `first_name` at + # a minimum in order to work. Taxes are recalculated after an address + # change. + # #### Memo and Payment Instructions + # A custom memo can be sent with the `memo` parameter. Likewise, custom + # payment instructions can be sent with the `payment_instructions` + # parameter. + # @param [Integer] subscription_id Required parameter: The Chargify id of + # the subscription. + # @param [String] uid Required parameter: The unique identifier for the + # invoice, this does not refer to the public facing invoice number. + # @param [UpdateInvoiceRequest] body Optional parameter: TODO: type + # description here + # @return [InvoiceResponse] Response from the API call. + def update_invoice(subscription_id, + uid, + body: nil) + @api_call + .request(new_request_builder(HttpMethodEnum::PUT, + '/subscriptions/{subscription_id}/invoices/{uid}.json', + Server::PRODUCTION) + .template_param(new_parameter(subscription_id, key: 'subscription_id') + .is_required(true) + .should_encode(true)) + .template_param(new_parameter(uid, key: 'uid') + .is_required(true) + .should_encode(true)) + .header_param(new_parameter('application/json', key: 'Content-Type')) + .body_param(new_parameter(body)) + .header_param(new_parameter('application/json', key: 'accept')) + .body_serializer(proc do |param| param.to_json unless param.nil? end) + .auth(Single.new('BasicAuth'))) + .response(new_response_handler + .deserializer(APIHelper.method(:custom_type_deserializer)) + .deserialize_into(InvoiceResponse.method(:from_hash)) + .local_error_template('404', + 'Not Found:\'{$response.body}\'', + ErrorListResponseException) + .local_error_template('422', + 'HTTP Response Not OK. Status code: {$statusCode}.'\ + ' Response: \'{$response.body}\'.', + ErrorArrayMapResponseException)) + .execute + end + + # Deletes an ad hoc invoice while it is in the `draft` state. + # **Important: only invoices with the `adhoc` role and `draft` status can be + # deleted.** Any other invoice — issued, or with a different role (e.g. + # `renewal`, `signup`) — cannot be deleted through this endpoint and the + # request returns a `422` error. Issued invoices should be voided instead. + # If the invoice does not belong to the provided subscription, a `404` error + # is returned. + # A successful deletion returns a `204 No Content` response and the invoice + # is permanently removed. + # @param [Integer] subscription_id Required parameter: The Chargify id of + # the subscription. + # @param [String] uid Required parameter: The unique identifier for the + # invoice, this does not refer to the public facing invoice number. + # @return [void] Response from the API call. + def delete_invoice(subscription_id, + uid) + @api_call + .request(new_request_builder(HttpMethodEnum::DELETE, + '/subscriptions/{subscription_id}/invoices/{uid}.json', + Server::PRODUCTION) + .template_param(new_parameter(subscription_id, key: 'subscription_id') + .is_required(true) + .should_encode(true)) + .template_param(new_parameter(uid, key: 'uid') + .is_required(true) + .should_encode(true)) + .auth(Single.new('BasicAuth'))) + .response(new_response_handler + .is_response_void(true) + .local_error_template('404', + 'Not Found:\'{$response.body}\'', + ErrorListResponseException) + .local_error_template('422', + 'HTTP Response Not OK. Status code: {$statusCode}.'\ + ' Response: \'{$response.body}\'.', + ErrorListResponseException)) + .execute + end + + # Sends an invoice to the customer via email. This endpoint supports the + # delivery of both ad-hoc and automatically generated invoices. + # Additionally, this endpoint supports email delivery to direct recipients, + # carbon-copy (cc) recipients, and blind carbon-copy (bcc) recipients. # **File Attachments**: You can attach files to invoice emails using # `attachment_urls[]` parameter by providing URLs to the files you want to # attach. When using attachments, the request must use `multipart/form-data` @@ -846,6 +947,7 @@ def send_invoice(uid, .execute end + # Previews the effect of customer information changes on an open invoice. # Customer information may change after an invoice is issued, which may lead # to a mismatch between customer information that is present on an open # invoice and actual customer information. This endpoint allows you to @@ -878,10 +980,9 @@ def preview_customer_information_changes(uid) .execute end - # This endpoint updates customer information on an open invoice and returns - # the updated invoice. If you would like to preview changes that will be - # applied, use the `/invoices/{uid}/customer_information/preview.json` - # endpoint first. + # Updates customer information on an open invoice and returns the updated + # invoice. If you would like to preview changes that will be applied, use + # the `/invoices/{uid}/customer_information/preview.json` endpoint first. # The endpoint doesn't accept a request body. Customer information # differences are calculated on the application side. # @param [String] uid Required parameter: The unique identifier for the @@ -910,10 +1011,9 @@ def update_customer_information(uid) .execute end - # This endpoint allows you to issue an invoice that is in "pending" or - # "draft" status. For example, you can issue an invoice that was created - # when allocating new quantity on a component and using "accrue charges" - # option. + # Issues an invoice that is in "pending" or "draft" status. For example, you + # can issue an invoice that was created when allocating new quantity on a + # component and using "accrue charges" option. # You cannot issue a pending child invoice that was created for a member # subscription in a group. # For Remittance subscriptions, the invoice will go into "open" status and diff --git a/lib/advanced_billing/controllers/offers_controller.rb b/lib/advanced_billing/controllers/offers_controller.rb index 617b1f7f..73f0e97d 100644 --- a/lib/advanced_billing/controllers/offers_controller.rb +++ b/lib/advanced_billing/controllers/offers_controller.rb @@ -6,17 +6,15 @@ module AdvancedBilling # OffersController class OffersController < BaseController - # Creates an offer within your Advanced Billing site. - # ## Documentation + # Creates an offer within your site. # Offers allow you to package complicated combinations of products, # components and coupons into a convenient package which can then be # subscribed to just like products. # Once an offer is defined it can be used as an alternative to the product # when creating subscriptions. - # Full documentation on how to use offers in the Advanced Billing UI can be - # located - # [here](https://maxio.zendesk.com/hc/en-us/articles/24261295098637-Offers-O - # verview). + # For more information, see + # [Offers](https://maxio.zendesk.com/hc/en-us/articles/24261295098637-Offers + # -Overview) in the product documentation. # ## Using a Product Price Point # You can optionally pass in a `product_price_point_id` that corresponds # with the `product_id` and the offer will use that price point. If a diff --git a/lib/advanced_billing/controllers/payment_profiles_controller.rb b/lib/advanced_billing/controllers/payment_profiles_controller.rb index 6ea6ac50..2f4599d0 100644 --- a/lib/advanced_billing/controllers/payment_profiles_controller.rb +++ b/lib/advanced_billing/controllers/payment_profiles_controller.rb @@ -111,9 +111,9 @@ def create_payment_profile(body: nil) .execute end - # Returns all active payment profiles for a site, or for one customer within - # a site. If no payment profiles are found, this endpoint will return an - # empty array, not a 404. + # Lists all active payment profiles for a site, or for one customer within a + # site. If no payment profiles are found, this endpoint returns an empty + # array. # @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 @@ -277,8 +277,8 @@ def update_payment_profile(payment_profile_id, end # Deletes an unused payment profile. - # If the payment profile is in use by one or more subscriptions or groups, a - # 422 and error message will be returned. + # If the payment profile is in use by one or more subscriptions or groups, + # an error message is returned. # @param [Integer] payment_profile_id Required parameter: The Chargify id of # the payment profile # @return [void] Response from the API call. @@ -304,11 +304,11 @@ def delete_unused_payment_profile(payment_profile_id) end # Deletes a payment profile belonging to the customer on the subscription. - # + If the customer has multiple subscriptions, the payment profile will be - # removed from all of them. - # + If you delete the default payment profile for a subscription, you will - # need to specify another payment profile to be the default through the api, - # or either prompt the user to enter a card in the billing portal or on the + # If the customer has multiple subscriptions, the payment profile is removed + # from all of them. + # If you delete the default payment profile for a subscription, you need to + # specify another payment profile to be the default through the API, or + # either prompt the user to enter a card in the billing portal or on the # self-service page, or visit the Payment Details tab on the subscription in # the Admin UI and use the “Add New Credit Card” or “Make Active Payment # Method” link, (depending on whether there are other cards present). @@ -431,8 +431,8 @@ def change_subscription_default_payment_profile(subscription_id, .execute end - # This will change the default payment profile on the subscription group to - # the existing payment profile with the id specified. + # Changes the default payment profile on the subscription group to the + # existing payment profile with the specified ID. # You must elect to change the existing payment profile to a new payment # profile ID in order to receive a satisfactory response from this endpoint. # The new payment profile must belong to the subscription group's customer, @@ -466,8 +466,10 @@ def change_subscription_group_default_payment_profile(uid, .execute end - # One Time Tokens aka Advanced Billing Tokens house the credit card or ACH - # (Authorize.Net or Stripe only) data for a customer. + # Returns the one-time token data, including credit card or ACH details, + # associated with the provided token ID. One Time Tokens aka Advanced + # Billing Tokens house the credit card or ACH (Authorize.Net or Stripe only) + # data for a customer. # You can use One Time Tokens while creating a subscription or payment # profile instead of passing all bank account or credit card data directly # to a given API endpoint. @@ -496,8 +498,8 @@ def read_one_time_token(chargify_token) .execute end - # You can send a "request payment update" email to the customer associated - # with the subscription. + # Sends a "request payment update" email to the customer associated with the + # subscription. # If you attempt to send a "request payment update" email more than five # times within a 30-minute period, you will receive a `422` response with an # error message in the body. This error message will indicate that the diff --git a/lib/advanced_billing/controllers/product_families_controller.rb b/lib/advanced_billing/controllers/product_families_controller.rb index 22e5cd03..51a0f609 100644 --- a/lib/advanced_billing/controllers/product_families_controller.rb +++ b/lib/advanced_billing/controllers/product_families_controller.rb @@ -45,7 +45,7 @@ class ProductFamiliesController < BaseController # 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. # @param [TrueClass | FalseClass] include_archived Optional parameter: - # Include archived products + # Include archived products. # @param [ListProductsInclude] include Optional parameter: Allows including # additional data in the response. Use in query # `include=prepaid_product_price_point`. @@ -81,9 +81,8 @@ def list_products_for_product_family(options = {}) .execute end - # Creates a Product Family within your Advanced Billing site. Create a - # Product Family to act as a container for your products, components, and - # coupons. + # Creates a Product Family within your site. Create a Product Family to act + # as a container for your products, components, and coupons. # Full documentation on how Product Families operate within the Advanced # Billing UI can be located # [here](https://maxio.zendesk.com/hc/en-us/articles/24261098936205-Product- @@ -111,7 +110,7 @@ def create_product_family(body: nil) .execute end - # Returns a list of Product Families for a site. + # Lists Product Families for a site. # @param [BasicDateField] date_field Optional parameter: The type of filter # you would like to apply to your search. Use in query: # `date_field=created_at`. diff --git a/lib/advanced_billing/controllers/product_price_points_controller.rb b/lib/advanced_billing/controllers/product_price_points_controller.rb index 0e60ed7f..6171a9bc 100644 --- a/lib/advanced_billing/controllers/product_price_points_controller.rb +++ b/lib/advanced_billing/controllers/product_price_points_controller.rb @@ -58,13 +58,13 @@ def create_product_price_point(product_id, # 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. - # @param [TrueClass | FalseClass] currency_prices Optional parameter: 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. + # @param [TrueClass | FalseClass] currency_prices Optional parameter: + # (Optional) If you have defined multiple currencies at the site level, you + # can pass ?currency_prices=true 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. # @param [Array[PricePointType]] filter_type Optional parameter: Use in # query: `filter[type]=catalog,default`. # @param [TrueClass | FalseClass] archived Optional parameter: Set to @@ -151,13 +151,13 @@ def update_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. - # @param [TrueClass | FalseClass] currency_prices Optional parameter: 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. + # @param [TrueClass | FalseClass] currency_prices Optional parameter: + # (Optional) If you have defined multiple currencies at the site level, you + # can pass ?currency_prices=true 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. # @return [ProductPricePointResponse] Response from the API call. def read_product_price_point(product_id, price_point_id, diff --git a/lib/advanced_billing/controllers/products_controller.rb b/lib/advanced_billing/controllers/products_controller.rb index 8f187212..44352d64 100644 --- a/lib/advanced_billing/controllers/products_controller.rb +++ b/lib/advanced_billing/controllers/products_controller.rb @@ -6,11 +6,16 @@ module AdvancedBilling # ProductsController class ProductsController < BaseController - # Creates a product in your Advanced Billing site. - # See the following product documentation for more information: + # Creates a product in your site. + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, the `auto_create_signup_page` parameter is + # not supported. If `auto_create_signup_page` is included (with any value) + # an error is returned. + # For more information, see: # + [Products - # Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261090117645- - # Products-Overview) + # Overview](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Produ + # cts-Overview) # + [Changing a Subscription's # Product](https://maxio.zendesk.com/hc/en-us/articles/24252069837581-Produc # t-Changes-and-Migrations) diff --git a/lib/advanced_billing/controllers/proforma_invoices_controller.rb b/lib/advanced_billing/controllers/proforma_invoices_controller.rb index 18452efb..6e1c624f 100644 --- a/lib/advanced_billing/controllers/proforma_invoices_controller.rb +++ b/lib/advanced_billing/controllers/proforma_invoices_controller.rb @@ -6,11 +6,10 @@ module AdvancedBilling # ProformaInvoicesController class ProformaInvoicesController < BaseController - # Creates a consolidated proforma invoice asynchronously. It will return a - # 201 with no message, or a 422 with any errors. To find and view the new - # consolidated proforma invoice, you may poll the subscription group listing - # for proforma invoices; only one consolidated proforma invoice may be - # created per group at a time. + # Creates a consolidated proforma invoice asynchronously. To find and view + # the new consolidated proforma invoice, you can poll the subscription group + # listing for proforma invoices; only one consolidated proforma invoice can + # be created per group at a time. # If the information becomes outdated, simply void the old consolidated # proforma invoice and generate a new one. # ## Restrictions @@ -47,17 +46,17 @@ def create_consolidated_proforma_invoice(uid) # @param [String] uid Required parameter: The uid of the subscription # group # @param [TrueClass | FalseClass] line_items Optional parameter: Include - # line items data + # line items data. # @param [TrueClass | FalseClass] discounts Optional parameter: Include - # discounts data + # discounts data. # @param [TrueClass | FalseClass] taxes Optional parameter: Include taxes - # data + # data. # @param [TrueClass | FalseClass] credits Optional parameter: Include - # credits data + # credits data. # @param [TrueClass | FalseClass] payments Optional parameter: Include - # payments data + # payments data. # @param [TrueClass | FalseClass] custom_fields Optional parameter: Include - # custom fields data + # custom fields data. # @return [ListProformaInvoicesResponse] Response from the API call. def list_subscription_group_proforma_invoices(options = {}) @api_call @@ -168,17 +167,17 @@ def create_proforma_invoice(subscription_id) # @param [Direction] direction Optional parameter: The sort direction of the # returned invoices. # @param [TrueClass | FalseClass] line_items Optional parameter: Include - # line items data + # line items data. # @param [TrueClass | FalseClass] discounts Optional parameter: Include - # discounts data + # discounts data. # @param [TrueClass | FalseClass] taxes Optional parameter: Include taxes - # data + # data. # @param [TrueClass | FalseClass] credits Optional parameter: Include - # credits data + # credits data. # @param [TrueClass | FalseClass] payments Optional parameter: Include - # payments data + # payments data. # @param [TrueClass | FalseClass] custom_fields Optional parameter: Include - # custom fields data + # custom fields data. # @return [ListProformaInvoicesResponse] Response from the API call. def list_proforma_invoices(options = {}) @api_call @@ -289,12 +288,12 @@ def void_proforma_invoice(proforma_invoice_uid, .execute end - # Returns a preview of the data that will be included on a given - # subscription's proforma invoice if one were to be generated. It will have - # similar line items and totals as a renewal preview, but the response will - # be presented in the format of a proforma invoice. Consequently it will - # include additional information such as the name and addresses that will - # appear on the proforma invoice. + # Previews the data that will be included on a given subscription's proforma + # invoice if one were to be generated. It will have similar line items and + # totals as a renewal preview, but the response will be presented in the + # format of a proforma invoice. Consequently it will include additional + # information such as the name and addresses that will appear on the + # proforma invoice. # The preview endpoint is subject to all the same conditions as the proforma # invoice endpoint. For example, previews are only available on the # Relationship Invoicing architecture, and previews cannot be made for diff --git a/lib/advanced_billing/controllers/reason_codes_controller.rb b/lib/advanced_billing/controllers/reason_codes_controller.rb index e26fdace..591309fe 100644 --- a/lib/advanced_billing/controllers/reason_codes_controller.rb +++ b/lib/advanced_billing/controllers/reason_codes_controller.rb @@ -7,21 +7,14 @@ module AdvancedBilling # ReasonCodesController class ReasonCodesController < BaseController # Creates a reason code for a given site. - # # Reason Codes Intro # Reason Codes 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. - # ## Reason Code Documentation - # Full documentation on how Reason Codes operate within Advanced Billing can - # be located under the following links. - # [Churn Reason + # For more information, see [Churn Reason # Codes](https://maxio.zendesk.com/hc/en-us/articles/24286647554701-Churn-Re - # ason-Codes) - # ## Create Reason Code - # This method gives a merchant the option to create reason codes for a given - # site. + # ason-Codes). # @param [CreateReasonCodeRequest] body Optional parameter: TODO: type # description here # @return [ReasonCodeResponse] Response from the API call. diff --git a/lib/advanced_billing/controllers/referral_codes_controller.rb b/lib/advanced_billing/controllers/referral_codes_controller.rb index 6660815a..9c7fa247 100644 --- a/lib/advanced_billing/controllers/referral_codes_controller.rb +++ b/lib/advanced_billing/controllers/referral_codes_controller.rb @@ -9,15 +9,9 @@ class ReferralCodesController < BaseController # Validates whether a referral code is valid and applicable within your # site. This method is useful for validating referral codes that are entered # by a customer. - # ## Referrals Documentation - # Full documentation on how to use the referrals feature in the Advanced - # Billing UI can be located - # [here](https://maxio.zendesk.com/hc/en-us/sections/24286965611405-Referral - # s). - # ## Server Response - # If the referral code is valid the status code will be `200` and the - # referral code will be returned. If the referral code is invalid, a `404` - # response will be returned. + # For more information, see [Understanding + # Referrals](https://docs.maxio.com/hc/en-us/articles/24286981223693-Underst + # anding-Referrals) in the product documentation. # @param [String] code Required parameter: The referral code you are trying # to validate # @return [ReferralValidationResponse] Response from the API call. diff --git a/lib/advanced_billing/controllers/sales_commissions_controller.rb b/lib/advanced_billing/controllers/sales_commissions_controller.rb index 94b3fbd3..09732d43 100644 --- a/lib/advanced_billing/controllers/sales_commissions_controller.rb +++ b/lib/advanced_billing/controllers/sales_commissions_controller.rb @@ -22,7 +22,7 @@ class SalesCommissionsController < BaseController # enabled. For further information on getting access to Advanced Analytics # contact Maxio support. # > Note: The request is at seller level, it means `<>` variable - # will be replaced by `app` + # will be replaced by `app`. # @param [String] seller_id Required parameter: The Chargify id of your # seller account # @param [String] authorization Optional parameter: For authorization use @@ -63,7 +63,7 @@ def list_sales_commission_settings(options = {}) .execute end - # Returns a sales rep list with details. + # Lists sales reps with details. # ## Modified Authentication Process # The Sales Commission API differs from other Chargify API endpoints. This # resource is associated with the seller itself. Up to now all available @@ -79,7 +79,7 @@ def list_sales_commission_settings(options = {}) # enabled. For further information on getting access to Advanced Analytics # contact Maxio support. # > Note: The request is at seller level, it means `<>` variable - # will be replaced by `app` + # will be replaced by `app`. # @param [String] seller_id Required parameter: The Chargify id of your # seller account # @param [String] authorization Optional parameter: For authorization use @@ -136,7 +136,7 @@ def list_sales_reps(options = {}) # enabled. For further information on getting access to Advanced Analytics # contact Maxio support. # > Note: The request is at seller level, it means `<>` variable - # will be replaced by `app` + # will be replaced by `app`. # @param [String] seller_id Required parameter: The Chargify id of your # seller account # @param [String] sales_rep_id Required parameter: The Advanced Billing id diff --git a/lib/advanced_billing/controllers/sites_controller.rb b/lib/advanced_billing/controllers/sites_controller.rb index 3d9475d5..8f2620ae 100644 --- a/lib/advanced_billing/controllers/sites_controller.rb +++ b/lib/advanced_billing/controllers/sites_controller.rb @@ -7,20 +7,22 @@ module AdvancedBilling # SitesController class SitesController < BaseController # Retrieves site data. - # Full documentation on Sites in the Advanced Billing UI can be located - # [here](https://maxio.zendesk.com/hc/en-us/sections/24250550707085-Sites). - # Specifically, the [Clearing Site + # For more information, see + # [Sites](https://maxio.zendesk.com/hc/en-us/sections/24250550707085-Sites) + # in the product documentation. Specifically, the [Clearing Site # Data](https://maxio.zendesk.com/hc/en-us/articles/24250617028365-Clearing- - # Site-Data) section is relevant to this endpoint documentation. + # Site-Data) section is relevant to this endpoint. # #### Relationship invoicing enabled - # If the site has RI enabled then you will see more settings like: - # "customer_hierarchy_enabled": true, - # "whopays_enabled": true, - # "whopays_default_payer": "self" - # You can read more about these settings here: - # [Who Pays & Customer + # If the site has Relationship invoicing enabled, additional properties are + # returned in the response: + # ``` + # "customer_hierarchy_enabled": true, + # "whopays_enabled": true, + # "whopays_default_payer": "self" + # ``` + # For more information, see [Who Pays & Customer # Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Cust - # omer-Hierarchies-WhoPays) + # omer-Hierarchies-WhoPays). # @return [SiteResponse] Response from the API call. def read_site @api_call @@ -61,7 +63,7 @@ def clear_site(cleanup_scope: CleanupScope::ALL) .execute end - # Returns public keys used for Maxio.js (formerly Chargify.js). + # Lists public keys used for Maxio.js (formerly Chargify.js). # @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 diff --git a/lib/advanced_billing/controllers/subscription_components_controller.rb b/lib/advanced_billing/controllers/subscription_components_controller.rb index fa2faa74..c3fd7fca 100644 --- a/lib/advanced_billing/controllers/subscription_components_controller.rb +++ b/lib/advanced_billing/controllers/subscription_components_controller.rb @@ -239,7 +239,7 @@ def allocate_component(subscription_id, .execute end - # Returns the 50 most recent Allocations, ordered by most recent first. + # Lists the 50 most recent Allocations, ordered by most recent first. # ## On/Off Components # When a subscription's on/off component has been toggled to on (`1`) or off # (`0`), usage will be logged in this response. @@ -608,9 +608,9 @@ def create_usage(subscription_id_or_reference, .execute end - # Returns a list of usages associated with a subscription for a particular - # metered component. This will display the previously recorded components - # for a subscription. + # Lists usages associated with a subscription for a particular metered + # component. This will display the previously recorded components for a + # subscription. # This endpoint is not compatible with quantity-based components. # ## Since Date and Until Date Usage # Note: The `since_date` and `until_date` attributes each default to @@ -635,9 +635,9 @@ def create_usage(subscription_id_or_reference, # Advanced Billing id for the component or the component's handle prefixed # by `handle:` # @param [Integer] since_id Optional parameter: Returns usages with an id - # greater than or equal to the one specified + # greater than or equal to the one specified. # @param [Integer] max_id Optional parameter: Returns usages with an id less - # than or equal to the one specified + # than or equal to the one specified. # @param [Date] since_date Optional parameter: Returns usages with a # created_at date greater than or equal to midnight (12:00 AM) on the date # specified. @@ -691,19 +691,18 @@ def list_usages(options = {}) end # Activates an event-based component for a single subscription. - # In order to bill your subscribers on your Events data under the - # Events-Based Billing feature, the components must be activated for the - # subscriber. - # Learn more about the role of activation in the [Events-Based Billing - # docs](https://maxio.zendesk.com/hc/en-us/articles/24260323329805-Events-Ba - # sed-Billing-Overview). + # To bill your subscribers on your Events data under the Events-Based + # Billing feature, the components must be activated for the subscriber. + # For more information, see [Design Your + # Catalog](https://docs.maxio.com/hc/en-us/articles/24181036583053-Design-Yo + # ur-Catalog?method=componenttypes). # Use this endpoint to activate an event-based component for a single - # subscription. Activating an event-based component causes Advanced Billing - # to bill for events when the subscription is renewed. - # *Note: it is possible to stream events for a subscription at any time, + # subscription. Activating an event-based component causes billing for + # events when the subscription is renewed. + # Note: it is possible to stream events for a subscription at any time, # regardless of component activation status. The activation status only # determines if the subscription should be billed for event-based component - # usage at renewal.* + # usage at renewal. # @param [Integer] subscription_id Required parameter: The Advanced Billing # id of the subscription # @param [Integer] component_id Required parameter: The Advanced Billing id @@ -760,7 +759,6 @@ def deactivate_event_based_component(subscription_id, end # Records a single event for Events-Based Billing. - # ## Documentation # Events-Based Billing is an evolved form of metered billing that is based # on data-rich events streamed in real-time from your system to Advanced # Billing. @@ -768,14 +766,11 @@ def deactivate_event_based_component(subscription_id, # computed totals of usage charges billed to your customers. # This API allows you to stream events into the Advanced Billing data # ingestion engine. - # Learn more about the feature in general in the [Events-Based Billing help - # docs](https://maxio.zendesk.com/hc/en-us/articles/24260323329805-Events-Ba - # sed-Billing-Overview). - # ## Record Event - # Use this endpoint to record a single event. - # *Note: this endpoint differs from the standard Chargify API endpoints in - # that the URL subdomain will be `events` and your site subdomain will be - # included in the URL path. For example:* + # For more information, see [Design Your + # Catalog](https://docs.maxio.com/hc/en-us/articles/24181036583053-Design-Yo + # ur-Catalog?method=componenttypes). + # Note: this endpoint differs from the standard URL for this API in that + # `events` and your site subdomain are included in the path. For example: # ``` # https://events.chargify.com/my-site-subdomain/events/my-stream-api-handle # ``` @@ -783,7 +778,8 @@ def deactivate_event_based_component(subscription_id, # which the event should be published. # @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. + # to indicate the data-store. This applies to Legacy Metering sites only — + # it has no effect on Maxio Metering sites. # @param [EBBEvent] body Optional parameter: TODO: type description here # @return [void] Response from the API call. def record_event(api_handle, @@ -807,16 +803,16 @@ def record_event(api_handle, end # Records a collection of events. - # *Note: this endpoint differs from the standard Chargify API endpoints in - # that the subdomain will be `events` and your site subdomain will be - # included in the URL path.* + # Note: this endpoint differs from the standard URL for this API in that + # `events` and your site subdomain are included in the path. # A maximum of 1000 events can be published in a single request. A 422 will # be returned if this limit is exceeded. # @param [String] api_handle Required parameter: Identifies the Stream for # which the events should be published. # @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. + # to indicate the data-store. This applies to Legacy Metering sites only — + # it has no effect on Maxio Metering sites. # @param [Array[EBBEvent]] body Optional parameter: TODO: type description # here # @return [void] Response from the API call. diff --git a/lib/advanced_billing/controllers/subscription_groups_controller.rb b/lib/advanced_billing/controllers/subscription_groups_controller.rb index ea30b653..ce52a6da 100644 --- a/lib/advanced_billing/controllers/subscription_groups_controller.rb +++ b/lib/advanced_billing/controllers/subscription_groups_controller.rb @@ -70,8 +70,8 @@ def create_subscription_group(body: nil) .execute end - # Returns an array of subscription groups for the site. The response is - # paginated and will return a `meta` key with pagination information. + # Lists subscription groups for the site. The response is paginated and will + # return a `meta` key with pagination information. # #### Account Balance Information # Account balance information for the subscription groups is not returned by # default. If this information is desired, the `include[]=account_balances` @@ -199,8 +199,7 @@ def delete_subscription_group(uid) end # Finds the subscription group associated with a subscription. - # If the subscription is not in a group, the endpoint will return a 404 - # code. + # If the subscription is not in a group, this endpoint returns an error. # @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. @@ -222,7 +221,8 @@ def find_subscription_group(subscription_id) .execute end - # For sites making use of the [Relationship + # Adds an existing subscription to a subscription group. For sites making + # use of the [Relationship # Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanc # ed-Billing-Invoices-Overview) and [Customer # Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Cust @@ -277,7 +277,8 @@ def add_subscription_to_group(subscription_id, .execute end - # For sites making use of the [Relationship + # Removes an existing subscription from a subscription group. For sites + # making use of the [Relationship # Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanc # ed-Billing-Invoices-Overview) and [Customer # Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Cust diff --git a/lib/advanced_billing/controllers/subscription_notes_controller.rb b/lib/advanced_billing/controllers/subscription_notes_controller.rb index 0b43c6e0..e9a80073 100644 --- a/lib/advanced_billing/controllers/subscription_notes_controller.rb +++ b/lib/advanced_billing/controllers/subscription_notes_controller.rb @@ -7,15 +7,15 @@ module AdvancedBilling # SubscriptionNotesController class SubscriptionNotesController < BaseController # Creates a note for a subscription. - # ## How to Use Subscription Notes # Notes allow you to record information about a particular Subscription in a # free text format. # If you have structured data such as birth date, color, etc., consider - # using Metadata instead. - # Full documentation on how to use Notes in the Advanced Billing UI can be - # located - # [here](https://maxio.zendesk.com/hc/en-us/articles/24251712214413-Subscrip - # tion-Summary-Overview). + # using [Metadata]($e/Custom%20Fields/createMetadata) instead. + # For more information, see [Adding + # Notes](https://docs.maxio.com/hc/en-us/articles/24251654953997-Understandi + # ng-the-Subscription-Summary-Page#billing-portal-status:~:text=documentatio + # n%20for%20more.-,Adding%20Notes,-Notes%20are%20optional) in the product + # documentation. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [UpdateSubscriptionNoteRequest] body Optional parameter: TODO: type diff --git a/lib/advanced_billing/controllers/subscription_products_controller.rb b/lib/advanced_billing/controllers/subscription_products_controller.rb index 8ab5ac51..cb3952df 100644 --- a/lib/advanced_billing/controllers/subscription_products_controller.rb +++ b/lib/advanced_billing/controllers/subscription_products_controller.rb @@ -7,25 +7,23 @@ module AdvancedBilling # SubscriptionProductsController class SubscriptionProductsController < BaseController # Migrates a subscription to a different product. - # In order to create a migration, you must pass the `product_id` or - # `product_handle` in the object when you send a POST request. You may also - # pass either a `product_price_point_id` or `product_price_point_handle` to - # choose which price point the subscription is moved to. If no price point - # identifier is passed the subscription will be moved to the products - # default price point. The response will be the updated subscription. + # To create a migration, you must pass the `product_id` or `product_handle` + # in the object when you send a POST request. You can also pass either a + # `product_price_point_id` or `product_price_point_handle` to choose which + # price point the subscription is moved to. If no price point identifier is + # passed, the subscription is moved to the product's default price point. + # The response is the updated subscription. # ## Valid Subscriptions - # Subscriptions should be in the `active` or `trialing` state in order to be + # Subscriptions should be in the `active` or `trialing` state to be # migrated. # (For backwards compatibility reasons, it is possible to migrate a # subscription that is in the `trial_ended` state via the API, however this # is not recommended. Since `trial_ended` is an end-of-life state, the # subscription should be canceled, the product changed, and then the # subscription can be reactivated.) - # ## Migrations Documentation - # Full documentation on how to record Migrations in the Advanced Billing UI - # can be located - # [here](https://maxio.zendesk.com/hc/en-us/articles/24181589372429-Data-Mig - # ration-to-Advanced-Billing). + # For more information, see [Product Changes and + # Migrations](https://docs.maxio.com/hc/en-us/articles/24252069837581-Produc + # t-Changes-and-Migrations). # ## Failed Migrations # Important note: One of the most common ways that a migration can fail is # when the attempt is made to migrate a subscription to its current product. diff --git a/lib/advanced_billing/controllers/subscription_renewals_controller.rb b/lib/advanced_billing/controllers/subscription_renewals_controller.rb index 8871b743..ffe9c3d6 100644 --- a/lib/advanced_billing/controllers/subscription_renewals_controller.rb +++ b/lib/advanced_billing/controllers/subscription_renewals_controller.rb @@ -183,7 +183,7 @@ def lock_in_scheduled_renewal_immediately(subscription_id, .execute end - # Returns a scheduled renewal configuration to an editable state. + # Restores a scheduled renewal configuration to an editable state. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [Integer] id Required parameter: The renewal id. @@ -240,6 +240,12 @@ def cancel_scheduled_renewal_configuration(subscription_id, end # Adds product and component line items to the scheduled renewal. + # If your site has list vs sales pricing enabled, accepts + # renewal_configuration_item.custom_price.list_price_point_id, validates and + # persists it; omitted value follows existing/default behavior; with list vs + # sales pricing disabled, parameter is ignored (no validation/behavioral + # impact). This functionality is supported in the API, but is not currently + # supported in SDKs. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [Integer] scheduled_renewals_configuration_id Required parameter: @@ -275,6 +281,12 @@ def create_scheduled_renewal_configuration_item(subscription_id, end # Updates an existing configuration item’s pricing and quantity. + # If you site has list vs sales pricing enabled, accepts + # renewal_configuration_item.custom_price.list_price_point_id, validates and + # persists it; omitted value follows existing/default behavior; with list vs + # sales pricing disabled, parameter is ignored (no validation/behavioral + # impact). This functionality is supported in the API, but is not currently + # supported in SDKs. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [Integer] scheduled_renewals_configuration_id Required parameter: diff --git a/lib/advanced_billing/controllers/subscription_status_controller.rb b/lib/advanced_billing/controllers/subscription_status_controller.rb index 275283a3..70dae7bd 100644 --- a/lib/advanced_billing/controllers/subscription_status_controller.rb +++ b/lib/advanced_billing/controllers/subscription_status_controller.rb @@ -450,33 +450,33 @@ def cancel_dunning(subscription_id) # to see a snapshot of how much your customer will be charged on their next # renewal. # The "Next Billing" amount and "Next Billing" date are already represented - # in the UI on each Subscriber's Summary. For more information, see our - # documentation - # [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscrib - # er-Interface-Overview). + # in the UI on each Subscriber's Summary. For more information, see + # [Subscriber Interface + # Overview](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subsc + # riber-Interface-Overview). # ## Optional Component Fields - # This endpoint is particularly useful due to the fact that it will return - # the computed billing amount for the base product and the components which - # are in use by a subscriber. - # By default, the preview will include billing details for all components - # _at their **current** quantities_. This means: + # This endpoint is particularly useful because it returns the computed + # billing amount for the base product and the components which are in use by + # a subscriber. + # By default, the preview includes billing details for all components _at + # their **current** quantities_. This means: # * Current `allocated_quantity` for quantity-based components # * Current enabled/disabled status for on/off components # * Current metered usage `unit_balance` for metered components # * Current metric quantity value for events recorded thus far for # events-based components # In the above statements, "current" means the quantity or value as of the - # call to the renewal preview endpoint. We do not predict end-of-period - # values for components, so metered or events-based usage may be less than - # it will eventually be at the end of the period. - # Optionally, **you may provide your own custom quantities** for any + # call to the renewal preview endpoint. End-of-period values for components + # are not predicted, so metered or events-based usage may be less than it + # will eventually be at the end of the period. + # Optionally, **you can provide your own custom quantities** for any # component to see a billing preview for non-current quantities. This is # accomplished by sending a request body with data under the `components` # key. See the request body documentation below. - # ## Subscription Side Effects - # You can request a `POST` to obtain this data from the endpoint without any - # side effects. This method allows you to preview data, but does not log any - # changes against a subscription. + # ## Preview Behavior + # Sending a `POST` request to this endpoint returns preview data without + # modifying the subscription. This method previews data, but does not log + # any changes against a subscription. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [RenewalPreviewRequest] body Optional parameter: TODO: type diff --git a/lib/advanced_billing/controllers/subscriptions_controller.rb b/lib/advanced_billing/controllers/subscriptions_controller.rb index a544a46d..ed9297e1 100644 --- a/lib/advanced_billing/controllers/subscriptions_controller.rb +++ b/lib/advanced_billing/controllers/subscriptions_controller.rb @@ -16,6 +16,61 @@ class SubscriptionsController < BaseController # Select an option from the **Request Examples** drop-down on the right side # of the portal to see examples of common scenarios for creating # subscriptions. + # ## List vs Sales Pricing + # When a subscription uses custom pricing as the sales price, you can + # optionally provide a list price for any item. If omitted, the list price + # defaults to the sales price. The difference between the list price and + # sales price is used to calculate implicit discounts, which appear on + # Invoices and in reporting. List price can also support revenue allocations + # in [Advanced + # Revenue](https://docs.maxio.com/hc/en-us/articles/24177001342861-Create-an + # d-Configure-RevenueBooks). + # If your site has list pricing enabled, the API accepts + # `custom_price.list_price_point_id` for custom pricing, validates and + # persists it, and returns list price metadata in subscription responses. If + # list pricing is disabled, this input is ignored and related response + # fields are omitted. + # When list pricing is enabled: + # - Subscription → Product `product_price_point_list_price_point_id` + # (integer) + # - `product_price_point_list_price_point_handle` (string) + # - Subscription Components (when components are included in the response, + # such as with subscriptions built from components or component + # serialization paths) `component_id` (integer) + # - `price_point_id` (integer) + # - `list_price_point_id` (integer) + # When list pricing is disabled: + # - Subscription → Product `product_price_point_list_price_point_id`: + # omitted + # - `product_price_point_list_price_point_handle`: omitted + # - Subscription Components `list_price_point_id`: omitted + # This functionality is supported in the API, but is not currently supported + # in SDKs. + # ## Subscriptions can now work independently from the catalog + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, you can create subscriptions without a + # `product_id` or `product_handle` using POST /subscriptions, building them + # entirely from components. + # A valid subscription must include at least one active component with: + # - a positive `allocated_quantity`, + # - a positive `unit_balance`, or + # - 'enabled: true' (for on/off components) + # - a configured metered component + # `component_id` can be provided as a numeric ID or in handle: format. If + # `trial_interval` and `trial_interval_unit` are included, they are applied + # at creation. + # In the response, product and product price point fields are null, and + # component details are returned instead. + # This functionality is supported in the API, but is not currently supported + # in SDKs. + # ## Payment information + # Payment information may be required to create a subscription, depending on + # the options for the Product being subscribed. See [product + # options](https://docs.maxio.com/hc/en-us/articles/24261076617869-Edit-Prod + # ucts) for more information. See the [Payments + # Profile]($e/Payment%20Profiles/createPaymentProfile) endpoint for details + # on payment parameters. # See the [Subscription # Signups](page:introduction/basic-concepts/subscription-signup) article for # more information on working with subscriptions in Advanced Billing. @@ -70,9 +125,14 @@ def create_subscription(body: nil) .execute end - # Returns an array of subscriptions from a Site. Pay close attention to - # query string filters and pagination in order to control responses from the - # server. + # Lists subscriptions for a site. Use the query string filters and + # pagination to control responses from the server. + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, some subscriptions may not have an + # associated product. For subscriptions without an associated product, + # 'product', 'product_price_point_id', and 'product_price_point_type' are + # returned as 'null'. # ## Search for a subscription # Use the query strings below to search for a subscription using the # criteria available. The return value will be an array. @@ -91,17 +151,34 @@ def create_subscription(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`. + # @param [SubscriptionSort] sort Optional parameter: The attribute by which + # to sort + # @param [SortingDirection] direction Optional parameter: Controls the order + # in which results are returned. Use in query `direction=asc`. # @param [SubscriptionStateFilter] state Optional parameter: The current # state of the subscription - # @param [Integer] product Optional parameter: The product id of the - # subscription. (Note that the product handle cannot be used.) + # @param [Integer | String | nil] product Optional parameter: Filter + # subscriptions by product. Accepts product ID or exact product name. + # Product handle is not supported. + # @param [String] q Optional parameter: Search string. + # @param [QScope] q_scope Optional parameter: Scope of fields used by the q + # search. + # @param [Integer] customer_id Optional parameter: The Advanced Billing id + # of the customer. # @param [Integer] product_price_point_id Optional parameter: The ID of the - # product price point. If supplied, product is required + # product price point. If supplied, product is required. # @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 [CollectionMethod1] collection_method Optional parameter: The + # collection method for the subscription. + # @param [Integer] branding_theme_id Optional parameter: Filter + # subscriptions by the ID of an assigned Branding Theme. Branding Themes is + # a beta feature. See [Understand Branding + # Themes](https://docs.maxio.com/hc/en-us/articles/43796895662093-Understand + # -Branding-Themes#understand-branding-themes-0-0) for more information. # @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, @@ -130,10 +207,14 @@ def create_subscription(body: nil) # @param [Hash[String, String]] metadata Optional parameter: The value of # the metadata field specified in the parameter. Use in query # `metadata[my-field]=value&metadata[other-field]=another_value`. - # @param [SortingDirection] direction Optional parameter: Controls the order - # in which results are returned. Use in query `direction=asc`. - # @param [SubscriptionSort] sort Optional parameter: The attribute by which - # to sort + # @param [GroupStatus] group_status Optional parameter: Filter by whether a + # subscription is in a group. + # @param [TrueClass | FalseClass] dunning_exemption Optional parameter: + # Filter by dunning exemption status. + # @param [String] payment_gateways Optional parameter: Comma-separated + # payment gateway identifiers. + # @param [String] currencies Optional parameter: Comma-separated currency + # codes. # @param [Array[SubscriptionListInclude]] include Optional parameter: Allows # including additional data in the response. Use in query: # `include[]=self_service_page_token`. @@ -145,19 +226,32 @@ def list_subscriptions(options = {}) Server::PRODUCTION) .query_param(new_parameter(options['page'], key: 'page')) .query_param(new_parameter(options['per_page'], key: 'per_page')) + .query_param(new_parameter(options['sort'], key: 'sort')) + .query_param(new_parameter(options['direction'], key: 'direction')) .query_param(new_parameter(options['state'], key: 'state')) - .query_param(new_parameter(options['product'], key: 'product')) + .query_param(new_parameter(options['product'], key: 'product') + .validator(proc do |value| + UnionTypeLookUp.get(:ListSubscriptionsInputProduct) + .validate(value) + end)) + .query_param(new_parameter(options['q'], key: 'q')) + .query_param(new_parameter(options['q_scope'], key: 'q_scope')) + .query_param(new_parameter(options['customer_id'], key: 'customer_id')) .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['collection_method'], key: 'collection_method')) + .query_param(new_parameter(options['branding_theme_id'], key: 'branding_theme_id')) .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')) .query_param(new_parameter(options['start_datetime'], key: 'start_datetime')) .query_param(new_parameter(options['end_datetime'], key: 'end_datetime')) .query_param(new_parameter(options['metadata'], key: 'metadata')) - .query_param(new_parameter(options['direction'], key: 'direction')) - .query_param(new_parameter(options['sort'], key: 'sort')) + .query_param(new_parameter(options['group_status'], key: 'group_status')) + .query_param(new_parameter(options['dunning_exemption'], key: 'dunning_exemption')) + .query_param(new_parameter(options['payment_gateways'], key: 'payment_gateways')) + .query_param(new_parameter(options['currencies'], key: 'currencies')) .query_param(new_parameter(options['include'], key: 'include')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('BasicAuth')) @@ -237,10 +331,16 @@ def list_subscriptions(options = {}) # billing date for **a subscription using a product eligible for calendar # billing**. # > Note: If you change the product associated with a subscription that - # contains a `snap_day` and immediately `READ/GET` the subscription data, it - # will still contain original `snap_day`. The `snap_day` will reset to null - # on the next billing cycle. This is because a product change is + # contains a `snap_day` and immediately READ/GET the subscription data, it + # will still contain the original `snap_day`. The `snap_day` will be reset + # to `null` on the next billing cycle. This is because a product change is # instantaneous and only affects the product associated with a subscription. + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, some subscriptions may not have an + # associated product. For subscriptions without an associated product, + # `product`, `product_price_point_id`, and `product_price_point_type` are + # returned as `null`. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [UpdateSubscriptionRequest] body Optional parameter: TODO: type @@ -271,6 +371,12 @@ def update_subscription(subscription_id, end # Retrieves subscription details. + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, some subscriptions may not have an + # associated product. For subscriptions without an associated product, + # 'product', 'product_price_point_id', and 'product_price_point_type' are + # returned as 'null'. # ## Self-Service Page token # Self-Service Page token for the subscription is not returned by default. # If this information is desired, the include[]=self_service_page_token @@ -379,7 +485,7 @@ def find_subscription(reference: nil) end # Purges an individual subscription for sites in test mode. - # Provide the subscription ID in the url. To confirm, supply the customer + # Provide the subscription ID in the URL. To confirm, supply the customer # ID in the query string `ack` parameter. You may also delete the customer # record and/or payment profiles by passing `cascade` parameters. For # example, to delete just the customer record, the query params would be: @@ -456,36 +562,50 @@ def update_prepaid_subscription_configuration(subscription_id, # subscription creation. # The "Next Billing" amount and "Next Billing" date are represented in each # Subscriber's Summary. - # A subscription will not be created by utilizing this endpoint; it is meant - # to serve as a prediction. - # For more information, see our documentation - # [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscrib - # er-Interface-Overview). + # This endpoint does not create a subscription; it is meant to serve as a + # prediction. + # For more information, see [Subscriber Interface + # Overview](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subsc + # riber-Interface-Overview). + # ## Subscriptions can now work independently from the catalog + # If you have the new [Catalog + # experience](page:help/announcements/2026-announcements#new-catalog-experie + # nce-and-terminology) enabled, you can create subscriptions without a + # `product_id` or `product_handle` using POST /subscriptions, building them + # entirely from components. + # A valid subscription must include at least one active component with: + # - a positive `allocated_quantity`, + # - a positive `unit_balance`, or + # - 'enabled: true' (for on/off components) + # `component_id` can be provided as a numeric ID or in handle: format. If + # `trial_interval` and `trial_interval_unit` are included, they are applied + # at creation. + # In the response, product and product price point fields are null, and + # component details are returned instead. + # This functionality is supported in the API, but is not currently supported + # in SDKs. # ## Taxable Subscriptions - # This endpoint will preview taxes applicable to a purchase. In order for - # taxes to be previewed, the following conditions must be met: + # This endpoint previews taxes applicable to a purchase. For taxes to be + # previewed, the following conditions must be met: # + Taxes must be configured on the subscription # + The preview must be for the purchase of a taxable product or component, # or combination of the two. # + The subscription payload must contain a full billing or shipping address - # in order to calculate tax - # For more information about creating taxable previews, see our - # documentation guide on how to create [taxable - # subscriptions.](https://maxio.zendesk.com/hc/en-us/sections/24287012349325 - # -Taxes) + # to calculate tax + # For more information about creating taxable previews, see + # [Taxes](https://maxio.zendesk.com/hc/en-us/sections/24287012349325-Taxes). # You do **not** need to include a card number to generate tax information # when you are previewing a subscription. However, when you actually want to # create the subscription, you must include the credit card information if - # you want the billing address to be stored in Advanced Billing. The billing - # address and the credit card information are stored together within the - # payment profile object. Also, you may not send a billing address to - # Advanced Billing without payment profile information, as the address is - # stored on the card. + # you want the billing address to be stored. The billing address and the + # credit card information are stored together within the payment profile + # object. Also, you cannot send a billing address without payment profile + # information, as the address is stored on the card. # You can pass shipping and billing addresses and still decide not to # calculate taxes. To do that, pass `skip_billing_manifest_taxes: true` # attribute. # ## Non-taxable Subscriptions - # If you'd like to calculate subscriptions that do not include tax you may + # If you'd like to calculate subscriptions that do not include tax, you can # leave off the billing information. # @param [CreateSubscriptionRequest] body Optional parameter: TODO: type # description here @@ -555,9 +675,9 @@ def apply_coupons_to_subscription(subscription_id, # Removes a coupon from an existing subscription. # For more information on the expected behavior of removing a coupon from a - # subscription, see our documentation - # [here.](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons - # -and-Subscriptions#removing-a-coupon) + # subscription, see [Coupons and + # Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101- + # Coupons-and-Subscriptions#removing-a-coupon). # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [String] coupon_code Optional parameter: The coupon code @@ -586,23 +706,20 @@ def remove_coupon_from_subscription(subscription_id, # Activates awaiting signup and trialing subscriptions. This feature is only # available on the Relationship Invoicing architecture. Subscriptions in a - # group may not be activated immediately. - # For details on how the activation works, and how to activate subscriptions - # through the application, see [activation](#). + # group cannot be activated immediately. # The `revert_on_failure` parameter controls the behavior upon activation # failure. - # - If set to `true` and something goes wrong i.e. payment fails, then - # Advanced Billing will not change the subscription's state. The - # subscription’s billing period will also remain the same. - # - If set to `false` and something goes wrong i.e. payment fails, then - # Advanced Billing will continue through with the activation and enter an - # end of life state. For trialing subscriptions, that will either be trial - # ended (if the trial is no obligation), past due (if the trial has an - # obligation), or canceled (if the site has no dunning strategy, or has a - # strategy that says to cancel immediately). For awaiting signup - # subscriptions, that will always be canceled. + # - If set to `true` and something goes wrong i.e. payment fails, the + # subscription's state does not change. The subscription’s billing period + # also remains the same. + # - If set to `false` and something goes wrong i.e. payment fails, the + # activation continues and enters an end of life state. For trialing + # subscriptions, that is either trial ended (if the trial is no obligation), + # past due (if the trial has an obligation), or canceled (if the site has no + # dunning strategy, or has a strategy that says to cancel immediately). For + # awaiting signup subscriptions, that is always canceled. # The default activation failure behavior can be configured per activation - # attempt, or you may set a default value under Config > Settings > + # attempt, or you can set a default value under Config > Settings > # Subscription Activation Settings. # ## Activation Scenarios # ### Activate Awaiting Signup subscription @@ -627,13 +744,14 @@ def remove_coupon_from_subscription(subscription_id, # ROF -->|false| PD[Past Due] # ``` # ### Activate Trialing subscription - # You can read more about the behavior of trialing subscriptions - # [here](https://maxio.zendesk.com/hc/en-us/articles/24252155721869-Trialing - # -Subscriptions). + # For more information about the behavior of trialing subscriptions, see + # [Trialing + # Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24252155721869- + # Trialing-Subscriptions). # When the `revert_on_failure` parameter is set to `true`, the - # subscription's state will remain as Trialing, we will void the invoice - # from activation and return any prepayments and credits applied to the - # invoice back to the subscription. + # subscription's state remains Trialing; the invoice from activation is + # voided, and any prepayments and credits applied to the invoice are + # returned to the subscription. # @param [Integer] subscription_id Required parameter: The Chargify id of # the subscription. # @param [ActivateSubscriptionRequest] body Optional parameter: TODO: type diff --git a/lib/advanced_billing/controllers/webhooks_controller.rb b/lib/advanced_billing/controllers/webhooks_controller.rb index 3a731aa2..c3084141 100644 --- a/lib/advanced_billing/controllers/webhooks_controller.rb +++ b/lib/advanced_billing/controllers/webhooks_controller.rb @@ -126,7 +126,7 @@ def create_endpoint(body: nil) .execute end - # Returns created endpoints for a site. + # Lists endpoints configured for a site. # @return [Array[Endpoint]] Response from the API call. def list_endpoints @api_call diff --git a/lib/advanced_billing/models/account_balances.rb b/lib/advanced_billing/models/account_balances.rb index 4f22d0e8..1a851bd6 100644 --- a/lib/advanced_billing/models/account_balances.rb +++ b/lib/advanced_billing/models/account_balances.rb @@ -9,12 +9,12 @@ class AccountBalances < BaseModel SKIP = Object.new private_constant :SKIP - # The balance, in cents, of the sum of the subscription's open, payable + # The balance, in cents, of the sum of the subscription's open, payable # invoices. # @return [AccountBalance] attr_accessor :open_invoices - # The balance, in cents, of the sum of the subscription's pending, payable + # The balance, in cents, of the sum of the subscription's pending, payable # invoices. # @return [AccountBalance] attr_accessor :pending_invoices diff --git a/lib/advanced_billing/models/activate_subscription_request.rb b/lib/advanced_billing/models/activate_subscription_request.rb index 162cc951..65d87aad 100644 --- a/lib/advanced_billing/models/activate_subscription_request.rb +++ b/lib/advanced_billing/models/activate_subscription_request.rb @@ -10,10 +10,10 @@ class ActivateSubscriptionRequest < BaseModel private_constant :SKIP # You may choose how to handle the activation failure. `true` means do not - # change the subscription’s state and billing period. `false` means to - # continue through with the activation and enter an end of life state. If - # this parameter is omitted or `null` is passed it will default to value set - # in the site settings (default: `true`) + # change the subscription’s state and billing period. `false` means to + # continue through with the activation and enter an end-of-life state. If + # this parameter is omitted or `null` is passed it will default to the value + # set in the site settings (default: `true`). # @return [TrueClass | FalseClass] attr_accessor :revert_on_failure diff --git a/lib/advanced_billing/models/agreement_acceptance.rb b/lib/advanced_billing/models/agreement_acceptance.rb index ca0b0bcb..00cbc4a1 100644 --- a/lib/advanced_billing/models/agreement_acceptance.rb +++ b/lib/advanced_billing/models/agreement_acceptance.rb @@ -14,31 +14,31 @@ class AgreementAcceptance < BaseModel attr_accessor :ip_address # Required when creating a subscription with Maxio Payments. Either - # terms_url or provacy_policy_url required when providing + # terms_url or privacy_policy_url is required when providing # agreement_acceptance params. # @return [String] attr_accessor :terms_url # Required when creating a subscription with Maxio Payments. Either - # terms_url or provacy_policy_url required when providing + # terms_url or privacy_policy_url is required when providing # agreement_acceptance params. # @return [String] attr_accessor :privacy_policy_url # Required when creating a subscription with Maxio Payments. Either - # terms_url or provacy_policy_url required when providing + # terms_url or privacy_policy_url is required when providing # agreement_acceptance params. # @return [String] attr_accessor :return_refund_policy_url # Required when creating a subscription with Maxio Payments. Either - # terms_url or provacy_policy_url required when providing + # terms_url or privacy_policy_url is required when providing # agreement_acceptance params. # @return [String] attr_accessor :delivery_policy_url # Required when creating a subscription with Maxio Payments. Either - # terms_url or provacy_policy_url required when providing + # terms_url or privacy_policy_url is required when providing # agreement_acceptance params. # @return [String] attr_accessor :secure_checkout_policy_url diff --git a/lib/advanced_billing/models/allocate_components.rb b/lib/advanced_billing/models/allocate_components.rb index d29e0cbd..69067f25 100644 --- a/lib/advanced_billing/models/allocate_components.rb +++ b/lib/advanced_billing/models/allocate_components.rb @@ -36,7 +36,7 @@ class AllocateComponents < BaseModel attr_accessor :downgrade_credit # (Optional) If not passed, the allocation(s) will use the payment - # collection method on the subscription + # collection method on the subscription. # @return [CollectionMethod] attr_accessor :payment_collection_method diff --git a/lib/advanced_billing/models/allocation.rb b/lib/advanced_billing/models/allocation.rb index e183de74..cf1837a7 100644 --- a/lib/advanced_billing/models/allocation.rb +++ b/lib/advanced_billing/models/allocation.rb @@ -10,26 +10,26 @@ class Allocation < BaseModel SKIP = Object.new private_constant :SKIP - # The allocation unique id + # The allocation unique ID # @return [Integer] attr_accessor :allocation_id # The integer component ID for the allocation. This references a component - # that you have created in your Product setup + # that you have created in your Product setup. # @return [Integer] attr_accessor :component_id # The handle of the component. This references a component that you have - # created in your Product setup + # created in your Product setup. # @return [String] attr_accessor :component_handle # The integer subscription ID for the allocation. This references a unique - # subscription in your Site + # subscription in your Site. # @return [Integer] attr_accessor :subscription_id - # The allocated quantity set in to effect by the allocation. String for + # The allocated quantity set into effect by the allocation. String for # components supporting fractional quantities # @return [Object] attr_accessor :quantity @@ -43,8 +43,8 @@ class Allocation < BaseModel # @return [String] attr_accessor :memo - # The time that the allocation was recorded, in format and UTC timezone, - # i.e. 2012-11-20T22:00:37Z + # The time that the allocation was recorded, in ISO 8601 format and UTC + # timezone, e.g., 2012-11-20T22:00:37Z # @return [DateTime] attr_accessor :timestamp @@ -77,7 +77,7 @@ class Allocation < BaseModel # @return [String] attr_accessor :price_point_handle - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., an interval of ‘30’ coupled with an # interval_unit of day would mean this component price point would renew # every 30 days. This property is only available for sites with # Multifrequency enabled. diff --git a/lib/advanced_billing/models/allocation_preview_item.rb b/lib/advanced_billing/models/allocation_preview_item.rb index ab38538c..6dba7e7a 100644 --- a/lib/advanced_billing/models/allocation_preview_item.rb +++ b/lib/advanced_billing/models/allocation_preview_item.rb @@ -60,7 +60,7 @@ class AllocationPreviewItem < BaseModel # @return [Integer] attr_accessor :price_point_id - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., an interval of ‘30’ coupled with an # interval_unit of day would mean this component price point would renew # every 30 days. This property is only available for sites with # Multifrequency enabled. diff --git a/lib/advanced_billing/models/allocation_preview_line_item.rb b/lib/advanced_billing/models/allocation_preview_line_item.rb index 3e323702..18ef68a7 100644 --- a/lib/advanced_billing/models/allocation_preview_line_item.rb +++ b/lib/advanced_billing/models/allocation_preview_line_item.rb @@ -41,7 +41,7 @@ class AllocationPreviewLineItem < BaseModel # @return [String] attr_accessor :component_handle - # Visible when using Fine-grained Component Control + # Visible when using Fine-grained Component Control. # @return [AllocationPreviewDirection] attr_accessor :direction diff --git a/lib/advanced_billing/models/apple_pay_payment_profile.rb b/lib/advanced_billing/models/apple_pay_payment_profile.rb index 46c1c067..0db4dacc 100644 --- a/lib/advanced_billing/models/apple_pay_payment_profile.rb +++ b/lib/advanced_billing/models/apple_pay_payment_profile.rb @@ -22,7 +22,7 @@ class ApplePayPaymentProfile < BaseModel # @return [String] attr_accessor :last_name - # The Chargify-assigned id for the customer record to which the Apple Pay + # The Chargify-assigned ID for the customer record to which the Apple Pay # account belongs # @return [Integer] attr_accessor :customer_id diff --git a/lib/advanced_billing/models/apply_credit_note_event_data.rb b/lib/advanced_billing/models/apply_credit_note_event_data.rb index f8152eee..d897cf74 100644 --- a/lib/advanced_billing/models/apply_credit_note_event_data.rb +++ b/lib/advanced_billing/models/apply_credit_note_event_data.rb @@ -47,7 +47,7 @@ class ApplyCreditNoteEventData < BaseModel # @return [String] attr_accessor :role - # Shows whether it was applied to consolidated invoice or not + # Shows whether it was applied to consolidated invoice or not. # @return [TrueClass | FalseClass] attr_accessor :consolidated_invoice diff --git a/lib/advanced_billing/models/bank_account_attributes.rb b/lib/advanced_billing/models/bank_account_attributes.rb index 32357cfd..866ecdd5 100644 --- a/lib/advanced_billing/models/bank_account_attributes.rb +++ b/lib/advanced_billing/models/bank_account_attributes.rb @@ -18,9 +18,9 @@ class BankAccountAttributes < BaseModel # @return [String] attr_accessor :bank_name - # (Required when creating a subscription with ACH. Optional when creating a + # (Required when creating a subscription with ACH; optional when creating a # subscription with GoCardless). The routing number of the bank. It becomes - # bank_code while passing via GoCardless API + # bank_code while passing via GoCardless API. # @return [String] attr_accessor :bank_routing_number @@ -35,12 +35,12 @@ class BankAccountAttributes < BaseModel attr_accessor :bank_account_type # (Optional when creating a subscription with GoCardless) Branch code. - # Alternatively, an IBAN can be provided + # Alternatively, an IBAN can be provided. # @return [String] attr_accessor :bank_branch_code # (Optional when creating a subscription with GoCardless). International - # Bank Account Number. Alternatively, local bank details can be provided + # Bank Account Number. Alternatively, local bank details can be provided. # @return [String] attr_accessor :bank_iban diff --git a/lib/advanced_billing/models/bank_account_payment_profile.rb b/lib/advanced_billing/models/bank_account_payment_profile.rb index e8efffac..4580a58d 100644 --- a/lib/advanced_billing/models/bank_account_payment_profile.rb +++ b/lib/advanced_billing/models/bank_account_payment_profile.rb @@ -12,7 +12,7 @@ class BankAccountPaymentProfile < BaseModel # The Chargify-assigned ID of the stored bank account. This value can be # used as an input to payment_profile_id when creating a subscription, in - # order to re-use a stored payment profile for the same customer + # order to re-use a stored payment profile for the same customer. # @return [Integer] attr_accessor :id @@ -24,7 +24,7 @@ class BankAccountPaymentProfile < BaseModel # @return [String] attr_accessor :last_name - # The Chargify-assigned id for the customer record to which the bank account + # The Chargify-assigned ID for the customer record to which the bank account # belongs # @return [Integer] attr_accessor :customer_id @@ -74,12 +74,12 @@ class BankAccountPaymentProfile < BaseModel # A string representation of the stored bank routing number with all but the # last 4 digits marked with X's (i.e. 'XXXXXXX1111'). payment_type will be - # bank_account + # bank_account. # @return [String] attr_accessor :masked_bank_routing_number # A string representation of the stored bank account number with all but the - # last 4 digits marked with X's (i.e. 'XXXXXXX1111') + # last 4 digits marked with X's (i.e. 'XXXXXXX1111'). # @return [String] attr_accessor :masked_bank_account_number @@ -95,18 +95,18 @@ class BankAccountPaymentProfile < BaseModel # @return [PaymentType] attr_accessor :payment_type - # denotes whether a bank account has been verified by providing the amounts - # of two small deposits made into the account + # Denotes whether a bank account has been verified by providing the amounts + # of two small deposits made into the account. # @return [TrueClass | FalseClass] attr_accessor :verified - # denotes whether a bank account has been verified by providing the amounts - # of two small deposits made into the account + # Denotes whether a bank account has been verified by providing the amounts + # of two small deposits made into the account. # @return [Integer] attr_accessor :site_gateway_setting_id - # denotes whether a bank account has been verified by providing the amounts - # of two small deposits made into the account + # Denotes whether a bank account has been verified by providing the amounts + # of two small deposits made into the account. # @return [String] attr_accessor :gateway_handle diff --git a/lib/advanced_billing/models/calendar_billing.rb b/lib/advanced_billing/models/calendar_billing.rb index 70a70b4f..633d53bc 100644 --- a/lib/advanced_billing/models/calendar_billing.rb +++ b/lib/advanced_billing/models/calendar_billing.rb @@ -4,7 +4,7 @@ # APIMATIC v3.0 ( https://www.apimatic.io ). module AdvancedBilling - # (Optional). Cannot be used when also specifying next_billing_at + # (Optional). Cannot be used when also specifying next_billing_at. class CalendarBilling < BaseModel SKIP = Object.new private_constant :SKIP diff --git a/lib/advanced_billing/models/cancellation_options.rb b/lib/advanced_billing/models/cancellation_options.rb index 62913a9e..96782617 100644 --- a/lib/advanced_billing/models/cancellation_options.rb +++ b/lib/advanced_billing/models/cancellation_options.rb @@ -27,7 +27,7 @@ class CancellationOptions < BaseModel # @return [TrueClass | FalseClass] attr_accessor :cancel_at_end_of_period - # Schedules the cancellation on the provided date. This is option is not + # Schedules the cancellation on the provided date. This option is not # applicable for prepaid subscriptions. To use this option, the Schedule # Subscription Cancellation feature must be enabled on your site. # @return [DateTime] diff --git a/lib/advanced_billing/models/chargify_ebb.rb b/lib/advanced_billing/models/chargify_ebb.rb index f6db3c21..eaa02c59 100644 --- a/lib/advanced_billing/models/chargify_ebb.rb +++ b/lib/advanced_billing/models/chargify_ebb.rb @@ -33,14 +33,14 @@ class ChargifyEBB < BaseModel attr_accessor :uniqueness_token # Id of Maxio Advanced Billing Subscription which is connected to this - # event. + # event. # Provide `subscription_id` if you configured `chargify.subscription_id` as # Subscription Identifier in your Event Stream. # @return [Integer] attr_accessor :subscription_id # Reference of Maxio Advanced Billing Subscription which is connected to - # this event. + # this event. # Provide `subscription_reference` if you configured # `chargify.subscription_reference` as Subscription Identifier in your Event # Stream. diff --git a/lib/advanced_billing/models/collection_method1.rb b/lib/advanced_billing/models/collection_method1.rb new file mode 100644 index 00000000..83a3a22c --- /dev/null +++ b/lib/advanced_billing/models/collection_method1.rb @@ -0,0 +1,40 @@ +# advanced_billing +# +# This file was automatically generated for Maxio by +# APIMATIC v3.0 ( https://www.apimatic.io ). + +module AdvancedBilling + # collection_method1. + class CollectionMethod1 + COLLECTION_METHOD1 = [ + # TODO: Write general description for AUTOMATIC + AUTOMATIC = 'automatic'.freeze, + + # TODO: Write general description for REMITTANCE + REMITTANCE = 'remittance'.freeze, + + # TODO: Write general description for PREPAID + PREPAID = 'prepaid'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + COLLECTION_METHOD1.include?(value) + end + + def self.from_value(value, default_value = AUTOMATIC) + return default_value if value.nil? + + str = value.to_s.strip + + case str.downcase + when 'automatic' then AUTOMATIC + when 'remittance' then REMITTANCE + when 'prepaid' then PREPAID + else + default_value + end + end + end +end diff --git a/lib/advanced_billing/models/component.rb b/lib/advanced_billing/models/component.rb index 120b0892..260884af 100644 --- a/lib/advanced_billing/models/component.rb +++ b/lib/advanced_billing/models/component.rb @@ -15,7 +15,7 @@ class Component < BaseModel # @return [Integer] attr_accessor :id - # The name of the Component, suitable for display on statements. i.e. Text + # The name of the Component, suitable for display on statements. e.g., Text # Messages. # @return [String] attr_accessor :name @@ -28,7 +28,7 @@ class Component < BaseModel # @return [PricingScheme] attr_accessor :pricing_scheme - # The name of the unit that the component’s usage is measured in. i.e. + # The name of the unit that the component’s usage is measured in. e.g., # message # @return [String] attr_accessor :unit_name @@ -50,7 +50,7 @@ class Component < BaseModel # @return [String] attr_accessor :product_family_handle - # deprecated - use unit_price instead + # deprecated - use unit_price instead. # @return [Integer] attr_accessor :price_per_unit_in_cents @@ -163,8 +163,8 @@ class Component < BaseModel # @return [Integer] attr_accessor :event_based_billing_metric_id - # The numerical interval. i.e. an interval of ‘30’ coupled with an - # interval_unit of day would mean this component's default price point would + # The numerical interval. e.g., an interval of ‘30’ coupled with an + # interval_unit of day would mean this component’s default price point would # renew every 30 days. This property is only available for sites with # Multifrequency enabled. # @return [Integer] @@ -176,6 +176,12 @@ class Component < BaseModel # @return [IntervalUnit] attr_accessor :interval_unit + # (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. + # When set, this value is sent as the commodity code on invoice line items + # for this component instead of the default derived from item_category. + # @return [String] + attr_accessor :unspsc_code + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -215,6 +221,7 @@ def self.names 'event_based_billing_metric_id' @_hash['interval'] = 'interval' @_hash['interval_unit'] = 'interval_unit' + @_hash['unspsc_code'] = 'unspsc_code' @_hash end @@ -256,6 +263,7 @@ def self.optionals event_based_billing_metric_id interval interval_unit + unspsc_code ] end @@ -279,6 +287,7 @@ def self.nullables use_site_exchange_rate accounting_code interval_unit + unspsc_code ] end @@ -296,7 +305,8 @@ def initialize(id: SKIP, name: SKIP, handle: SKIP, pricing_scheme: SKIP, allow_fractional_quantities: SKIP, item_category: SKIP, use_site_exchange_rate: SKIP, accounting_code: SKIP, event_based_billing_metric_id: SKIP, interval: SKIP, - interval_unit: SKIP, additional_properties: {}) + interval_unit: SKIP, unspsc_code: SKIP, + additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -346,6 +356,7 @@ def initialize(id: SKIP, name: SKIP, handle: SKIP, pricing_scheme: SKIP, end @interval = interval unless interval == SKIP @interval_unit = interval_unit unless interval_unit == SKIP + @unspsc_code = unspsc_code unless unspsc_code == SKIP end # Creates an instance of the object from a hash. @@ -434,6 +445,7 @@ def self.from_hash(hash) hash.key?('event_based_billing_metric_id') ? hash['event_based_billing_metric_id'] : SKIP interval = hash.key?('interval') ? hash['interval'] : SKIP interval_unit = hash.key?('interval_unit') ? hash['interval_unit'] : SKIP + unspsc_code = hash.key?('unspsc_code') ? hash['unspsc_code'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -474,6 +486,7 @@ def self.from_hash(hash) event_based_billing_metric_id: event_based_billing_metric_id, interval: interval, interval_unit: interval_unit, + unspsc_code: unspsc_code, additional_properties: additional_properties) end @@ -507,7 +520,8 @@ def to_s " #{@allow_fractional_quantities}, item_category: #{@item_category}, use_site_exchange_rate:"\ " #{@use_site_exchange_rate}, accounting_code: #{@accounting_code},"\ " event_based_billing_metric_id: #{@event_based_billing_metric_id}, interval: #{@interval},"\ - " interval_unit: #{@interval_unit}, additional_properties: #{get_additional_properties}>" + " interval_unit: #{@interval_unit}, unspsc_code: #{@unspsc_code}, additional_properties:"\ + " #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -533,7 +547,8 @@ def inspect " use_site_exchange_rate: #{@use_site_exchange_rate.inspect}, accounting_code:"\ " #{@accounting_code.inspect}, event_based_billing_metric_id:"\ " #{@event_based_billing_metric_id.inspect}, interval: #{@interval.inspect}, interval_unit:"\ - " #{@interval_unit.inspect}, additional_properties: #{get_additional_properties}>" + " #{@interval_unit.inspect}, unspsc_code: #{@unspsc_code.inspect}, additional_properties:"\ + " #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/component_custom_price.rb b/lib/advanced_billing/models/component_custom_price.rb index bafefbef..20b367dd 100644 --- a/lib/advanced_billing/models/component_custom_price.rb +++ b/lib/advanced_billing/models/component_custom_price.rb @@ -14,11 +14,11 @@ class ComponentCustomPrice < BaseModel # @return [TrueClass | FalseClass] attr_accessor :tax_included - # Omit for On/Off components + # Omit for On/Off components. # @return [PricingScheme] attr_accessor :pricing_scheme - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., an interval of ‘30’ coupled with an # interval_unit of day would mean this component price point would renew # every 30 days. This property is only available for sites with # Multifrequency enabled. @@ -31,7 +31,7 @@ class ComponentCustomPrice < BaseModel # @return [IntervalUnit] attr_accessor :interval_unit - # Optional id of the price point to use for list price calculations when + # (Optional) Id of the price point to use for list price calculations when # overriding the customer price. # @return [Integer] attr_accessor :list_price_point_id diff --git a/lib/advanced_billing/models/component_price_point.rb b/lib/advanced_billing/models/component_price_point.rb index 24cb3e08..1f5f6759 100644 --- a/lib/advanced_billing/models/component_price_point.rb +++ b/lib/advanced_billing/models/component_price_point.rb @@ -23,11 +23,11 @@ class ComponentPricePoint < BaseModel # @return [PricePointType] attr_accessor :type - # Note: Refer to type attribute instead + # Note: Refer to type attribute instead. # @return [TrueClass | FalseClass] attr_accessor :default - # Note: Refer to type attribute instead + # Note: Refer to type attribute instead. # @return [String] attr_accessor :name @@ -89,7 +89,7 @@ class ComponentPricePoint < BaseModel # @return [TrueClass | FalseClass] attr_accessor :tax_included - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., an interval of ‘30’ coupled with an # interval_unit of day would mean this component price point would renew # every 30 days. This property is only available for sites with # Multifrequency enabled. diff --git a/lib/advanced_billing/models/component_price_point_item.rb b/lib/advanced_billing/models/component_price_point_item.rb index daa5a9b4..544aafb5 100644 --- a/lib/advanced_billing/models/component_price_point_item.rb +++ b/lib/advanced_billing/models/component_price_point_item.rb @@ -23,7 +23,7 @@ class ComponentPricePointItem < BaseModel # @return [PricingScheme] attr_accessor :pricing_scheme - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., an interval of ‘30’ coupled with an # interval_unit of day would mean this component price point would renew # every 30 days. This property is only available for sites with # Multifrequency enabled. diff --git a/lib/advanced_billing/models/coupon_payload.rb b/lib/advanced_billing/models/coupon_payload.rb index 917d816b..d4f2f894 100644 --- a/lib/advanced_billing/models/coupon_payload.rb +++ b/lib/advanced_billing/models/coupon_payload.rb @@ -17,7 +17,7 @@ class CouponPayload < BaseModel # Required when creating a new coupon. The code is limited to 255 # characters. May contain uppercase alphanumeric characters and these # special characters (which allow for email addresses to be used): “%”, “@”, - # “+”, “-”, “_”, and “.” + # “+”, “-”, “_”, and “.”. # @return [String] attr_accessor :code @@ -28,12 +28,12 @@ class CouponPayload < BaseModel attr_accessor :description # Required when creating a new percentage coupon. Can't be used together - # with amount_in_cents. Percentage discount + # with amount_in_cents. Percentage discount. # @return [Object] attr_accessor :percentage # Required when creating a new flat amount coupon. Can't be used together - # with percentage. Flat USD discount + # with percentage. Flat USD discount. # @return [Integer] attr_accessor :amount_in_cents diff --git a/lib/advanced_billing/models/coupon_request.rb b/lib/advanced_billing/models/coupon_request.rb index f8e877ca..d360416d 100644 --- a/lib/advanced_billing/models/coupon_request.rb +++ b/lib/advanced_billing/models/coupon_request.rb @@ -15,13 +15,13 @@ class CouponRequest < BaseModel # 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 + # applicable to the product. # @return [Hash[String, TrueClass | FalseClass]] attr_accessor :restricted_products # 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 + # applicable to the component. # @return [Hash[String, TrueClass | FalseClass]] attr_accessor :restricted_components diff --git a/lib/advanced_billing/models/coupon_usage.rb b/lib/advanced_billing/models/coupon_usage.rb index ff80ab11..1a2da232 100644 --- a/lib/advanced_billing/models/coupon_usage.rb +++ b/lib/advanced_billing/models/coupon_usage.rb @@ -29,13 +29,13 @@ class CouponUsage < BaseModel # @return [Integer] attr_accessor :savings_in_cents - # Total revenue of the all subscriptions that have received a discount from - # this coupon. + # Total revenue of all subscriptions that have received a discount from this + # coupon. # @return [Integer] attr_accessor :revenue - # Total revenue of the all subscriptions that have received a discount from - # this coupon. + # Total revenue of all subscriptions that have received a discount from this + # coupon. # @return [Integer] attr_accessor :revenue_in_cents diff --git a/lib/advanced_billing/models/create_allocation.rb b/lib/advanced_billing/models/create_allocation.rb index 74df7331..080f51b5 100644 --- a/lib/advanced_billing/models/create_allocation.rb +++ b/lib/advanced_billing/models/create_allocation.rb @@ -11,8 +11,8 @@ class CreateAllocation < BaseModel # The allocated quantity to which to set the line-items allocated quantity. # By default, this is an integer. If decimal allocations are enabled for the - # component, it will be a decimal number. For On/Off components, use 1for on - # and 0 for off. + # component, it will be a decimal number. For On/Off components, use 1 for + # on and 0 for off. # @return [Float] attr_accessor :quantity diff --git a/lib/advanced_billing/models/create_component_price_point.rb b/lib/advanced_billing/models/create_component_price_point.rb index af8a7ecb..ece358f0 100644 --- a/lib/advanced_billing/models/create_component_price_point.rb +++ b/lib/advanced_billing/models/create_component_price_point.rb @@ -40,7 +40,7 @@ class CreateComponentPricePoint < BaseModel # @return [TrueClass | FalseClass] attr_accessor :tax_included - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., 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. diff --git a/lib/advanced_billing/models/create_customer.rb b/lib/advanced_billing/models/create_customer.rb index 936bc722..228b1c3f 100644 --- a/lib/advanced_billing/models/create_customer.rb +++ b/lib/advanced_billing/models/create_customer.rb @@ -73,7 +73,13 @@ class CreateCustomer < BaseModel # @return [TrueClass | FalseClass] attr_accessor :tax_exempt - # Set a specific language on a customer record. + # Whether surcharging is enabled for the customer. Defaults to `true` when + # omitted. Only applied on sites where surcharging control is enabled. + # @return [TrueClass | FalseClass] + attr_accessor :surcharging + + # Whether surcharging is enabled for the customer. Defaults to `true` when + # omitted. Only applied on sites where surcharging control is enabled. # @return [String] attr_accessor :tax_exempt_reason @@ -86,6 +92,13 @@ class CreateCustomer < BaseModel # @return [String] attr_accessor :salesforce_id + # The ID of the Branding Theme assigned to this customer as the customer's + # default Branding Theme. This customer-level Branding Theme is used when a + # subscription does not have its own subscription-level Branding Theme. + # Available only when Branding Themes are enabled for the site. + # @return [Integer] + attr_accessor :branding_theme_id + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -105,9 +118,11 @@ def self.names @_hash['locale'] = 'locale' @_hash['vat_number'] = 'vat_number' @_hash['tax_exempt'] = 'tax_exempt' + @_hash['surcharging'] = 'surcharging' @_hash['tax_exempt_reason'] = 'tax_exempt_reason' @_hash['parent_id'] = 'parent_id' @_hash['salesforce_id'] = 'salesforce_id' + @_hash['branding_theme_id'] = 'branding_theme_id' @_hash end @@ -127,9 +142,11 @@ def self.optionals locale vat_number tax_exempt + surcharging tax_exempt_reason parent_id salesforce_id + branding_theme_id ] end @@ -138,6 +155,7 @@ def self.nullables %w[ parent_id salesforce_id + branding_theme_id ] end @@ -145,8 +163,9 @@ def initialize(first_name:, last_name:, email:, cc_emails: SKIP, organization: SKIP, reference: SKIP, address: SKIP, address_2: SKIP, city: SKIP, state: SKIP, zip: SKIP, country: SKIP, phone: SKIP, locale: SKIP, vat_number: SKIP, - tax_exempt: SKIP, tax_exempt_reason: SKIP, parent_id: SKIP, - salesforce_id: SKIP, additional_properties: {}) + tax_exempt: SKIP, surcharging: SKIP, tax_exempt_reason: SKIP, + parent_id: SKIP, salesforce_id: SKIP, + branding_theme_id: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -168,9 +187,11 @@ def initialize(first_name:, last_name:, email:, cc_emails: SKIP, @locale = locale unless locale == SKIP @vat_number = vat_number unless vat_number == SKIP @tax_exempt = tax_exempt unless tax_exempt == SKIP + @surcharging = surcharging unless surcharging == SKIP @tax_exempt_reason = tax_exempt_reason unless tax_exempt_reason == SKIP @parent_id = parent_id unless parent_id == SKIP @salesforce_id = salesforce_id unless salesforce_id == SKIP + @branding_theme_id = branding_theme_id unless branding_theme_id == SKIP end # Creates an instance of the object from a hash. @@ -194,10 +215,13 @@ def self.from_hash(hash) locale = hash.key?('locale') ? hash['locale'] : SKIP vat_number = hash.key?('vat_number') ? hash['vat_number'] : SKIP tax_exempt = hash.key?('tax_exempt') ? hash['tax_exempt'] : SKIP + surcharging = hash.key?('surcharging') ? hash['surcharging'] : SKIP tax_exempt_reason = hash.key?('tax_exempt_reason') ? hash['tax_exempt_reason'] : SKIP parent_id = hash.key?('parent_id') ? hash['parent_id'] : SKIP salesforce_id = hash.key?('salesforce_id') ? hash['salesforce_id'] : SKIP + branding_theme_id = + hash.key?('branding_theme_id') ? hash['branding_theme_id'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -219,9 +243,11 @@ def self.from_hash(hash) locale: locale, vat_number: vat_number, tax_exempt: tax_exempt, + surcharging: surcharging, tax_exempt_reason: tax_exempt_reason, parent_id: parent_id, salesforce_id: salesforce_id, + branding_theme_id: branding_theme_id, additional_properties: additional_properties) end @@ -232,8 +258,9 @@ def to_s " cc_emails: #{@cc_emails}, organization: #{@organization}, reference: #{@reference},"\ " address: #{@address}, address_2: #{@address_2}, city: #{@city}, state: #{@state}, zip:"\ " #{@zip}, country: #{@country}, phone: #{@phone}, locale: #{@locale}, vat_number:"\ - " #{@vat_number}, tax_exempt: #{@tax_exempt}, tax_exempt_reason: #{@tax_exempt_reason},"\ - " parent_id: #{@parent_id}, salesforce_id: #{@salesforce_id}, additional_properties:"\ + " #{@vat_number}, tax_exempt: #{@tax_exempt}, surcharging: #{@surcharging},"\ + " tax_exempt_reason: #{@tax_exempt_reason}, parent_id: #{@parent_id}, salesforce_id:"\ + " #{@salesforce_id}, branding_theme_id: #{@branding_theme_id}, additional_properties:"\ " #{get_additional_properties}>" end @@ -246,9 +273,10 @@ def inspect " address_2: #{@address_2.inspect}, city: #{@city.inspect}, state: #{@state.inspect}, zip:"\ " #{@zip.inspect}, country: #{@country.inspect}, phone: #{@phone.inspect}, locale:"\ " #{@locale.inspect}, vat_number: #{@vat_number.inspect}, tax_exempt:"\ - " #{@tax_exempt.inspect}, tax_exempt_reason: #{@tax_exempt_reason.inspect}, parent_id:"\ - " #{@parent_id.inspect}, salesforce_id: #{@salesforce_id.inspect}, additional_properties:"\ - " #{get_additional_properties}>" + " #{@tax_exempt.inspect}, surcharging: #{@surcharging.inspect}, tax_exempt_reason:"\ + " #{@tax_exempt_reason.inspect}, parent_id: #{@parent_id.inspect}, salesforce_id:"\ + " #{@salesforce_id.inspect}, branding_theme_id: #{@branding_theme_id.inspect},"\ + " additional_properties: #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/create_invoice.rb b/lib/advanced_billing/models/create_invoice.rb index b0c441d1..813b6596 100644 --- a/lib/advanced_billing/models/create_invoice.rb +++ b/lib/advanced_billing/models/create_invoice.rb @@ -38,23 +38,23 @@ class CreateInvoice < BaseModel # @return [String] attr_accessor :memo - # Overrides the defaults for the site + # Overrides the defaults for the site. # @return [CreateInvoiceAddress] attr_accessor :seller_address - # Overrides the default for the customer + # Overrides the default for the customer. # @return [CreateInvoiceAddress] attr_accessor :billing_address - # Overrides the default for the customer + # Overrides the default for the customer. # @return [CreateInvoiceAddress] attr_accessor :shipping_address - # Overrides the default for the customer + # Overrides the default for the customer. # @return [Array[CreateInvoiceCoupon]] attr_accessor :coupons - # Overrides the default for the customer + # Overrides the default for the customer. # @return [CreateInvoiceStatus] attr_accessor :status diff --git a/lib/advanced_billing/models/create_invoice_item.rb b/lib/advanced_billing/models/create_invoice_item.rb index 50a35a75..22a95464 100644 --- a/lib/advanced_billing/models/create_invoice_item.rb +++ b/lib/advanced_billing/models/create_invoice_item.rb @@ -13,13 +13,13 @@ class CreateInvoiceItem < BaseModel # @return [String] attr_accessor :title - # The quantity can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or + # The quantity can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or # 0.00000065. If you submit a value with more than 8 decimal places, we will # round it down to the 8th decimal place. # @return [Object] attr_accessor :quantity - # The unit_price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or + # The unit_price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or # 0.00000065. If you submit a value with more than 8 decimal places, we will # round it down to the 8th decimal place. # @return [Object] diff --git a/lib/advanced_billing/models/create_or_update_endpoint.rb b/lib/advanced_billing/models/create_or_update_endpoint.rb index 2144c476..806e2941 100644 --- a/lib/advanced_billing/models/create_or_update_endpoint.rb +++ b/lib/advanced_billing/models/create_or_update_endpoint.rb @@ -4,7 +4,7 @@ # APIMATIC v3.0 ( https://www.apimatic.io ). module AdvancedBilling - # Used to Create or Update Endpoint + # Used to Create or Update Endpoint. class CreateOrUpdateEndpoint < BaseModel SKIP = Object.new private_constant :SKIP diff --git a/lib/advanced_billing/models/create_or_update_endpoint_request.rb b/lib/advanced_billing/models/create_or_update_endpoint_request.rb index c62bd444..10c7c972 100644 --- a/lib/advanced_billing/models/create_or_update_endpoint_request.rb +++ b/lib/advanced_billing/models/create_or_update_endpoint_request.rb @@ -4,12 +4,12 @@ # APIMATIC v3.0 ( https://www.apimatic.io ). module AdvancedBilling - # Used to Create or Update Endpoint + # Used to Create or Update Endpoint. class CreateOrUpdateEndpointRequest < BaseModel SKIP = Object.new private_constant :SKIP - # Used to Create or Update Endpoint + # Used to Create or Update Endpoint. # @return [CreateOrUpdateEndpoint] attr_accessor :endpoint diff --git a/lib/advanced_billing/models/create_or_update_product.rb b/lib/advanced_billing/models/create_or_update_product.rb index 97329629..71229193 100644 --- a/lib/advanced_billing/models/create_or_update_product.rb +++ b/lib/advanced_billing/models/create_or_update_product.rb @@ -35,8 +35,8 @@ class CreateOrUpdateProduct < BaseModel # @return [Integer] attr_accessor :price_in_cents - # The numerical interval. i.e. an interval of ‘30’ coupled with an - # interval_unit of day would mean this product would renew every 30 days + # The numerical interval. e.g., an interval of ‘30’ coupled with an + # interval_unit of day would mean this product would renew every 30 days. # @return [Integer] attr_accessor :interval @@ -49,7 +49,7 @@ class CreateOrUpdateProduct < BaseModel # @return [Integer] attr_accessor :trial_price_in_cents - # The numerical trial interval. i.e. an interval of ‘30’ coupled with a + # The numerical trial interval. e.g., an interval of ‘30’ coupled with a # trial_interval_unit of day would mean this product trial would last 30 # days. # @return [Integer] @@ -60,7 +60,7 @@ class CreateOrUpdateProduct < BaseModel # @return [IntervalUnit] attr_accessor :trial_interval_unit - # Indicates how a trial is handled when the trail period ends and there is + # Indicates how a trial is handled when the trial period ends and there is # no credit card on file. For `no_obligation`, the subscription transitions # to a Trial Ended state. Maxio will not send any emails or statements. For # `payment_expected`, the subscription transitions to a Past Due state. @@ -69,7 +69,7 @@ class CreateOrUpdateProduct < BaseModel # @return [TrialType] attr_accessor :trial_type - # The numerical expiration interval. i.e. an expiration_interval of ‘30’ + # The numerical expiration interval. e.g., an expiration_interval of ‘30’ # coupled with an expiration_interval_unit of day would mean this product # would expire after 30 days. # @return [Integer] @@ -91,6 +91,12 @@ class CreateOrUpdateProduct < BaseModel # @return [String] attr_accessor :tax_code + # (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. + # When set, this value is sent as the commodity code on invoice line items + # for this product instead of the default derived from item_category. + # @return [String] + attr_accessor :unspsc_code + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -110,6 +116,7 @@ def self.names @_hash['expiration_interval_unit'] = 'expiration_interval_unit' @_hash['auto_create_signup_page'] = 'auto_create_signup_page' @_hash['tax_code'] = 'tax_code' + @_hash['unspsc_code'] = 'unspsc_code' @_hash end @@ -127,6 +134,7 @@ def self.optionals expiration_interval_unit auto_create_signup_page tax_code + unspsc_code ] end @@ -136,6 +144,7 @@ def self.nullables trial_interval_unit trial_type expiration_interval_unit + unspsc_code ] end @@ -146,7 +155,7 @@ def initialize(name:, description:, price_in_cents:, interval:, trial_type: SKIP, expiration_interval: SKIP, expiration_interval_unit: SKIP, auto_create_signup_page: SKIP, tax_code: SKIP, - additional_properties: {}) + unspsc_code: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -168,6 +177,7 @@ def initialize(name:, description:, price_in_cents:, interval:, @expiration_interval_unit = expiration_interval_unit unless expiration_interval_unit == SKIP @auto_create_signup_page = auto_create_signup_page unless auto_create_signup_page == SKIP @tax_code = tax_code unless tax_code == SKIP + @unspsc_code = unspsc_code unless unspsc_code == SKIP end # Creates an instance of the object from a hash. @@ -200,6 +210,7 @@ def self.from_hash(hash) auto_create_signup_page = hash.key?('auto_create_signup_page') ? hash['auto_create_signup_page'] : SKIP tax_code = hash.key?('tax_code') ? hash['tax_code'] : SKIP + unspsc_code = hash.key?('unspsc_code') ? hash['unspsc_code'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -221,6 +232,7 @@ def self.from_hash(hash) expiration_interval_unit: expiration_interval_unit, auto_create_signup_page: auto_create_signup_page, tax_code: tax_code, + unspsc_code: unspsc_code, additional_properties: additional_properties) end @@ -234,7 +246,8 @@ def to_s " #{@trial_interval}, trial_interval_unit: #{@trial_interval_unit}, trial_type:"\ " #{@trial_type}, expiration_interval: #{@expiration_interval}, expiration_interval_unit:"\ " #{@expiration_interval_unit}, auto_create_signup_page: #{@auto_create_signup_page},"\ - " tax_code: #{@tax_code}, additional_properties: #{get_additional_properties}>" + " tax_code: #{@tax_code}, unspsc_code: #{@unspsc_code}, additional_properties:"\ + " #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -249,8 +262,8 @@ def inspect " #{@trial_interval_unit.inspect}, trial_type: #{@trial_type.inspect}, expiration_interval:"\ " #{@expiration_interval.inspect}, expiration_interval_unit:"\ " #{@expiration_interval_unit.inspect}, auto_create_signup_page:"\ - " #{@auto_create_signup_page.inspect}, tax_code: #{@tax_code.inspect},"\ - " additional_properties: #{get_additional_properties}>" + " #{@auto_create_signup_page.inspect}, tax_code: #{@tax_code.inspect}, unspsc_code:"\ + " #{@unspsc_code.inspect}, additional_properties: #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/create_or_update_segment_price.rb b/lib/advanced_billing/models/create_or_update_segment_price.rb index 1ffc386f..bcf2272a 100644 --- a/lib/advanced_billing/models/create_or_update_segment_price.rb +++ b/lib/advanced_billing/models/create_or_update_segment_price.rb @@ -17,7 +17,7 @@ class CreateOrUpdateSegmentPrice < BaseModel # @return [Integer] attr_accessor :ending_quantity - # The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or + # The price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or # 0.00000065 # @return [Object] attr_accessor :unit_price diff --git a/lib/advanced_billing/models/create_payment_profile.rb b/lib/advanced_billing/models/create_payment_profile.rb index c32693d2..e67cee89 100644 --- a/lib/advanced_billing/models/create_payment_profile.rb +++ b/lib/advanced_billing/models/create_payment_profile.rb @@ -49,31 +49,31 @@ class CreatePaymentProfile < BaseModel # (Optional when performing an Import via vault_token, required otherwise) # The 1- or 2-digit credit card expiration month, as an integer or string, - # i.e. 5 + # e.g., 5 # @return [Object] attr_accessor :expiration_month - # (Optional when performing a Import via vault_token, required otherwise) - # The 4-digit credit card expiration year, as an integer or string, i.e. + # (Optional when performing an Import via vault_token, required otherwise) + # The 4-digit credit card expiration year, as an integer or string, e.g., # 2012 # @return [Object] attr_accessor :expiration_year - # The credit card or bank account billing street address (i.e. 123 Main + # The credit card or bank account billing street address (e.g., 123 Main # St.). This value is merely passed through to the payment gateway. # @return [String] attr_accessor :billing_address - # Second line of the customer’s billing address i.e. Apt. 100 + # Second line of the customer’s billing address e.g., Apt. 100 # @return [String] attr_accessor :billing_address_2 - # The credit card or bank account billing address city (i.e. “Boston”). This - # value is merely passed through to the payment gateway. + # The credit card or bank account billing address city (e.g., “Boston”). + # This value is merely passed through to the payment gateway. # @return [String] attr_accessor :billing_city - # The credit card or bank account billing address state (i.e. MA). This + # The credit card or bank account billing address state (e.g., MA). This # value is merely passed through to the payment gateway. This must conform # to the # [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in @@ -81,16 +81,16 @@ class CreatePaymentProfile < BaseModel # @return [String] attr_accessor :billing_state - # The credit card or bank account billing address country, required in + # “The credit card or bank account billing address country, required in # [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) - # format (i.e. “US”). This value is merely passed through to the payment + # format (e.g., “US”). This value is merely passed through to the payment # gateway. Some gateways require country codes in a specific format. Check # your gateway’s documentation. If creating an ACH subscription, only US is - # supported at this time. + # supported at this time.” # @return [String] attr_accessor :billing_country - # The credit card or bank account billing address zip code (i.e. 12345). + # The credit card or bank account billing address zip code (e.g., 12345). # This value is merely passed through to the payment gateway. # @return [String] attr_accessor :billing_zip @@ -148,13 +148,13 @@ class CreatePaymentProfile < BaseModel # (Optional when creating with GoCardless, required with Stripe Direct # Debit). International Bank Account Number. Alternatively, local bank - # details can be provided + # details can be provided. # @return [String] attr_accessor :bank_iban # (Required when creating with ACH. Optional when creating a subscription # with GoCardless). The routing number of the bank. It becomes bank_code - # while passing via GoCardless API + # while passing via GoCardless API. # @return [String] attr_accessor :bank_routing_number @@ -164,7 +164,7 @@ class CreatePaymentProfile < BaseModel attr_accessor :bank_account_number # (Optional when creating with GoCardless, required with Stripe BECS or BACS - # Direct Debit) Branch/Sort code. Alternatively, an IBAN can be provided + # Direct Debit) Branch/Sort code. Alternatively, an IBAN can be provided. # @return [String] attr_accessor :bank_branch_code diff --git a/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb b/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb index f645e20c..b5eb7eb6 100644 --- a/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb +++ b/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb @@ -41,24 +41,24 @@ class CreatePrepaidUsageComponentPricePoint < BaseModel attr_accessor :use_site_exchange_rate # (only for prepaid usage components) Boolean which controls whether or not - # remaining units should be rolled over to the next period + # remaining units should be rolled over to the next period. # @return [TrueClass | FalseClass] attr_accessor :rollover_prepaid_remainder # (only for prepaid usage components) Boolean which controls whether or not - # the allocated quantity should be renewed at the beginning of each period + # the allocated quantity should be renewed at the beginning of each period. # @return [TrueClass | FalseClass] attr_accessor :renew_prepaid_allocation # (only for prepaid usage components where rollover_prepaid_remainder is # true) The number of `expiration_interval_unit`s after which rollover - # amounts should expire + # amounts should expire. # @return [Float] attr_accessor :expiration_interval # (only for prepaid usage components where rollover_prepaid_remainder is # true) A string representing the expiration interval unit for this - # component, either month or day + # component, either month or day. # @return [ExpirationIntervalUnit] attr_accessor :expiration_interval_unit diff --git a/lib/advanced_billing/models/create_prepayment.rb b/lib/advanced_billing/models/create_prepayment.rb index 9bd7025d..1112e031 100644 --- a/lib/advanced_billing/models/create_prepayment.rb +++ b/lib/advanced_billing/models/create_prepayment.rb @@ -21,14 +21,14 @@ class CreatePrepayment < BaseModel # @return [String] attr_accessor :memo - # :- When the `method` specified is `"credit_card_on_file"`, the prepayment + # When the `method` specified is `"credit_card_on_file"`, the prepayment # amount will be collected using the default credit card payment profile and # applied to the prepayment account balance. This is especially useful for # manual replenishment of prepaid subscriptions. # @return [CreatePrepaymentMethod] attr_accessor :method - # :- When the `method` specified is `"credit_card_on_file"`, the prepayment + # When the `method` specified is `"credit_card_on_file"`, the prepayment # amount will be collected using the default credit card payment profile and # applied to the prepayment account balance. This is especially useful for # manual replenishment of prepaid subscriptions. diff --git a/lib/advanced_billing/models/create_prepayment_method.rb b/lib/advanced_billing/models/create_prepayment_method.rb index 79e1932c..d5040bd3 100644 --- a/lib/advanced_billing/models/create_prepayment_method.rb +++ b/lib/advanced_billing/models/create_prepayment_method.rb @@ -4,7 +4,7 @@ # APIMATIC v3.0 ( https://www.apimatic.io ). module AdvancedBilling - # :- When the `method` specified is `"credit_card_on_file"`, the prepayment + # When the `method` specified is `"credit_card_on_file"`, the prepayment # amount will be collected using the default credit card payment profile and # applied to the prepayment account balance. This is especially useful for # manual replenishment of prepaid subscriptions. diff --git a/lib/advanced_billing/models/create_product_family.rb b/lib/advanced_billing/models/create_product_family.rb index 0391585a..62a1f13b 100644 --- a/lib/advanced_billing/models/create_product_family.rb +++ b/lib/advanced_billing/models/create_product_family.rb @@ -21,12 +21,18 @@ class CreateProductFamily < BaseModel # @return [String] attr_accessor :description + # Whether surcharging applies to this product family. Defaults to `true` + # when omitted. Only applied on sites where surcharging is enabled. + # @return [TrueClass | FalseClass] + attr_accessor :surcharging + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' @_hash['handle'] = 'handle' @_hash['description'] = 'description' + @_hash['surcharging'] = 'surcharging' @_hash end @@ -35,6 +41,7 @@ def self.optionals %w[ handle description + surcharging ] end @@ -46,7 +53,7 @@ def self.nullables ] end - def initialize(name:, handle: SKIP, description: SKIP, + def initialize(name:, handle: SKIP, description: SKIP, surcharging: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| @@ -56,6 +63,7 @@ def initialize(name:, handle: SKIP, description: SKIP, @name = name @handle = handle unless handle == SKIP @description = description unless description == SKIP + @surcharging = surcharging unless surcharging == SKIP end # Creates an instance of the object from a hash. @@ -66,6 +74,7 @@ def self.from_hash(hash) name = hash.key?('name') ? hash['name'] : nil handle = hash.key?('handle') ? hash['handle'] : SKIP description = hash.key?('description') ? hash['description'] : SKIP + surcharging = hash.key?('surcharging') ? hash['surcharging'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -74,6 +83,7 @@ def self.from_hash(hash) CreateProductFamily.new(name: name, handle: handle, description: description, + surcharging: surcharging, additional_properties: additional_properties) end @@ -81,14 +91,15 @@ def self.from_hash(hash) def to_s class_name = self.class.name.split('::').last "<#{class_name} name: #{@name}, handle: #{@handle}, description: #{@description},"\ - " additional_properties: #{get_additional_properties}>" + " surcharging: #{@surcharging}, 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} name: #{@name.inspect}, handle: #{@handle.inspect}, description:"\ - " #{@description.inspect}, additional_properties: #{get_additional_properties}>" + " #{@description.inspect}, surcharging: #{@surcharging.inspect}, additional_properties:"\ + " #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/create_product_price_point.rb b/lib/advanced_billing/models/create_product_price_point.rb index aa172c1f..e721142f 100644 --- a/lib/advanced_billing/models/create_product_price_point.rb +++ b/lib/advanced_billing/models/create_product_price_point.rb @@ -21,9 +21,9 @@ class CreateProductPricePoint < BaseModel # @return [Integer] attr_accessor :price_in_cents - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., an interval of ‘30’ coupled with an # interval_unit of day would mean this product price point would renew every - # 30 days + # 30 days. # @return [Integer] attr_accessor :interval @@ -36,7 +36,7 @@ class CreateProductPricePoint < BaseModel # @return [Integer] attr_accessor :trial_price_in_cents - # The numerical trial interval. i.e. an interval of ‘30’ coupled with a + # The numerical trial interval. e.g., an interval of ‘30’ coupled with a # trial_interval_unit of day would mean this product price point trial would # last 30 days. # @return [Integer] @@ -47,7 +47,7 @@ class CreateProductPricePoint < BaseModel # @return [IntervalUnit] attr_accessor :trial_interval_unit - # Indicates how a trial is handled when the trail period ends and there is + # Indicates how a trial is handled when the trial period ends and there is # no credit card on file. For `no_obligation`, the subscription transitions # to a Trial Ended state. Maxio will not send any emails or statements. For # `payment_expected`, the subscription transitions to a Past Due state. @@ -64,7 +64,7 @@ class CreateProductPricePoint < BaseModel # @return [TrueClass | FalseClass] attr_accessor :initial_charge_after_trial - # The numerical expiration interval. i.e. an expiration_interval of ‘30’ + # The numerical expiration interval. e.g., an expiration_interval of ‘30’ # coupled with an expiration_interval_unit of day would mean this product # price point would expire after 30 days. # @return [Integer] diff --git a/lib/advanced_billing/models/create_subscription.rb b/lib/advanced_billing/models/create_subscription.rb index f08abd4e..e721bc3d 100644 --- a/lib/advanced_billing/models/create_subscription.rb +++ b/lib/advanced_billing/models/create_subscription.rb @@ -68,6 +68,15 @@ class CreateSubscription < BaseModel # @return [Integer] attr_accessor :customer_id + # The ID of the Branding Theme to assign to this subscription. When set, + # this subscription-level Branding Theme is used instead of the customer's + # default Branding Theme for subscription-related documents and + # communications that use subscription theming. Pass null or an empty value + # to clear the subscription-level Branding Theme. Available only when + # Branding Themes are enabled for the site. Not returned in the response. + # @return [Integer] + attr_accessor :branding_theme_id + # (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 @@ -104,7 +113,7 @@ class CreateSubscription < BaseModel # (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 + # 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 @@ -133,7 +142,7 @@ class CreateSubscription < BaseModel # 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) + # subscription via the API as `credit_card` > id or `bank_account` > id.) # @return [Integer] attr_accessor :payment_profile_id @@ -166,7 +175,7 @@ class CreateSubscription < BaseModel # @return [Array[CreateSubscriptionComponent]] attr_accessor :components - # (Optional). Cannot be used when also specifying next_billing_at + # (Optional). Cannot be used when also specifying next_billing_at. # @return [CalendarBilling] attr_accessor :calendar_billing @@ -258,13 +267,13 @@ class CreateSubscription < BaseModel # Use in place of passing product and component information to set up the # subscription with an existing offer. May be either the Chargify id of the - # offer or its handle prefixed with `handle:`.er + # offer or its handle prefixed with `handle:`. # @return [Object] attr_accessor :offer_id # Use in place of passing product and component information to set up the # subscription with an existing offer. May be either the Chargify id of the - # offer or its handle prefixed with `handle:`.er + # offer or its handle prefixed with `handle:`. # @return [UpsertPrepaidConfiguration] attr_accessor :prepaid_configuration @@ -337,6 +346,7 @@ def self.names @_hash['receives_invoice_emails'] = 'receives_invoice_emails' @_hash['net_terms'] = 'net_terms' @_hash['customer_id'] = 'customer_id' + @_hash['branding_theme_id'] = 'branding_theme_id' @_hash['next_billing_at'] = 'next_billing_at' @_hash['initial_billing_at'] = 'initial_billing_at' @_hash['defer_signup'] = 'defer_signup' @@ -398,6 +408,7 @@ def self.optionals receives_invoice_emails net_terms customer_id + branding_theme_id next_billing_at initial_billing_at defer_signup @@ -443,6 +454,7 @@ def self.optionals # An array for nullable fields def self.nullables %w[ + branding_theme_id dunning_communication_delay_time_zone ] end @@ -453,11 +465,12 @@ def initialize(product_handle: SKIP, product_id: SKIP, coupon_code: SKIP, coupon_codes: SKIP, payment_collection_method: SKIP, receives_invoice_emails: SKIP, net_terms: SKIP, - customer_id: SKIP, next_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, + customer_id: SKIP, branding_theme_id: SKIP, + next_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, credit_card_attributes: SKIP, bank_account_attributes: SKIP, components: SKIP, calendar_billing: SKIP, metafields: SKIP, customer_reference: SKIP, group: SKIP, ref: SKIP, @@ -496,6 +509,7 @@ def initialize(product_handle: SKIP, product_id: SKIP, @receives_invoice_emails = receives_invoice_emails unless receives_invoice_emails == SKIP @net_terms = net_terms unless net_terms == SKIP @customer_id = customer_id unless customer_id == SKIP + @branding_theme_id = branding_theme_id unless branding_theme_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 @@ -580,6 +594,8 @@ def self.from_hash(hash) hash.key?('receives_invoice_emails') ? hash['receives_invoice_emails'] : SKIP net_terms = hash.key?('net_terms') ? hash['net_terms'] : SKIP customer_id = hash.key?('customer_id') ? hash['customer_id'] : SKIP + branding_theme_id = + hash.key?('branding_theme_id') ? hash['branding_theme_id'] : SKIP next_billing_at = if hash.key?('next_billing_at') (DateTimeHelper.from_rfc3339(hash['next_billing_at']) if hash['next_billing_at']) else @@ -692,6 +708,7 @@ def self.from_hash(hash) receives_invoice_emails: receives_invoice_emails, net_terms: net_terms, customer_id: customer_id, + branding_theme_id: branding_theme_id, next_billing_at: next_billing_at, initial_billing_at: initial_billing_at, defer_signup: defer_signup, @@ -776,14 +793,14 @@ def to_s " #{@product_price_point_id}, custom_price: #{@custom_price}, coupon_code: #{@coupon_code},"\ " 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}, 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},"\ - " credit_card_attributes: #{@credit_card_attributes}, bank_account_attributes:"\ - " #{@bank_account_attributes}, components: #{@components}, calendar_billing:"\ - " #{@calendar_billing}, metafields: #{@metafields}, customer_reference:"\ + " customer_id: #{@customer_id}, branding_theme_id: #{@branding_theme_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}, reference:"\ + " #{@reference}, customer_attributes: #{@customer_attributes}, payment_profile_attributes:"\ + " #{@payment_profile_attributes}, credit_card_attributes: #{@credit_card_attributes},"\ + " bank_account_attributes: #{@bank_account_attributes}, components: #{@components},"\ + " calendar_billing: #{@calendar_billing}, metafields: #{@metafields}, customer_reference:"\ " #{@customer_reference}, group: #{@group}, ref: #{@ref}, cancellation_message:"\ " #{@cancellation_message}, cancellation_method: #{@cancellation_method}, currency:"\ " #{@currency}, expires_at: #{@expires_at}, expiration_tracks_next_billing_change:"\ @@ -811,7 +828,8 @@ def inspect " #{@coupon_code.inspect}, coupon_codes: #{@coupon_codes.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:"\ + " #{@customer_id.inspect}, branding_theme_id: #{@branding_theme_id.inspect},"\ + " next_billing_at: #{@next_billing_at.inspect}, initial_billing_at:"\ " #{@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:"\ diff --git a/lib/advanced_billing/models/create_subscription_component.rb b/lib/advanced_billing/models/create_subscription_component.rb index ce43bb67..aa4f1644 100644 --- a/lib/advanced_billing/models/create_subscription_component.rb +++ b/lib/advanced_billing/models/create_subscription_component.rb @@ -18,7 +18,7 @@ class CreateSubscriptionComponent < BaseModel attr_accessor :enabled # Used for metered and events based components. - # @return [Integer] + # @return [Object] attr_accessor :unit_balance # Used for quantity based components. @@ -96,7 +96,9 @@ def self.from_hash(hash) UnionTypeLookUp.get(:CreateSubscriptionComponentComponentId), hash['component_id'] ) : SKIP enabled = hash.key?('enabled') ? hash['enabled'] : SKIP - unit_balance = hash.key?('unit_balance') ? hash['unit_balance'] : SKIP + unit_balance = hash.key?('unit_balance') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:CreateSubscriptionComponentUnitBalance), hash['unit_balance'] + ) : SKIP allocated_quantity = hash.key?('allocated_quantity') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:CreateSubscriptionComponentAllocatedQuantity), hash['allocated_quantity'] ) : SKIP diff --git a/lib/advanced_billing/models/credit_card_payment_profile.rb b/lib/advanced_billing/models/credit_card_payment_profile.rb index d857bb75..d42a195d 100644 --- a/lib/advanced_billing/models/credit_card_payment_profile.rb +++ b/lib/advanced_billing/models/credit_card_payment_profile.rb @@ -25,7 +25,7 @@ class CreditCardPaymentProfile < BaseModel attr_accessor :last_name # A string representation of the credit card number with all but the last 4 - # digits masked with X’s (i.e. ‘XXXX-XXXX-XXXX-1234’). + # digits masked with X’s (e.g., ‘XXXX-XXXX-XXXX-1234’). # @return [String] attr_accessor :masked_card_number @@ -37,7 +37,7 @@ class CreditCardPaymentProfile < BaseModel # @return [Integer] attr_accessor :expiration_month - # An integer representing the 4-digit expiration year of the card(i.e. + # An integer representing the 4-digit expiration year of the card(e.g., # ‘2012’). # @return [Integer] attr_accessor :expiration_year @@ -96,13 +96,13 @@ class CreditCardPaymentProfile < BaseModel # Token received after sending billing information using Maxio.js (formerly # Chargify.js). This token will only be received if passed as a sole - # attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) + # attribute of credit_card_attributes (e.g., tok_9g6hw85pnpt6knmskpwp4ttt). # @return [String] attr_accessor :chargify_token # Token received after sending billing information using Maxio.js (formerly # Chargify.js). This token will only be received if passed as a sole - # attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) + # attribute of credit_card_attributes (e.g., tok_9g6hw85pnpt6knmskpwp4ttt). # @return [Integer] attr_accessor :site_gateway_setting_id @@ -180,6 +180,7 @@ def self.optionals # An array for nullable fields def self.nullables %w[ + card_type vault_token billing_address billing_city diff --git a/lib/advanced_billing/models/credit_note.rb b/lib/advanced_billing/models/credit_note.rb index 5ea7f2cd..76030ba5 100644 --- a/lib/advanced_billing/models/credit_note.rb +++ b/lib/advanced_billing/models/credit_note.rb @@ -74,7 +74,7 @@ class CreditNote < BaseModel # @return [InvoiceSeller] attr_accessor :seller - # Information about the customer who is owner or recipient the credited + # Information about the customer who is owner or recipient of the credited # subscription. # @return [InvoiceCustomer] attr_accessor :customer @@ -95,7 +95,7 @@ class CreditNote < BaseModel # Total discount applied to the credit note. Note that this is a positive # amount representing the discount amount being credited back to the - # customer (i.e. a credit on an earlier discount). For example, if the + # customer (i.e., a credit on an earlier discount). For example, if the # original purchase was $1.00 and the original discount was $0.10, a credit # of $0.50 of the original purchase (half) would have a discount credit of # $0.05 (also half). @@ -103,8 +103,8 @@ class CreditNote < BaseModel attr_accessor :discount_amount # Total tax of the credit note. Note that this is a positive amount - # representing a previously taxex amount being credited back to the customer - # (i.e. a credit of an earlier tax). For example, if the original purchase + # representing a previously taxed amount being credited back to the customer + # (i.e., a credit of an earlier tax). For example, if the original purchase # was $1.00 and the original tax was $0.10, a credit of $0.50 of the # original purchase (half) would also have a tax credit of $0.05 (also # half). @@ -112,7 +112,7 @@ class CreditNote < BaseModel attr_accessor :tax_amount # The credit note total, which is `subtotal_amount - discount_amount + - # tax_amount`.' + # tax_amount`. # @return [String] attr_accessor :total_amount @@ -148,7 +148,7 @@ class CreditNote < BaseModel # An array of origin invoices for the credit note. Learn more about [Origin # Invoice from our # docs](https://maxio.zendesk.com/hc/en-us/articles/24252261284749-Credit-No - # tes-Proration#origin-invoices) + # tes-Proration#origin-invoices). # @return [Array[OriginInvoice]] attr_accessor :origin_invoices diff --git a/lib/advanced_billing/models/credit_note_line_item.rb b/lib/advanced_billing/models/credit_note_line_item.rb index d63d551e..185d44c0 100644 --- a/lib/advanced_billing/models/credit_note_line_item.rb +++ b/lib/advanced_billing/models/credit_note_line_item.rb @@ -32,7 +32,7 @@ class CreditNoteLineItem < BaseModel attr_accessor :quantity # The price per unit for the line item. - # When tiered pricing was used (i.e. not every unit was actually priced at + # When tiered pricing was used (i.e., not every unit was actually priced at # the same price) this will be the blended average cost per unit and the # `tiered_unit_price` field will be set to `true`. # @return [String] diff --git a/lib/advanced_billing/models/currency_overage_prices.rb b/lib/advanced_billing/models/currency_overage_prices.rb index 401ee3fd..2736f1f6 100644 --- a/lib/advanced_billing/models/currency_overage_prices.rb +++ b/lib/advanced_billing/models/currency_overage_prices.rb @@ -23,11 +23,11 @@ class CurrencyOveragePrices < BaseModel # @return [PricePointType] attr_accessor :type - # Note: Refer to type attribute instead + # Note: Refer to type attribute instead. # @return [TrueClass | FalseClass] attr_accessor :default - # Note: Refer to type attribute instead + # Note: Refer to type attribute instead. # @return [String] attr_accessor :name @@ -89,7 +89,7 @@ class CurrencyOveragePrices < BaseModel # @return [TrueClass | FalseClass] attr_accessor :tax_included - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., an interval of ‘30’ coupled with an # interval_unit of day would mean this component price point would renew # every 30 days. This property is only available for sites with # Multifrequency enabled. diff --git a/lib/advanced_billing/models/customer.rb b/lib/advanced_billing/models/customer.rb index dbac2ff4..800ce789 100644 --- a/lib/advanced_billing/models/customer.rb +++ b/lib/advanced_billing/models/customer.rb @@ -22,8 +22,8 @@ class Customer < BaseModel # @return [String] attr_accessor :email - # A comma-separated list of emails that should be cc’d on all customer - # communications (i.e. “joe@example.com, sue@example.com”) + # “A comma-separated list of emails that should be cc’d on all customer + # communications (e.g., “joe@example.com, sue@example.com”)” # @return [String] attr_accessor :cc_emails @@ -49,19 +49,19 @@ class Customer < BaseModel # @return [DateTime] attr_accessor :updated_at - # The customer’s shipping street address (i.e. “123 Main St.”) + # The customer’s shipping street address (e.g., “123 Main St.”) # @return [String] attr_accessor :address - # Second line of the customer’s shipping address i.e. “Apt. 100” + # Second line of the customer’s shipping address e.g., “Apt. 100” # @return [String] attr_accessor :address_2 - # The customer’s shipping address city (i.e. “Boston”) + # The customer’s shipping address city (e.g., “Boston”) # @return [String] attr_accessor :city - # The customer’s shipping address state (i.e. “MA”) + # The customer’s shipping address state (e.g., “MA”) # @return [String] attr_accessor :state @@ -69,7 +69,7 @@ class Customer < BaseModel # @return [String] attr_accessor :state_name - # The customer’s shipping address zip code (i.e. “12345”) + # The customer’s shipping address zip code (e.g., “12345”) # @return [String] attr_accessor :zip @@ -107,6 +107,11 @@ class Customer < BaseModel # @return [TrueClass | FalseClass] attr_accessor :tax_exempt + # Whether surcharging is enabled for the customer. Only included on sites + # where surcharging control is enabled. + # @return [TrueClass | FalseClass] + attr_accessor :surcharging + # The VAT business identification number for the customer. This number is # used to determine VAT tax opt out rules. It is not validated when added or # updated on a customer record. Instead, it is validated via VIES before @@ -144,6 +149,13 @@ class Customer < BaseModel # @return [String] attr_accessor :maxioid + # The ID of the Branding Theme assigned to this customer as the customer's + # default Branding Theme. This customer-level Branding Theme is used when a + # subscription does not have its own subscription-level Branding Theme. + # Available only when Branding Themes are enabled for the site. + # @return [Integer] + attr_accessor :branding_theme_id + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -171,6 +183,7 @@ def self.names @_hash['portal_invite_last_accepted_at'] = 'portal_invite_last_accepted_at' @_hash['tax_exempt'] = 'tax_exempt' + @_hash['surcharging'] = 'surcharging' @_hash['vat_number'] = 'vat_number' @_hash['parent_id'] = 'parent_id' @_hash['locale'] = 'locale' @@ -181,6 +194,7 @@ def self.names @_hash['default_auto_renewal_profile_id'] = 'default_auto_renewal_profile_id' @_hash['maxioid'] = 'maxioid' + @_hash['branding_theme_id'] = 'branding_theme_id' @_hash end @@ -210,6 +224,7 @@ def self.optionals portal_invite_last_sent_at portal_invite_last_accepted_at tax_exempt + surcharging vat_number parent_id locale @@ -218,6 +233,7 @@ def self.optionals tax_exempt_reason default_auto_renewal_profile_id maxioid + branding_theme_id ] end @@ -248,6 +264,7 @@ def self.nullables tax_exempt_reason default_auto_renewal_profile_id maxioid + branding_theme_id ] end @@ -259,11 +276,11 @@ def initialize(first_name: SKIP, last_name: SKIP, email: SKIP, verified: SKIP, portal_customer_created_at: SKIP, portal_invite_last_sent_at: SKIP, portal_invite_last_accepted_at: SKIP, tax_exempt: SKIP, - vat_number: SKIP, parent_id: SKIP, locale: SKIP, - default_subscription_group_uid: SKIP, salesforce_id: SKIP, - tax_exempt_reason: SKIP, + surcharging: SKIP, vat_number: SKIP, parent_id: SKIP, + locale: SKIP, default_subscription_group_uid: SKIP, + salesforce_id: SKIP, tax_exempt_reason: SKIP, default_auto_renewal_profile_id: SKIP, maxioid: SKIP, - additional_properties: {}) + branding_theme_id: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -301,6 +318,7 @@ def initialize(first_name: SKIP, last_name: SKIP, email: SKIP, portal_invite_last_accepted_at end @tax_exempt = tax_exempt unless tax_exempt == SKIP + @surcharging = surcharging unless surcharging == SKIP @vat_number = vat_number unless vat_number == SKIP @parent_id = parent_id unless parent_id == SKIP @locale = locale unless locale == SKIP @@ -315,6 +333,7 @@ def initialize(first_name: SKIP, last_name: SKIP, email: SKIP, default_auto_renewal_profile_id end @maxioid = maxioid unless maxioid == SKIP + @branding_theme_id = branding_theme_id unless branding_theme_id == SKIP end # Creates an instance of the object from a hash. @@ -365,6 +384,7 @@ def self.from_hash(hash) SKIP end tax_exempt = hash.key?('tax_exempt') ? hash['tax_exempt'] : SKIP + surcharging = hash.key?('surcharging') ? hash['surcharging'] : SKIP vat_number = hash.key?('vat_number') ? hash['vat_number'] : SKIP parent_id = hash.key?('parent_id') ? hash['parent_id'] : SKIP locale = hash.key?('locale') ? hash['locale'] : SKIP @@ -376,6 +396,8 @@ def self.from_hash(hash) default_auto_renewal_profile_id = hash.key?('default_auto_renewal_profile_id') ? hash['default_auto_renewal_profile_id'] : SKIP maxioid = hash.key?('maxioid') ? hash['maxioid'] : SKIP + branding_theme_id = + hash.key?('branding_theme_id') ? hash['branding_theme_id'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -404,6 +426,7 @@ def self.from_hash(hash) portal_invite_last_sent_at: portal_invite_last_sent_at, portal_invite_last_accepted_at: portal_invite_last_accepted_at, tax_exempt: tax_exempt, + surcharging: surcharging, vat_number: vat_number, parent_id: parent_id, locale: locale, @@ -412,6 +435,7 @@ def self.from_hash(hash) tax_exempt_reason: tax_exempt_reason, default_auto_renewal_profile_id: default_auto_renewal_profile_id, maxioid: maxioid, + branding_theme_id: branding_theme_id, additional_properties: additional_properties) end @@ -456,11 +480,12 @@ def to_s " verified: #{@verified}, portal_customer_created_at: #{@portal_customer_created_at},"\ " portal_invite_last_sent_at: #{@portal_invite_last_sent_at},"\ " portal_invite_last_accepted_at: #{@portal_invite_last_accepted_at}, tax_exempt:"\ - " #{@tax_exempt}, vat_number: #{@vat_number}, parent_id: #{@parent_id}, locale: #{@locale},"\ - " default_subscription_group_uid: #{@default_subscription_group_uid}, salesforce_id:"\ - " #{@salesforce_id}, tax_exempt_reason: #{@tax_exempt_reason},"\ - " default_auto_renewal_profile_id: #{@default_auto_renewal_profile_id}, maxioid:"\ - " #{@maxioid}, additional_properties: #{get_additional_properties}>" + " #{@tax_exempt}, surcharging: #{@surcharging}, vat_number: #{@vat_number}, parent_id:"\ + " #{@parent_id}, locale: #{@locale}, default_subscription_group_uid:"\ + " #{@default_subscription_group_uid}, salesforce_id: #{@salesforce_id}, tax_exempt_reason:"\ + " #{@tax_exempt_reason}, default_auto_renewal_profile_id:"\ + " #{@default_auto_renewal_profile_id}, maxioid: #{@maxioid}, branding_theme_id:"\ + " #{@branding_theme_id}, additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -477,12 +502,13 @@ def inspect " #{@portal_customer_created_at.inspect}, portal_invite_last_sent_at:"\ " #{@portal_invite_last_sent_at.inspect}, portal_invite_last_accepted_at:"\ " #{@portal_invite_last_accepted_at.inspect}, tax_exempt: #{@tax_exempt.inspect},"\ - " vat_number: #{@vat_number.inspect}, parent_id: #{@parent_id.inspect}, locale:"\ - " #{@locale.inspect}, default_subscription_group_uid:"\ + " surcharging: #{@surcharging.inspect}, vat_number: #{@vat_number.inspect}, parent_id:"\ + " #{@parent_id.inspect}, locale: #{@locale.inspect}, default_subscription_group_uid:"\ " #{@default_subscription_group_uid.inspect}, salesforce_id: #{@salesforce_id.inspect},"\ " tax_exempt_reason: #{@tax_exempt_reason.inspect}, default_auto_renewal_profile_id:"\ " #{@default_auto_renewal_profile_id.inspect}, maxioid: #{@maxioid.inspect},"\ - " additional_properties: #{get_additional_properties}>" + " branding_theme_id: #{@branding_theme_id.inspect}, additional_properties:"\ + " #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/customer_attributes.rb b/lib/advanced_billing/models/customer_attributes.rb index 483a88e4..1183db58 100644 --- a/lib/advanced_billing/models/customer_attributes.rb +++ b/lib/advanced_billing/models/customer_attributes.rb @@ -24,48 +24,47 @@ class CustomerAttributes < BaseModel # @return [String] attr_accessor :email - # A list of emails that should be cc’d on all customer communications. - # Optional. + # (Optional) A list of emails that should be cc’d on all customer + # communications. # @return [String] attr_accessor :cc_emails - # The organization/company of the customer. Optional. + # (Optional) The organization/company of the customer. # @return [String] attr_accessor :organization - # A customer “reference”, or unique identifier from your app, stored in - # Chargify. Can be used so that you may reference your customer’s within - # Chargify using the same unique value you use in your application. - # Optional. + # (Optional) A customer “reference”, or unique identifier from your app, + # stored in Chargify. Can be used so that you may reference your customer’s + # within Chargify using the same unique value you use in your application. # @return [String] attr_accessor :reference - # (Optional) The customer’s shipping street address (i.e. “123 Main St.”). + # (Optional) The customer’s shipping street address (e.g., “123 Main St.”). # @return [String] attr_accessor :address - # (Optional) Second line of the customer’s shipping address i.e. “Apt. 100” + # (Optional) Second line of the customer’s shipping address e.g., “Apt. 100” # @return [String] attr_accessor :address_2 - # (Optional) The customer’s shipping address city (i.e. “Boston”). + # (Optional) The customer’s shipping address city (e.g., “Boston”). # @return [String] attr_accessor :city - # (Optional) The customer’s shipping address state (i.e. “MA”). This must + # “(Optional) The customer’s shipping address state (e.g., “MA”). This must # conform to the # [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in - # order to be valid for tax locale purposes. + # order to be valid for tax locale purposes.” # @return [String] attr_accessor :state - # (Optional) The customer’s shipping address zip code (i.e. “12345”). + # (Optional) The customer’s shipping address zip code (e.g., “12345”). # @return [String] attr_accessor :zip - # (Optional) The customer shipping address country, required in [ISO_3166-1 - # alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. - # “US”). + # “(Optional) The customer shipping address country, required in [ISO_3166-1 + # alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., + # “US”).” # @return [String] attr_accessor :country @@ -82,7 +81,13 @@ class CustomerAttributes < BaseModel # @return [TrueClass | FalseClass] attr_accessor :tax_exempt - # (Optional) Supplying the VAT number allows EU customer’s to opt-out of the + # (Optional) Whether surcharging is enabled for the customer. Defaults to + # `true` when omitted. Only applied on sites where surcharging control is + # enabled. + # @return [TrueClass | FalseClass] + attr_accessor :surcharging + + # (Optional) Supplying the VAT number allows EU customers to opt-out of the # Value Added Tax assuming the merchant address and customer billing address # are not within the same EU country. It’s important to omit the country # code from the VAT number upon entry. Otherwise, taxes will be assessed @@ -127,6 +132,7 @@ def self.names @_hash['phone'] = 'phone' @_hash['verified'] = 'verified' @_hash['tax_exempt'] = 'tax_exempt' + @_hash['surcharging'] = 'surcharging' @_hash['vat_number'] = 'vat_number' @_hash['metafields'] = 'metafields' @_hash['parent_id'] = 'parent_id' @@ -154,6 +160,7 @@ def self.optionals phone verified tax_exempt + surcharging vat_number metafields parent_id @@ -176,8 +183,8 @@ def initialize(first_name: SKIP, last_name: SKIP, email: SKIP, cc_emails: SKIP, organization: SKIP, reference: SKIP, address: SKIP, address_2: SKIP, city: SKIP, state: SKIP, zip: SKIP, country: SKIP, phone: SKIP, verified: SKIP, - tax_exempt: SKIP, vat_number: SKIP, metafields: SKIP, - parent_id: SKIP, salesforce_id: SKIP, + tax_exempt: SKIP, surcharging: SKIP, vat_number: SKIP, + metafields: SKIP, parent_id: SKIP, salesforce_id: SKIP, default_auto_renewal_profile_id: SKIP, additional_properties: {}) # Add additional model properties to the instance. @@ -200,6 +207,7 @@ def initialize(first_name: SKIP, last_name: SKIP, email: SKIP, @phone = phone unless phone == SKIP @verified = verified unless verified == SKIP @tax_exempt = tax_exempt unless tax_exempt == SKIP + @surcharging = surcharging unless surcharging == SKIP @vat_number = vat_number unless vat_number == SKIP @metafields = metafields unless metafields == SKIP @parent_id = parent_id unless parent_id == SKIP @@ -230,6 +238,7 @@ def self.from_hash(hash) phone = hash.key?('phone') ? hash['phone'] : SKIP verified = hash.key?('verified') ? hash['verified'] : SKIP tax_exempt = hash.key?('tax_exempt') ? hash['tax_exempt'] : SKIP + surcharging = hash.key?('surcharging') ? hash['surcharging'] : SKIP vat_number = hash.key?('vat_number') ? hash['vat_number'] : SKIP metafields = hash.key?('metafields') ? hash['metafields'] : SKIP parent_id = hash.key?('parent_id') ? hash['parent_id'] : SKIP @@ -256,6 +265,7 @@ def self.from_hash(hash) phone: phone, verified: verified, tax_exempt: tax_exempt, + surcharging: surcharging, vat_number: vat_number, metafields: metafields, parent_id: parent_id, @@ -281,9 +291,10 @@ def to_s " cc_emails: #{@cc_emails}, organization: #{@organization}, reference: #{@reference},"\ " address: #{@address}, address_2: #{@address_2}, city: #{@city}, state: #{@state}, zip:"\ " #{@zip}, country: #{@country}, phone: #{@phone}, verified: #{@verified}, tax_exempt:"\ - " #{@tax_exempt}, vat_number: #{@vat_number}, metafields: #{@metafields}, parent_id:"\ - " #{@parent_id}, salesforce_id: #{@salesforce_id}, default_auto_renewal_profile_id:"\ - " #{@default_auto_renewal_profile_id}, additional_properties: #{get_additional_properties}>" + " #{@tax_exempt}, surcharging: #{@surcharging}, vat_number: #{@vat_number}, metafields:"\ + " #{@metafields}, parent_id: #{@parent_id}, salesforce_id: #{@salesforce_id},"\ + " default_auto_renewal_profile_id: #{@default_auto_renewal_profile_id},"\ + " additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -294,11 +305,12 @@ def inspect " #{@organization.inspect}, reference: #{@reference.inspect}, address: #{@address.inspect},"\ " address_2: #{@address_2.inspect}, city: #{@city.inspect}, state: #{@state.inspect}, zip:"\ " #{@zip.inspect}, country: #{@country.inspect}, phone: #{@phone.inspect}, verified:"\ - " #{@verified.inspect}, tax_exempt: #{@tax_exempt.inspect}, vat_number:"\ - " #{@vat_number.inspect}, metafields: #{@metafields.inspect}, parent_id:"\ - " #{@parent_id.inspect}, salesforce_id: #{@salesforce_id.inspect},"\ - " default_auto_renewal_profile_id: #{@default_auto_renewal_profile_id.inspect},"\ - " additional_properties: #{get_additional_properties}>" + " #{@verified.inspect}, tax_exempt: #{@tax_exempt.inspect}, surcharging:"\ + " #{@surcharging.inspect}, vat_number: #{@vat_number.inspect}, metafields:"\ + " #{@metafields.inspect}, parent_id: #{@parent_id.inspect}, salesforce_id:"\ + " #{@salesforce_id.inspect}, default_auto_renewal_profile_id:"\ + " #{@default_auto_renewal_profile_id.inspect}, additional_properties:"\ + " #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/debit_note.rb b/lib/advanced_billing/models/debit_note.rb index c12a7f72..a82c03bd 100644 --- a/lib/advanced_billing/models/debit_note.rb +++ b/lib/advanced_billing/models/debit_note.rb @@ -26,7 +26,7 @@ class DebitNote < BaseModel # @return [Integer] attr_accessor :subscription_id - # A unique, identifier that appears on the debit note and in places it is + # A unique identifier that appears on the debit note and in places it is # referenced. # @return [Integer] attr_accessor :number @@ -44,7 +44,7 @@ class DebitNote < BaseModel # @return [String] attr_accessor :origin_credit_note_uid - # A unique, identifying string of the connected credit note. + # A unique identifying string of the connected credit note. # @return [String] attr_accessor :origin_credit_note_number @@ -88,8 +88,8 @@ class DebitNote < BaseModel # @return [InvoiceSeller] attr_accessor :seller - # Information about the customer who is owner or recipient the debited - # subscription. + # Information about the customer who is the owner or recipient of the + # debited subscription. # @return [InvoiceCustomer] attr_accessor :customer diff --git a/lib/advanced_billing/models/ebb_component.rb b/lib/advanced_billing/models/ebb_component.rb index 2e0cd938..05c0b216 100644 --- a/lib/advanced_billing/models/ebb_component.rb +++ b/lib/advanced_billing/models/ebb_component.rb @@ -10,14 +10,14 @@ class EBBComponent < BaseModel private_constant :SKIP # A name for this component that is suitable for showing customers and - # displaying on billing statements, ie. "Minutes". + # displaying on billing statements, i.e., "Minutes". # @return [String] attr_accessor :name - # The name of the unit of measurement for the component. It should be - # singular since it will be automatically pluralized when necessary. i.e. + # “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 + # component line-item” # @return [String] attr_accessor :unit_name @@ -27,7 +27,7 @@ class EBBComponent < BaseModel attr_accessor :description # 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 + # component in subsequent requests. Must start with a letter or number and # may only contain lowercase letters, numbers, or the characters '.', ':', # '-', or '_'. # @return [String] @@ -60,7 +60,7 @@ class EBBComponent < BaseModel attr_accessor :price_points # The amount the customer will be charged per unit when the pricing scheme - # is “per_unit”. The price can contain up to 8 decimal places. i.e. 1.00 or + # is “per_unit”. The price can contain up to 8 decimal places. i.e., 1.00 or # 0.0012 or 0.00000065 # @return [Object] attr_accessor :unit_price @@ -82,7 +82,7 @@ class EBBComponent < BaseModel # @return [Integer] attr_accessor :event_based_billing_metric_id - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. i.e., an interval of ‘30’ coupled with an # interval_unit of day would mean this component's default price point would # renew every 30 days. This property is only available for sites with # Multifrequency enabled. @@ -95,6 +95,12 @@ class EBBComponent < BaseModel # @return [IntervalUnit] attr_accessor :interval_unit + # (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. + # When set, this value is sent as the commodity code on invoice line items + # for this component instead of the default derived from item_category. + # @return [String] + attr_accessor :unspsc_code + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -113,6 +119,7 @@ def self.names 'event_based_billing_metric_id' @_hash['interval'] = 'interval' @_hash['interval_unit'] = 'interval_unit' + @_hash['unspsc_code'] = 'unspsc_code' @_hash end @@ -129,6 +136,7 @@ def self.optionals hide_date_range_on_invoice interval interval_unit + unspsc_code ] end @@ -136,6 +144,7 @@ def self.optionals def self.nullables %w[ interval_unit + unspsc_code ] end @@ -144,7 +153,8 @@ def initialize(name:, unit_name:, pricing_scheme:, handle: SKIP, taxable: SKIP, prices: SKIP, price_points: SKIP, unit_price: SKIP, tax_code: SKIP, hide_date_range_on_invoice: SKIP, interval: SKIP, - interval_unit: SKIP, additional_properties: {}) + interval_unit: SKIP, unspsc_code: SKIP, + additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -167,6 +177,7 @@ def initialize(name:, unit_name:, pricing_scheme:, @event_based_billing_metric_id = event_based_billing_metric_id @interval = interval unless interval == SKIP @interval_unit = interval_unit unless interval_unit == SKIP + @unspsc_code = unspsc_code unless unspsc_code == SKIP end # Creates an instance of the object from a hash. @@ -211,6 +222,7 @@ def self.from_hash(hash) hash.key?('hide_date_range_on_invoice') ? hash['hide_date_range_on_invoice'] : SKIP interval = hash.key?('interval') ? hash['interval'] : SKIP interval_unit = hash.key?('interval_unit') ? hash['interval_unit'] : SKIP + unspsc_code = hash.key?('unspsc_code') ? hash['unspsc_code'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -230,6 +242,7 @@ def self.from_hash(hash) hide_date_range_on_invoice: hide_date_range_on_invoice, interval: interval, interval_unit: interval_unit, + unspsc_code: unspsc_code, additional_properties: additional_properties) end @@ -271,7 +284,8 @@ def to_s " #{@prices}, price_points: #{@price_points}, unit_price: #{@unit_price}, tax_code:"\ " #{@tax_code}, hide_date_range_on_invoice: #{@hide_date_range_on_invoice},"\ " event_based_billing_metric_id: #{@event_based_billing_metric_id}, interval: #{@interval},"\ - " interval_unit: #{@interval_unit}, additional_properties: #{get_additional_properties}>" + " interval_unit: #{@interval_unit}, unspsc_code: #{@unspsc_code}, additional_properties:"\ + " #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -283,8 +297,8 @@ def inspect " #{@price_points.inspect}, unit_price: #{@unit_price.inspect}, tax_code:"\ " #{@tax_code.inspect}, hide_date_range_on_invoice: #{@hide_date_range_on_invoice.inspect},"\ " event_based_billing_metric_id: #{@event_based_billing_metric_id.inspect}, interval:"\ - " #{@interval.inspect}, interval_unit: #{@interval_unit.inspect}, additional_properties:"\ - " #{get_additional_properties}>" + " #{@interval.inspect}, interval_unit: #{@interval_unit.inspect}, unspsc_code:"\ + " #{@unspsc_code.inspect}, additional_properties: #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/event.rb b/lib/advanced_billing/models/event.rb index 2ef8b0f1..e2447f05 100644 --- a/lib/advanced_billing/models/event.rb +++ b/lib/advanced_billing/models/event.rb @@ -36,7 +36,8 @@ class Event < BaseModel # The schema varies based on the event key. The key-to-event data mapping is # as follows: - # * `subscription_product_change` - SubscriptionProductChange + # * `subscription_product_change`, `subscription_product_change_scheduled` - + # SubscriptionProductChange # * `subscription_state_change` - SubscriptionStateChange # * `signup_success`, `delayed_signup_creation_success`, `payment_success`, # `payment_failure`, `renewal_success`, `renewal_failure`, diff --git a/lib/advanced_billing/models/event_key.rb b/lib/advanced_billing/models/event_key.rb index ce123c60..3667c705 100644 --- a/lib/advanced_billing/models/event_key.rb +++ b/lib/advanced_billing/models/event_key.rb @@ -43,6 +43,10 @@ class EventKey # TODO: Write general description for SUBSCRIPTION_PRODUCT_CHANGE SUBSCRIPTION_PRODUCT_CHANGE = 'subscription_product_change'.freeze, + # TODO: Write general description for + # SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED + SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED = 'subscription_product_change_scheduled'.freeze, + # TODO: Write general description for PENDING_CANCELLATION_CHANGE PENDING_CANCELLATION_CHANGE = 'pending_cancellation_change'.freeze, @@ -288,6 +292,7 @@ def self.from_value(value, default_value = PAYMENT_SUCCESS) when 'renewal_failure' then RENEWAL_FAILURE when 'subscription_state_change' then SUBSCRIPTION_STATE_CHANGE when 'subscription_product_change' then SUBSCRIPTION_PRODUCT_CHANGE + when 'subscription_product_change_scheduled' then SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED when 'pending_cancellation_change' then PENDING_CANCELLATION_CHANGE when 'expiring_card' then EXPIRING_CARD when 'customer_update' then CUSTOMER_UPDATE diff --git a/lib/advanced_billing/models/failed_payment_action.rb b/lib/advanced_billing/models/failed_payment_action.rb index c96d1e25..0059dab4 100644 --- a/lib/advanced_billing/models/failed_payment_action.rb +++ b/lib/advanced_billing/models/failed_payment_action.rb @@ -13,7 +13,7 @@ module AdvancedBilling # 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 + # recorded in the invoice history; subscription will most likely go into # "past_due" or "canceled" state (depending upon net terms and dunning # settings). class FailedPaymentAction diff --git a/lib/advanced_billing/models/get_one_time_token_bank_account_payment_profile.rb b/lib/advanced_billing/models/get_one_time_token_bank_account_payment_profile.rb new file mode 100644 index 00000000..918743a1 --- /dev/null +++ b/lib/advanced_billing/models/get_one_time_token_bank_account_payment_profile.rb @@ -0,0 +1,393 @@ +# advanced_billing +# +# This file was automatically generated for Maxio by +# APIMATIC v3.0 ( https://www.apimatic.io ). + +module AdvancedBilling + # GetOneTimeTokenBankAccountPaymentProfile Model. + class GetOneTimeTokenBankAccountPaymentProfile < BaseModel + SKIP = Object.new + private_constant :SKIP + + # TODO: Write general description for this method + # @return [String] + attr_accessor :id + + # TODO: Write general description for this method + # @return [String] + attr_accessor :first_name + + # TODO: Write general description for this method + # @return [String] + attr_accessor :last_name + + # TODO: Write general description for this method + # @return [String] + attr_accessor :customer_id + + # The vault that stores the payment profile with the provided vault_token. + # Use `bogus` for testing. + # @return [BankAccountVault] + attr_accessor :current_vault + + # The vault that stores the payment profile with the provided vault_token. + # Use `bogus` for testing. + # @return [String] + attr_accessor :vault_token + + # The vault that stores the payment profile with the provided vault_token. + # Use `bogus` for testing. + # @return [String] + attr_accessor :billing_address + + # The vault that stores the payment profile with the provided vault_token. + # Use `bogus` for testing. + # @return [String] + attr_accessor :billing_address_2 + + # The vault that stores the payment profile with the provided vault_token. + # Use `bogus` for testing. + # @return [String] + attr_accessor :billing_city + + # The vault that stores the payment profile with the provided vault_token. + # Use `bogus` for testing. + # @return [String] + attr_accessor :billing_country + + # The vault that stores the payment profile with the provided vault_token. + # Use `bogus` for testing. + # @return [String] + attr_accessor :billing_state + + # The vault that stores the payment profile with the provided vault_token. + # Use `bogus` for testing. + # @return [String] + attr_accessor :billing_zip + + # The vault that stores the payment profile with the provided vault_token. + # Use `bogus` for testing. + # @return [String] + attr_accessor :bank_name + + # The vault that stores the payment profile with the provided vault_token. + # Use `bogus` for testing. + # @return [String] + attr_accessor :masked_bank_routing_number + + # The vault that stores the payment profile with the provided vault_token. + # Use `bogus` for testing. + # @return [String] + attr_accessor :masked_bank_account_number + + # Defaults to checking + # @return [BankAccountType] + attr_accessor :bank_account_type + + # Defaults to personal + # @return [BankAccountHolderType] + attr_accessor :bank_account_holder_type + + # Defaults to personal + # @return [String] + attr_accessor :payment_type + + # Defaults to personal + # @return [TrueClass | FalseClass] + attr_accessor :disabled + + # Defaults to personal + # @return [Integer] + attr_accessor :site_gateway_setting_id + + # Defaults to personal + # @return [String] + attr_accessor :customer_vault_token + + # Defaults to personal + # @return [String] + attr_accessor :gateway_handle + + # Defaults to personal + # @return [TrueClass | FalseClass] + attr_accessor :verified + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['id'] = 'id' + @_hash['first_name'] = 'first_name' + @_hash['last_name'] = 'last_name' + @_hash['customer_id'] = 'customer_id' + @_hash['current_vault'] = 'current_vault' + @_hash['vault_token'] = 'vault_token' + @_hash['billing_address'] = 'billing_address' + @_hash['billing_address_2'] = 'billing_address_2' + @_hash['billing_city'] = 'billing_city' + @_hash['billing_country'] = 'billing_country' + @_hash['billing_state'] = 'billing_state' + @_hash['billing_zip'] = 'billing_zip' + @_hash['bank_name'] = 'bank_name' + @_hash['masked_bank_routing_number'] = 'masked_bank_routing_number' + @_hash['masked_bank_account_number'] = 'masked_bank_account_number' + @_hash['bank_account_type'] = 'bank_account_type' + @_hash['bank_account_holder_type'] = 'bank_account_holder_type' + @_hash['payment_type'] = 'payment_type' + @_hash['disabled'] = 'disabled' + @_hash['site_gateway_setting_id'] = 'site_gateway_setting_id' + @_hash['customer_vault_token'] = 'customer_vault_token' + @_hash['gateway_handle'] = 'gateway_handle' + @_hash['verified'] = 'verified' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + id + customer_id + billing_address_2 + customer_vault_token + gateway_handle + verified + ] + end + + # An array for nullable fields + def self.nullables + %w[ + id + customer_id + customer_vault_token + gateway_handle + verified + ] + end + + def initialize(first_name:, last_name:, current_vault:, vault_token:, + billing_address:, billing_city:, billing_country:, + billing_state:, billing_zip:, bank_name:, + masked_bank_routing_number:, masked_bank_account_number:, + bank_account_type:, bank_account_holder_type:, payment_type:, + disabled:, site_gateway_setting_id:, id: SKIP, + customer_id: SKIP, billing_address_2: SKIP, + customer_vault_token: SKIP, gateway_handle: SKIP, + verified: 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 + @first_name = first_name + @last_name = last_name + @customer_id = customer_id unless customer_id == SKIP + @current_vault = current_vault + @vault_token = vault_token + @billing_address = billing_address + @billing_address_2 = billing_address_2 unless billing_address_2 == SKIP + @billing_city = billing_city + @billing_country = billing_country + @billing_state = billing_state + @billing_zip = billing_zip + @bank_name = bank_name + @masked_bank_routing_number = masked_bank_routing_number + @masked_bank_account_number = masked_bank_account_number + @bank_account_type = bank_account_type + @bank_account_holder_type = bank_account_holder_type + @payment_type = payment_type + @disabled = disabled + @site_gateway_setting_id = site_gateway_setting_id + @customer_vault_token = customer_vault_token unless customer_vault_token == SKIP + @gateway_handle = gateway_handle unless gateway_handle == SKIP + @verified = verified unless verified == 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. + first_name = hash.key?('first_name') ? hash['first_name'] : nil + last_name = hash.key?('last_name') ? hash['last_name'] : nil + current_vault = hash.key?('current_vault') ? hash['current_vault'] : nil + vault_token = hash.key?('vault_token') ? hash['vault_token'] : nil + billing_address = + hash.key?('billing_address') ? hash['billing_address'] : nil + billing_city = hash.key?('billing_city') ? hash['billing_city'] : nil + billing_country = + hash.key?('billing_country') ? hash['billing_country'] : nil + billing_state = hash.key?('billing_state') ? hash['billing_state'] : nil + billing_zip = hash.key?('billing_zip') ? hash['billing_zip'] : nil + bank_name = hash.key?('bank_name') ? hash['bank_name'] : nil + masked_bank_routing_number = + hash.key?('masked_bank_routing_number') ? hash['masked_bank_routing_number'] : nil + masked_bank_account_number = + hash.key?('masked_bank_account_number') ? hash['masked_bank_account_number'] : nil + bank_account_type = + hash.key?('bank_account_type') ? hash['bank_account_type'] : nil + bank_account_holder_type = + hash.key?('bank_account_holder_type') ? hash['bank_account_holder_type'] : nil + payment_type = hash.key?('payment_type') ? hash['payment_type'] : nil + disabled = hash.key?('disabled') ? hash['disabled'] : nil + site_gateway_setting_id = + hash.key?('site_gateway_setting_id') ? hash['site_gateway_setting_id'] : nil + id = hash.key?('id') ? hash['id'] : SKIP + customer_id = hash.key?('customer_id') ? hash['customer_id'] : SKIP + billing_address_2 = + hash.key?('billing_address_2') ? hash['billing_address_2'] : SKIP + customer_vault_token = + hash.key?('customer_vault_token') ? hash['customer_vault_token'] : SKIP + gateway_handle = + hash.key?('gateway_handle') ? hash['gateway_handle'] : SKIP + verified = hash.key?('verified') ? hash['verified'] : SKIP + + # Clean out expected properties from Hash. + additional_properties = hash.reject { |k, _| names.value?(k) } + + # Create object from extracted values. + GetOneTimeTokenBankAccountPaymentProfile.new(first_name: first_name, + last_name: last_name, + current_vault: current_vault, + vault_token: vault_token, + billing_address: billing_address, + billing_city: billing_city, + billing_country: billing_country, + billing_state: billing_state, + billing_zip: billing_zip, + bank_name: bank_name, + masked_bank_routing_number: masked_bank_routing_number, + masked_bank_account_number: masked_bank_account_number, + bank_account_type: bank_account_type, + bank_account_holder_type: bank_account_holder_type, + payment_type: payment_type, + disabled: disabled, + site_gateway_setting_id: site_gateway_setting_id, + id: id, + customer_id: customer_id, + billing_address_2: billing_address_2, + customer_vault_token: customer_vault_token, + gateway_handle: gateway_handle, + verified: verified, + additional_properties: additional_properties) + end + + # Validates an instance of the object from a given value. + # @param [GetOneTimeTokenBankAccountPaymentProfile | Hash] The value against the validation is performed. + def self.validate(value) + if value.instance_of? self + return ( + APIHelper.valid_type?(value.first_name, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.last_name, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.current_vault, + ->(val) { BankAccountVault.validate(val) }) and + APIHelper.valid_type?(value.vault_token, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.billing_address, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.billing_city, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.billing_country, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.billing_state, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.billing_zip, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.bank_name, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.masked_bank_routing_number, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.masked_bank_account_number, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.bank_account_type, + ->(val) { BankAccountType.validate(val) }) and + APIHelper.valid_type?(value.bank_account_holder_type, + ->(val) { BankAccountHolderType.validate(val) }) and + APIHelper.valid_type?(value.payment_type, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.disabled, + ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass }) and + APIHelper.valid_type?(value.site_gateway_setting_id, + ->(val) { val.instance_of? Integer }) + ) + end + + return false unless value.instance_of? Hash + + ( + APIHelper.valid_type?(value['first_name'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['last_name'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['current_vault'], + ->(val) { BankAccountVault.validate(val) }) and + APIHelper.valid_type?(value['vault_token'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['billing_address'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['billing_city'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['billing_country'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['billing_state'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['billing_zip'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['bank_name'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['masked_bank_routing_number'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['masked_bank_account_number'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['bank_account_type'], + ->(val) { BankAccountType.validate(val) }) and + APIHelper.valid_type?(value['bank_account_holder_type'], + ->(val) { BankAccountHolderType.validate(val) }) and + APIHelper.valid_type?(value['payment_type'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['disabled'], + ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass }) and + APIHelper.valid_type?(value['site_gateway_setting_id'], + ->(val) { val.instance_of? Integer }) + ) + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} id: #{@id}, first_name: #{@first_name}, last_name: #{@last_name},"\ + " customer_id: #{@customer_id}, current_vault: #{@current_vault}, vault_token:"\ + " #{@vault_token}, billing_address: #{@billing_address}, billing_address_2:"\ + " #{@billing_address_2}, billing_city: #{@billing_city}, billing_country:"\ + " #{@billing_country}, billing_state: #{@billing_state}, billing_zip: #{@billing_zip},"\ + " bank_name: #{@bank_name}, masked_bank_routing_number: #{@masked_bank_routing_number},"\ + " masked_bank_account_number: #{@masked_bank_account_number}, bank_account_type:"\ + " #{@bank_account_type}, bank_account_holder_type: #{@bank_account_holder_type},"\ + " payment_type: #{@payment_type}, disabled: #{@disabled}, site_gateway_setting_id:"\ + " #{@site_gateway_setting_id}, customer_vault_token: #{@customer_vault_token},"\ + " gateway_handle: #{@gateway_handle}, verified: #{@verified}, 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}, first_name: #{@first_name.inspect}, last_name:"\ + " #{@last_name.inspect}, customer_id: #{@customer_id.inspect}, current_vault:"\ + " #{@current_vault.inspect}, vault_token: #{@vault_token.inspect}, billing_address:"\ + " #{@billing_address.inspect}, billing_address_2: #{@billing_address_2.inspect},"\ + " billing_city: #{@billing_city.inspect}, billing_country: #{@billing_country.inspect},"\ + " billing_state: #{@billing_state.inspect}, billing_zip: #{@billing_zip.inspect}, bank_name:"\ + " #{@bank_name.inspect}, masked_bank_routing_number: #{@masked_bank_routing_number.inspect},"\ + " masked_bank_account_number: #{@masked_bank_account_number.inspect}, bank_account_type:"\ + " #{@bank_account_type.inspect}, bank_account_holder_type:"\ + " #{@bank_account_holder_type.inspect}, payment_type: #{@payment_type.inspect}, disabled:"\ + " #{@disabled.inspect}, site_gateway_setting_id: #{@site_gateway_setting_id.inspect},"\ + " customer_vault_token: #{@customer_vault_token.inspect}, gateway_handle:"\ + " #{@gateway_handle.inspect}, verified: #{@verified.inspect}, additional_properties:"\ + " #{get_additional_properties}>" + end + end +end diff --git a/lib/advanced_billing/models/get_one_time_token_payment_profile.rb b/lib/advanced_billing/models/get_one_time_token_payment_profile.rb index 24658ab5..5372b812 100644 --- a/lib/advanced_billing/models/get_one_time_token_payment_profile.rb +++ b/lib/advanced_billing/models/get_one_time_token_payment_profile.rb @@ -254,6 +254,84 @@ def self.from_hash(hash) additional_properties: additional_properties) end + # Validates an instance of the object from a given value. + # @param [GetOneTimeTokenPaymentProfile | Hash] The value against the validation is performed. + def self.validate(value) + if value.instance_of? self + return ( + APIHelper.valid_type?(value.first_name, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.last_name, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.masked_card_number, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.card_type, + ->(val) { CardType.validate(val) }) and + APIHelper.valid_type?(value.expiration_month, + ->(val) { val.instance_of? Float }) and + APIHelper.valid_type?(value.expiration_year, + ->(val) { val.instance_of? Float }) and + APIHelper.valid_type?(value.current_vault, + ->(val) { CreditCardVault.validate(val) }) and + APIHelper.valid_type?(value.vault_token, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.billing_address, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.billing_city, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.billing_country, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.billing_state, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.billing_zip, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.payment_type, + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value.disabled, + ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass }) and + APIHelper.valid_type?(value.site_gateway_setting_id, + ->(val) { val.instance_of? Integer }) + ) + end + + return false unless value.instance_of? Hash + + ( + APIHelper.valid_type?(value['first_name'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['last_name'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['masked_card_number'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['card_type'], + ->(val) { CardType.validate(val) }) and + APIHelper.valid_type?(value['expiration_month'], + ->(val) { val.instance_of? Float }) and + APIHelper.valid_type?(value['expiration_year'], + ->(val) { val.instance_of? Float }) and + APIHelper.valid_type?(value['current_vault'], + ->(val) { CreditCardVault.validate(val) }) and + APIHelper.valid_type?(value['vault_token'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['billing_address'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['billing_city'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['billing_country'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['billing_state'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['billing_zip'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['payment_type'], + ->(val) { val.instance_of? String }) and + APIHelper.valid_type?(value['disabled'], + ->(val) { val.instance_of? TrueClass or val.instance_of? FalseClass }) and + APIHelper.valid_type?(value['site_gateway_setting_id'], + ->(val) { val.instance_of? Integer }) + ) + end + # Provides a human-readable string representation of the object. def to_s class_name = self.class.name.split('::').last diff --git a/lib/advanced_billing/models/get_one_time_token_request.rb b/lib/advanced_billing/models/get_one_time_token_request.rb index 923985df..b6294d1c 100644 --- a/lib/advanced_billing/models/get_one_time_token_request.rb +++ b/lib/advanced_billing/models/get_one_time_token_request.rb @@ -10,7 +10,7 @@ class GetOneTimeTokenRequest < BaseModel private_constant :SKIP # TODO: Write general description for this method - # @return [GetOneTimeTokenPaymentProfile] + # @return [Object] attr_accessor :payment_profile # A mapping from model property names to API property names. @@ -44,8 +44,9 @@ def self.from_hash(hash) return nil unless hash # Extract variables from the hash. - payment_profile = GetOneTimeTokenPaymentProfile.from_hash(hash['payment_profile']) if - hash['payment_profile'] + payment_profile = hash.key?('payment_profile') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:GetOneTimeTokenRequestPaymentProfile), hash['payment_profile'] + ) : nil # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -55,6 +56,20 @@ def self.from_hash(hash) additional_properties: additional_properties) end + # Validates an instance of the object from a given value. + # @param [GetOneTimeTokenRequest | Hash] The value against the validation is performed. + def self.validate(value) + if value.instance_of? self + return UnionTypeLookUp.get(:GetOneTimeTokenRequestPaymentProfile) + .validate(value.payment_profile) + end + + return false unless value.instance_of? Hash + + UnionTypeLookUp.get(:GetOneTimeTokenRequestPaymentProfile) + .validate(value['payment_profile']) + end + # Provides a human-readable string representation of the object. def to_s class_name = self.class.name.split('::').last diff --git a/lib/advanced_billing/models/group_billing.rb b/lib/advanced_billing/models/group_billing.rb index 93b79b06..a9c479b6 100644 --- a/lib/advanced_billing/models/group_billing.rb +++ b/lib/advanced_billing/models/group_billing.rb @@ -4,7 +4,7 @@ # APIMATIC v3.0 ( https://www.apimatic.io ). module AdvancedBilling - # Optional attributes related to billing date and accrual. Note: Only + # (Optional) Attributes related to billing date and accrual. Note: Only # applicable for new subscriptions. class GroupBilling < BaseModel SKIP = Object.new diff --git a/lib/advanced_billing/models/group_settings.rb b/lib/advanced_billing/models/group_settings.rb index 4fafe2a3..9c292e91 100644 --- a/lib/advanced_billing/models/group_settings.rb +++ b/lib/advanced_billing/models/group_settings.rb @@ -14,7 +14,7 @@ class GroupSettings < BaseModel # @return [GroupTarget] attr_accessor :target - # Optional attributes related to billing date and accrual. Note: Only + # (Optional) Attributes related to billing date and accrual. Note: Only # applicable for new subscriptions. # @return [GroupBilling] attr_accessor :billing diff --git a/lib/advanced_billing/models/group_status.rb b/lib/advanced_billing/models/group_status.rb new file mode 100644 index 00000000..278dc075 --- /dev/null +++ b/lib/advanced_billing/models/group_status.rb @@ -0,0 +1,36 @@ +# advanced_billing +# +# This file was automatically generated for Maxio by +# APIMATIC v3.0 ( https://www.apimatic.io ). + +module AdvancedBilling + # group_status. + class GroupStatus + GROUP_STATUS = [ + # TODO: Write general description for UNGROUPED + UNGROUPED = 'ungrouped'.freeze, + + # TODO: Write general description for GROUPED + GROUPED = 'grouped'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + GROUP_STATUS.include?(value) + end + + def self.from_value(value, default_value = UNGROUPED) + return default_value if value.nil? + + str = value.to_s.strip + + case str.downcase + when 'ungrouped' then UNGROUPED + when 'grouped' then GROUPED + else + default_value + end + end + end +end diff --git a/lib/advanced_billing/models/group_target.rb b/lib/advanced_billing/models/group_target.rb index cef9c44c..dad3a6bd 100644 --- a/lib/advanced_billing/models/group_target.rb +++ b/lib/advanced_billing/models/group_target.rb @@ -15,8 +15,8 @@ class GroupTarget < BaseModel attr_accessor :type # The id of the target customer or subscription to group the existing - # subscription with. Ignored and should not be included if type is "self" , - # "parent", or "eldest" + # subscription with. Ignored and should not be included if type is "self", + # "parent", or "eldest". # @return [Integer] attr_accessor :id diff --git a/lib/advanced_billing/models/historic_usage.rb b/lib/advanced_billing/models/historic_usage.rb index fda701de..4000058d 100644 --- a/lib/advanced_billing/models/historic_usage.rb +++ b/lib/advanced_billing/models/historic_usage.rb @@ -5,8 +5,8 @@ require 'date' module AdvancedBilling - # Optional for Event Based Components. If the `include=historic_usages` query - # param is provided, the last ten billing periods will be returned. + # (Optional) For Event Based Components. If the `include=historic_usages` + # query param is provided, the last ten billing periods will be returned. class HistoricUsage < BaseModel SKIP = Object.new private_constant :SKIP diff --git a/lib/advanced_billing/models/invoice.rb b/lib/advanced_billing/models/invoice.rb index 3ba2d704..497cb243 100644 --- a/lib/advanced_billing/models/invoice.rb +++ b/lib/advanced_billing/models/invoice.rb @@ -39,30 +39,30 @@ class Invoice < BaseModel attr_accessor :number # A monotonically increasing number assigned to invoices as they are - # created. This number is unique within a site and can be used to sort and + # created. This number is unique within a site and can be used to sort and # order invoices. # @return [Integer] attr_accessor :sequence_number # A monotonically increasing number assigned to invoices as they are - # created. This number is unique within a site and can be used to sort and + # created. This number is unique within a site and can be used to sort and # order invoices. # @return [DateTime] attr_accessor :transaction_time # A monotonically increasing number assigned to invoices as they are - # created. This number is unique within a site and can be used to sort and + # created. This number is unique within a site and can be used to sort and # order invoices. # @return [DateTime] attr_accessor :created_at # A monotonically increasing number assigned to invoices as they are - # created. This number is unique within a site and can be used to sort and + # created. This number is unique within a site and can be used to sort and # order invoices. # @return [DateTime] attr_accessor :updated_at - # Date the invoice was issued to the customer. This is the date that the + # Date the invoice was issued to the customer. This is the date that the # invoice was made available for payment. # The format is `"YYYY-MM-DD"`. # @return [Date] @@ -117,7 +117,7 @@ class Invoice < BaseModel attr_accessor :currency # Consolidation level of the invoice, which is applicable to invoice - # consolidation. It will hold one of the following values: + # consolidation. It will hold one of the following values: # * "none": A normal invoice with no consolidation. # * "child": An invoice segment which has been combined into a consolidated # invoice. @@ -165,27 +165,27 @@ class Invoice < BaseModel # @return [InvoiceSeller] attr_accessor :seller - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [InvoiceCustomer] attr_accessor :customer - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [InvoicePayer] attr_accessor :payer - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [Array[String]] attr_accessor :recipient_emails - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [Integer] attr_accessor :net_terms - # The memo printed on invoices of any collection type. This message is in + # The memo printed on invoices of any collection type. This message is in # control of the merchant. # @return [String] attr_accessor :memo @@ -212,7 +212,7 @@ class Invoice < BaseModel attr_accessor :tax_amount # The invoice total, which is `subtotal_amount - discount_amount + - # tax_amount`.' + # tax_amount`. # @return [String] attr_accessor :total_amount @@ -292,6 +292,13 @@ class Invoice < BaseModel # @return [Date] attr_accessor :public_url_expires_on + # The ID of the Branding Theme associated with this invoice. This value + # represents the Branding Theme used for invoice theming, such as themed + # invoice rendering. Available only when Branding Themes are enabled for the + # site. + # @return [Integer] + attr_accessor :branding_theme_id + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -352,6 +359,7 @@ def self.names @_hash['public_url'] = 'public_url' @_hash['previous_balance_data'] = 'previous_balance_data' @_hash['public_url_expires_on'] = 'public_url_expires_on' + @_hash['branding_theme_id'] = 'branding_theme_id' @_hash end @@ -414,6 +422,7 @@ def self.optionals public_url previous_balance_data public_url_expires_on + branding_theme_id ] end @@ -426,6 +435,7 @@ def self.nullables subscription_group_id parent_invoice_number group_primary_subscription_id + branding_theme_id ] end @@ -450,7 +460,7 @@ def initialize(id: SKIP, uid: SKIP, site_id: SKIP, customer_id: SKIP, payments: SKIP, custom_fields: SKIP, display_settings: SKIP, avatax_details: SKIP, public_url: SKIP, previous_balance_data: SKIP, public_url_expires_on: SKIP, - additional_properties: {}) + branding_theme_id: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -515,6 +525,7 @@ def initialize(id: SKIP, uid: SKIP, site_id: SKIP, customer_id: SKIP, @public_url = public_url unless public_url == SKIP @previous_balance_data = previous_balance_data unless previous_balance_data == SKIP @public_url_expires_on = public_url_expires_on unless public_url_expires_on == SKIP + @branding_theme_id = branding_theme_id unless branding_theme_id == SKIP end # Creates an instance of the object from a hash. @@ -682,6 +693,8 @@ def self.from_hash(hash) hash['previous_balance_data'] public_url_expires_on = hash.key?('public_url_expires_on') ? hash['public_url_expires_on'] : SKIP + branding_theme_id = + hash.key?('branding_theme_id') ? hash['branding_theme_id'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -743,6 +756,7 @@ def self.from_hash(hash) public_url: public_url, previous_balance_data: previous_balance_data, public_url_expires_on: public_url_expires_on, + branding_theme_id: branding_theme_id, additional_properties: additional_properties) end @@ -793,7 +807,8 @@ def to_s " #{@refunds}, payments: #{@payments}, custom_fields: #{@custom_fields}, display_settings:"\ " #{@display_settings}, avatax_details: #{@avatax_details}, public_url: #{@public_url},"\ " previous_balance_data: #{@previous_balance_data}, public_url_expires_on:"\ - " #{@public_url_expires_on}, additional_properties: #{get_additional_properties}>" + " #{@public_url_expires_on}, branding_theme_id: #{@branding_theme_id},"\ + " additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -827,7 +842,8 @@ def inspect " display_settings: #{@display_settings.inspect}, avatax_details:"\ " #{@avatax_details.inspect}, public_url: #{@public_url.inspect}, previous_balance_data:"\ " #{@previous_balance_data.inspect}, public_url_expires_on:"\ - " #{@public_url_expires_on.inspect}, additional_properties: #{get_additional_properties}>" + " #{@public_url_expires_on.inspect}, branding_theme_id: #{@branding_theme_id.inspect},"\ + " additional_properties: #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/invoice_consolidation_level.rb b/lib/advanced_billing/models/invoice_consolidation_level.rb index 99f8f20d..15e12dfe 100644 --- a/lib/advanced_billing/models/invoice_consolidation_level.rb +++ b/lib/advanced_billing/models/invoice_consolidation_level.rb @@ -5,7 +5,7 @@ module AdvancedBilling # Consolidation level of the invoice, which is applicable to invoice - # consolidation. It will hold one of the following values: * "none": A normal + # consolidation. It will hold one of the following values: * "none": A normal # invoice with no consolidation. * "child": An invoice segment which has been # combined into a consolidated invoice. * "parent": A consolidated invoice, # whose contents are composed of invoice segments. "Parent" invoices do not diff --git a/lib/advanced_billing/models/invoice_customer.rb b/lib/advanced_billing/models/invoice_customer.rb index 7ed18f2c..6ddbca3c 100644 --- a/lib/advanced_billing/models/invoice_customer.rb +++ b/lib/advanced_billing/models/invoice_customer.rb @@ -4,7 +4,7 @@ # APIMATIC v3.0 ( https://www.apimatic.io ). module AdvancedBilling - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. class InvoiceCustomer < BaseModel SKIP = Object.new diff --git a/lib/advanced_billing/models/invoice_line_item.rb b/lib/advanced_billing/models/invoice_line_item.rb index 2990e73d..551ec739 100644 --- a/lib/advanced_billing/models/invoice_line_item.rb +++ b/lib/advanced_billing/models/invoice_line_item.rb @@ -9,7 +9,7 @@ class InvoiceLineItem < BaseModel SKIP = Object.new private_constant :SKIP - # Unique identifier for the line item. Useful when cross-referencing the + # Unique identifier for the line item. Useful when cross-referencing the # line against individual discounts in the `discounts` or `taxes` lists. # @return [String] attr_accessor :uid @@ -18,7 +18,7 @@ class InvoiceLineItem < BaseModel # @return [String] attr_accessor :title - # Detailed description for the charge or item represented by this line. May + # Detailed description for the charge or item represented by this line. May # include proration details in plain text. # Note: this string may contain line breaks that are hints for the best # display format on the invoice. @@ -32,7 +32,7 @@ class InvoiceLineItem < BaseModel attr_accessor :quantity # The price per unit for the line item. - # When tiered pricing was used (i.e. not every unit was actually priced at + # When tiered pricing was used (i.e., not every unit was actually priced at # the same price) this will be the blended average cost per unit and the # `tiered_unit_price` field will be set to `true`. # @return [String] @@ -77,7 +77,7 @@ class InvoiceLineItem < BaseModel # The non-canonical total amount for the line. # `subtotal_amount` is the canonical amount for a line. The invoice # `total_amount` is derived from the sum of the line `subtotal_amount`s and - # discounts or taxes applied thereafter. Therefore, due to rounding or + # discounts or taxes applied thereafter. Therefore, due to rounding or # precision errors, the sum of line `total_amount`s may not equal the # invoice `total_amount`. # @return [String] @@ -92,7 +92,7 @@ class InvoiceLineItem < BaseModel # `"YYYY-MM-DD"`. # * For periodic charges paid in advance, this date will match the billing # date, and the end date will be in the future. - # * For periodic charges paid in arrears (e.g. metered charges), this date + # * For periodic charges paid in arrears (e.g., metered charges), this date # will be the date of the previous billing, and the end date will be the # current billing date. # * For non-periodic charges, this date and the end date will match. @@ -103,7 +103,7 @@ class InvoiceLineItem < BaseModel # `"YYYY-MM-DD"`. # * For periodic charges paid in advance, this date will match the next # (future) billing date. - # * For periodic charges paid in arrears (e.g. metered charges), this date + # * For periodic charges paid in arrears (e.g., metered charges), this date # will be the date of the current billing date. # * For non-periodic charges, this date and the start date will match. # @return [Date] @@ -113,7 +113,7 @@ class InvoiceLineItem < BaseModel # `"YYYY-MM-DD"`. # * For periodic charges paid in advance, this date will match the next # (future) billing date. - # * For periodic charges paid in arrears (e.g. metered charges), this date + # * For periodic charges paid in arrears (e.g., metered charges), this date # will be the date of the current billing date. # * For non-periodic charges, this date and the start date will match. # @return [Integer] diff --git a/lib/advanced_billing/models/issue_invoice_event_data.rb b/lib/advanced_billing/models/issue_invoice_event_data.rb index a391bc73..593dae87 100644 --- a/lib/advanced_billing/models/issue_invoice_event_data.rb +++ b/lib/advanced_billing/models/issue_invoice_event_data.rb @@ -10,7 +10,7 @@ class IssueInvoiceEventData < BaseModel private_constant :SKIP # Consolidation level of the invoice, which is applicable to invoice - # consolidation. It will hold one of the following values: + # consolidation. It will hold one of the following values: # * "none": A normal invoice with no consolidation. # * "child": An invoice segment which has been combined into a consolidated # invoice. diff --git a/lib/advanced_billing/models/issue_invoice_request.rb b/lib/advanced_billing/models/issue_invoice_request.rb index 9df9a583..170692c1 100644 --- a/lib/advanced_billing/models/issue_invoice_request.rb +++ b/lib/advanced_billing/models/issue_invoice_request.rb @@ -20,7 +20,7 @@ class IssueInvoiceRequest < BaseModel # - `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" + # history; subscription will most likely go into "past_due" or "canceled" # state (depending upon net terms and dunning settings). # @return [FailedPaymentAction] attr_accessor :on_failed_payment diff --git a/lib/advanced_billing/models/list_subscription_group_prepayment.rb b/lib/advanced_billing/models/list_subscription_group_prepayment.rb index 26ecfb0c..28614674 100644 --- a/lib/advanced_billing/models/list_subscription_group_prepayment.rb +++ b/lib/advanced_billing/models/list_subscription_group_prepayment.rb @@ -10,7 +10,7 @@ class ListSubscriptionGroupPrepayment < BaseModel private_constant :SKIP # TODO: Write general description for this method - # @return [ListSubcriptionGroupPrepaymentItem] + # @return [ListSubscriptionGroupPrepaymentItem] attr_accessor :prepayment # A mapping from model property names to API property names. @@ -44,7 +44,7 @@ def self.from_hash(hash) return nil unless hash # Extract variables from the hash. - prepayment = ListSubcriptionGroupPrepaymentItem.from_hash(hash['prepayment']) if + prepayment = ListSubscriptionGroupPrepaymentItem.from_hash(hash['prepayment']) if hash['prepayment'] # Clean out expected properties from Hash. diff --git a/lib/advanced_billing/models/list_subcription_group_prepayment_item.rb b/lib/advanced_billing/models/list_subscription_group_prepayment_item.rb similarity index 86% rename from lib/advanced_billing/models/list_subcription_group_prepayment_item.rb rename to lib/advanced_billing/models/list_subscription_group_prepayment_item.rb index a0608a39..313a148e 100644 --- a/lib/advanced_billing/models/list_subcription_group_prepayment_item.rb +++ b/lib/advanced_billing/models/list_subscription_group_prepayment_item.rb @@ -5,8 +5,8 @@ require 'date' module AdvancedBilling - # ListSubcriptionGroupPrepaymentItem Model. - class ListSubcriptionGroupPrepaymentItem < BaseModel + # ListSubscriptionGroupPrepaymentItem Model. + class ListSubscriptionGroupPrepaymentItem < BaseModel SKIP = Object.new private_constant :SKIP @@ -131,16 +131,16 @@ def self.from_hash(hash) additional_properties = hash.reject { |k, _| names.value?(k) } # Create object from extracted values. - ListSubcriptionGroupPrepaymentItem.new(id: id, - subscription_group_uid: subscription_group_uid, - amount_in_cents: amount_in_cents, - remaining_amount_in_cents: remaining_amount_in_cents, - details: details, - external: external, - memo: memo, - payment_type: payment_type, - created_at: created_at, - additional_properties: additional_properties) + ListSubscriptionGroupPrepaymentItem.new(id: id, + subscription_group_uid: subscription_group_uid, + amount_in_cents: amount_in_cents, + remaining_amount_in_cents: remaining_amount_in_cents, + details: details, + external: external, + memo: memo, + payment_type: payment_type, + created_at: created_at, + additional_properties: additional_properties) end def to_custom_created_at diff --git a/lib/advanced_billing/models/metered_component.rb b/lib/advanced_billing/models/metered_component.rb index f6fd5ea7..bc720a19 100644 --- a/lib/advanced_billing/models/metered_component.rb +++ b/lib/advanced_billing/models/metered_component.rb @@ -10,12 +10,12 @@ class MeteredComponent < BaseModel private_constant :SKIP # A name for this component that is suitable for showing customers and - # displaying on billing statements, ie. "Minutes". + # displaying on billing statements, e.g., "Minutes". # @return [String] attr_accessor :name # The name of the unit of measurement for the component. It should be - # singular since it will be automatically pluralized when necessary. i.e. + # singular since it will be automatically pluralized when necessary. e.g., # “message”, which may then be shown as “5 messages” on a subscription’s # component line-item # @return [String] @@ -27,7 +27,7 @@ class MeteredComponent < BaseModel attr_accessor :description # 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 + # component in subsequent requests. Must start with a letter or number and # may only contain lowercase letters, numbers, or the characters '.', ':', # '-', or '_'. # @return [String] @@ -62,7 +62,7 @@ class MeteredComponent < BaseModel # The amount the customer will be charged per unit when the pricing scheme # is “per_unit”. For On/Off Components, this is the amount that the customer # will be charged when they turn the component on for the subscription. The - # price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or + # price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or # 0.00000065 # @return [Object] attr_accessor :unit_price @@ -97,7 +97,7 @@ class MeteredComponent < BaseModel # @return [Array[Integer]] attr_accessor :public_signup_page_ids - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., an interval of ‘30’ coupled with an # interval_unit of day would mean this component's default price point would # renew every 30 days. This property is only available for sites with # Multifrequency enabled. @@ -110,6 +110,12 @@ class MeteredComponent < BaseModel # @return [IntervalUnit] attr_accessor :interval_unit + # (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. + # When set, this value is sent as the commodity code on invoice line items + # for this component instead of the default derived from item_category. + # @return [String] + attr_accessor :unspsc_code + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -129,6 +135,7 @@ def self.names @_hash['public_signup_page_ids'] = 'public_signup_page_ids' @_hash['interval'] = 'interval' @_hash['interval_unit'] = 'interval_unit' + @_hash['unspsc_code'] = 'unspsc_code' @_hash end @@ -148,6 +155,7 @@ def self.optionals public_signup_page_ids interval interval_unit + unspsc_code ] end @@ -155,6 +163,7 @@ def self.optionals def self.nullables %w[ interval_unit + unspsc_code ] end @@ -165,7 +174,8 @@ def initialize(name:, unit_name:, pricing_scheme:, description: SKIP, display_on_hosted_page: SKIP, allow_fractional_quantities: SKIP, public_signup_page_ids: SKIP, interval: SKIP, - interval_unit: SKIP, additional_properties: {}) + interval_unit: SKIP, unspsc_code: SKIP, + additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -193,6 +203,7 @@ def initialize(name:, unit_name:, pricing_scheme:, description: SKIP, @public_signup_page_ids = public_signup_page_ids unless public_signup_page_ids == SKIP @interval = interval unless interval == SKIP @interval_unit = interval_unit unless interval_unit == SKIP + @unspsc_code = unspsc_code unless unspsc_code == SKIP end # Creates an instance of the object from a hash. @@ -241,6 +252,7 @@ def self.from_hash(hash) hash.key?('public_signup_page_ids') ? hash['public_signup_page_ids'] : SKIP interval = hash.key?('interval') ? hash['interval'] : SKIP interval_unit = hash.key?('interval_unit') ? hash['interval_unit'] : SKIP + unspsc_code = hash.key?('unspsc_code') ? hash['unspsc_code'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -262,6 +274,7 @@ def self.from_hash(hash) public_signup_page_ids: public_signup_page_ids, interval: interval, interval_unit: interval_unit, + unspsc_code: unspsc_code, additional_properties: additional_properties) end @@ -300,8 +313,8 @@ def to_s " #{@tax_code}, hide_date_range_on_invoice: #{@hide_date_range_on_invoice},"\ " display_on_hosted_page: #{@display_on_hosted_page}, allow_fractional_quantities:"\ " #{@allow_fractional_quantities}, public_signup_page_ids: #{@public_signup_page_ids},"\ - " interval: #{@interval}, interval_unit: #{@interval_unit}, additional_properties:"\ - " #{get_additional_properties}>" + " interval: #{@interval}, interval_unit: #{@interval_unit}, unspsc_code: #{@unspsc_code},"\ + " additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -315,7 +328,8 @@ def inspect " display_on_hosted_page: #{@display_on_hosted_page.inspect}, allow_fractional_quantities:"\ " #{@allow_fractional_quantities.inspect}, public_signup_page_ids:"\ " #{@public_signup_page_ids.inspect}, interval: #{@interval.inspect}, interval_unit:"\ - " #{@interval_unit.inspect}, additional_properties: #{get_additional_properties}>" + " #{@interval_unit.inspect}, unspsc_code: #{@unspsc_code.inspect}, additional_properties:"\ + " #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/metered_usage.rb b/lib/advanced_billing/models/metered_usage.rb index d397b575..2913291c 100644 --- a/lib/advanced_billing/models/metered_usage.rb +++ b/lib/advanced_billing/models/metered_usage.rb @@ -14,7 +14,7 @@ class MeteredUsage < BaseModel attr_accessor :previous_unit_balance # TODO: Write general description for this method - # @return [Integer] + # @return [Object] attr_accessor :new_unit_balance # TODO: Write general description for this method @@ -78,8 +78,9 @@ def self.from_hash(hash) # Extract variables from the hash. previous_unit_balance = hash.key?('previous_unit_balance') ? hash['previous_unit_balance'] : nil - new_unit_balance = - hash.key?('new_unit_balance') ? hash['new_unit_balance'] : nil + new_unit_balance = hash.key?('new_unit_balance') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:MeteredUsageNewUnitBalance), hash['new_unit_balance'] + ) : nil usage_quantity = hash.key?('usage_quantity') ? hash['usage_quantity'] : nil component_id = hash.key?('component_id') ? hash['component_id'] : nil @@ -107,8 +108,8 @@ def self.validate(value) return ( APIHelper.valid_type?(value.previous_unit_balance, ->(val) { val.instance_of? String }) and - APIHelper.valid_type?(value.new_unit_balance, - ->(val) { val.instance_of? Integer }) and + UnionTypeLookUp.get(:MeteredUsageNewUnitBalance) + .validate(value.new_unit_balance) and APIHelper.valid_type?(value.usage_quantity, ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value.component_id, @@ -125,8 +126,8 @@ def self.validate(value) ( APIHelper.valid_type?(value['previous_unit_balance'], ->(val) { val.instance_of? String }) and - APIHelper.valid_type?(value['new_unit_balance'], - ->(val) { val.instance_of? Integer }) and + UnionTypeLookUp.get(:MeteredUsageNewUnitBalance) + .validate(value['new_unit_balance']) and APIHelper.valid_type?(value['usage_quantity'], ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value['component_id'], diff --git a/lib/advanced_billing/models/offer_item.rb b/lib/advanced_billing/models/offer_item.rb index 7f0701f3..750ae47c 100644 --- a/lib/advanced_billing/models/offer_item.rb +++ b/lib/advanced_billing/models/offer_item.rb @@ -41,7 +41,7 @@ class OfferItem < BaseModel # @return [Array[CurrencyPrice]] attr_accessor :currency_prices - # The numerical interval. i.e. an interval of '30' coupled with an + # The numerical interval. e.g., an interval of '30' coupled with an # interval_unit of day would mean this component price point would renew # every 30 days. This property is only available for sites with # Multifrequency enabled. diff --git a/lib/advanced_billing/models/on_off_component.rb b/lib/advanced_billing/models/on_off_component.rb index e506ac3d..e63fd70c 100644 --- a/lib/advanced_billing/models/on_off_component.rb +++ b/lib/advanced_billing/models/on_off_component.rb @@ -10,7 +10,7 @@ class OnOffComponent < BaseModel private_constant :SKIP # A name for this component that is suitable for showing customers and - # displaying on billing statements, ie. "Minutes". + # displaying on billing statements, e.g., "Minutes". # @return [String] attr_accessor :name @@ -20,7 +20,7 @@ class OnOffComponent < BaseModel attr_accessor :description # 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 + # component in subsequent requests. Must start with a letter or number and # may only contain lowercase letters, numbers, or the characters '.', ':', # '-', or '_'. # @return [String] @@ -47,7 +47,7 @@ class OnOffComponent < BaseModel # This is the amount that the customer will be charged when they turn the # component on for the subscription. The price can contain up to 8 decimal - # places. i.e. 1.00 or 0.0012 or 0.00000065 + # places. e.g., 1.00 or 0.0012 or 0.00000065 # @return [Object] attr_accessor :unit_price @@ -81,7 +81,7 @@ class OnOffComponent < BaseModel # @return [Array[Integer]] attr_accessor :public_signup_page_ids - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., an interval of ‘30’ coupled with an # interval_unit of day would mean this component's default price point would # renew every 30 days. This property is only available for sites with # Multifrequency enabled. @@ -94,6 +94,12 @@ class OnOffComponent < BaseModel # @return [IntervalUnit] attr_accessor :interval_unit + # (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. + # When set, this value is sent as the commodity code on invoice line items + # for this component instead of the default derived from item_category. + # @return [String] + attr_accessor :unspsc_code + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -112,6 +118,7 @@ def self.names @_hash['public_signup_page_ids'] = 'public_signup_page_ids' @_hash['interval'] = 'interval' @_hash['interval_unit'] = 'interval_unit' + @_hash['unspsc_code'] = 'unspsc_code' @_hash end @@ -131,6 +138,7 @@ def self.optionals public_signup_page_ids interval interval_unit + unspsc_code ] end @@ -140,6 +148,7 @@ def self.nullables upgrade_charge downgrade_credit interval_unit + unspsc_code ] end @@ -150,7 +159,8 @@ def initialize(name:, unit_price:, description: SKIP, handle: SKIP, display_on_hosted_page: SKIP, allow_fractional_quantities: SKIP, public_signup_page_ids: SKIP, interval: SKIP, - interval_unit: SKIP, additional_properties: {}) + interval_unit: SKIP, unspsc_code: SKIP, + additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -177,6 +187,7 @@ def initialize(name:, unit_price:, description: SKIP, handle: SKIP, @public_signup_page_ids = public_signup_page_ids unless public_signup_page_ids == SKIP @interval = interval unless interval == SKIP @interval_unit = interval_unit unless interval_unit == SKIP + @unspsc_code = unspsc_code unless unspsc_code == SKIP end # Creates an instance of the object from a hash. @@ -216,6 +227,7 @@ def self.from_hash(hash) hash.key?('public_signup_page_ids') ? hash['public_signup_page_ids'] : SKIP interval = hash.key?('interval') ? hash['interval'] : SKIP interval_unit = hash.key?('interval_unit') ? hash['interval_unit'] : SKIP + unspsc_code = hash.key?('unspsc_code') ? hash['unspsc_code'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -236,6 +248,7 @@ def self.from_hash(hash) public_signup_page_ids: public_signup_page_ids, interval: interval, interval_unit: interval_unit, + unspsc_code: unspsc_code, additional_properties: additional_properties) end @@ -270,7 +283,8 @@ def to_s " hide_date_range_on_invoice: #{@hide_date_range_on_invoice}, display_on_hosted_page:"\ " #{@display_on_hosted_page}, allow_fractional_quantities: #{@allow_fractional_quantities},"\ " public_signup_page_ids: #{@public_signup_page_ids}, interval: #{@interval}, interval_unit:"\ - " #{@interval_unit}, additional_properties: #{get_additional_properties}>" + " #{@interval_unit}, unspsc_code: #{@unspsc_code}, additional_properties:"\ + " #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -284,7 +298,8 @@ def inspect " display_on_hosted_page: #{@display_on_hosted_page.inspect}, allow_fractional_quantities:"\ " #{@allow_fractional_quantities.inspect}, public_signup_page_ids:"\ " #{@public_signup_page_ids.inspect}, interval: #{@interval.inspect}, interval_unit:"\ - " #{@interval_unit.inspect}, additional_properties: #{get_additional_properties}>" + " #{@interval_unit.inspect}, unspsc_code: #{@unspsc_code.inspect}, additional_properties:"\ + " #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/pause_request.rb b/lib/advanced_billing/models/pause_request.rb index 60816b4f..e1b18a36 100644 --- a/lib/advanced_billing/models/pause_request.rb +++ b/lib/advanced_billing/models/pause_request.rb @@ -4,7 +4,7 @@ # APIMATIC v3.0 ( https://www.apimatic.io ). module AdvancedBilling - # Allows to pause a Subscription + # Allows you to pause a Subscription. class PauseRequest < BaseModel SKIP = Object.new private_constant :SKIP diff --git a/lib/advanced_billing/models/payment_profile_attributes.rb b/lib/advanced_billing/models/payment_profile_attributes.rb index eae26b6b..ad8988fd 100644 --- a/lib/advanced_billing/models/payment_profile_attributes.rb +++ b/lib/advanced_billing/models/payment_profile_attributes.rb @@ -11,19 +11,19 @@ class PaymentProfileAttributes < BaseModel # (Optional) Token received after sending billing information using Maxio.js # (formerly Chargify.js). This token must be passed as a sole attribute of - # `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) + # `payment_profile_attributes` (e.g., tok_9g6hw85pnpt6knmskpwp4ttt). # @return [String] attr_accessor :chargify_token # (Optional) Token received after sending billing information using Maxio.js # (formerly Chargify.js). This token must be passed as a sole attribute of - # `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) + # `payment_profile_attributes` (e.g., tok_9g6hw85pnpt6knmskpwp4ttt). # @return [Integer] attr_accessor :id # (Optional) Token received after sending billing information using Maxio.js # (formerly Chargify.js). This token must be passed as a sole attribute of - # `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) + # `payment_profile_attributes` (e.g., tok_9g6hw85pnpt6knmskpwp4ttt). # @return [PaymentType] attr_accessor :payment_type @@ -42,47 +42,48 @@ class PaymentProfileAttributes < BaseModel # @return [String] attr_accessor :masked_card_number - # The full credit card number (string representation, i.e. 5424000000000015) + # The full credit card number (string representation, e.g., + # 5424000000000015) # @return [String] attr_accessor :full_number # (Optional, used only for Subscription Import) If you know the card type - # (i.e. Visa, MC, etc) you may supply it here so that we may display the + # (e.g., Visa, MC, etc.) you may supply it here so that we may display the # card type in the UI. # @return [CardType] attr_accessor :card_type # (Optional when performing a Subscription Import via vault_token, required # otherwise) The 1- or 2-digit credit card expiration month, as an integer - # or string, i.e. 5 + # or string, e.g., 5 # @return [Object] attr_accessor :expiration_month # (Optional when performing a Subscription Import via vault_token, required # otherwise) The 4-digit credit card expiration year, as an integer or - # string, i.e. 2012 + # string, e.g., 2012 # @return [Object] attr_accessor :expiration_year # (Optional, may be required by your product configuration or gateway - # settings) The credit card or bank account billing street address (i.e. 123 - # Main St.). This value is merely passed through to the payment gateway. + # settings) The credit card or bank account billing street address (e.g., + # 123 Main St.). This value is merely passed through to the payment gateway. # @return [String] attr_accessor :billing_address - # (Optional) Second line of the customer’s billing address i.e. Apt. 100 + # (Optional) Second line of the customer’s billing address, e.g., Apt. 100 # @return [String] attr_accessor :billing_address_2 # (Optional, may be required by your product configuration or gateway - # settings) The credit card or bank account billing address city (i.e. + # settings) The credit card or bank account billing address city (e.g., # “Boston”). This value is merely passed through to the payment gateway. # @return [String] attr_accessor :billing_city # (Optional, may be required by your product configuration or gateway - # settings) The credit card or bank account billing address state (i.e. MA). - # This value is merely passed through to the payment gateway. This must + # settings) The credit card or bank account billing address state (e.g., + # MA). This value is merely passed through to the payment gateway. This must # conform to the # [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in # order to be valid for tax locale purposes. @@ -92,7 +93,7 @@ class PaymentProfileAttributes < BaseModel # (Optional, may be required by your product configuration or gateway # settings) The credit card or bank account billing address country, # required in [ISO_3166-1 - # alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. + # alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., # “US”). This value is merely passed through to the payment gateway. Some # gateways require country codes in a specific format. Check your gateway’s # documentation. If creating an ACH subscription, only US is supported at @@ -101,7 +102,7 @@ class PaymentProfileAttributes < BaseModel attr_accessor :billing_country # (Optional, may be required by your product configuration or gateway - # settings) The credit card or bank account billing address zip code (i.e. + # settings) The credit card or bank account billing address zip code (e.g., # 12345). This value is merely passed through to the payment gateway. # @return [String] attr_accessor :billing_zip @@ -160,7 +161,7 @@ class PaymentProfileAttributes < BaseModel # (Optional, used only for Subscription Import) If you have the last 4 # digits of the credit card number, you may supply them here so that we may - # create a masked card number (i.e. XXXX-XXXX-XXXX-1234) for display in the + # create a masked card number (e.g., XXXX-XXXX-XXXX-1234) for display in the # UI. Last 4 digits are required for refunds in Auth.Net. # @return [String] attr_accessor :last_four diff --git a/lib/advanced_billing/models/prepaid_usage.rb b/lib/advanced_billing/models/prepaid_usage.rb index 8f3b185f..2113b4f8 100644 --- a/lib/advanced_billing/models/prepaid_usage.rb +++ b/lib/advanced_billing/models/prepaid_usage.rb @@ -18,11 +18,11 @@ class PrepaidUsage < BaseModel attr_accessor :previous_overage_unit_balance # TODO: Write general description for this method - # @return [Integer] + # @return [Object] attr_accessor :new_unit_balance # TODO: Write general description for this method - # @return [Integer] + # @return [Object] attr_accessor :new_overage_unit_balance # TODO: Write general description for this method @@ -107,10 +107,12 @@ def self.from_hash(hash) hash.key?('previous_unit_balance') ? hash['previous_unit_balance'] : nil previous_overage_unit_balance = hash.key?('previous_overage_unit_balance') ? hash['previous_overage_unit_balance'] : nil - new_unit_balance = - hash.key?('new_unit_balance') ? hash['new_unit_balance'] : nil - new_overage_unit_balance = - hash.key?('new_overage_unit_balance') ? hash['new_overage_unit_balance'] : nil + new_unit_balance = hash.key?('new_unit_balance') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:PrepaidUsageNewUnitBalance), hash['new_unit_balance'] + ) : nil + new_overage_unit_balance = hash.key?('new_overage_unit_balance') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:PrepaidUsageNewOverageUnitBalance), hash['new_overage_unit_balance'] + ) : nil usage_quantity = hash.key?('usage_quantity') ? hash['usage_quantity'] : nil overage_usage_quantity = @@ -156,10 +158,10 @@ def self.validate(value) ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.previous_overage_unit_balance, ->(val) { val.instance_of? String }) and - APIHelper.valid_type?(value.new_unit_balance, - ->(val) { val.instance_of? Integer }) and - APIHelper.valid_type?(value.new_overage_unit_balance, - ->(val) { val.instance_of? Integer }) and + UnionTypeLookUp.get(:PrepaidUsageNewUnitBalance) + .validate(value.new_unit_balance) and + UnionTypeLookUp.get(:PrepaidUsageNewOverageUnitBalance) + .validate(value.new_overage_unit_balance) and APIHelper.valid_type?(value.usage_quantity, ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value.overage_usage_quantity, @@ -184,10 +186,10 @@ def self.validate(value) ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['previous_overage_unit_balance'], ->(val) { val.instance_of? String }) and - APIHelper.valid_type?(value['new_unit_balance'], - ->(val) { val.instance_of? Integer }) and - APIHelper.valid_type?(value['new_overage_unit_balance'], - ->(val) { val.instance_of? Integer }) and + UnionTypeLookUp.get(:PrepaidUsageNewUnitBalance) + .validate(value['new_unit_balance']) and + UnionTypeLookUp.get(:PrepaidUsageNewOverageUnitBalance) + .validate(value['new_overage_unit_balance']) and APIHelper.valid_type?(value['usage_quantity'], ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value['overage_usage_quantity'], diff --git a/lib/advanced_billing/models/prepaid_usage_component.rb b/lib/advanced_billing/models/prepaid_usage_component.rb index ca41f3cc..94d217ed 100644 --- a/lib/advanced_billing/models/prepaid_usage_component.rb +++ b/lib/advanced_billing/models/prepaid_usage_component.rb @@ -10,12 +10,12 @@ class PrepaidUsageComponent < BaseModel private_constant :SKIP # A name for this component that is suitable for showing customers and - # displaying on billing statements, ie. "Minutes". + # displaying on billing statements, e.g., "Minutes". # @return [String] attr_accessor :name # The name of the unit of measurement for the component. It should be - # singular since it will be automatically pluralized when necessary. i.e. + # singular since it will be automatically pluralized when necessary. e.g., # “message”, which may then be shown as “5 messages” on a subscription’s # component line-item # @return [String] @@ -27,7 +27,7 @@ class PrepaidUsageComponent < BaseModel attr_accessor :description # 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 + # component in subsequent requests. Must start with a letter or number and # may only contain lowercase letters, numbers, or the characters '.', ':', # '-', or '_'. # @return [String] @@ -69,7 +69,7 @@ class PrepaidUsageComponent < BaseModel # The amount the customer will be charged per unit when the pricing scheme # is “per_unit”. For On/Off Components, this is the amount that the customer # will be charged when they turn the component on for the subscription. The - # price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or + # price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or # 0.00000065 # @return [Object] attr_accessor :unit_price @@ -93,12 +93,12 @@ class PrepaidUsageComponent < BaseModel attr_accessor :overage_pricing # Boolean which controls whether or not remaining units should be rolled - # over to the next period + # over to the next period. # @return [TrueClass | FalseClass] attr_accessor :rollover_prepaid_remainder # Boolean which controls whether or not the allocated quantity should be - # renewed at the beginning of each period + # renewed at the beginning of each period. # @return [TrueClass | FalseClass] attr_accessor :renew_prepaid_allocation @@ -132,6 +132,12 @@ class PrepaidUsageComponent < BaseModel # @return [Array[Integer]] attr_accessor :public_signup_page_ids + # (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. + # When set, this value is sent as the commodity code on invoice line items + # for this component instead of the default derived from item_category. + # @return [String] + attr_accessor :unspsc_code + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -156,6 +162,7 @@ def self.names @_hash['display_on_hosted_page'] = 'display_on_hosted_page' @_hash['allow_fractional_quantities'] = 'allow_fractional_quantities' @_hash['public_signup_page_ids'] = 'public_signup_page_ids' + @_hash['unspsc_code'] = 'unspsc_code' @_hash end @@ -179,6 +186,7 @@ def self.optionals display_on_hosted_page allow_fractional_quantities public_signup_page_ids + unspsc_code ] end @@ -188,6 +196,7 @@ def self.nullables upgrade_charge downgrade_credit expiration_interval_unit + unspsc_code ] end @@ -200,7 +209,8 @@ def initialize(name:, unit_name:, pricing_scheme:, overage_pricing:, renew_prepaid_allocation: SKIP, expiration_interval: SKIP, expiration_interval_unit: SKIP, display_on_hosted_page: SKIP, allow_fractional_quantities: SKIP, - public_signup_page_ids: SKIP, additional_properties: {}) + public_signup_page_ids: SKIP, unspsc_code: SKIP, + additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -236,6 +246,7 @@ def initialize(name:, unit_name:, pricing_scheme:, overage_pricing:, allow_fractional_quantities end @public_signup_page_ids = public_signup_page_ids unless public_signup_page_ids == SKIP + @unspsc_code = unspsc_code unless unspsc_code == SKIP end # Creates an instance of the object from a hash. @@ -296,6 +307,7 @@ def self.from_hash(hash) hash.key?('allow_fractional_quantities') ? hash['allow_fractional_quantities'] : SKIP public_signup_page_ids = hash.key?('public_signup_page_ids') ? hash['public_signup_page_ids'] : SKIP + unspsc_code = hash.key?('unspsc_code') ? hash['unspsc_code'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -322,6 +334,7 @@ def self.from_hash(hash) display_on_hosted_page: display_on_hosted_page, allow_fractional_quantities: allow_fractional_quantities, public_signup_page_ids: public_signup_page_ids, + unspsc_code: unspsc_code, additional_properties: additional_properties) end @@ -370,7 +383,7 @@ def to_s " #{@expiration_interval}, expiration_interval_unit: #{@expiration_interval_unit},"\ " display_on_hosted_page: #{@display_on_hosted_page}, allow_fractional_quantities:"\ " #{@allow_fractional_quantities}, public_signup_page_ids: #{@public_signup_page_ids},"\ - " additional_properties: #{get_additional_properties}>" + " unspsc_code: #{@unspsc_code}, additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -389,7 +402,8 @@ def inspect " #{@expiration_interval_unit.inspect}, display_on_hosted_page:"\ " #{@display_on_hosted_page.inspect}, allow_fractional_quantities:"\ " #{@allow_fractional_quantities.inspect}, public_signup_page_ids:"\ - " #{@public_signup_page_ids.inspect}, additional_properties: #{get_additional_properties}>" + " #{@public_signup_page_ids.inspect}, unspsc_code: #{@unspsc_code.inspect},"\ + " additional_properties: #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/price.rb b/lib/advanced_billing/models/price.rb index f84afc09..4cc849da 100644 --- a/lib/advanced_billing/models/price.rb +++ b/lib/advanced_billing/models/price.rb @@ -17,7 +17,7 @@ class Price < BaseModel # @return [Object] attr_accessor :ending_quantity - # The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or + # The price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or # 0.00000065 # @return [Object] attr_accessor :unit_price diff --git a/lib/advanced_billing/models/product.rb b/lib/advanced_billing/models/product.rb index 58046f52..a5ab89a4 100644 --- a/lib/advanced_billing/models/product.rb +++ b/lib/advanced_billing/models/product.rb @@ -26,7 +26,7 @@ class Product < BaseModel # @return [String] attr_accessor :description - # E.g. Internal ID or SKU Number + # E.g., Internal ID or SKU Number # @return [String] attr_accessor :accounting_code @@ -39,7 +39,7 @@ class Product < BaseModel # A numerical interval for the length a subscription to this product will # run before it expires. See the description of interval for a description # of how this value is coupled with an interval unit to calculate the full - # interval + # interval. # @return [Integer] attr_accessor :expiration_interval @@ -60,8 +60,8 @@ class Product < BaseModel # @return [Integer] attr_accessor :price_in_cents - # The numerical interval. i.e. an interval of ‘30’ coupled with an - # interval_unit of day would mean this product would renew every 30 days + # The numerical interval. e.g., an interval of ‘30’ coupled with an + # interval_unit of day would mean this product would renew every 30 days. # @return [Integer] attr_accessor :interval @@ -81,7 +81,8 @@ class Product < BaseModel # A numerical interval for the length of the trial period of a subscription # to this product. See the description of interval for a description of how - # this value is coupled with an interval unit to calculate the full interval + # this value is coupled with an interval unit to calculate the full + # interval. # @return [Integer] attr_accessor :trial_interval @@ -126,28 +127,28 @@ class Product < BaseModel # The parameters will append to the url after a successful account update. # See [help # documentation](https://help.chargify.com/products/product-editing.html#ret - # urn-parameters-after-account-update) + # urn-parameters-after-account-update). # @return [String] attr_accessor :update_return_params # The parameters will append to the url after a successful account update. # See [help # documentation](https://help.chargify.com/products/product-editing.html#ret - # urn-parameters-after-account-update) + # urn-parameters-after-account-update). # @return [ProductFamily] attr_accessor :product_family # The parameters will append to the url after a successful account update. # See [help # documentation](https://help.chargify.com/products/product-editing.html#ret - # urn-parameters-after-account-update) + # urn-parameters-after-account-update). # @return [Array[PublicSignupPage]] attr_accessor :public_signup_pages # The parameters will append to the url after a successful account update. # See [help # documentation](https://help.chargify.com/products/product-editing.html#ret - # urn-parameters-after-account-update) + # urn-parameters-after-account-update). # @return [String] attr_accessor :product_price_point_name @@ -199,6 +200,12 @@ class Product < BaseModel # @return [String] attr_accessor :product_price_point_handle + # (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. + # When set, this value is sent as the commodity code on invoice line items + # for this product instead of the default derived from item_category. + # @return [String] + attr_accessor :unspsc_code + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -240,6 +247,7 @@ def self.names @_hash['item_category'] = 'item_category' @_hash['product_price_point_id'] = 'product_price_point_id' @_hash['product_price_point_handle'] = 'product_price_point_handle' + @_hash['unspsc_code'] = 'unspsc_code' @_hash end @@ -283,6 +291,7 @@ def self.optionals item_category product_price_point_id product_price_point_handle + unspsc_code ] end @@ -307,6 +316,7 @@ def self.nullables use_site_exchange_rate item_category product_price_point_handle + unspsc_code ] end @@ -327,7 +337,8 @@ def initialize(id: SKIP, name: SKIP, handle: SKIP, description: SKIP, default_product_price_point_id: SKIP, use_site_exchange_rate: SKIP, item_category: SKIP, product_price_point_id: SKIP, - product_price_point_handle: SKIP, additional_properties: {}) + product_price_point_handle: SKIP, unspsc_code: SKIP, + additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -379,6 +390,7 @@ def initialize(id: SKIP, name: SKIP, handle: SKIP, description: SKIP, @product_price_point_handle = product_price_point_handle end + @unspsc_code = unspsc_code unless unspsc_code == SKIP end # Creates an instance of the object from a hash. @@ -466,6 +478,7 @@ def self.from_hash(hash) hash.key?('product_price_point_id') ? hash['product_price_point_id'] : SKIP product_price_point_handle = hash.key?('product_price_point_handle') ? hash['product_price_point_handle'] : SKIP + unspsc_code = hash.key?('unspsc_code') ? hash['unspsc_code'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -508,6 +521,7 @@ def self.from_hash(hash) item_category: item_category, product_price_point_id: product_price_point_id, product_price_point_handle: product_price_point_handle, + unspsc_code: unspsc_code, additional_properties: additional_properties) end @@ -544,8 +558,8 @@ def to_s " tax_code: #{@tax_code}, default_product_price_point_id:"\ " #{@default_product_price_point_id}, use_site_exchange_rate: #{@use_site_exchange_rate},"\ " item_category: #{@item_category}, product_price_point_id: #{@product_price_point_id},"\ - " product_price_point_handle: #{@product_price_point_handle}, additional_properties:"\ - " #{get_additional_properties}>" + " product_price_point_handle: #{@product_price_point_handle}, unspsc_code: #{@unspsc_code},"\ + " additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -574,8 +588,8 @@ def inspect " default_product_price_point_id: #{@default_product_price_point_id.inspect},"\ " use_site_exchange_rate: #{@use_site_exchange_rate.inspect}, item_category:"\ " #{@item_category.inspect}, product_price_point_id: #{@product_price_point_id.inspect},"\ - " product_price_point_handle: #{@product_price_point_handle.inspect}, additional_properties:"\ - " #{get_additional_properties}>" + " product_price_point_handle: #{@product_price_point_handle.inspect}, unspsc_code:"\ + " #{@unspsc_code.inspect}, additional_properties: #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/product_family.rb b/lib/advanced_billing/models/product_family.rb index d50f3bf9..e66d4111 100644 --- a/lib/advanced_billing/models/product_family.rb +++ b/lib/advanced_billing/models/product_family.rb @@ -30,11 +30,18 @@ class ProductFamily < BaseModel # @return [String] attr_accessor :description - # TODO: Write general description for this method + # Whether surcharging applies to this product family. Only included on sites + # where surcharging is enabled. + # @return [TrueClass | FalseClass] + attr_accessor :surcharging + + # Whether surcharging applies to this product family. Only included on sites + # where surcharging is enabled. # @return [DateTime] attr_accessor :created_at - # TODO: Write general description for this method + # Whether surcharging applies to this product family. Only included on sites + # where surcharging is enabled. # @return [DateTime] attr_accessor :updated_at @@ -51,6 +58,7 @@ def self.names @_hash['handle'] = 'handle' @_hash['accounting_code'] = 'accounting_code' @_hash['description'] = 'description' + @_hash['surcharging'] = 'surcharging' @_hash['created_at'] = 'created_at' @_hash['updated_at'] = 'updated_at' @_hash['archived_at'] = 'archived_at' @@ -65,6 +73,7 @@ def self.optionals handle accounting_code description + surcharging created_at updated_at archived_at @@ -81,8 +90,9 @@ def self.nullables end def initialize(id: SKIP, name: SKIP, handle: SKIP, accounting_code: SKIP, - description: SKIP, created_at: SKIP, updated_at: SKIP, - archived_at: SKIP, additional_properties: {}) + description: SKIP, surcharging: SKIP, created_at: SKIP, + updated_at: SKIP, archived_at: SKIP, + additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -93,6 +103,7 @@ def initialize(id: SKIP, name: SKIP, handle: SKIP, accounting_code: SKIP, @handle = handle unless handle == SKIP @accounting_code = accounting_code unless accounting_code == SKIP @description = description unless description == SKIP + @surcharging = surcharging unless surcharging == SKIP @created_at = created_at unless created_at == SKIP @updated_at = updated_at unless updated_at == SKIP @archived_at = archived_at unless archived_at == SKIP @@ -109,6 +120,7 @@ def self.from_hash(hash) accounting_code = hash.key?('accounting_code') ? hash['accounting_code'] : SKIP description = hash.key?('description') ? hash['description'] : SKIP + surcharging = hash.key?('surcharging') ? hash['surcharging'] : SKIP created_at = if hash.key?('created_at') (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at']) else @@ -134,6 +146,7 @@ def self.from_hash(hash) handle: handle, accounting_code: accounting_code, description: description, + surcharging: surcharging, created_at: created_at, updated_at: updated_at, archived_at: archived_at, @@ -156,9 +169,9 @@ def to_custom_archived_at def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, name: #{@name}, handle: #{@handle}, accounting_code:"\ - " #{@accounting_code}, description: #{@description}, created_at: #{@created_at}, updated_at:"\ - " #{@updated_at}, archived_at: #{@archived_at}, additional_properties:"\ - " #{get_additional_properties}>" + " #{@accounting_code}, description: #{@description}, surcharging: #{@surcharging},"\ + " created_at: #{@created_at}, updated_at: #{@updated_at}, archived_at: #{@archived_at},"\ + " additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -166,8 +179,9 @@ def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, name: #{@name.inspect}, handle: #{@handle.inspect},"\ " accounting_code: #{@accounting_code.inspect}, description: #{@description.inspect},"\ - " created_at: #{@created_at.inspect}, updated_at: #{@updated_at.inspect}, archived_at:"\ - " #{@archived_at.inspect}, additional_properties: #{get_additional_properties}>" + " surcharging: #{@surcharging.inspect}, created_at: #{@created_at.inspect}, updated_at:"\ + " #{@updated_at.inspect}, archived_at: #{@archived_at.inspect}, additional_properties:"\ + " #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/product_price_point.rb b/lib/advanced_billing/models/product_price_point.rb index f41f85f2..a83c553b 100644 --- a/lib/advanced_billing/models/product_price_point.rb +++ b/lib/advanced_billing/models/product_price_point.rb @@ -26,9 +26,9 @@ class ProductPricePoint < BaseModel # @return [Integer] attr_accessor :price_in_cents - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., an interval of ‘30’ coupled with an # interval_unit of day would mean this product price point would renew every - # 30 days + # 30 days. # @return [Integer] attr_accessor :interval @@ -41,9 +41,9 @@ class ProductPricePoint < BaseModel # @return [Integer] attr_accessor :trial_price_in_cents - # The numerical trial interval. i.e. an interval of ‘30’ coupled with a + # The numerical trial interval. e.g., an interval of ‘30’ coupled with a # trial_interval_unit of day would mean this product price point trial would - # last 30 days + # last 30 days. # @return [Integer] attr_accessor :trial_interval @@ -52,7 +52,7 @@ class ProductPricePoint < BaseModel # @return [IntervalUnit] attr_accessor :trial_interval_unit - # Indicates how a trial is handled when the trail period ends and there is + # Indicates how a trial is handled when the trial period ends and there is # no credit card on file. For `no_obligation`, the subscription transitions # to a Trial Ended state. Maxio will not send any emails or statements. For # `payment_expected`, the subscription transitions to a Past Due state. @@ -73,9 +73,9 @@ class ProductPricePoint < BaseModel # @return [TrueClass | FalseClass] attr_accessor :initial_charge_after_trial - # The numerical expiration interval. i.e. an expiration_interval of ‘30’ + # The numerical expiration interval. e.g., an expiration_interval of ‘30’ # coupled with an expiration_interval_unit of day would mean this product - # price point would expire after 30 days + # price point would expire after 30 days. # @return [Integer] attr_accessor :expiration_interval diff --git a/lib/advanced_billing/models/proforma_invoice.rb b/lib/advanced_billing/models/proforma_invoice.rb index 63fe9f1a..0f95f77a 100644 --- a/lib/advanced_billing/models/proforma_invoice.rb +++ b/lib/advanced_billing/models/proforma_invoice.rb @@ -68,7 +68,7 @@ class ProformaInvoice < BaseModel attr_accessor :currency # Consolidation level of the invoice, which is applicable to invoice - # consolidation. It will hold one of the following values: + # consolidation. It will hold one of the following values: # * "none": A normal invoice with no consolidation. # * "child": An invoice segment which has been combined into a consolidated # invoice. @@ -83,7 +83,7 @@ class ProformaInvoice < BaseModel attr_accessor :consolidation_level # Consolidation level of the invoice, which is applicable to invoice - # consolidation. It will hold one of the following values: + # consolidation. It will hold one of the following values: # * "none": A normal invoice with no consolidation. # * "child": An invoice segment which has been combined into a consolidated # invoice. @@ -98,7 +98,7 @@ class ProformaInvoice < BaseModel attr_accessor :product_name # Consolidation level of the invoice, which is applicable to invoice - # consolidation. It will hold one of the following values: + # consolidation. It will hold one of the following values: # * "none": A normal invoice with no consolidation. # * "child": An invoice segment which has been combined into a consolidated # invoice. @@ -113,7 +113,7 @@ class ProformaInvoice < BaseModel attr_accessor :product_family_name # 'proforma' value is deprecated in favor of proforma_adhoc and - # proforma_automatic + # proforma_automatic. # @return [ProformaInvoiceRole] attr_accessor :role @@ -122,102 +122,102 @@ class ProformaInvoice < BaseModel # @return [InvoiceSeller] attr_accessor :seller - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [InvoiceCustomer] attr_accessor :customer - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [String] attr_accessor :memo - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [InvoiceAddress] attr_accessor :billing_address - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [InvoiceAddress] attr_accessor :shipping_address - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [String] attr_accessor :subtotal_amount - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [String] attr_accessor :discount_amount - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [String] attr_accessor :tax_amount - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [String] attr_accessor :total_amount - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [String] attr_accessor :credit_amount - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [String] attr_accessor :paid_amount - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [String] attr_accessor :refund_amount - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [String] attr_accessor :due_amount - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [Array[InvoiceLineItem]] attr_accessor :line_items - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [Array[ProformaInvoiceDiscount]] attr_accessor :discounts - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [Array[ProformaInvoiceTax]] attr_accessor :taxes - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [Array[ProformaInvoiceCredit]] attr_accessor :credits - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [Array[ProformaInvoicePayment]] attr_accessor :payments - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [Array[InvoiceCustomField]] attr_accessor :custom_fields - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [String] attr_accessor :public_url - # Information about the customer who is owner or recipient the invoiced + # Information about the customer who is owner or recipient of the invoiced # subscription. # @return [AvailableActions] attr_accessor :available_actions diff --git a/lib/advanced_billing/models/proforma_invoice_role.rb b/lib/advanced_billing/models/proforma_invoice_role.rb index 2f11d93a..d0a9f071 100644 --- a/lib/advanced_billing/models/proforma_invoice_role.rb +++ b/lib/advanced_billing/models/proforma_invoice_role.rb @@ -5,7 +5,7 @@ module AdvancedBilling # 'proforma' value is deprecated in favor of proforma_adhoc and - # proforma_automatic + # proforma_automatic. class ProformaInvoiceRole PROFORMA_INVOICE_ROLE = [ # TODO: Write general description for UNSET diff --git a/lib/advanced_billing/models/public_signup_page.rb b/lib/advanced_billing/models/public_signup_page.rb index c2e7d6d0..6925da31 100644 --- a/lib/advanced_billing/models/public_signup_page.rb +++ b/lib/advanced_billing/models/public_signup_page.rb @@ -14,7 +14,7 @@ class PublicSignupPage < BaseModel attr_accessor :id # The url to which a customer will be returned after a successful signup - # (public_signup_pages only) + # (public_signup_pages only). # @return [String] attr_accessor :return_url @@ -22,7 +22,7 @@ class PublicSignupPage < BaseModel # @return [String] attr_accessor :return_params - # The url where the signup page can be viewed (public_signup_pages only) + # The url where the signup page can be viewed (public_signup_pages only). # @return [String] attr_accessor :url diff --git a/lib/advanced_billing/models/q_scope.rb b/lib/advanced_billing/models/q_scope.rb new file mode 100644 index 00000000..a3a7afb1 --- /dev/null +++ b/lib/advanced_billing/models/q_scope.rb @@ -0,0 +1,52 @@ +# advanced_billing +# +# This file was automatically generated for Maxio by +# APIMATIC v3.0 ( https://www.apimatic.io ). + +module AdvancedBilling + # q_scope. + class QScope + Q_SCOPE = [ + # TODO: Write general description for FULL_NAME + FULL_NAME = 'full_name'.freeze, + + # TODO: Write general description for FIRST_NAME + FIRST_NAME = 'first_name'.freeze, + + # TODO: Write general description for LAST_NAME + LAST_NAME = 'last_name'.freeze, + + # TODO: Write general description for ORGANIZATION + ORGANIZATION = 'organization'.freeze, + + # TODO: Write general description for CUSTOMER_REFERENCE + CUSTOMER_REFERENCE = 'customer_reference'.freeze, + + # TODO: Write general description for SUBSCRIPTION_REFERENCE + SUBSCRIPTION_REFERENCE = 'subscription_reference'.freeze + ].freeze + + def self.validate(value) + return false if value.nil? + + Q_SCOPE.include?(value) + end + + def self.from_value(value, default_value = FULL_NAME) + return default_value if value.nil? + + str = value.to_s.strip + + case str.downcase + when 'full_name' then FULL_NAME + when 'first_name' then FIRST_NAME + when 'last_name' then LAST_NAME + when 'organization' then ORGANIZATION + when 'customer_reference' then CUSTOMER_REFERENCE + when 'subscription_reference' then SUBSCRIPTION_REFERENCE + else + default_value + end + end + end +end diff --git a/lib/advanced_billing/models/quantity_based_component.rb b/lib/advanced_billing/models/quantity_based_component.rb index 230d7b7f..25bf0b83 100644 --- a/lib/advanced_billing/models/quantity_based_component.rb +++ b/lib/advanced_billing/models/quantity_based_component.rb @@ -10,14 +10,14 @@ class QuantityBasedComponent < BaseModel private_constant :SKIP # A name for this component that is suitable for showing customers and - # displaying on billing statements, ie. "Minutes". + # displaying on billing statements, e.g., "Minutes". # @return [String] attr_accessor :name - # The name of the unit of measurement for the component. It should be - # singular since it will be automatically pluralized when necessary. i.e. + # “The name of the unit of measurement for the component. It should be + # singular since it will be automatically pluralized when necessary. e.g., # “message”, which may then be shown as “5 messages” on a subscription’s - # component line-item + # component line-item.” # @return [String] attr_accessor :unit_name @@ -27,7 +27,7 @@ class QuantityBasedComponent < BaseModel attr_accessor :description # 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 + # component in subsequent requests. Must start with a letter or number and # may only contain lowercase letters, numbers, or the characters '.', ':', # '-', or '_'. # @return [String] @@ -69,7 +69,7 @@ class QuantityBasedComponent < BaseModel # The amount the customer will be charged per unit when the pricing scheme # is “per_unit”. For On/Off Components, this is the amount that the customer # will be charged when they turn the component on for the subscription. The - # price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or + # price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or # 0.00000065 # @return [Object] attr_accessor :unit_price @@ -110,8 +110,8 @@ class QuantityBasedComponent < BaseModel # @return [Array[Integer]] attr_accessor :public_signup_page_ids - # The numerical interval. i.e. an interval of ‘30’ coupled with an - # interval_unit of day would mean this component's default price point would + # The numerical interval. e.g., an interval of ‘30’ coupled with an + # interval_unit of day would mean this component’s default price point would # renew every 30 days. This property is only available for sites with # Multifrequency enabled. # @return [Integer] @@ -123,6 +123,12 @@ class QuantityBasedComponent < BaseModel # @return [IntervalUnit] attr_accessor :interval_unit + # (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. + # When set, this value is sent as the commodity code on invoice line items + # for this component instead of the default derived from item_category. + # @return [String] + attr_accessor :unspsc_code + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -145,6 +151,7 @@ def self.names @_hash['public_signup_page_ids'] = 'public_signup_page_ids' @_hash['interval'] = 'interval' @_hash['interval_unit'] = 'interval_unit' + @_hash['unspsc_code'] = 'unspsc_code' @_hash end @@ -167,6 +174,7 @@ def self.optionals public_signup_page_ids interval interval_unit + unspsc_code ] end @@ -176,6 +184,7 @@ def self.nullables upgrade_charge downgrade_credit interval_unit + unspsc_code ] end @@ -187,7 +196,8 @@ def initialize(name:, unit_name:, pricing_scheme:, description: SKIP, display_on_hosted_page: SKIP, allow_fractional_quantities: SKIP, public_signup_page_ids: SKIP, interval: SKIP, - interval_unit: SKIP, additional_properties: {}) + interval_unit: SKIP, unspsc_code: SKIP, + additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -218,6 +228,7 @@ def initialize(name:, unit_name:, pricing_scheme:, description: SKIP, @public_signup_page_ids = public_signup_page_ids unless public_signup_page_ids == SKIP @interval = interval unless interval == SKIP @interval_unit = interval_unit unless interval_unit == SKIP + @unspsc_code = unspsc_code unless unspsc_code == SKIP end # Creates an instance of the object from a hash. @@ -271,6 +282,7 @@ def self.from_hash(hash) hash.key?('public_signup_page_ids') ? hash['public_signup_page_ids'] : SKIP interval = hash.key?('interval') ? hash['interval'] : SKIP interval_unit = hash.key?('interval_unit') ? hash['interval_unit'] : SKIP + unspsc_code = hash.key?('unspsc_code') ? hash['unspsc_code'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -295,6 +307,7 @@ def self.from_hash(hash) public_signup_page_ids: public_signup_page_ids, interval: interval, interval_unit: interval_unit, + unspsc_code: unspsc_code, additional_properties: additional_properties) end @@ -334,8 +347,8 @@ def to_s " hide_date_range_on_invoice: #{@hide_date_range_on_invoice}, recurring: #{@recurring},"\ " display_on_hosted_page: #{@display_on_hosted_page}, allow_fractional_quantities:"\ " #{@allow_fractional_quantities}, public_signup_page_ids: #{@public_signup_page_ids},"\ - " interval: #{@interval}, interval_unit: #{@interval_unit}, additional_properties:"\ - " #{get_additional_properties}>" + " interval: #{@interval}, interval_unit: #{@interval_unit}, unspsc_code: #{@unspsc_code},"\ + " additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -351,7 +364,8 @@ def inspect " #{@display_on_hosted_page.inspect}, allow_fractional_quantities:"\ " #{@allow_fractional_quantities.inspect}, public_signup_page_ids:"\ " #{@public_signup_page_ids.inspect}, interval: #{@interval.inspect}, interval_unit:"\ - " #{@interval_unit.inspect}, additional_properties: #{get_additional_properties}>" + " #{@interval_unit.inspect}, unspsc_code: #{@unspsc_code.inspect}, additional_properties:"\ + " #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/reactivate_subscription_request.rb b/lib/advanced_billing/models/reactivate_subscription_request.rb index 23bba4ef..09a7bb7c 100644 --- a/lib/advanced_billing/models/reactivate_subscription_request.rb +++ b/lib/advanced_billing/models/reactivate_subscription_request.rb @@ -9,7 +9,7 @@ class ReactivateSubscriptionRequest < BaseModel SKIP = Object.new private_constant :SKIP - # These values are only applicable to subscriptions using calendar billing + # These values are only applicable to subscriptions using calendar billing. # @return [ReactivationBilling] attr_accessor :calendar_billing diff --git a/lib/advanced_billing/models/reactivation_billing.rb b/lib/advanced_billing/models/reactivation_billing.rb index 2e544de9..2aa93723 100644 --- a/lib/advanced_billing/models/reactivation_billing.rb +++ b/lib/advanced_billing/models/reactivation_billing.rb @@ -4,17 +4,16 @@ # APIMATIC v3.0 ( https://www.apimatic.io ). module AdvancedBilling - # These values are only applicable to subscriptions using calendar billing + # These values are only applicable to subscriptions using calendar billing. class ReactivationBilling < BaseModel SKIP = Object.new private_constant :SKIP # 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 + # be attempted 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. # @return [ReactivationCharge] attr_accessor :reactivation_charge diff --git a/lib/advanced_billing/models/reactivation_charge.rb b/lib/advanced_billing/models/reactivation_charge.rb index 90248032..6bfd2c69 100644 --- a/lib/advanced_billing/models/reactivation_charge.rb +++ b/lib/advanced_billing/models/reactivation_charge.rb @@ -5,10 +5,10 @@ module AdvancedBilling # 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 + # 1) `prorated` A prorated charge for the product price will be attempted 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. class ReactivationCharge REACTIVATION_CHARGE = [ # TODO: Write general description for PRORATED diff --git a/lib/advanced_billing/models/refund_consolidated_invoice.rb b/lib/advanced_billing/models/refund_consolidated_invoice.rb index ff4fcc0f..7f048645 100644 --- a/lib/advanced_billing/models/refund_consolidated_invoice.rb +++ b/lib/advanced_billing/models/refund_consolidated_invoice.rb @@ -4,7 +4,7 @@ # APIMATIC v3.0 ( https://www.apimatic.io ). module AdvancedBilling - # Refund consolidated invoice + # Refund consolidated invoice. class RefundConsolidatedInvoice < BaseModel SKIP = Object.new private_constant :SKIP diff --git a/lib/advanced_billing/models/refund_invoice.rb b/lib/advanced_billing/models/refund_invoice.rb index dfacab5d..cf4ae88b 100644 --- a/lib/advanced_billing/models/refund_invoice.rb +++ b/lib/advanced_billing/models/refund_invoice.rb @@ -32,9 +32,9 @@ class RefundInvoice < BaseModel # @return [TrueClass | FalseClass] attr_accessor :apply_credit - # If `apply_credit` set to false and refunding full amount, if - # `void_invoice` set to true, invoice will be voided after refund. Defaults - # to `false`. + # If `apply_credit` is set to false and refunding full amount, if + # `void_invoice` is set to true, invoice will be voided after refund. + # Defaults to `false`. # @return [TrueClass | FalseClass] attr_accessor :void_invoice diff --git a/lib/advanced_billing/models/refund_invoice_event_data.rb b/lib/advanced_billing/models/refund_invoice_event_data.rb index dc2238f7..6a50bb18 100644 --- a/lib/advanced_billing/models/refund_invoice_event_data.rb +++ b/lib/advanced_billing/models/refund_invoice_event_data.rb @@ -15,7 +15,7 @@ class RefundInvoiceEventData < BaseModel attr_accessor :apply_credit # Consolidation level of the invoice, which is applicable to invoice - # consolidation. It will hold one of the following values: + # consolidation. It will hold one of the following values: # * "none": A normal invoice with no consolidation. # * "child": An invoice segment which has been combined into a consolidated # invoice. @@ -30,7 +30,7 @@ class RefundInvoiceEventData < BaseModel attr_accessor :consolidation_level # Consolidation level of the invoice, which is applicable to invoice - # consolidation. It will hold one of the following values: + # consolidation. It will hold one of the following values: # * "none": A normal invoice with no consolidation. # * "child": An invoice segment which has been combined into a consolidated # invoice. diff --git a/lib/advanced_billing/models/register.rb b/lib/advanced_billing/models/register.rb index e39d951f..a088dcb1 100644 --- a/lib/advanced_billing/models/register.rb +++ b/lib/advanced_billing/models/register.rb @@ -22,7 +22,7 @@ class Register < BaseModel attr_accessor :name # The ISO 4217 currency code (3 character string) representing the currency - # of invoice transaction. + # of an invoice transaction. # @return [String] attr_accessor :currency_code diff --git a/lib/advanced_billing/models/renewal_preview_request.rb b/lib/advanced_billing/models/renewal_preview_request.rb index 9bcf155b..f3630564 100644 --- a/lib/advanced_billing/models/renewal_preview_request.rb +++ b/lib/advanced_billing/models/renewal_preview_request.rb @@ -9,7 +9,7 @@ class RenewalPreviewRequest < BaseModel SKIP = Object.new private_constant :SKIP - # An optional array of component definitions to preview. Providing any + # (Optional) Array of component definitions to preview. Providing any # component definitions here will override the actual components on the # subscription (and their quantities), and the billing preview will contain # only these components (in addition to any product base fees). diff --git a/lib/advanced_billing/models/scheduled_renewal_component_custom_price.rb b/lib/advanced_billing/models/scheduled_renewal_component_custom_price.rb index ffd9cded..599e4e6a 100644 --- a/lib/advanced_billing/models/scheduled_renewal_component_custom_price.rb +++ b/lib/advanced_billing/models/scheduled_renewal_component_custom_price.rb @@ -13,7 +13,7 @@ class ScheduledRenewalComponentCustomPrice < BaseModel # @return [TrueClass | FalseClass] attr_accessor :tax_included - # Omit for On/Off components + # Omit for On/Off components. # @return [PricingScheme] attr_accessor :pricing_scheme diff --git a/lib/advanced_billing/models/scheduled_renewal_item_request_body_component.rb b/lib/advanced_billing/models/scheduled_renewal_item_request_body_component.rb index 14398779..e2e317e6 100644 --- a/lib/advanced_billing/models/scheduled_renewal_item_request_body_component.rb +++ b/lib/advanced_billing/models/scheduled_renewal_item_request_body_component.rb @@ -21,7 +21,7 @@ class ScheduledRenewalItemRequestBodyComponent < BaseModel # @return [Integer] attr_accessor :price_point_id - # Optional quantity for the item. + # (Optional) Quantity for the item. # @return [Integer] attr_accessor :quantity diff --git a/lib/advanced_billing/models/scheduled_renewal_item_request_body_product.rb b/lib/advanced_billing/models/scheduled_renewal_item_request_body_product.rb index 13f55294..88afbb48 100644 --- a/lib/advanced_billing/models/scheduled_renewal_item_request_body_product.rb +++ b/lib/advanced_billing/models/scheduled_renewal_item_request_body_product.rb @@ -21,7 +21,7 @@ class ScheduledRenewalItemRequestBodyProduct < BaseModel # @return [Integer] attr_accessor :price_point_id - # Optional quantity for the item. + # (Optional) Quantity for the item. # @return [Integer] attr_accessor :quantity diff --git a/lib/advanced_billing/models/scheduled_renewal_product_price_point.rb b/lib/advanced_billing/models/scheduled_renewal_product_price_point.rb index 7e8ddd18..b5a1f96a 100644 --- a/lib/advanced_billing/models/scheduled_renewal_product_price_point.rb +++ b/lib/advanced_billing/models/scheduled_renewal_product_price_point.rb @@ -37,7 +37,7 @@ class ScheduledRenewalProductPricePoint < BaseModel # @return [Integer] attr_accessor :initial_charge_in_cents - # The numerical expiration interval. i.e. an expiration_interval of ‘30’ + # The numerical expiration interval. e.g., an expiration_interval of ‘30’ # coupled with an expiration_interval_unit of day would mean this product # price point would expire after 30 days. # @return [Integer] diff --git a/lib/advanced_billing/models/service_credit1.rb b/lib/advanced_billing/models/service_credit1.rb index 06738cd8..0252a16a 100644 --- a/lib/advanced_billing/models/service_credit1.rb +++ b/lib/advanced_billing/models/service_credit1.rb @@ -30,7 +30,7 @@ class ServiceCredit1 < BaseModel # @return [String] attr_accessor :memo - # The invoice uid associated with the entry. Only present for debit entries + # The invoice uid associated with the entry. Only present for debit entries. # @return [String] attr_accessor :invoice_uid diff --git a/lib/advanced_billing/models/subscription.rb b/lib/advanced_billing/models/subscription.rb index 444ca3da..05531209 100644 --- a/lib/advanced_billing/models/subscription.rb +++ b/lib/advanced_billing/models/subscription.rb @@ -97,10 +97,10 @@ class Subscription < BaseModel # @return [Integer] attr_accessor :total_revenue_in_cents - # (Added Nov 5 2013) The recurring amount of the product (and - # version),currently subscribed. NOTE: this may differ from the current - # price of,the product, if you’ve changed the price of the product but - # haven’t,moved this subscription to a newer version. + # (Added Nov 5 2013) The recurring amount of the product (and version), + # currently subscribed. NOTE: this may differ from the current price of the + # product, if you’ve changed the price of the product but haven’t moved this + # subscription to a newer version. # @return [Integer] attr_accessor :product_price_in_cents @@ -109,18 +109,18 @@ class Subscription < BaseModel # @return [Integer] attr_accessor :product_version_number - # Timestamp relating to the end of the current (recurring) period (i.e.,when - # the next regularly scheduled attempted charge will occur) + # Timestamp relating to the end of the current (recurring) period (i.e., + # when the next regularly scheduled attempted charge will occur) # @return [DateTime] attr_accessor :current_period_ends_at - # Timestamp that indicates when capture of payment will be tried or,retried. - # This value will usually track the current_period_ends_at, but,will diverge - # if a renewal payment fails and must be retried. In that,case, the - # current_period_ends_at will advance to the end of the next,period (time - # doesn’t stop because a payment was missed) but the,next_assessment_at will - # be scheduled for the auto-retry time (i.e. 24,hours in the future, in some - # cases) + # Timestamp that indicates when capture of payment will be tried or retried. + # This value will usually track the current_period_ends_at, but will diverge + # if a renewal payment fails and must be retried. In that case, the + # current_period_ends_at will advance to the end of the next period (time + # doesn’t stop because a payment was missed) but the next_assessment_at will + # be scheduled for the auto-retry time (e.g., 24 hours in the future, in + # some cases). # @return [DateTime] attr_accessor :next_assessment_at @@ -132,8 +132,8 @@ class Subscription < BaseModel # @return [DateTime] attr_accessor :trial_ended_at - # Timestamp for when the subscription began (i.e. when it came out of trial, - # or when it began in the case of no trial) + # Timestamp for when the subscription began (i.e., when it came out of + # trial, or when it began in the case of no trial) # @return [DateTime] attr_accessor :activated_at @@ -173,7 +173,7 @@ class Subscription < BaseModel # Only valid for webhook payloads The previous state for webhooks that have # indicated a change in state. For normal API calls, this will always be the - # same as the state (current state) + # same as the state (current state). # @return [SubscriptionState] attr_accessor :previous_state @@ -181,8 +181,8 @@ class Subscription < BaseModel # @return [Integer] attr_accessor :signup_payment_id - # The revenue, formatted as a string of decimal separated dollars and,cents, - # from the subscription signup ($50.00 would be formatted as,50.00) + # The revenue, formatted as a string of decimal separated dollars and cents, + # from the subscription signup ($50.00 would be formatted as 50.00) # @return [String] attr_accessor :signup_revenue @@ -271,7 +271,7 @@ class Subscription < BaseModel # @return [Integer] attr_accessor :coupon_uses_allowed - # The churn reason code associated to a cancelled subscription. + # The churn reason code associated to a canceled subscription. # @return [String] attr_accessor :reason_code @@ -329,7 +329,7 @@ class Subscription < BaseModel # @return [Integer] attr_accessor :stored_credential_transaction_id - # The reference value (provided by your app) for the subscription istelf. + # The reference value (provided by your app) for the subscription itself. # @return [String] attr_accessor :reference @@ -339,12 +339,12 @@ class Subscription < BaseModel # Boolean representing whether the subscription is prepaid and currently in # dunning. Only returned for Relationship Invoicing sites with the feature - # enabled + # enabled. # @return [TrueClass | FalseClass] attr_accessor :prepaid_dunning # Additional coupon data. To use this data you also have to include the - # following param in the request`include[]=coupons`. + # following param in the request: `include[]=coupons`. # Only in Read Subscription Endpoint. # @return [Array[SubscriptionIncludedCoupon]] attr_accessor :coupons diff --git a/lib/advanced_billing/models/subscription_component.rb b/lib/advanced_billing/models/subscription_component.rb index ad751f4c..9e20e718 100644 --- a/lib/advanced_billing/models/subscription_component.rb +++ b/lib/advanced_billing/models/subscription_component.rb @@ -27,17 +27,17 @@ class SubscriptionComponent < BaseModel attr_accessor :unit_name # (for on/off components) indicates if the component is enabled for the - # subscription + # subscription. # @return [TrueClass | FalseClass] attr_accessor :enabled # (for on/off components) indicates if the component is enabled for the - # subscription - # @return [Integer] + # subscription. + # @return [Object] attr_accessor :unit_balance # (for on/off components) indicates if the component is enabled for the - # subscription + # subscription. # @return [String] attr_accessor :currency @@ -147,22 +147,22 @@ class SubscriptionComponent < BaseModel # @return [TrueClass | FalseClass] attr_accessor :allow_fractional_quantities - # An optional object, will be returned if provided `include=subscription` - # query param. + # (Optional) Object that will be returned if the `include=subscription` + # query param is provided. # @return [SubscriptionComponentSubscription] attr_accessor :subscription - # An optional object, will be returned if provided `include=subscription` - # query param. + # (Optional) Object that will be returned if the `include=subscription` + # query param is provided. # @return [Array[HistoricUsage]] attr_accessor :historic_usages - # An optional object, will be returned if provided `include=subscription` - # query param. + # (Optional) Object that will be returned if the `include=subscription` + # query param is provided. # @return [TrueClass | FalseClass] attr_accessor :display_on_hosted_page - # The numerical interval. i.e. an interval of '30' coupled with an + # The numerical interval. e.g., an interval of '30' coupled with an # interval_unit of day would mean this component price point would renew # every 30 days. This property is only available for sites with # Multifrequency enabled. @@ -336,7 +336,9 @@ def self.from_hash(hash) kind = hash.key?('kind') ? hash['kind'] : SKIP unit_name = hash.key?('unit_name') ? hash['unit_name'] : SKIP enabled = hash.key?('enabled') ? hash['enabled'] : SKIP - unit_balance = hash.key?('unit_balance') ? hash['unit_balance'] : SKIP + unit_balance = hash.key?('unit_balance') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:SubscriptionComponentUnitBalance), hash['unit_balance'] + ) : SKIP currency = hash.key?('currency') ? hash['currency'] : SKIP allocated_quantity = hash.key?('allocated_quantity') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:SubscriptionComponentAllocatedQuantity), hash['allocated_quantity'] diff --git a/lib/advanced_billing/models/subscription_component_subscription.rb b/lib/advanced_billing/models/subscription_component_subscription.rb index b3ea2451..812976a2 100644 --- a/lib/advanced_billing/models/subscription_component_subscription.rb +++ b/lib/advanced_billing/models/subscription_component_subscription.rb @@ -5,8 +5,8 @@ require 'date' module AdvancedBilling - # An optional object, will be returned if provided `include=subscription` - # query param. + # (Optional) Object that will be returned if the `include=subscription` query + # param is provided. class SubscriptionComponentSubscription < BaseModel SKIP = Object.new private_constant :SKIP diff --git a/lib/advanced_billing/models/subscription_custom_price.rb b/lib/advanced_billing/models/subscription_custom_price.rb index d2d4734a..65de21a7 100644 --- a/lib/advanced_billing/models/subscription_custom_price.rb +++ b/lib/advanced_billing/models/subscription_custom_price.rb @@ -43,7 +43,7 @@ class SubscriptionCustomPrice < BaseModel # @return [IntervalUnit] attr_accessor :trial_interval_unit - # Indicates how a trial is handled when the trail period ends and there is + # Indicates how a trial is handled when the trial period ends and there is # no credit card on file. For `no_obligation`, the subscription transitions # to a Trial Ended state. Maxio will not send any emails or statements. For # `payment_expected`, the subscription transitions to a Past Due state. diff --git a/lib/advanced_billing/models/subscription_group_bank_account.rb b/lib/advanced_billing/models/subscription_group_bank_account.rb index 380cb7e0..4ed062b3 100644 --- a/lib/advanced_billing/models/subscription_group_bank_account.rb +++ b/lib/advanced_billing/models/subscription_group_bank_account.rb @@ -21,18 +21,18 @@ class SubscriptionGroupBankAccount < BaseModel attr_accessor :bank_account_number # (Required when creating a subscription with ACH. Optional when creating a - # subscription with GoCardless). The routing number of the bank. It becomes - # bank_code while passing via GoCardless API + # subscription with GoCardless.) The routing number of the bank. It becomes + # bank_code while passing via GoCardless API. # @return [String] attr_accessor :bank_routing_number # (Optional when creating a subscription with GoCardless). International - # Bank Account Number. Alternatively, local bank details can be provided + # Bank Account Number. Alternatively, local bank details can be provided. # @return [String] attr_accessor :bank_iban # (Optional when creating a subscription with GoCardless) Branch code. - # Alternatively, an IBAN can be provided + # Alternatively, an IBAN can be provided. # @return [String] attr_accessor :bank_branch_code diff --git a/lib/advanced_billing/models/subscription_group_signup_item.rb b/lib/advanced_billing/models/subscription_group_signup_item.rb index 47d98d64..da056f1b 100644 --- a/lib/advanced_billing/models/subscription_group_signup_item.rb +++ b/lib/advanced_billing/models/subscription_group_signup_item.rb @@ -29,11 +29,11 @@ class SubscriptionGroupSignupItem < BaseModel # Use in place of passing product and component information to set up the # subscription with an existing offer. May be either the Chargify ID of the - # offer or its handle prefixed with `handle:` + # offer or its handle prefixed with `handle:`. # @return [Integer] attr_accessor :offer_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 @@ -62,7 +62,7 @@ class SubscriptionGroupSignupItem < BaseModel # @return [SubscriptionCustomPrice] attr_accessor :custom_price - # (Optional). Cannot be used when also specifying next_billing_at + # (Optional). Cannot be used when also specifying next_billing_at. # @return [CalendarBilling] attr_accessor :calendar_billing diff --git a/lib/advanced_billing/models/subscription_list_include.rb b/lib/advanced_billing/models/subscription_list_include.rb index b6042e2a..e1f07894 100644 --- a/lib/advanced_billing/models/subscription_list_include.rb +++ b/lib/advanced_billing/models/subscription_list_include.rb @@ -8,7 +8,16 @@ module AdvancedBilling class SubscriptionListInclude SUBSCRIPTION_LIST_INCLUDE = [ # TODO: Write general description for SELF_SERVICE_PAGE_TOKEN - SELF_SERVICE_PAGE_TOKEN = 'self_service_page_token'.freeze + SELF_SERVICE_PAGE_TOKEN = 'self_service_page_token'.freeze, + + # TODO: Write general description for CURRENT_ACCOUNT_BALANCE_IN_CENTS + CURRENT_ACCOUNT_BALANCE_IN_CENTS = 'current_account_balance_in_cents'.freeze, + + # TODO: Write general description for CURRENT_BILLING_AMOUNT + CURRENT_BILLING_AMOUNT = 'current_billing_amount'.freeze, + + # TODO: Write general description for COUPONS + COUPONS = 'coupons'.freeze ].freeze def self.validate(value) @@ -20,7 +29,16 @@ def self.validate(value) def self.from_value(value, default_value = SELF_SERVICE_PAGE_TOKEN) return default_value if value.nil? - default_value + str = value.to_s.strip + + case str.downcase + when 'self_service_page_token' then SELF_SERVICE_PAGE_TOKEN + when 'current_account_balance_in_cents' then CURRENT_ACCOUNT_BALANCE_IN_CENTS + when 'current_billing_amount' then CURRENT_BILLING_AMOUNT + when 'coupons' then COUPONS + else + default_value + end end end end diff --git a/lib/advanced_billing/models/subscription_product_change.rb b/lib/advanced_billing/models/subscription_product_change.rb index 4698d6af..fc340054 100644 --- a/lib/advanced_billing/models/subscription_product_change.rb +++ b/lib/advanced_billing/models/subscription_product_change.rb @@ -3,8 +3,11 @@ # This file was automatically generated for Maxio by # APIMATIC v3.0 ( https://www.apimatic.io ). +require 'date' module AdvancedBilling - # SubscriptionProductChange Model. + # Event data for both `subscription_product_change` and + # `subscription_product_change_scheduled`. The price point and `effective_at` + # fields are only populated for scheduled changes. class SubscriptionProductChange < BaseModel SKIP = Object.new private_constant :SKIP @@ -17,25 +20,52 @@ class SubscriptionProductChange < BaseModel # @return [Integer] attr_accessor :new_product_id + # TODO: Write general description for this method + # @return [Integer] + attr_accessor :previous_product_price_point_id + + # TODO: Write general description for this method + # @return [Integer] + attr_accessor :new_product_price_point_id + + # When the scheduled product change takes effect (the subscription's next + # renewal). Only sent for `subscription_product_change_scheduled`. + # @return [DateTime] + attr_accessor :effective_at + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @_hash['previous_product_id'] = 'previous_product_id' @_hash['new_product_id'] = 'new_product_id' + @_hash['previous_product_price_point_id'] = + 'previous_product_price_point_id' + @_hash['new_product_price_point_id'] = 'new_product_price_point_id' + @_hash['effective_at'] = 'effective_at' @_hash end # An array for optional fields def self.optionals - [] + %w[ + previous_product_price_point_id + new_product_price_point_id + effective_at + ] end # An array for nullable fields def self.nullables - [] + %w[ + previous_product_price_point_id + new_product_price_point_id + effective_at + ] end def initialize(previous_product_id:, new_product_id:, + previous_product_price_point_id: SKIP, + new_product_price_point_id: SKIP, effective_at: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| @@ -44,6 +74,15 @@ def initialize(previous_product_id:, new_product_id:, @previous_product_id = previous_product_id @new_product_id = new_product_id + unless previous_product_price_point_id == SKIP + @previous_product_price_point_id = + previous_product_price_point_id + end + unless new_product_price_point_id == SKIP + @new_product_price_point_id = + new_product_price_point_id + end + @effective_at = effective_at unless effective_at == SKIP end # Creates an instance of the object from a hash. @@ -55,6 +94,15 @@ def self.from_hash(hash) hash.key?('previous_product_id') ? hash['previous_product_id'] : nil new_product_id = hash.key?('new_product_id') ? hash['new_product_id'] : nil + previous_product_price_point_id = + hash.key?('previous_product_price_point_id') ? hash['previous_product_price_point_id'] : SKIP + new_product_price_point_id = + hash.key?('new_product_price_point_id') ? hash['new_product_price_point_id'] : SKIP + effective_at = if hash.key?('effective_at') + (DateTimeHelper.from_rfc3339(hash['effective_at']) if hash['effective_at']) + else + SKIP + end # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -62,9 +110,16 @@ def self.from_hash(hash) # Create object from extracted values. SubscriptionProductChange.new(previous_product_id: previous_product_id, new_product_id: new_product_id, + previous_product_price_point_id: previous_product_price_point_id, + new_product_price_point_id: new_product_price_point_id, + effective_at: effective_at, additional_properties: additional_properties) end + def to_custom_effective_at + DateTimeHelper.to_rfc3339(effective_at) + end + # Validates an instance of the object from a given value. # @param [SubscriptionProductChange | Hash] The value against the validation is performed. def self.validate(value) @@ -91,14 +146,19 @@ def self.validate(value) def to_s class_name = self.class.name.split('::').last "<#{class_name} previous_product_id: #{@previous_product_id}, new_product_id:"\ - " #{@new_product_id}, additional_properties: #{get_additional_properties}>" + " #{@new_product_id}, previous_product_price_point_id: #{@previous_product_price_point_id},"\ + " new_product_price_point_id: #{@new_product_price_point_id}, effective_at:"\ + " #{@effective_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} previous_product_id: #{@previous_product_id.inspect}, new_product_id:"\ - " #{@new_product_id.inspect}, additional_properties: #{get_additional_properties}>" + " #{@new_product_id.inspect}, previous_product_price_point_id:"\ + " #{@previous_product_price_point_id.inspect}, new_product_price_point_id:"\ + " #{@new_product_price_point_id.inspect}, effective_at: #{@effective_at.inspect},"\ + " additional_properties: #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/subscription_state_filter.rb b/lib/advanced_billing/models/subscription_state_filter.rb index 8e4243cb..f2dc643e 100644 --- a/lib/advanced_billing/models/subscription_state_filter.rb +++ b/lib/advanced_billing/models/subscription_state_filter.rb @@ -19,9 +19,22 @@ class SubscriptionStateFilter # TODO: Write general description for EXPIRED_CARDS EXPIRED_CARDS = 'expired_cards'.freeze, + # TODO: Write general description for + # ENUM_EXPIRED_CARDS_LIVE_SUBSCRIPTIONS + ENUM_EXPIRED_CARDS_LIVE_SUBSCRIPTIONS = 'expired_cards_(live_subscriptions)'.freeze, + + # TODO: Write general description for ENUM_EXPIRED_CARDS_ALL_SUBSCRIPTIONS + ENUM_EXPIRED_CARDS_ALL_SUBSCRIPTIONS = 'expired_cards_(all_subscriptions)'.freeze, + # TODO: Write general description for ON_HOLD ON_HOLD = 'on_hold'.freeze, + # TODO: Write general description for AWAITING_SIGNUP + AWAITING_SIGNUP = 'awaiting_signup'.freeze, + + # TODO: Write general description for AWAITING_SIGNUP_DATE + AWAITING_SIGNUP_DATE = 'awaiting_signup_date'.freeze, + # TODO: Write general description for PAST_DUE PAST_DUE = 'past_due'.freeze, @@ -31,6 +44,9 @@ class SubscriptionStateFilter # TODO: Write general description for PENDING_RENEWAL PENDING_RENEWAL = 'pending_renewal'.freeze, + # TODO: Write general description for PREPAID_DUNNING + PREPAID_DUNNING = 'prepaid_dunning'.freeze, + # TODO: Write general description for SUSPENDED SUSPENDED = 'suspended'.freeze, @@ -60,10 +76,15 @@ def self.from_value(value, default_value = ACTIVE) when 'canceled' then CANCELED when 'expired' then EXPIRED when 'expired_cards' then EXPIRED_CARDS + when 'enum_expired_cards_live_subscriptions' then ENUM_EXPIRED_CARDS_LIVE_SUBSCRIPTIONS + when 'enum_expired_cards_all_subscriptions' then ENUM_EXPIRED_CARDS_ALL_SUBSCRIPTIONS when 'on_hold' then ON_HOLD + when 'awaiting_signup' then AWAITING_SIGNUP + when 'awaiting_signup_date' then AWAITING_SIGNUP_DATE when 'past_due' then PAST_DUE when 'pending_cancellation' then PENDING_CANCELLATION when 'pending_renewal' then PENDING_RENEWAL + when 'prepaid_dunning' then PREPAID_DUNNING when 'suspended' then SUSPENDED when 'trial_ended' then TRIAL_ENDED when 'trialing' then TRIALING diff --git a/lib/advanced_billing/models/trial_type.rb b/lib/advanced_billing/models/trial_type.rb index 8e66dc52..0b805d73 100644 --- a/lib/advanced_billing/models/trial_type.rb +++ b/lib/advanced_billing/models/trial_type.rb @@ -4,7 +4,7 @@ # APIMATIC v3.0 ( https://www.apimatic.io ). module AdvancedBilling - # Indicates how a trial is handled when the trail period ends and there is no + # Indicates how a trial is handled when the trial period ends and there is no # credit card on file. For `no_obligation`, the subscription transitions to a # Trial Ended state. Maxio will not send any emails or statements. For # `payment_expected`, the subscription transitions to a Past Due state. Maxio diff --git a/lib/advanced_billing/models/update_component.rb b/lib/advanced_billing/models/update_component.rb index 1c3bffc9..c788c4fb 100644 --- a/lib/advanced_billing/models/update_component.rb +++ b/lib/advanced_billing/models/update_component.rb @@ -13,7 +13,7 @@ class UpdateComponent < BaseModel # @return [String] attr_accessor :handle - # The name of the Component, suitable for display on statements. i.e. Text + # The name of the Component, suitable for display on statements. e.g., Text # Messages. # @return [String] attr_accessor :name @@ -51,6 +51,12 @@ class UpdateComponent < BaseModel # @return [CreditType] attr_accessor :upgrade_charge + # (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. + # When set, this value is sent as the commodity code on invoice line items + # for this component instead of the default derived from item_category. + # @return [String] + attr_accessor :unspsc_code + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -63,6 +69,7 @@ def self.names @_hash['item_category'] = 'item_category' @_hash['display_on_hosted_page'] = 'display_on_hosted_page' @_hash['upgrade_charge'] = 'upgrade_charge' + @_hash['unspsc_code'] = 'unspsc_code' @_hash end @@ -78,6 +85,7 @@ def self.optionals item_category display_on_hosted_page upgrade_charge + unspsc_code ] end @@ -89,13 +97,15 @@ def self.nullables tax_code item_category upgrade_charge + unspsc_code ] end def initialize(handle: SKIP, name: SKIP, description: SKIP, accounting_code: SKIP, taxable: SKIP, tax_code: SKIP, item_category: SKIP, display_on_hosted_page: SKIP, - upgrade_charge: SKIP, additional_properties: {}) + upgrade_charge: SKIP, unspsc_code: SKIP, + additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) @@ -110,6 +120,7 @@ def initialize(handle: SKIP, name: SKIP, description: SKIP, @item_category = item_category unless item_category == SKIP @display_on_hosted_page = display_on_hosted_page unless display_on_hosted_page == SKIP @upgrade_charge = upgrade_charge unless upgrade_charge == SKIP + @unspsc_code = unspsc_code unless unspsc_code == SKIP end # Creates an instance of the object from a hash. @@ -129,6 +140,7 @@ def self.from_hash(hash) hash.key?('display_on_hosted_page') ? hash['display_on_hosted_page'] : SKIP upgrade_charge = hash.key?('upgrade_charge') ? hash['upgrade_charge'] : SKIP + unspsc_code = hash.key?('unspsc_code') ? hash['unspsc_code'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -143,6 +155,7 @@ def self.from_hash(hash) item_category: item_category, display_on_hosted_page: display_on_hosted_page, upgrade_charge: upgrade_charge, + unspsc_code: unspsc_code, additional_properties: additional_properties) end @@ -152,7 +165,8 @@ def to_s "<#{class_name} handle: #{@handle}, name: #{@name}, description: #{@description},"\ " accounting_code: #{@accounting_code}, taxable: #{@taxable}, tax_code: #{@tax_code},"\ " item_category: #{@item_category}, display_on_hosted_page: #{@display_on_hosted_page},"\ - " upgrade_charge: #{@upgrade_charge}, additional_properties: #{get_additional_properties}>" + " upgrade_charge: #{@upgrade_charge}, unspsc_code: #{@unspsc_code}, additional_properties:"\ + " #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -162,8 +176,8 @@ def inspect " #{@description.inspect}, accounting_code: #{@accounting_code.inspect}, taxable:"\ " #{@taxable.inspect}, tax_code: #{@tax_code.inspect}, item_category:"\ " #{@item_category.inspect}, display_on_hosted_page: #{@display_on_hosted_page.inspect},"\ - " upgrade_charge: #{@upgrade_charge.inspect}, additional_properties:"\ - " #{get_additional_properties}>" + " upgrade_charge: #{@upgrade_charge.inspect}, unspsc_code: #{@unspsc_code.inspect},"\ + " additional_properties: #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/update_component_price_point.rb b/lib/advanced_billing/models/update_component_price_point.rb index e482d2fd..1b5c0d7b 100644 --- a/lib/advanced_billing/models/update_component_price_point.rb +++ b/lib/advanced_billing/models/update_component_price_point.rb @@ -32,7 +32,7 @@ class UpdateComponentPricePoint < BaseModel # @return [TrueClass | FalseClass] attr_accessor :tax_included - # The numerical interval. i.e. an interval of ‘30’ coupled with an + # The numerical interval. e.g., an interval of ‘30’ coupled with an # interval_unit of day would mean this component price point would renew # every 30 days. This property is only available for sites with # Multifrequency enabled. diff --git a/lib/advanced_billing/models/update_customer.rb b/lib/advanced_billing/models/update_customer.rb index 6aeb3897..e0a622a2 100644 --- a/lib/advanced_billing/models/update_customer.rb +++ b/lib/advanced_billing/models/update_customer.rb @@ -73,16 +73,23 @@ class UpdateCustomer < BaseModel # @return [TrueClass | FalseClass] attr_accessor :tax_exempt - # Set a specific language on a customer record. + # Whether surcharging is enabled for the customer. Only applied on sites + # where surcharging control is enabled. + # @return [TrueClass | FalseClass] + attr_accessor :surcharging + + # Whether surcharging is enabled for the customer. Only applied on sites + # where surcharging control is enabled. # @return [String] attr_accessor :tax_exempt_reason - # Set a specific language on a customer record. + # Whether surcharging is enabled for the customer. Only applied on sites + # where surcharging control is enabled. # @return [Integer] attr_accessor :parent_id # Is the customer verified to use ACH as a payment method. Available only on - # Authorize.Net gateway + # the Authorize.Net gateway. # @return [TrueClass | FalseClass] attr_accessor :verified @@ -90,6 +97,13 @@ class UpdateCustomer < BaseModel # @return [String] attr_accessor :salesforce_id + # The ID of the Branding Theme assigned to this customer as the customer's + # default Branding Theme. This customer-level Branding Theme is used when a + # subscription does not have its own subscription-level Branding Theme. + # Available only when Branding Themes are enabled for the site. + # @return [Integer] + attr_accessor :branding_theme_id + # A mapping from model property names to API property names. def self.names @_hash = {} if @_hash.nil? @@ -109,10 +123,12 @@ def self.names @_hash['locale'] = 'locale' @_hash['vat_number'] = 'vat_number' @_hash['tax_exempt'] = 'tax_exempt' + @_hash['surcharging'] = 'surcharging' @_hash['tax_exempt_reason'] = 'tax_exempt_reason' @_hash['parent_id'] = 'parent_id' @_hash['verified'] = 'verified' @_hash['salesforce_id'] = 'salesforce_id' + @_hash['branding_theme_id'] = 'branding_theme_id' @_hash end @@ -135,10 +151,12 @@ def self.optionals locale vat_number tax_exempt + surcharging tax_exempt_reason parent_id verified salesforce_id + branding_theme_id ] end @@ -148,6 +166,7 @@ def self.nullables parent_id verified salesforce_id + branding_theme_id ] end @@ -155,8 +174,9 @@ def initialize(first_name: SKIP, last_name: SKIP, email: SKIP, cc_emails: SKIP, organization: SKIP, reference: SKIP, address: SKIP, address_2: SKIP, city: SKIP, state: SKIP, zip: SKIP, country: SKIP, phone: SKIP, locale: SKIP, - vat_number: SKIP, tax_exempt: SKIP, tax_exempt_reason: SKIP, - parent_id: SKIP, verified: SKIP, salesforce_id: SKIP, + vat_number: SKIP, tax_exempt: SKIP, surcharging: SKIP, + tax_exempt_reason: SKIP, parent_id: SKIP, verified: SKIP, + salesforce_id: SKIP, branding_theme_id: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| @@ -179,10 +199,12 @@ def initialize(first_name: SKIP, last_name: SKIP, email: SKIP, @locale = locale unless locale == SKIP @vat_number = vat_number unless vat_number == SKIP @tax_exempt = tax_exempt unless tax_exempt == SKIP + @surcharging = surcharging unless surcharging == SKIP @tax_exempt_reason = tax_exempt_reason unless tax_exempt_reason == SKIP @parent_id = parent_id unless parent_id == SKIP @verified = verified unless verified == SKIP @salesforce_id = salesforce_id unless salesforce_id == SKIP + @branding_theme_id = branding_theme_id unless branding_theme_id == SKIP end # Creates an instance of the object from a hash. @@ -206,11 +228,14 @@ def self.from_hash(hash) locale = hash.key?('locale') ? hash['locale'] : SKIP vat_number = hash.key?('vat_number') ? hash['vat_number'] : SKIP tax_exempt = hash.key?('tax_exempt') ? hash['tax_exempt'] : SKIP + surcharging = hash.key?('surcharging') ? hash['surcharging'] : SKIP tax_exempt_reason = hash.key?('tax_exempt_reason') ? hash['tax_exempt_reason'] : SKIP parent_id = hash.key?('parent_id') ? hash['parent_id'] : SKIP verified = hash.key?('verified') ? hash['verified'] : SKIP salesforce_id = hash.key?('salesforce_id') ? hash['salesforce_id'] : SKIP + branding_theme_id = + hash.key?('branding_theme_id') ? hash['branding_theme_id'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } @@ -232,10 +257,12 @@ def self.from_hash(hash) locale: locale, vat_number: vat_number, tax_exempt: tax_exempt, + surcharging: surcharging, tax_exempt_reason: tax_exempt_reason, parent_id: parent_id, verified: verified, salesforce_id: salesforce_id, + branding_theme_id: branding_theme_id, additional_properties: additional_properties) end @@ -246,8 +273,9 @@ def to_s " cc_emails: #{@cc_emails}, organization: #{@organization}, reference: #{@reference},"\ " address: #{@address}, address_2: #{@address_2}, city: #{@city}, state: #{@state}, zip:"\ " #{@zip}, country: #{@country}, phone: #{@phone}, locale: #{@locale}, vat_number:"\ - " #{@vat_number}, tax_exempt: #{@tax_exempt}, tax_exempt_reason: #{@tax_exempt_reason},"\ - " parent_id: #{@parent_id}, verified: #{@verified}, salesforce_id: #{@salesforce_id},"\ + " #{@vat_number}, tax_exempt: #{@tax_exempt}, surcharging: #{@surcharging},"\ + " tax_exempt_reason: #{@tax_exempt_reason}, parent_id: #{@parent_id}, verified:"\ + " #{@verified}, salesforce_id: #{@salesforce_id}, branding_theme_id: #{@branding_theme_id},"\ " additional_properties: #{get_additional_properties}>" end @@ -260,9 +288,10 @@ def inspect " address_2: #{@address_2.inspect}, city: #{@city.inspect}, state: #{@state.inspect}, zip:"\ " #{@zip.inspect}, country: #{@country.inspect}, phone: #{@phone.inspect}, locale:"\ " #{@locale.inspect}, vat_number: #{@vat_number.inspect}, tax_exempt:"\ - " #{@tax_exempt.inspect}, tax_exempt_reason: #{@tax_exempt_reason.inspect}, parent_id:"\ - " #{@parent_id.inspect}, verified: #{@verified.inspect}, salesforce_id:"\ - " #{@salesforce_id.inspect}, additional_properties: #{get_additional_properties}>" + " #{@tax_exempt.inspect}, surcharging: #{@surcharging.inspect}, tax_exempt_reason:"\ + " #{@tax_exempt_reason.inspect}, parent_id: #{@parent_id.inspect}, verified:"\ + " #{@verified.inspect}, salesforce_id: #{@salesforce_id.inspect}, branding_theme_id:"\ + " #{@branding_theme_id.inspect}, additional_properties: #{get_additional_properties}>" end end end diff --git a/lib/advanced_billing/models/update_invoice.rb b/lib/advanced_billing/models/update_invoice.rb new file mode 100644 index 00000000..2fbad1b4 --- /dev/null +++ b/lib/advanced_billing/models/update_invoice.rb @@ -0,0 +1,185 @@ +# advanced_billing +# +# This file was automatically generated for Maxio by +# APIMATIC v3.0 ( https://www.apimatic.io ). + +module AdvancedBilling + # Attributes of a draft ad hoc invoice which can be updated. Only the + # submitted attributes are changed. + class UpdateInvoice < BaseModel + SKIP = Object.new + private_constant :SKIP + + # Line item changes to apply. Line items without a `uid` are added, line + # items with a `uid` are updated, and line items with a `uid` and `_destroy` + # set to `true` are removed. Existing line items not referenced in the array + # remain unchanged. + # @return [Array[UpdateInvoiceItem]] + attr_accessor :line_items + + # New issue date for the invoice (format YYYY-MM-DD). This date is + # interpreted and validated in your site's time zone. It must be today or a + # date in the past — future dates are not accepted. The due date is + # recalculated from the issue date and net terms. + # @return [Date] + attr_accessor :issue_date + + # Number of days after the issue date on which the invoice is due. The due + # date is recalculated when net terms or the issue date change. + # @return [Integer] + attr_accessor :net_terms + + # Custom payment instructions displayed on the invoice. + # @return [String] + attr_accessor :payment_instructions + + # A custom memo displayed on the invoice. + # @return [String] + attr_accessor :memo + + # Replaces the seller address on the invoice + # @return [CreateInvoiceAddress] + attr_accessor :seller_address + + # Replaces the billing address on the invoice + # @return [CreateInvoiceAddress] + attr_accessor :billing_address + + # Replaces the shipping address on the invoice + # @return [CreateInvoiceAddress] + attr_accessor :shipping_address + + # When present, replaces all discounts currently applied to the invoice. + # Send an empty array to remove all discounts. + # @return [Array[CreateInvoiceCoupon]] + attr_accessor :coupons + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['line_items'] = 'line_items' + @_hash['issue_date'] = 'issue_date' + @_hash['net_terms'] = 'net_terms' + @_hash['payment_instructions'] = 'payment_instructions' + @_hash['memo'] = 'memo' + @_hash['seller_address'] = 'seller_address' + @_hash['billing_address'] = 'billing_address' + @_hash['shipping_address'] = 'shipping_address' + @_hash['coupons'] = 'coupons' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + line_items + issue_date + net_terms + payment_instructions + memo + seller_address + billing_address + shipping_address + coupons + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(line_items: SKIP, issue_date: SKIP, net_terms: SKIP, + payment_instructions: SKIP, memo: SKIP, seller_address: SKIP, + billing_address: SKIP, shipping_address: SKIP, coupons: SKIP, + additional_properties: {}) + # Add additional model properties to the instance. + additional_properties.each do |_name, _value| + instance_variable_set("@#{_name}", _value) + end + + @line_items = line_items unless line_items == SKIP + @issue_date = issue_date unless issue_date == SKIP + @net_terms = net_terms unless net_terms == SKIP + @payment_instructions = payment_instructions unless payment_instructions == SKIP + @memo = memo unless memo == SKIP + @seller_address = seller_address unless seller_address == SKIP + @billing_address = billing_address unless billing_address == SKIP + @shipping_address = shipping_address unless shipping_address == SKIP + @coupons = coupons unless coupons == 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 + line_items = nil + unless hash['line_items'].nil? + line_items = [] + hash['line_items'].each do |structure| + line_items << (UpdateInvoiceItem.from_hash(structure) if structure) + end + end + + line_items = SKIP unless hash.key?('line_items') + issue_date = hash.key?('issue_date') ? hash['issue_date'] : SKIP + net_terms = hash.key?('net_terms') ? hash['net_terms'] : SKIP + payment_instructions = + hash.key?('payment_instructions') ? hash['payment_instructions'] : SKIP + memo = hash.key?('memo') ? hash['memo'] : SKIP + seller_address = CreateInvoiceAddress.from_hash(hash['seller_address']) if + hash['seller_address'] + billing_address = CreateInvoiceAddress.from_hash(hash['billing_address']) if + hash['billing_address'] + shipping_address = CreateInvoiceAddress.from_hash(hash['shipping_address']) if + hash['shipping_address'] + # Parameter is an array, so we need to iterate through it + coupons = nil + unless hash['coupons'].nil? + coupons = [] + hash['coupons'].each do |structure| + coupons << (CreateInvoiceCoupon.from_hash(structure) if structure) + end + end + + coupons = SKIP unless hash.key?('coupons') + + # Clean out expected properties from Hash. + additional_properties = hash.reject { |k, _| names.value?(k) } + + # Create object from extracted values. + UpdateInvoice.new(line_items: line_items, + issue_date: issue_date, + net_terms: net_terms, + payment_instructions: payment_instructions, + memo: memo, + seller_address: seller_address, + billing_address: billing_address, + shipping_address: shipping_address, + coupons: coupons, + 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} line_items: #{@line_items}, issue_date: #{@issue_date}, net_terms:"\ + " #{@net_terms}, payment_instructions: #{@payment_instructions}, memo: #{@memo},"\ + " seller_address: #{@seller_address}, billing_address: #{@billing_address},"\ + " shipping_address: #{@shipping_address}, coupons: #{@coupons}, 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} line_items: #{@line_items.inspect}, issue_date: #{@issue_date.inspect},"\ + " net_terms: #{@net_terms.inspect}, payment_instructions: #{@payment_instructions.inspect},"\ + " memo: #{@memo.inspect}, seller_address: #{@seller_address.inspect}, billing_address:"\ + " #{@billing_address.inspect}, shipping_address: #{@shipping_address.inspect}, coupons:"\ + " #{@coupons.inspect}, additional_properties: #{get_additional_properties}>" + end + end +end diff --git a/lib/advanced_billing/models/update_invoice_item.rb b/lib/advanced_billing/models/update_invoice_item.rb new file mode 100644 index 00000000..c926da75 --- /dev/null +++ b/lib/advanced_billing/models/update_invoice_item.rb @@ -0,0 +1,242 @@ +# advanced_billing +# +# This file was automatically generated for Maxio by +# APIMATIC v3.0 ( https://www.apimatic.io ). + +module AdvancedBilling + # A line item change for a draft ad hoc invoice. Supports the same attributes + # as line items on invoice creation, plus `uid` and `_destroy` for updating or + # removing existing line items. + class UpdateInvoiceItem < BaseModel + SKIP = Object.new + private_constant :SKIP + + # TODO: Write general description for this method + # @return [String] + attr_accessor :title + + # The quantity can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or + # 0.00000065. If you submit a value with more than 8 decimal places, we will + # round it down to the 8th decimal place. + # @return [Object] + attr_accessor :quantity + + # The unit_price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or + # 0.00000065. If you submit a value with more than 8 decimal places, we will + # round it down to the 8th decimal place. + # @return [Object] + attr_accessor :unit_price + + # Set to true to automatically calculate taxes. Site must be configured to + # use and calculate taxes. If using AvaTax, a tax_code parameter must also + # be sent. + # @return [TrueClass | FalseClass] + attr_accessor :taxable + + # A string representing the tax code related to the product type. This is + # especially important when using AvaTax to tax based on locale. This + # attribute has a max length of 25 characters. + # @return [String] + attr_accessor :tax_code + + # YYYY-MM-DD + # @return [String] + attr_accessor :period_range_start + + # YYYY-MM-DD + # @return [String] + attr_accessor :period_range_end + + # Product handle or product id. + # @return [Object] + attr_accessor :product_id + + # Component handle or component id. + # @return [Object] + attr_accessor :component_id + + # Price point handle or id. For component. + # @return [Object] + attr_accessor :price_point_id + + # Price point handle or id. For component. + # @return [Object] + attr_accessor :product_price_point_id + + # Price point handle or id. For component. + # @return [String] + attr_accessor :description + + # Unique identifier of an existing line item on the invoice. When provided, + # the matching line item is updated with the submitted attributes. When + # omitted, a new line item is added to the invoice. + # @return [String] + attr_accessor :uid + + # Set to `true` together with `uid` to remove the matching line item from + # the invoice. Line items not referenced in the request remain unchanged. + # @return [TrueClass | FalseClass] + attr_accessor :destroy + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['title'] = 'title' + @_hash['quantity'] = 'quantity' + @_hash['unit_price'] = 'unit_price' + @_hash['taxable'] = 'taxable' + @_hash['tax_code'] = 'tax_code' + @_hash['period_range_start'] = 'period_range_start' + @_hash['period_range_end'] = 'period_range_end' + @_hash['product_id'] = 'product_id' + @_hash['component_id'] = 'component_id' + @_hash['price_point_id'] = 'price_point_id' + @_hash['product_price_point_id'] = 'product_price_point_id' + @_hash['description'] = 'description' + @_hash['uid'] = 'uid' + @_hash['destroy'] = '_destroy' + @_hash + end + + # An array for optional fields + def self.optionals + %w[ + title + quantity + unit_price + taxable + tax_code + period_range_start + period_range_end + product_id + component_id + price_point_id + product_price_point_id + description + uid + destroy + ] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(title: SKIP, quantity: SKIP, unit_price: SKIP, taxable: SKIP, + tax_code: SKIP, period_range_start: SKIP, + period_range_end: SKIP, product_id: SKIP, component_id: SKIP, + price_point_id: SKIP, product_price_point_id: SKIP, + description: SKIP, uid: SKIP, destroy: SKIP, + additional_properties: {}) + # Add additional model properties to the instance. + additional_properties.each do |_name, _value| + instance_variable_set("@#{_name}", _value) + end + + @title = title unless title == SKIP + @quantity = quantity unless quantity == SKIP + @unit_price = unit_price unless unit_price == SKIP + @taxable = taxable unless taxable == SKIP + @tax_code = tax_code unless tax_code == SKIP + @period_range_start = period_range_start unless period_range_start == SKIP + @period_range_end = period_range_end unless period_range_end == SKIP + @product_id = product_id unless product_id == SKIP + @component_id = component_id unless component_id == SKIP + @price_point_id = price_point_id unless price_point_id == SKIP + @product_price_point_id = product_price_point_id unless product_price_point_id == SKIP + @description = description unless description == SKIP + @uid = uid unless uid == SKIP + @destroy = destroy unless destroy == 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. + title = hash.key?('title') ? hash['title'] : SKIP + quantity = hash.key?('quantity') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:UpdateInvoiceItemQuantity), hash['quantity'] + ) : SKIP + unit_price = hash.key?('unit_price') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:UpdateInvoiceItemUnitPrice), hash['unit_price'] + ) : SKIP + taxable = hash.key?('taxable') ? hash['taxable'] : SKIP + tax_code = hash.key?('tax_code') ? hash['tax_code'] : SKIP + period_range_start = + hash.key?('period_range_start') ? hash['period_range_start'] : SKIP + period_range_end = + hash.key?('period_range_end') ? hash['period_range_end'] : SKIP + product_id = hash.key?('product_id') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:UpdateInvoiceItemProductId), hash['product_id'] + ) : SKIP + component_id = hash.key?('component_id') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:UpdateInvoiceItemComponentId), hash['component_id'] + ) : SKIP + price_point_id = hash.key?('price_point_id') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:UpdateInvoiceItemPricePointId), hash['price_point_id'] + ) : SKIP + product_price_point_id = hash.key?('product_price_point_id') ? APIHelper.deserialize_union_type( + UnionTypeLookUp.get(:UpdateInvoiceItemProductPricePointId), hash['product_price_point_id'] + ) : SKIP + description = hash.key?('description') ? hash['description'] : SKIP + uid = hash.key?('uid') ? hash['uid'] : SKIP + destroy = hash.key?('_destroy') ? hash['_destroy'] : SKIP + + # Clean out expected properties from Hash. + additional_properties = hash.reject { |k, _| names.value?(k) } + + # Create object from extracted values. + UpdateInvoiceItem.new(title: title, + quantity: quantity, + unit_price: unit_price, + taxable: taxable, + tax_code: tax_code, + period_range_start: period_range_start, + period_range_end: period_range_end, + product_id: product_id, + component_id: component_id, + price_point_id: price_point_id, + product_price_point_id: product_price_point_id, + description: description, + uid: uid, + destroy: destroy, + additional_properties: additional_properties) + end + + # Validates an instance of the object from a given value. + # @param [UpdateInvoiceItem | Hash] The value against the validation is performed. + def self.validate(value) + return true if value.instance_of? self + + return false unless value.instance_of? Hash + + true + end + + # Provides a human-readable string representation of the object. + def to_s + class_name = self.class.name.split('::').last + "<#{class_name} title: #{@title}, quantity: #{@quantity}, unit_price: #{@unit_price},"\ + " taxable: #{@taxable}, tax_code: #{@tax_code}, period_range_start: #{@period_range_start},"\ + " period_range_end: #{@period_range_end}, product_id: #{@product_id}, component_id:"\ + " #{@component_id}, price_point_id: #{@price_point_id}, product_price_point_id:"\ + " #{@product_price_point_id}, description: #{@description}, uid: #{@uid}, destroy:"\ + " #{@destroy}, 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} title: #{@title.inspect}, quantity: #{@quantity.inspect}, unit_price:"\ + " #{@unit_price.inspect}, taxable: #{@taxable.inspect}, tax_code: #{@tax_code.inspect},"\ + " period_range_start: #{@period_range_start.inspect}, period_range_end:"\ + " #{@period_range_end.inspect}, product_id: #{@product_id.inspect}, component_id:"\ + " #{@component_id.inspect}, price_point_id: #{@price_point_id.inspect},"\ + " product_price_point_id: #{@product_price_point_id.inspect}, description:"\ + " #{@description.inspect}, uid: #{@uid.inspect}, destroy: #{@destroy.inspect},"\ + " additional_properties: #{get_additional_properties}>" + end + end +end diff --git a/lib/advanced_billing/models/update_invoice_request.rb b/lib/advanced_billing/models/update_invoice_request.rb new file mode 100644 index 00000000..b70f3531 --- /dev/null +++ b/lib/advanced_billing/models/update_invoice_request.rb @@ -0,0 +1,71 @@ +# advanced_billing +# +# This file was automatically generated for Maxio by +# APIMATIC v3.0 ( https://www.apimatic.io ). + +module AdvancedBilling + # Request payload for updating a draft ad hoc invoice. + class UpdateInvoiceRequest < BaseModel + SKIP = Object.new + private_constant :SKIP + + # Attributes of a draft ad hoc invoice which can be updated. Only the + # submitted attributes are changed. + # @return [UpdateInvoice] + attr_accessor :invoice + + # A mapping from model property names to API property names. + def self.names + @_hash = {} if @_hash.nil? + @_hash['invoice'] = 'invoice' + @_hash + end + + # An array for optional fields + def self.optionals + [] + end + + # An array for nullable fields + def self.nullables + [] + end + + def initialize(invoice:, additional_properties: {}) + # Add additional model properties to the instance. + additional_properties.each do |_name, _value| + instance_variable_set("@#{_name}", _value) + end + + @invoice = invoice + end + + # Creates an instance of the object from a hash. + def self.from_hash(hash) + return nil unless hash + + # Extract variables from the hash. + invoice = UpdateInvoice.from_hash(hash['invoice']) if hash['invoice'] + + # Clean out expected properties from Hash. + additional_properties = hash.reject { |k, _| names.value?(k) } + + # Create object from extracted values. + UpdateInvoiceRequest.new(invoice: invoice, + 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} invoice: #{@invoice}, 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} invoice: #{@invoice.inspect}, additional_properties:"\ + " #{get_additional_properties}>" + end + end +end diff --git a/lib/advanced_billing/models/update_payment_profile.rb b/lib/advanced_billing/models/update_payment_profile.rb index f4807b9a..01793ab1 100644 --- a/lib/advanced_billing/models/update_payment_profile.rb +++ b/lib/advanced_billing/models/update_payment_profile.rb @@ -27,12 +27,12 @@ class UpdatePaymentProfile < BaseModel # (Optional when performing an Import via vault_token, required otherwise) # The 1- or 2-digit credit card expiration month, as an integer or string, - # i.e. 5 + # e.g., 5 # @return [String] attr_accessor :expiration_month - # (Optional when performing a Import via vault_token, required otherwise) - # The 4-digit credit card expiration year, as an integer or string, i.e. + # (Optional when performing an Import via vault_token, required otherwise) + # The 4-digit credit card expiration year, as an integer or string, e.g., # 2012 # @return [String] attr_accessor :expiration_year @@ -42,17 +42,17 @@ class UpdatePaymentProfile < BaseModel # @return [AllVaults] attr_accessor :current_vault - # The credit card or bank account billing street address (i.e. 123 Main + # The credit card or bank account billing street address (e.g., 123 Main # St.). This value is merely passed through to the payment gateway. # @return [String] attr_accessor :billing_address - # The credit card or bank account billing address city (i.e. “Boston”). This - # value is merely passed through to the payment gateway. + # The credit card or bank account billing address city (e.g., “Boston”). + # This value is merely passed through to the payment gateway. # @return [String] attr_accessor :billing_city - # The credit card or bank account billing address state (i.e. MA). This + # The credit card or bank account billing address state (e.g., MA). This # value is merely passed through to the payment gateway. This must conform # to the # [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in @@ -60,21 +60,21 @@ class UpdatePaymentProfile < BaseModel # @return [String] attr_accessor :billing_state - # The credit card or bank account billing address zip code (i.e. 12345). + # The credit card or bank account billing address zip code (e.g., 12345). # This value is merely passed through to the payment gateway. # @return [String] attr_accessor :billing_zip # The credit card or bank account billing address country, required in # [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) - # format (i.e. “US”). This value is merely passed through to the payment + # format (e.g., “US”). This value is merely passed through to the payment # gateway. Some gateways require country codes in a specific format. Check # your gateway’s documentation. If creating an ACH subscription, only US is # supported at this time. # @return [String] attr_accessor :billing_country - # Second line of the customer’s billing address i.e. Apt. 100 + # Second line of the customer’s billing address, e.g., Apt. 100 # @return [String] attr_accessor :billing_address_2 diff --git a/lib/advanced_billing/models/update_price.rb b/lib/advanced_billing/models/update_price.rb index e2ce0066..dfb6ae0a 100644 --- a/lib/advanced_billing/models/update_price.rb +++ b/lib/advanced_billing/models/update_price.rb @@ -17,17 +17,17 @@ class UpdatePrice < BaseModel # @return [Object] attr_accessor :ending_quantity - # The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or + # The price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or # 0.00000065 # @return [Object] attr_accessor :unit_price - # The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or + # The price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or # 0.00000065 # @return [TrueClass | FalseClass] attr_accessor :destroy - # The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or + # The price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or # 0.00000065 # @return [Object] attr_accessor :starting_quantity diff --git a/lib/advanced_billing/models/update_subscription.rb b/lib/advanced_billing/models/update_subscription.rb index 3b59fc10..b2f597b6 100644 --- a/lib/advanced_billing/models/update_subscription.rb +++ b/lib/advanced_billing/models/update_subscription.rb @@ -15,15 +15,15 @@ class UpdateSubscription < BaseModel attr_accessor :credit_card_attributes # Set to the handle of a different product to change the subscription's - # product + # product. # @return [String] attr_accessor :product_handle - # Set to the id of a different product to change the subscription's product + # Set to the id of a different product to change the subscription's product. # @return [Integer] attr_accessor :product_id - # Set to the id of a different product to change the subscription's product + # Set to the id of a different product to change the subscription's product. # @return [TrueClass | FalseClass] attr_accessor :product_change_delayed @@ -43,7 +43,7 @@ class UpdateSubscription < BaseModel # (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 + # 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 @@ -81,6 +81,15 @@ class UpdateSubscription < BaseModel # @return [DateTime] attr_accessor :next_billing_at + # The ID of the Branding Theme to assign to this subscription. When set, + # this subscription-level Branding Theme is used instead of the customer's + # default Branding Theme for subscription-related documents and + # communications that use subscription theming. Pass null or an empty value + # to clear the subscription-level Branding Theme. Available only when + # Branding Themes are enabled for the site. Not returned in the response. + # @return [Integer] + attr_accessor :branding_theme_id + # Timestamp giving the expiration date of this subscription (if any). You # may manually change the expiration date at any point during a subscription # period. @@ -159,6 +168,7 @@ def self.names @_hash['initial_billing_at'] = 'initial_billing_at' @_hash['defer_signup'] = 'defer_signup' @_hash['next_billing_at'] = 'next_billing_at' + @_hash['branding_theme_id'] = 'branding_theme_id' @_hash['expires_at'] = 'expires_at' @_hash['payment_collection_method'] = 'payment_collection_method' @_hash['receives_invoice_emails'] = 'receives_invoice_emails' @@ -190,6 +200,7 @@ def self.optionals initial_billing_at defer_signup next_billing_at + branding_theme_id expires_at payment_collection_method receives_invoice_emails @@ -208,6 +219,7 @@ def self.optionals # An array for nullable fields def self.nullables %w[ + branding_theme_id dunning_communication_delay_time_zone ] end @@ -216,7 +228,8 @@ 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, initial_billing_at: SKIP, - defer_signup: false, next_billing_at: SKIP, expires_at: SKIP, + defer_signup: false, next_billing_at: SKIP, + branding_theme_id: SKIP, expires_at: SKIP, payment_collection_method: SKIP, receives_invoice_emails: SKIP, net_terms: SKIP, stored_credential_transaction_id: SKIP, reference: SKIP, @@ -243,6 +256,7 @@ def initialize(credit_card_attributes: SKIP, product_handle: 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 + @branding_theme_id = branding_theme_id unless branding_theme_id == SKIP @expires_at = expires_at unless expires_at == SKIP unless payment_collection_method == SKIP @payment_collection_method = @@ -302,6 +316,8 @@ def self.from_hash(hash) else SKIP end + branding_theme_id = + hash.key?('branding_theme_id') ? hash['branding_theme_id'] : SKIP expires_at = if hash.key?('expires_at') (DateTimeHelper.from_rfc3339(hash['expires_at']) if hash['expires_at']) else @@ -352,6 +368,7 @@ def self.from_hash(hash) initial_billing_at: initial_billing_at, defer_signup: defer_signup, next_billing_at: next_billing_at, + branding_theme_id: branding_theme_id, expires_at: expires_at, payment_collection_method: payment_collection_method, receives_invoice_emails: receives_invoice_emails, @@ -397,15 +414,15 @@ def to_s " #{@product_change_delayed}, 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}, 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:"\ - " #{@dunning_communication_delay_time_zone}, product_price_point_id:"\ - " #{@product_price_point_id}, product_price_point_handle: #{@product_price_point_handle},"\ - " additional_properties: #{get_additional_properties}>" + " next_billing_at: #{@next_billing_at}, branding_theme_id: #{@branding_theme_id},"\ + " 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: #{@dunning_communication_delay_time_zone},"\ + " product_price_point_id: #{@product_price_point_id}, product_price_point_handle:"\ + " #{@product_price_point_handle}, additional_properties: #{get_additional_properties}>" end # Provides a debugging-friendly string with detailed object information. @@ -416,15 +433,16 @@ def inspect " #{@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}, 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:"\ + " #{@defer_signup.inspect}, next_billing_at: #{@next_billing_at.inspect}, branding_theme_id:"\ + " #{@branding_theme_id.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 diff --git a/lib/advanced_billing/models/webhook.rb b/lib/advanced_billing/models/webhook.rb index d29c5261..c7dd8c44 100644 --- a/lib/advanced_billing/models/webhook.rb +++ b/lib/advanced_billing/models/webhook.rb @@ -14,7 +14,7 @@ class Webhook < BaseModel # @return [String] attr_accessor :event - # The unique identifier for the webhooks (unique across all of Chargify). + # The unique identifier for the webhook (unique across all of Chargify). # This is not changed on a retry/replay of the same webhook, so it may be # used to avoid duplicate action for the same event. # @return [Integer] @@ -50,9 +50,10 @@ class Webhook < BaseModel # @return [String] attr_accessor :last_sent_url - # A boolean flag describing whether the webhook was accepted by the webhook + # “A boolean flag describing whether the webhook was accepted by the webhook # endpoint for the most recent attempt. (Acceptance is defined by receiving - # a “200 OK” HTTP response within a reasonable timeframe, i.e. 15 seconds) + # a “200 OK” HTTP response within a reasonable timeframe, e.g., 15 + # seconds.)” # @return [TrueClass | FalseClass] attr_accessor :successful diff --git a/lib/advanced_billing/models/webhook_subscription.rb b/lib/advanced_billing/models/webhook_subscription.rb index 7b798992..6672fb93 100644 --- a/lib/advanced_billing/models/webhook_subscription.rb +++ b/lib/advanced_billing/models/webhook_subscription.rb @@ -97,6 +97,10 @@ class WebhookSubscription # TODO: Write general description for SUBSCRIPTION_PRODUCT_CHANGE SUBSCRIPTION_PRODUCT_CHANGE = 'subscription_product_change'.freeze, + # TODO: Write general description for + # SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED + SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED = 'subscription_product_change_scheduled'.freeze, + # TODO: Write general description for SUBSCRIPTION_STATE_CHANGE SUBSCRIPTION_STATE_CHANGE = 'subscription_state_change'.freeze, @@ -166,6 +170,7 @@ def self.from_value(value, default_value = BILLING_DATE_CHANGE) when 'subscription_card_update' then SUBSCRIPTION_CARD_UPDATE when 'subscription_group_card_update' then SUBSCRIPTION_GROUP_CARD_UPDATE when 'subscription_product_change' then SUBSCRIPTION_PRODUCT_CHANGE + when 'subscription_product_change_scheduled' then SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED when 'subscription_state_change' then SUBSCRIPTION_STATE_CHANGE when 'trial_end_notice' then TRIAL_END_NOTICE when 'upcoming_renewal_notice' then UPCOMING_RENEWAL_NOTICE diff --git a/lib/advanced_billing/utilities/union_type_lookup.rb b/lib/advanced_billing/utilities/union_type_lookup.rb index ee60c9fe..93e935a7 100644 --- a/lib/advanced_billing/utilities/union_type_lookup.rb +++ b/lib/advanced_billing/utilities/union_type_lookup.rb @@ -124,6 +124,16 @@ def self.union_types ] ), + :ListSubscriptionsInputProduct => OneOf.new( + [ + LeafType.new(Integer), + LeafType.new(String) + ], + UnionTypeContext.new( + is_optional: true + ) + ), + :CreateUsageSubscriptionIdOrReference => OneOf.new( [ LeafType.new(Integer), @@ -221,17 +231,7 @@ def self.union_types ) ), - :AllocationPreviewItemQuantity => OneOf.new( - [ - LeafType.new(Integer), - LeafType.new(String) - ], - UnionTypeContext.new( - is_optional: true - ) - ), - - :AllocationPreviewItemPreviousQuantity => OneOf.new( + :AllocationQuantity => OneOf.new( [ LeafType.new(Integer), LeafType.new(String) @@ -241,7 +241,7 @@ def self.union_types ) ), - :AllocationQuantity => OneOf.new( + :AllocationPreviousQuantity => OneOf.new( [ LeafType.new(Integer), LeafType.new(String) @@ -251,7 +251,7 @@ def self.union_types ) ), - :AllocationPreviousQuantity => OneOf.new( + :AllocationPreviewItemQuantity => OneOf.new( [ LeafType.new(Integer), LeafType.new(String) @@ -261,7 +261,7 @@ def self.union_types ) ), - :ComponentAllocationChangeAllocatedQuantity => OneOf.new( + :AllocationPreviewItemPreviousQuantity => OneOf.new( [ LeafType.new(Integer), LeafType.new(String) @@ -306,37 +306,27 @@ def self.union_types ) ), - :CreateAllocationPricePointId => OneOf.new( + :ComponentAllocationChangeAllocatedQuantity => OneOf.new( [ - LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Integer), + LeafType.new(String) ], UnionTypeContext.new( - is_optional: true, - is_nullable: true + is_optional: true ) ), - :CreateMultiInvoicePaymentAmount => OneOf.new( + :ComponentPricePointAssignmentPricePoint => OneOf.new( [ LeafType.new(String), - LeafType.new(Float) - ] - ), - - :CustomerErrorResponseErrors => OneOf.new( - [ - LeafType.new(CustomerError), - LeafType.new(String, UnionTypeContext.new( - is_array: true - )) + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :EBBComponentUnitPrice => OneOf.new( + :CouponPayloadPercentage => OneOf.new( [ LeafType.new(String), LeafType.new(Float) @@ -346,13 +336,14 @@ def self.union_types ) ), - :CouponPayloadPercentage => OneOf.new( + :CreateAllocationPricePointId => OneOf.new( [ LeafType.new(String), - LeafType.new(Float) + LeafType.new(Integer) ], UnionTypeContext.new( - is_optional: true + is_optional: true, + is_nullable: true ) ), @@ -363,6 +354,16 @@ def self.union_types ] ), + :CreateComponentPricePointsRequestPricePoints => AnyOf.new( + [ + LeafType.new(CreateComponentPricePoint), + LeafType.new(CreatePrepaidUsageComponentPricePoint) + ], + UnionTypeContext.new( + is_array: true + ) + ), + :CreateInvoiceCouponPercentage => OneOf.new( [ LeafType.new(String), @@ -393,81 +394,57 @@ def self.union_types ) ), - :CreateInvoicePaymentAmount => OneOf.new( + :CreateInvoiceItemQuantity => OneOf.new( [ - LeafType.new(String), - LeafType.new(Float) + LeafType.new(Float), + LeafType.new(String) ], UnionTypeContext.new( is_optional: true ) ), - :CreateMetafieldsRequestMetafields => OneOf.new( - [ - LeafType.new(CreateMetafield), - LeafType.new(CreateMetafield, UnionTypeContext.new( - is_array: true - )) - ] - ), - - :CreateOrUpdateSegmentPriceUnitPrice => OneOf.new( - [ - LeafType.new(String), - LeafType.new(Float) - ] - ), - - :CreateSegmentSegmentProperty1Value => OneOf.new( + :CreateInvoiceItemUnitPrice => OneOf.new( [ - LeafType.new(String), LeafType.new(Float), - LeafType.new(Integer), - AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) + LeafType.new(String) ], UnionTypeContext.new( is_optional: true ) ), - :CreateSegmentSegmentProperty2Value => OneOf.new( + :CreateInvoiceItemProductId => OneOf.new( [ LeafType.new(String), - LeafType.new(Float), - LeafType.new(Integer), - AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :CreateSegmentSegmentProperty3Value => OneOf.new( + :CreateInvoiceItemComponentId => OneOf.new( [ LeafType.new(String), - LeafType.new(Float), - LeafType.new(Integer), - AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :CreateSegmentSegmentProperty4Value => OneOf.new( + :CreateInvoiceItemPricePointId => OneOf.new( [ LeafType.new(String), - LeafType.new(Float), - LeafType.new(Integer), - AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :ComponentPricePointAssignmentPricePoint => OneOf.new( + :CreateInvoiceItemProductPricePointId => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) @@ -477,19 +454,42 @@ def self.union_types ) ), - :CreateComponentPricePointsRequestPricePoints => AnyOf.new( + :CreateInvoicePaymentAmount => OneOf.new( [ - LeafType.new(CreateComponentPricePoint), - LeafType.new(CreatePrepaidUsageComponentPricePoint) + LeafType.new(String), + LeafType.new(Float) ], UnionTypeContext.new( - is_array: true + is_optional: true ) ), - :CreateInvoiceItemQuantity => OneOf.new( + :CreateMetafieldsRequestMetafields => OneOf.new( [ - LeafType.new(Float), + LeafType.new(CreateMetafield), + LeafType.new(CreateMetafield, UnionTypeContext.new( + is_array: true + )) + ] + ), + + :CreateMultiInvoicePaymentAmount => OneOf.new( + [ + LeafType.new(String), + LeafType.new(Float) + ] + ), + + :CreateOrUpdateSegmentPriceUnitPrice => OneOf.new( + [ + LeafType.new(String), + LeafType.new(Float) + ] + ), + + :CreatePaymentProfileExpirationMonth => OneOf.new( + [ + LeafType.new(Integer), LeafType.new(String) ], UnionTypeContext.new( @@ -497,9 +497,9 @@ def self.union_types ) ), - :CreateInvoiceItemUnitPrice => OneOf.new( + :CreatePaymentProfileExpirationYear => OneOf.new( [ - LeafType.new(Float), + LeafType.new(Integer), LeafType.new(String) ], UnionTypeContext.new( @@ -507,57 +507,65 @@ def self.union_types ) ), - :CreateInvoiceItemProductId => OneOf.new( + :CreateSegmentSegmentProperty1Value => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Float), + LeafType.new(Integer), + AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) ], UnionTypeContext.new( is_optional: true ) ), - :CreateInvoiceItemComponentId => OneOf.new( + :CreateSegmentSegmentProperty2Value => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Float), + LeafType.new(Integer), + AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) ], UnionTypeContext.new( is_optional: true ) ), - :CreateInvoiceItemPricePointId => OneOf.new( + :CreateSegmentSegmentProperty3Value => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Float), + LeafType.new(Integer), + AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) ], UnionTypeContext.new( is_optional: true ) ), - :CreateInvoiceItemProductPricePointId => OneOf.new( + :CreateSegmentSegmentProperty4Value => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Float), + LeafType.new(Integer), + AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]) ], UnionTypeContext.new( is_optional: true ) ), - :CreatePaymentProfileExpirationMonth => OneOf.new( + :CreateSubscriptionOfferId => OneOf.new( [ - LeafType.new(Integer), - LeafType.new(String) + LeafType.new(String), + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :CreatePaymentProfileExpirationYear => OneOf.new( + :CreateSubscriptionComponentComponentId => OneOf.new( [ LeafType.new(Integer), LeafType.new(String) @@ -567,17 +575,17 @@ def self.union_types ) ), - :CreateSubscriptionOfferId => OneOf.new( + :CreateSubscriptionComponentUnitBalance => OneOf.new( [ - LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Integer), + LeafType.new(String) ], UnionTypeContext.new( is_optional: true ) ), - :CreateSubscriptionComponentComponentId => OneOf.new( + :CreateSubscriptionComponentAllocatedQuantity => OneOf.new( [ LeafType.new(Integer), LeafType.new(String) @@ -587,7 +595,7 @@ def self.union_types ) ), - :CreateSubscriptionComponentAllocatedQuantity => OneOf.new( + :CreateSubscriptionComponentPricePointId => OneOf.new( [ LeafType.new(Integer), LeafType.new(String) @@ -597,10 +605,12 @@ def self.union_types ) ), - :CreateSubscriptionComponentPricePointId => OneOf.new( + :CustomerErrorResponseErrors => OneOf.new( [ - LeafType.new(Integer), - LeafType.new(String) + LeafType.new(CustomerError), + LeafType.new(String, UnionTypeContext.new( + is_array: true + )) ], UnionTypeContext.new( is_optional: true @@ -614,6 +624,16 @@ def self.union_types ] ), + :EBBComponentUnitPrice => OneOf.new( + [ + LeafType.new(String), + LeafType.new(Float) + ], + UnionTypeContext.new( + is_optional: true + ) + ), + :EventEventSpecificData => OneOf.new( [ LeafType.new(SubscriptionProductChange), @@ -642,6 +662,13 @@ def self.union_types ) ), + :GetOneTimeTokenRequestPaymentProfile => AnyOf.new( + [ + LeafType.new(GetOneTimeTokenPaymentProfile), + LeafType.new(GetOneTimeTokenBankAccountPaymentProfile) + ] + ), + :IssueServiceCreditAmount => OneOf.new( [ LeafType.new(Float), @@ -672,6 +699,20 @@ def self.union_types ) ), + :MeteredUsageNewUnitBalance => OneOf.new( + [ + LeafType.new(Integer), + LeafType.new(String) + ] + ), + + :OnOffComponentUnitPrice => OneOf.new( + [ + LeafType.new(String), + LeafType.new(Float) + ] + ), + :PaymentProfileAttributesExpirationMonth => OneOf.new( [ LeafType.new(Integer), @@ -692,71 +733,120 @@ def self.union_types ) ), - :ReactivateSubscriptionRequestResume => OneOf.new( + :PaymentProfile => AnyOf.new( [ - AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]), - LeafType.new(ResumeOptions) - ], - UnionTypeContext.new( - is_optional: true - ) + LeafType.new(ApplePayPaymentProfile, UnionTypeContext.new( + discriminator_value: 'apple_pay', + discriminator: 'payment_type' + )), + LeafType.new(BankAccountPaymentProfile, UnionTypeContext.new( + discriminator_value: 'bank_account', + discriminator: 'payment_type' + )), + LeafType.new(CreditCardPaymentProfile, UnionTypeContext.new( + discriminator_value: 'credit_card', + discriminator: 'payment_type' + )), + LeafType.new(PaypalPaymentProfile, UnionTypeContext.new( + discriminator_value: 'paypal_account', + discriminator: 'payment_type' + )) + ] ), - :SubscriptionCustomPricePriceInCents => OneOf.new( + :PrepaidUsageNewUnitBalance => OneOf.new( [ - LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Integer), + LeafType.new(String) ] ), - :SubscriptionCustomPriceInterval => OneOf.new( + :PrepaidUsageNewOverageUnitBalance => OneOf.new( [ - LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Integer), + LeafType.new(String) ] ), - :SubscriptionCustomPriceTrialPriceInCents => OneOf.new( + :PrepaidUsageComponentUnitPrice => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Float) ], UnionTypeContext.new( is_optional: true ) ), - :SubscriptionCustomPriceTrialInterval => OneOf.new( + :PriceStartingQuantity => OneOf.new( [ - LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Integer), + LeafType.new(String) + ] + ), + + :PriceEndingQuantity => OneOf.new( + [ + LeafType.new(Integer), + LeafType.new(String) ], UnionTypeContext.new( - is_optional: true + is_optional: true, + is_nullable: true ) ), - :SubscriptionCustomPriceInitialChargeInCents => OneOf.new( + :PriceUnitPrice => OneOf.new( + [ + LeafType.new(Float), + LeafType.new(String) + ] + ), + + :QuantityBasedComponentUnitPrice => OneOf.new( [ LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Float) ], UnionTypeContext.new( is_optional: true ) ), - :SubscriptionCustomPriceExpirationInterval => OneOf.new( + :ReactivateSubscriptionRequestResume => OneOf.new( [ - LeafType.new(String), - LeafType.new(Integer) + AnyOf.new([LeafType.new(TrueClass), LeafType.new(FalseClass)]), + LeafType.new(ResumeOptions) ], UnionTypeContext.new( is_optional: true ) ), - :SubscriptionGroupCreditCardFullNumber => OneOf.new( + :RefundConsolidatedInvoiceSegmentUids => OneOf.new( + [ + LeafType.new(String, UnionTypeContext.new( + is_array: true + )), + LeafType.new(String) + ] + ), + + :RefundInvoiceRequestRefund => AnyOf.new( + [ + LeafType.new(RefundInvoice), + LeafType.new(RefundConsolidatedInvoice) + ] + ), + + :RefundPrepaymentAmount => OneOf.new( + [ + LeafType.new(String), + LeafType.new(Float) + ] + ), + + :RenewalPreviewComponentComponentId => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) @@ -766,7 +856,7 @@ def self.union_types ) ), - :SubscriptionGroupCreditCardExpirationMonth => OneOf.new( + :RenewalPreviewComponentPricePointId => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) @@ -776,22 +866,31 @@ def self.union_types ) ), - :SubscriptionGroupCreditCardExpirationYear => OneOf.new( + :ScheduledRenewalConfigurationItemRequestRenewalConfigurationItem => OneOf.new( + [ + LeafType.new(ScheduledRenewalItemRequestBodyComponent), + LeafType.new(ScheduledRenewalItemRequestBodyProduct) + ] + ), + + :ScheduledRenewalProductPricePointPriceInCents => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) - ], - UnionTypeContext.new( - is_optional: true - ) + ] ), - :RefundConsolidatedInvoiceSegmentUids => OneOf.new( + :ScheduledRenewalProductPricePointInterval => OneOf.new( [ - LeafType.new(String, UnionTypeContext.new( - is_array: true - )), - LeafType.new(String) + LeafType.new(String), + LeafType.new(Integer) + ] + ), + + :ScheduledRenewalUpdateRequestRenewalConfigurationItem => OneOf.new( + [ + LeafType.new(ScheduledRenewalItemRequestBodyComponent), + LeafType.new(ScheduledRenewalItemRequestBodyProduct) ] ), @@ -843,59 +942,74 @@ def self.union_types ) ), - :PaymentProfile => AnyOf.new( + :SubscriptionComponentUnitBalance => OneOf.new( [ - LeafType.new(ApplePayPaymentProfile, UnionTypeContext.new( - discriminator_value: 'apple_pay', - discriminator: 'payment_type' - )), - LeafType.new(BankAccountPaymentProfile, UnionTypeContext.new( - discriminator_value: 'bank_account', - discriminator: 'payment_type' - )), - LeafType.new(CreditCardPaymentProfile, UnionTypeContext.new( - discriminator_value: 'credit_card', - discriminator: 'payment_type' - )), - LeafType.new(PaypalPaymentProfile, UnionTypeContext.new( - discriminator_value: 'paypal_account', - discriminator: 'payment_type' - )) - ] + LeafType.new(Integer), + LeafType.new(String) + ], + UnionTypeContext.new( + is_optional: true + ) ), - :RefundPrepaymentAmount => OneOf.new( + :SubscriptionComponentAllocatedQuantity => OneOf.new( + [ + LeafType.new(Integer), + LeafType.new(String) + ], + UnionTypeContext.new( + is_optional: true + ) + ), + + :SubscriptionCustomPricePriceInCents => OneOf.new( [ LeafType.new(String), - LeafType.new(Float) + LeafType.new(Integer) ] ), - :ScheduledRenewalConfigurationItemRequestRenewalConfigurationItem => OneOf.new( + :SubscriptionCustomPriceInterval => OneOf.new( [ - LeafType.new(ScheduledRenewalItemRequestBodyComponent), - LeafType.new(ScheduledRenewalItemRequestBodyProduct) + LeafType.new(String), + LeafType.new(Integer) ] ), - :ScheduledRenewalProductPricePointPriceInCents => OneOf.new( + :SubscriptionCustomPriceTrialPriceInCents => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) - ] + ], + UnionTypeContext.new( + is_optional: true + ) ), - :ScheduledRenewalProductPricePointInterval => OneOf.new( + :SubscriptionCustomPriceTrialInterval => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) - ] + ], + UnionTypeContext.new( + is_optional: true + ) ), - :SubscriptionComponentAllocatedQuantity => OneOf.new( + :SubscriptionCustomPriceInitialChargeInCents => OneOf.new( [ - LeafType.new(Integer), - LeafType.new(String) + LeafType.new(String), + LeafType.new(Integer) + ], + UnionTypeContext.new( + is_optional: true + ) + ), + + :SubscriptionCustomPriceExpirationInterval => OneOf.new( + [ + LeafType.new(String), + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true @@ -910,66 +1024,67 @@ def self.union_types ] ), - :OnOffComponentUnitPrice => OneOf.new( + :SubscriptionGroupCreditCardFullNumber => OneOf.new( [ LeafType.new(String), - LeafType.new(Float) - ] + LeafType.new(Integer) + ], + UnionTypeContext.new( + is_optional: true + ) ), - :PrepaidUsageComponentUnitPrice => OneOf.new( + :SubscriptionGroupCreditCardExpirationMonth => OneOf.new( [ LeafType.new(String), - LeafType.new(Float) + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :PriceStartingQuantity => OneOf.new( - [ - LeafType.new(Integer), - LeafType.new(String) - ] - ), - - :PriceEndingQuantity => OneOf.new( + :SubscriptionGroupCreditCardExpirationYear => OneOf.new( [ - LeafType.new(Integer), - LeafType.new(String) + LeafType.new(String), + LeafType.new(Integer) ], UnionTypeContext.new( - is_optional: true, - is_nullable: true + is_optional: true ) ), - :PriceUnitPrice => OneOf.new( + :SubscriptionGroupSignupComponentComponentId => OneOf.new( [ - LeafType.new(Float), - LeafType.new(String) - ] + LeafType.new(String), + LeafType.new(Integer) + ], + UnionTypeContext.new( + is_optional: true + ) ), - :QuantityBasedComponentUnitPrice => OneOf.new( + :SubscriptionGroupSignupComponentAllocatedQuantity => OneOf.new( [ LeafType.new(String), - LeafType.new(Float) + LeafType.new(Integer) ], UnionTypeContext.new( is_optional: true ) ), - :RefundInvoiceRequestRefund => AnyOf.new( + :SubscriptionGroupSignupComponentUnitBalance => OneOf.new( [ - LeafType.new(RefundInvoice), - LeafType.new(RefundConsolidatedInvoice) - ] + LeafType.new(String), + LeafType.new(Integer) + ], + UnionTypeContext.new( + is_optional: true + ) ), - :RenewalPreviewComponentComponentId => OneOf.new( + :SubscriptionGroupSignupComponentPricePointId => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) @@ -979,24 +1094,27 @@ def self.union_types ) ), - :RenewalPreviewComponentPricePointId => OneOf.new( + :UpdateInvoiceItemQuantity => OneOf.new( [ - LeafType.new(String), - LeafType.new(Integer) + LeafType.new(Float), + LeafType.new(String) ], UnionTypeContext.new( is_optional: true ) ), - :ScheduledRenewalUpdateRequestRenewalConfigurationItem => OneOf.new( + :UpdateInvoiceItemUnitPrice => OneOf.new( [ - LeafType.new(ScheduledRenewalItemRequestBodyComponent), - LeafType.new(ScheduledRenewalItemRequestBodyProduct) - ] + LeafType.new(Float), + LeafType.new(String) + ], + UnionTypeContext.new( + is_optional: true + ) ), - :SubscriptionGroupSignupComponentComponentId => OneOf.new( + :UpdateInvoiceItemProductId => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) @@ -1006,7 +1124,7 @@ def self.union_types ) ), - :SubscriptionGroupSignupComponentAllocatedQuantity => OneOf.new( + :UpdateInvoiceItemComponentId => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) @@ -1016,7 +1134,7 @@ def self.union_types ) ), - :SubscriptionGroupSignupComponentUnitBalance => OneOf.new( + :UpdateInvoiceItemPricePointId => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) @@ -1026,7 +1144,7 @@ def self.union_types ) ), - :SubscriptionGroupSignupComponentPricePointId => OneOf.new( + :UpdateInvoiceItemProductPricePointId => OneOf.new( [ LeafType.new(String), LeafType.new(Integer) @@ -1036,19 +1154,21 @@ def self.union_types ) ), - :UpdatePriceEndingQuantity => OneOf.new( + :UpdateMetafieldsRequestMetafields => OneOf.new( [ - LeafType.new(Integer), - LeafType.new(String) + LeafType.new(UpdateMetafield), + LeafType.new(UpdateMetafield, UnionTypeContext.new( + is_array: true + )) ], UnionTypeContext.new( is_optional: true ) ), - :UpdatePriceUnitPrice => OneOf.new( + :UpdatePriceEndingQuantity => OneOf.new( [ - LeafType.new(Float), + LeafType.new(Integer), LeafType.new(String) ], UnionTypeContext.new( @@ -1056,9 +1176,9 @@ def self.union_types ) ), - :UpdatePriceStartingQuantity => OneOf.new( + :UpdatePriceUnitPrice => OneOf.new( [ - LeafType.new(Integer), + LeafType.new(Float), LeafType.new(String) ], UnionTypeContext.new( @@ -1066,12 +1186,10 @@ def self.union_types ) ), - :UpdateMetafieldsRequestMetafields => OneOf.new( + :UpdatePriceStartingQuantity => OneOf.new( [ - LeafType.new(UpdateMetafield), - LeafType.new(UpdateMetafield, UnionTypeContext.new( - is_array: true - )) + LeafType.new(Integer), + LeafType.new(String) ], UnionTypeContext.new( is_optional: true