From d404076ef3319bb29587fa1dc1d2029c10ab75c9 Mon Sep 17 00:00:00 2001 From: lucassus Date: Tue, 11 Aug 2026 20:52:04 +0000 Subject: [PATCH 1/4] Automated commit message --- README.md | 98 +- .../controllers/advance_invoice_controller.py | 5 +- .../controllers/base_controller.py | 2 +- .../controllers/billing_portal_controller.py | 2 +- .../component_price_points_controller.py | 9 +- .../controllers/components_controller.py | 48 +- .../controllers/coupons_controller.py | 1121 ++++++++--------- .../controllers/customers_controller.py | 6 + .../controllers/events_controller.py | 57 +- .../controllers/insights_controller.py | 12 +- .../controllers/invoices_controller.py | 245 +++- .../payment_profiles_controller.py | 16 +- .../product_families_controller.py | 4 +- .../product_price_points_controller.py | 22 +- .../controllers/products_controller.py | 5 + .../proforma_invoices_controller.py | 35 +- .../sales_commissions_controller.py | 8 +- .../controllers/sites_controller.py | 4 +- .../subscription_components_controller.py | 16 +- .../subscription_groups_controller.py | 10 +- .../subscription_renewals_controller.py | 14 +- .../controllers/subscriptions_controller.py | 171 ++- .../controllers/webhooks_controller.py | 2 +- advancedbilling/models/__init__.py | 10 +- advancedbilling/models/account_balances.py | 4 +- .../models/activate_subscription_request.py | 6 +- .../models/agreement_acceptance.py | 2 +- advancedbilling/models/all_vaults.py | 8 +- advancedbilling/models/allocate_components.py | 2 +- advancedbilling/models/allocation.py | 20 +- .../models/allocation_preview_item.py | 6 +- .../models/allocation_preview_line_item.py | 2 +- .../models/apple_pay_payment_profile.py | 2 +- .../models/apply_credit_note_event_data.py | 2 +- .../models/bank_account_attributes.py | 10 +- .../models/bank_account_payment_profile.py | 36 +- advancedbilling/models/bank_account_vault.py | 4 +- advancedbilling/models/calendar_billing.py | 2 +- .../models/cancellation_options.py | 6 +- advancedbilling/models/card_type.py | 12 +- advancedbilling/models/chargify_ebb.py | 4 +- advancedbilling/models/collection_method_1.py | 49 + advancedbilling/models/component.py | 41 +- .../models/component_custom_price.py | 10 +- advancedbilling/models/component_kind.py | 4 +- .../models/component_price_point.py | 8 +- .../models/component_price_point_item.py | 6 +- advancedbilling/models/coupon_payload.py | 6 +- advancedbilling/models/coupon_request.py | 4 +- advancedbilling/models/coupon_usage.py | 6 +- advancedbilling/models/create_allocation.py | 2 +- .../models/create_component_price_point.py | 8 +- advancedbilling/models/create_customer.py | 53 + advancedbilling/models/create_invoice.py | 7 +- advancedbilling/models/create_invoice_item.py | 4 +- advancedbilling/models/create_metafield.py | 2 +- .../models/create_or_update_endpoint.py | 2 +- .../create_or_update_endpoint_request.py | 4 +- .../models/create_or_update_product.py | 38 +- .../models/create_or_update_segment_price.py | 2 +- .../models/create_payment_profile.py | 28 +- ...ate_prepaid_usage_component_price_point.py | 8 +- advancedbilling/models/create_prepayment.py | 2 +- .../models/create_prepayment_method.py | 2 +- .../models/create_product_family.py | 25 + .../models/create_product_price_point.py | 12 +- advancedbilling/models/create_subscription.py | 39 +- .../models/create_subscription_component.py | 12 +- .../models/credit_card_payment_profile.py | 11 +- advancedbilling/models/credit_card_vault.py | 12 +- advancedbilling/models/credit_note.py | 18 +- .../models/credit_note_line_item.py | 6 +- .../models/currency_overage_prices.py | 8 +- advancedbilling/models/customer.py | 66 +- advancedbilling/models/customer_attributes.py | 58 +- advancedbilling/models/debit_note.py | 10 +- advancedbilling/models/ebb_component.py | 51 +- advancedbilling/models/event.py | 7 +- advancedbilling/models/event_key.py | 33 +- .../models/failed_payment_action.py | 4 +- ...time_token_bank_account_payment_profile.py | 696 ++++++++++ .../get_one_time_token_payment_profile.py | 237 ++++ .../models/get_one_time_token_request.py | 50 +- advancedbilling/models/group_billing.py | 2 +- advancedbilling/models/group_settings.py | 2 +- advancedbilling/models/group_status.py | 46 + advancedbilling/models/group_target.py | 4 +- advancedbilling/models/group_target_type.py | 2 +- advancedbilling/models/historic_usage.py | 4 +- advancedbilling/models/invoice.py | 41 +- advancedbilling/models/invoice_customer.py | 2 +- .../models/invoice_discount_source_type.py | 2 +- .../models/invoice_event_payment_method.py | 3 +- advancedbilling/models/invoice_event_type.py | 6 +- advancedbilling/models/invoice_line_item.py | 23 +- .../models/invoice_payment_method_type.py | 3 +- advancedbilling/models/invoice_role.py | 5 +- advancedbilling/models/invoice_status.py | 3 +- .../models/issue_invoice_event_data.py | 2 +- .../models/issue_invoice_request.py | 2 +- advancedbilling/models/item_category.py | 8 +- .../list_subscription_group_prepayment.py | 10 +- ...ist_subscription_group_prepayment_item.py} | 6 +- advancedbilling/models/metafield.py | 2 +- advancedbilling/models/metafield_input.py | 4 +- advancedbilling/models/metered_component.py | 47 +- advancedbilling/models/metered_usage.py | 38 +- advancedbilling/models/offer_item.py | 6 +- advancedbilling/models/on_off_component.py | 45 +- advancedbilling/models/pause_request.py | 2 +- .../models/payment_profile_attributes.py | 28 +- advancedbilling/models/payment_type.py | 3 +- advancedbilling/models/prepaid_usage.py | 68 +- .../models/prepaid_usage_component.py | 43 +- advancedbilling/models/price.py | 2 +- advancedbilling/models/product.py | 40 +- advancedbilling/models/product_family.py | 24 + advancedbilling/models/product_price_point.py | 16 +- advancedbilling/models/proforma_invoice.py | 6 +- .../models/proforma_invoice_role.py | 2 +- advancedbilling/models/public_signup_page.py | 4 +- advancedbilling/models/q_scope.py | 61 + .../models/quantity_based_component.py | 51 +- .../models/reactivate_subscription_request.py | 2 +- .../models/reactivation_billing.py | 10 +- advancedbilling/models/reactivation_charge.py | 8 +- .../models/refund_consolidated_invoice.py | 2 +- advancedbilling/models/refund_invoice.py | 4 +- .../models/refund_invoice_event_data.py | 2 +- advancedbilling/models/register.py | 2 +- .../models/renewal_preview_request.py | 2 +- ...cheduled_renewal_component_custom_price.py | 2 +- ...led_renewal_item_request_body_component.py | 2 +- ...duled_renewal_item_request_body_product.py | 2 +- .../scheduled_renewal_product_price_point.py | 2 +- advancedbilling/models/service_credit_1.py | 2 +- advancedbilling/models/subscription.py | 40 +- .../models/subscription_component.py | 24 +- .../subscription_component_subscription.py | 4 +- .../models/subscription_custom_price.py | 2 +- .../models/subscription_group_bank_account.py | 8 +- .../models/subscription_group_signup_item.py | 6 +- .../models/subscription_list_include.py | 12 + .../subscription_product_change_scheduled.py | 235 ++++ advancedbilling/models/subscription_state.py | 6 +- .../models/subscription_state_filter.py | 15 + .../models/tax_configuration_kind.py | 6 +- advancedbilling/models/trial_type.py | 2 +- advancedbilling/models/update_component.py | 29 +- .../models/update_component_price_point.py | 6 +- advancedbilling/models/update_customer.py | 54 +- advancedbilling/models/update_invoice.py | 324 +++++ advancedbilling/models/update_invoice_item.py | 437 +++++++ .../models/update_invoice_request.py | 95 ++ advancedbilling/models/update_metafield.py | 2 +- .../models/update_payment_profile.py | 18 +- advancedbilling/models/update_price.py | 2 +- advancedbilling/models/update_subscription.py | 36 +- advancedbilling/models/webhook.py | 10 +- .../models/webhook_subscription.py | 3 + .../utilities/union_type_lookup.py | 115 ++ doc/controllers/advance-invoice.md | 4 +- doc/controllers/billing-portal.md | 2 +- doc/controllers/component-price-points.md | 6 +- doc/controllers/components.md | 28 +- doc/controllers/coupons.md | 20 +- doc/controllers/customers.md | 10 +- doc/controllers/events.md | 60 +- doc/controllers/insights.md | 8 +- doc/controllers/invoices.md | 209 ++- doc/controllers/payment-profiles.md | 8 +- doc/controllers/product-families.md | 13 +- doc/controllers/product-price-points.md | 4 +- doc/controllers/products.md | 2 + doc/controllers/proforma-invoices.md | 26 +- doc/controllers/sales-commissions.md | 8 +- doc/controllers/sites.md | 4 +- doc/controllers/subscription-components.md | 12 +- doc/controllers/subscription-groups.md | 6 +- doc/controllers/subscription-renewals.md | 6 +- doc/controllers/subscription-status.md | 4 +- doc/controllers/subscriptions.md | 89 +- doc/controllers/webhooks.md | 10 +- doc/models/account-balance.md | 18 +- doc/models/account-balances.md | 67 +- doc/models/ach-agreement.md | 20 +- doc/models/activate-event-based-component.md | 65 +- doc/models/activate-subscription-request.md | 14 +- doc/models/add-coupons-request.md | 20 +- doc/models/add-subscription-to-a-group.md | 38 +- doc/models/address-change.md | 41 +- doc/models/agreement-acceptance.md | 22 +- doc/models/all-vaults.md | 8 + doc/models/allocate-components.md | 52 +- doc/models/allocation-expiration-date.md | 14 +- doc/models/allocation-preview-direction.md | 8 + doc/models/allocation-preview-item.md | 22 +- .../allocation-preview-line-item-kind.md | 8 + doc/models/allocation-preview-line-item.md | 28 +- doc/models/allocation-preview-response.md | 29 +- doc/models/allocation-preview.md | 24 +- doc/models/allocation-response.md | 27 +- doc/models/allocation-settings.md | 19 +- doc/models/allocation.md | 32 +- doc/models/apple-pay-payment-profile.md | 28 +- doc/models/apple-pay-vault.md | 8 + doc/models/applied-credit-note-data.md | 14 +- doc/models/apply-credit-note-event-data.md | 59 +- doc/models/apply-credit-note-event.md | 96 +- doc/models/apply-debit-note-event-data.md | 26 +- doc/models/apply-debit-note-event.md | 61 +- doc/models/apply-payment-event-data.md | 43 +- doc/models/apply-payment-event.md | 78 +- doc/models/attribute-error.md | 21 +- doc/models/auto-invite.md | 8 + doc/models/auto-resume.md | 14 +- doc/models/available-actions.md | 21 +- doc/models/backport-invoice-event.md | 66 +- doc/models/bank-account-attributes.md | 27 +- doc/models/bank-account-holder-type.md | 8 + doc/models/bank-account-payment-profile.md | 37 +- doc/models/bank-account-response.md | 33 +- doc/models/bank-account-type.md | 8 + doc/models/bank-account-vault.md | 8 + .../bank-account-verification-request.md | 21 +- doc/models/bank-account-verification.md | 14 +- doc/models/base-refund-error.md | 33 +- doc/models/base-string-error.md | 19 +- doc/models/basic-date-field.md | 6 +- doc/models/batch-job-response.md | 29 +- doc/models/batch-job.md | 24 +- doc/models/billing-manifest-item.md | 24 +- doc/models/billing-manifest-line-item-kind.md | 8 + doc/models/billing-manifest.md | 69 +- doc/models/billing-schedule.md | 14 +- doc/models/breakouts.md | 20 +- .../bulk-components-price-point-assignment.md | 25 +- ...ulk-create-product-price-points-request.md | 43 +- ...lk-create-product-price-points-response.md | 31 +- doc/models/bulk-create-segments.md | 115 +- doc/models/bulk-update-segments-item.md | 32 +- doc/models/bulk-update-segments.md | 101 +- doc/models/calendar-billing.md | 17 +- .../cancel-grouped-subscriptions-request.md | 12 +- doc/models/cancellation-method.md | 8 + doc/models/cancellation-options.md | 24 +- doc/models/cancellation-request.md | 29 +- doc/models/card-type.md | 8 + .../change-chargeback-status-event-data.md | 13 +- doc/models/change-chargeback-status-event.md | 52 +- ...ge-invoice-collection-method-event-data.md | 14 +- .../change-invoice-collection-method-event.md | 53 +- .../change-invoice-status-event-data.md | 24 +- doc/models/change-invoice-status-event.md | 61 +- doc/models/chargeback-status.md | 8 + doc/models/chargify-ebb.md | 24 +- doc/models/chjs-tokenization-failure.md | 25 +- doc/models/chjs-tokenization-success.md | 27 +- doc/models/cleanup-scope.md | 8 + .../clone-component-price-point-request.md | 21 +- doc/models/clone-component-price-point.md | 14 +- doc/models/collection-method-1.md | 23 + doc/models/collection-method.md | 8 + doc/models/component-allocation-change.md | 26 +- .../component-allocation-error-exception.md | 34 +- doc/models/component-allocation-error-item.md | 20 +- doc/models/component-cost-data-rate-tier.md | 22 +- doc/models/component-cost-data.md | 22 +- doc/models/component-currency-price.md | 22 +- .../component-currency-prices-response.md | 31 +- doc/models/component-custom-price.md | 45 +- doc/models/component-kind.md | 8 + .../component-price-point-assignment.md | 14 +- ...t-price-point-currency-overage-response.md | 29 +- .../component-price-point-error-exception.md | 26 +- .../component-price-point-error-item.md | 18 +- doc/models/component-price-point-item.md | 24 +- doc/models/component-price-point-response.md | 29 +- doc/models/component-price-point.md | 26 +- doc/models/component-price-points-response.md | 60 +- doc/models/component-price.md | 22 +- doc/models/component-response.md | 31 +- doc/models/component.md | 35 +- doc/models/compounding-strategy.md | 8 + doc/models/consolidated-invoice.md | 38 +- ...ate-subscription-component-unit-balance.md | 34 + .../containers/event-event-specific-data.md | 22 +- ...-one-time-token-request-payment-profile.md | 69 + .../list-subscriptions-input-product.md | 34 + .../metered-usage-new-unit-balance.md | 34 + .../prepaid-usage-new-overage-unit-balance.md | 34 + .../prepaid-usage-new-unit-balance.md | 34 + .../subscription-component-unit-balance.md | 34 + .../update-invoice-item-component-id.md | 34 + .../update-invoice-item-price-point-id.md | 34 + .../update-invoice-item-product-id.md | 34 + ...ate-invoice-item-product-price-point-id.md | 34 + .../update-invoice-item-quantity.md | 34 + .../update-invoice-item-unit-price.md | 34 + doc/models/contract.md | 31 +- doc/models/count-response.md | 12 +- doc/models/coupon-currency-request.md | 25 +- doc/models/coupon-currency-response.md | 53 +- doc/models/coupon-currency.md | 20 +- doc/models/coupon-payload.md | 24 +- doc/models/coupon-request.md | 45 +- doc/models/coupon-response.md | 27 +- doc/models/coupon-restriction.md | 23 +- doc/models/coupon-subcodes-response.md | 36 +- doc/models/coupon-subcodes.md | 20 +- doc/models/coupon-usage.md | 28 +- doc/models/coupon.md | 22 +- doc/models/create-allocation-request.md | 29 +- doc/models/create-allocation.md | 26 +- .../create-component-price-point-request.md | 48 +- doc/models/create-component-price-point.md | 45 +- .../create-component-price-points-request.md | 122 +- doc/models/create-credit-note-event.md | 59 +- doc/models/create-currency-price.md | 18 +- doc/models/create-currency-prices-request.md | 27 +- doc/models/create-customer-request.md | 33 +- doc/models/create-customer.md | 32 +- doc/models/create-debit-note-event.md | 59 +- doc/models/create-ebb-component.md | 67 +- doc/models/create-invoice-address.md | 22 +- doc/models/create-invoice-coupon.md | 22 +- doc/models/create-invoice-item.md | 22 +- .../create-invoice-payment-application.md | 14 +- doc/models/create-invoice-payment-request.md | 31 +- doc/models/create-invoice-payment.md | 23 +- doc/models/create-invoice-request.md | 77 +- doc/models/create-invoice-status.md | 6 +- doc/models/create-invoice.md | 57 +- doc/models/create-metadata-request.md | 25 +- doc/models/create-metadata.md | 14 +- doc/models/create-metafield.md | 43 +- doc/models/create-metafields-request.md | 46 +- doc/models/create-metered-component.md | 111 +- .../create-multi-invoice-payment-request.md | 41 +- doc/models/create-multi-invoice-payment.md | 36 +- doc/models/create-offer-component.md | 18 +- doc/models/create-offer-request.md | 58 +- doc/models/create-offer.md | 53 +- doc/models/create-on-off-component.md | 32 +- .../create-or-update-endpoint-request.md | 32 +- doc/models/create-or-update-endpoint.md | 21 +- .../create-or-update-product-request.md | 38 +- doc/models/create-or-update-product.md | 44 +- doc/models/create-or-update-segment-price.md | 18 +- doc/models/create-payment-profile-request.md | 30 +- doc/models/create-payment-profile.md | 43 +- doc/models/create-payment.md | 21 +- doc/models/create-prepaid-component.md | 69 +- ...ate-prepaid-usage-component-price-point.md | 73 +- doc/models/create-prepayment-method.md | 10 +- doc/models/create-prepayment-request.md | 28 +- doc/models/create-prepayment-response.md | 29 +- doc/models/create-prepayment.md | 23 +- doc/models/create-product-currency-price.md | 19 +- .../create-product-currency-prices-request.md | 28 +- doc/models/create-product-family-request.md | 24 +- doc/models/create-product-family.md | 18 +- .../create-product-price-point-request.md | 39 +- doc/models/create-product-price-point.md | 42 +- doc/models/create-quantity-based-component.md | 58 +- doc/models/create-reason-code-request.md | 23 +- doc/models/create-reason-code.md | 18 +- doc/models/create-segment-request.md | 63 +- doc/models/create-segment.md | 58 +- .../create-signup-proforma-preview-include.md | 6 +- doc/models/create-subscription-component.md | 22 +- .../create-subscription-group-request.md | 27 +- doc/models/create-subscription-group.md | 20 +- doc/models/create-subscription-request.md | 61 +- doc/models/create-subscription.md | 61 +- doc/models/create-usage-request.md | 74 +- doc/models/create-usage.md | 69 +- doc/models/created-prepayment.md | 24 +- doc/models/credit-account-balance-changed.md | 24 +- doc/models/credit-card-attributes.md | 18 +- doc/models/credit-card-payment-profile.md | 61 +- doc/models/credit-card-vault.md | 8 + doc/models/credit-note-application.md | 24 +- doc/models/credit-note-line-item.md | 22 +- doc/models/credit-note-status.md | 8 + doc/models/credit-note.md | 34 +- doc/models/credit-scheme-request.md | 13 +- doc/models/credit-scheme.md | 8 + doc/models/credit-type.md | 8 + doc/models/currency-overage-prices.md | 26 +- doc/models/currency-price-role.md | 8 + doc/models/currency-price.md | 22 +- doc/models/currency-prices-response.md | 31 +- doc/models/custom-field-owner.md | 8 + doc/models/custom-field-value-change.md | 26 +- doc/models/customer-attributes.md | 51 +- doc/models/customer-change.md | 191 +-- .../customer-changes-preview-response.md | 196 +-- doc/models/customer-custom-fields-change.md | 50 +- .../customer-error-response-exception.md | 17 +- doc/models/customer-error.md | 12 +- doc/models/customer-payer-change.md | 37 +- doc/models/customer-response.md | 27 +- doc/models/customer.md | 34 +- doc/models/debit-note-role.md | 8 + doc/models/debit-note-status.md | 8 + doc/models/debit-note.md | 26 +- doc/models/deduct-service-credit-request.md | 21 +- doc/models/deduct-service-credit.md | 14 +- doc/models/delayed-cancellation-response.md | 12 +- .../delete-subscription-group-response.md | 14 +- .../deliver-proforma-invoice-request.md | 35 +- doc/models/direction.md | 8 + doc/models/discount-type.md | 8 + doc/models/downgrade-credit-credit-type.md | 8 + doc/models/dunner-data.md | 26 +- doc/models/dunning-step-data.md | 28 +- doc/models/dunning-step-reached.md | 72 +- doc/models/ebb-component.md | 83 +- doc/models/ebb-event.md | 37 +- doc/models/enable-webhooks-request.md | 12 +- doc/models/enable-webhooks-response.md | 12 +- doc/models/endpoint-response.md | 31 +- doc/models/endpoint.md | 27 +- .../error-array-map-response-exception.md | 20 +- doc/models/error-list-response-exception.md | 19 +- .../error-string-map-response-exception.md | 18 +- doc/models/errors.md | 30 +- ...-billing-list-segments-errors-exception.md | 26 +- .../event-based-billing-segment-error.md | 26 +- ...-based-billing-segment-errors-exception.md | 28 +- .../event-based-billing-segment-exception.md | 22 +- doc/models/event-key.md | 9 + doc/models/event-response.md | 53 +- doc/models/event.md | 52 +- doc/models/expiration-interval-unit.md | 8 + doc/models/failed-payment-action.md | 10 +- doc/models/failed-payment-event-data.md | 23 +- doc/models/failed-payment-event.md | 60 +- doc/models/first-charge-type.md | 8 + .../full-subscription-group-response.md | 30 +- ...time-token-bank-account-payment-profile.md | 69 + .../get-one-time-token-payment-profile.md | 56 +- doc/models/get-one-time-token-request.md | 65 +- doc/models/group-billing.md | 18 +- doc/models/group-settings.md | 37 +- doc/models/group-status.md | 22 + doc/models/group-target-type.md | 8 + doc/models/group-target.md | 17 +- doc/models/group-type.md | 8 + doc/models/historic-usage.md | 20 +- doc/models/include-not-null.md | 6 +- doc/models/include-null-or-not-null.md | 6 +- doc/models/include-option.md | 8 + doc/models/interval-unit.md | 8 + doc/models/invoice-address.md | 22 +- doc/models/invoice-avatax-details.md | 24 +- doc/models/invoice-balance-item.md | 18 +- doc/models/invoice-consolidation-level.md | 10 +- doc/models/invoice-credit.md | 24 +- doc/models/invoice-custom-field.md | 23 +- doc/models/invoice-customer.md | 22 +- doc/models/invoice-date-field.md | 6 +- doc/models/invoice-debit.md | 25 +- doc/models/invoice-discount-breakout.md | 18 +- doc/models/invoice-discount-source-type.md | 8 + doc/models/invoice-discount-type.md | 8 + doc/models/invoice-discount.md | 23 +- doc/models/invoice-display-settings.md | 14 +- doc/models/invoice-event-payment-method.md | 8 + doc/models/invoice-event-type.md | 8 + doc/models/invoice-issued.md | 61 +- .../invoice-line-item-component-cost-data.md | 45 +- doc/models/invoice-line-item-event-data.md | 22 +- .../invoice-line-item-pricing-detail.md | 14 +- doc/models/invoice-line-item.md | 32 +- doc/models/invoice-payer-change.md | 20 +- doc/models/invoice-payer.md | 22 +- doc/models/invoice-payment-application.md | 18 +- doc/models/invoice-payment-method-type.md | 8 + doc/models/invoice-payment-method.md | 22 +- doc/models/invoice-payment-type.md | 8 + doc/models/invoice-payment.md | 37 +- doc/models/invoice-pre-payment.md | 18 +- doc/models/invoice-previous-balance.md | 41 +- doc/models/invoice-refund.md | 22 +- doc/models/invoice-response.md | 37 +- doc/models/invoice-role.md | 8 + doc/models/invoice-seller.md | 33 +- doc/models/invoice-sort-field.md | 6 +- doc/models/invoice-status.md | 8 + doc/models/invoice-tax-breakout.md | 20 +- doc/models/invoice-tax-component-breakout.md | 22 +- doc/models/invoice-tax.md | 23 +- doc/models/invoice.md | 43 +- doc/models/issue-advance-invoice-request.md | 12 +- doc/models/issue-invoice-event-data.md | 24 +- doc/models/issue-invoice-event.md | 61 +- doc/models/issue-invoice-request.md | 15 +- doc/models/issue-service-credit-request.md | 21 +- doc/models/issue-service-credit.md | 14 +- doc/models/item-category.md | 6 +- doc/models/item-price-point-changed.md | 41 +- doc/models/item-price-point-data.md | 18 +- doc/models/line-item-kind.md | 8 + doc/models/line-item-transaction-type.md | 8 + doc/models/list-components-filter.md | 24 +- .../list-components-price-points-include.md | 6 +- .../list-components-price-points-response.md | 33 +- doc/models/list-coupons-filter.md | 43 +- doc/models/list-credit-notes-response.md | 31 +- doc/models/list-events-date-field.md | 6 +- doc/models/list-invoice-events-response.md | 101 +- doc/models/list-invoices-response.md | 41 +- doc/models/list-metafields-response.md | 80 +- doc/models/list-mrr-filter.md | 22 +- doc/models/list-mrr-response-result.md | 22 +- doc/models/list-mrr-response.md | 27 +- doc/models/list-offers-response.md | 52 +- doc/models/list-prepayment-date-field.md | 6 +- doc/models/list-prepayments-filter.md | 21 +- doc/models/list-price-points-filter.md | 46 +- .../list-product-price-points-response.md | 31 +- doc/models/list-products-filter.md | 29 +- doc/models/list-products-include.md | 6 +- .../list-products-price-points-include.md | 6 +- doc/models/list-proforma-invoices-meta.md | 20 +- doc/models/list-proforma-invoices-response.md | 72 +- doc/models/list-public-keys-meta.md | 20 +- doc/models/list-public-keys-response.md | 52 +- doc/models/list-sale-rep-item.md | 53 +- doc/models/list-segments-filter.md | 20 +- doc/models/list-segments-response.md | 32 +- doc/models/list-service-credits-response.md | 39 +- .../list-subscription-components-filter.md | 22 +- ...subscription-components-for-site-filter.md | 47 +- .../list-subscription-components-include.md | 6 +- .../list-subscription-components-response.md | 32 +- .../list-subscription-components-sort.md | 6 +- ...ist-subscription-group-prepayment-item.md} | 24 +- ...-subscription-group-prepayment-response.md | 36 +- .../list-subscription-group-prepayment.md | 31 +- doc/models/list-subscription-groups-item.md | 28 +- doc/models/list-subscription-groups-meta.md | 14 +- .../list-subscription-groups-response.md | 71 +- doc/models/metadata.md | 24 +- doc/models/metafield-input.md | 10 +- doc/models/metafield-scope.md | 23 +- doc/models/metafield.md | 39 +- doc/models/metered-component.md | 93 +- doc/models/metered-usage.md | 26 +- doc/models/movement-line-item.md | 22 +- doc/models/movement.md | 24 +- doc/models/mrr-movement.md | 20 +- doc/models/mrr-response.md | 38 +- doc/models/mrr.md | 33 +- doc/models/multi-invoice-payment-response.md | 58 +- doc/models/multi-invoice-payment.md | 33 +- doc/models/nested-subscription-group.md | 20 +- doc/models/net-terms.md | 22 +- doc/models/offer-discount.md | 18 +- doc/models/offer-item.md | 22 +- doc/models/offer-response.md | 27 +- doc/models/offer-signup-page.md | 22 +- doc/models/offer.md | 22 +- doc/models/ok-response.md | 12 +- doc/models/on-off-component.md | 36 +- doc/models/organization-address.md | 22 +- doc/models/origin-invoice.md | 14 +- doc/models/overage-pricing.md | 40 +- doc/models/override-subscription-request.md | 29 +- doc/models/override-subscription.md | 24 +- doc/models/paginated-metadata.md | 62 +- doc/models/paid-invoice.md | 21 +- doc/models/pause-request.md | 21 +- doc/models/pay-pal-vault.md | 8 + doc/models/payer-attributes.md | 30 +- doc/models/payer-error.md | 37 +- .../payment-collection-method-changed.md | 14 +- doc/models/payment-for-allocation.md | 20 +- doc/models/payment-method-apple-pay.md | 13 +- doc/models/payment-method-bank-account.md | 19 +- doc/models/payment-method-credit-card.md | 23 +- doc/models/payment-method-external.md | 21 +- doc/models/payment-method-paypal.md | 15 +- doc/models/payment-profile-attributes.md | 45 +- doc/models/payment-profile-params.md | 18 +- doc/models/payment-profile-response.md | 31 +- doc/models/payment-related-events.md | 14 +- doc/models/payment-type.md | 8 + doc/models/paypal-payment-profile.md | 26 +- doc/models/pending-cancellation-change.md | 16 +- doc/models/portal-management-link.md | 24 +- doc/models/prepaid-configuration-response.md | 27 +- doc/models/prepaid-configuration.md | 22 +- .../prepaid-product-price-point-filter.md | 10 +- .../prepaid-subscription-balance-changed.md | 20 +- doc/models/prepaid-usage-allocation-detail.md | 18 +- doc/models/prepaid-usage-component.md | 78 +- doc/models/prepaid-usage.md | 49 +- .../prepayment-account-balance-changed.md | 20 +- doc/models/prepayment-method.md | 8 + doc/models/prepayment-response.md | 40 +- doc/models/prepayment.md | 35 +- doc/models/prepayments-response.md | 80 +- doc/models/preview-allocations-request.md | 42 +- doc/models/price-point-type.md | 8 + doc/models/price.md | 18 +- doc/models/pricing-scheme.md | 8 + doc/models/product-family-response.md | 27 +- doc/models/product-family.md | 21 +- ...ct-price-point-error-response-exception.md | 35 +- doc/models/product-price-point-errors.md | 50 +- doc/models/product-price-point-response.md | 27 +- doc/models/product-price-point.md | 28 +- doc/models/product-response.md | 27 +- doc/models/product.md | 31 +- ...ma-bad-request-error-response-exception.md | 22 +- doc/models/proforma-error.md | 25 +- doc/models/proforma-invoice-credit.md | 20 +- .../proforma-invoice-discount-source-type.md | 8 + doc/models/proforma-invoice-discount.md | 24 +- doc/models/proforma-invoice-issued.md | 53 +- doc/models/proforma-invoice-payment.md | 20 +- doc/models/proforma-invoice-role.md | 10 +- doc/models/proforma-invoice-status.md | 8 + .../proforma-invoice-tax-source-type.md | 8 + doc/models/proforma-invoice-tax.md | 23 +- doc/models/proforma-invoice.md | 26 +- doc/models/proration.md | 12 +- doc/models/public-key.md | 20 +- doc/models/public-signup-page.md | 22 +- doc/models/q-scope.md | 27 + doc/models/quantity-based-component.md | 59 +- .../reactivate-subscription-group-request.md | 14 +- .../reactivate-subscription-group-response.md | 29 +- doc/models/reactivate-subscription-request.md | 30 +- doc/models/reactivation-billing.md | 17 +- doc/models/reactivation-charge.md | 10 +- doc/models/reason-code-response.md | 27 +- doc/models/reason-code.md | 22 +- doc/models/record-payment-request.md | 26 +- doc/models/record-payment-response.md | 53 +- doc/models/recurring-scheme.md | 8 + doc/models/referral-code.md | 20 +- doc/models/referral-validation-response.md | 25 +- doc/models/refund-consolidated-invoice.md | 33 +- doc/models/refund-invoice-event-data.md | 48 +- doc/models/refund-invoice-event.md | 81 +- doc/models/refund-invoice-request.md | 29 +- doc/models/refund-invoice.md | 28 +- ...epayment-base-errors-response-exception.md | 24 +- .../refund-prepayment-base-refund-error.md | 28 +- doc/models/refund-prepayment-request.md | 25 +- doc/models/refund-prepayment.md | 20 +- doc/models/refund-success.md | 18 +- doc/models/register.md | 20 +- doc/models/remove-payment-event-data.md | 34 +- doc/models/remove-payment-event.md | 69 +- doc/models/renewal-preview-component.md | 18 +- doc/models/renewal-preview-line-item.md | 24 +- doc/models/renewal-preview-request.md | 46 +- doc/models/renewal-preview-response.md | 29 +- doc/models/renewal-preview.md | 24 +- doc/models/replay-webhooks-request.md | 20 +- doc/models/replay-webhooks-response.md | 12 +- doc/models/resent-invitation.md | 26 +- doc/models/resource-type.md | 8 + doc/models/restriction-type.md | 8 + doc/models/resume-options.md | 14 +- doc/models/resumption-charge.md | 8 + doc/models/revoked-invitation.md | 18 +- doc/models/sale-rep-item-mrr.md | 18 +- doc/models/sale-rep-settings.md | 22 +- doc/models/sale-rep-subscription.md | 22 +- doc/models/sale-rep.md | 53 +- ...cheduled-renewal-component-custom-price.md | 34 +- ...uled-renewal-configuration-item-request.md | 59 +- ...led-renewal-configuration-item-response.md | 27 +- .../scheduled-renewal-configuration-item.md | 22 +- ...uled-renewal-configuration-request-body.md | 24 +- ...scheduled-renewal-configuration-request.md | 29 +- ...cheduled-renewal-configuration-response.md | 29 +- doc/models/scheduled-renewal-configuration.md | 24 +- ...heduled-renewal-configurations-response.md | 54 +- ...led-renewal-item-request-body-component.md | 56 +- ...duled-renewal-item-request-body-product.md | 43 +- .../scheduled-renewal-lock-in-request.md | 14 +- .../scheduled-renewal-product-price-point.md | 31 +- .../scheduled-renewal-update-request.md | 59 +- doc/models/segment-price.md | 22 +- doc/models/segment-response.md | 28 +- doc/models/segment.md | 23 +- doc/models/send-email.md | 14 +- doc/models/send-invoice-request.md | 46 +- doc/models/service-credit-1.md | 23 +- doc/models/service-credit-response.md | 28 +- doc/models/service-credit-type.md | 8 + doc/models/service-credit.md | 23 +- .../signup-proforma-preview-response.md | 46 +- doc/models/signup-proforma-preview.md | 41 +- doc/models/single-error-response-exception.md | 15 +- .../single-string-error-response-exception.md | 15 +- doc/models/site-response.md | 27 +- doc/models/site-statistics.md | 22 +- doc/models/site-summary.md | 35 +- doc/models/site.md | 22 +- doc/models/sorting-direction.md | 8 + doc/models/status.md | 8 + ...subscription-add-coupon-error-exception.md | 29 +- ...on-component-allocation-error-exception.md | 20 +- ...ription-component-allocation-error-item.md | 14 +- doc/models/subscription-component-response.md | 28 +- .../subscription-component-subscription.md | 19 +- doc/models/subscription-component.md | 29 +- doc/models/subscription-custom-price.md | 31 +- doc/models/subscription-date-field.md | 8 + doc/models/subscription-filter.md | 34 +- doc/models/subscription-group-balances.md | 53 +- doc/models/subscription-group-bank-account.md | 26 +- ...bscription-group-component-custom-price.md | 83 +- ...n-group-create-error-response-exception.md | 19 +- doc/models/subscription-group-credit-card.md | 25 +- doc/models/subscription-group-customer.md | 22 +- doc/models/subscription-group-include.md | 8 + doc/models/subscription-group-item.md | 22 +- .../subscription-group-members-array-error.md | 18 +- .../subscription-group-payment-profile.md | 20 +- .../subscription-group-prepayment-method.md | 8 + .../subscription-group-prepayment-request.md | 26 +- .../subscription-group-prepayment-response.md | 23 +- doc/models/subscription-group-prepayment.md | 21 +- doc/models/subscription-group-response.md | 45 +- .../subscription-group-signup-component.md | 139 +- ...n-group-signup-error-response-exception.md | 64 +- doc/models/subscription-group-signup-error.md | 122 +- .../subscription-group-signup-event-data.md | 55 +- .../subscription-group-signup-failure-data.md | 35 +- doc/models/subscription-group-signup-item.md | 36 +- .../subscription-group-signup-request.md | 68 +- .../subscription-group-signup-response.md | 30 +- doc/models/subscription-group-signup.md | 63 +- doc/models/subscription-group-single-error.md | 12 +- .../subscription-group-subscription-error.md | 49 +- ...n-group-update-error-response-exception.md | 20 +- doc/models/subscription-group-update-error.md | 22 +- doc/models/subscription-group.md | 41 +- .../subscription-groups-list-include.md | 8 + doc/models/subscription-include.md | 8 + doc/models/subscription-included-coupon.md | 26 +- doc/models/subscription-list-date-field.md | 6 +- doc/models/subscription-list-include.md | 12 + .../subscription-migration-preview-options.md | 24 +- .../subscription-migration-preview-request.md | 29 +- ...subscription-migration-preview-response.md | 25 +- doc/models/subscription-migration-preview.md | 20 +- doc/models/subscription-mrr-breakout.md | 14 +- doc/models/subscription-mrr-response.md | 34 +- doc/models/subscription-mrr.md | 25 +- doc/models/subscription-note-response.md | 29 +- doc/models/subscription-note.md | 24 +- doc/models/subscription-preview-response.md | 107 +- doc/models/subscription-preview.md | 102 +- .../subscription-product-change-scheduled.md | 33 + doc/models/subscription-product-change.md | 14 +- .../subscription-product-migration-request.md | 29 +- doc/models/subscription-product-migration.md | 24 +- doc/models/subscription-purge-type.md | 8 + ...cription-remove-coupon-errors-exception.md | 17 +- .../subscription-response-error-exception.md | 21 +- doc/models/subscription-response.md | 28 +- doc/models/subscription-sort.md | 8 + doc/models/subscription-state-change.md | 14 +- doc/models/subscription-state-filter.md | 13 + doc/models/subscription-state.md | 8 + doc/models/subscription.md | 91 +- ...scriptions-mrr-error-response-exception.md | 19 +- doc/models/tax-configuration-kind.md | 8 + doc/models/tax-configuration.md | 20 +- doc/models/tax-destination-address.md | 8 + doc/models/tokenized-payment-profile.md | 20 +- ...anagement-link-requests-error-exception.md | 18 +- .../too-many-management-link-requests.md | 16 +- doc/models/trial-type.md | 10 +- .../update-allocation-expiration-date.md | 21 +- .../update-component-price-point-request.md | 28 +- doc/models/update-component-price-point.md | 23 +- doc/models/update-component-request.md | 30 +- doc/models/update-component.md | 30 +- doc/models/update-coupon-currency.md | 14 +- doc/models/update-currency-price.md | 14 +- doc/models/update-currency-prices-request.md | 25 +- doc/models/update-customer-request.md | 27 +- doc/models/update-customer.md | 24 +- doc/models/update-invoice-item.md | 42 + doc/models/update-invoice-request.md | 57 + doc/models/update-invoice.md | 55 + doc/models/update-metadata-request.md | 23 +- doc/models/update-metadata.md | 18 +- doc/models/update-metafield.md | 44 +- doc/models/update-metafields-request.md | 46 +- doc/models/update-payment-profile-request.md | 28 +- doc/models/update-payment-profile.md | 41 +- doc/models/update-price.md | 22 +- .../update-product-price-point-request.md | 21 +- doc/models/update-product-price-point.md | 14 +- doc/models/update-reason-code-request.md | 23 +- doc/models/update-reason-code.md | 18 +- doc/models/update-segment-request.md | 55 +- doc/models/update-segment.md | 35 +- doc/models/update-subscription-component.md | 56 +- .../update-subscription-group-request.md | 25 +- doc/models/update-subscription-group.md | 21 +- .../update-subscription-note-request.md | 21 +- doc/models/update-subscription-note.md | 14 +- doc/models/update-subscription-request.md | 40 +- doc/models/update-subscription.md | 42 +- doc/models/upgrade-charge-credit-type.md | 8 + .../upsert-prepaid-configuration-request.md | 25 +- doc/models/upsert-prepaid-configuration.md | 20 +- doc/models/usage-response.md | 29 +- doc/models/usage.md | 24 +- doc/models/void-invoice-event-data.md | 39 +- doc/models/void-invoice-event.md | 74 +- doc/models/void-invoice-request.md | 19 +- doc/models/void-invoice.md | 12 +- doc/models/void-remainder-event-data.md | 35 +- doc/models/void-remainder-event.md | 70 +- doc/models/webhook-order.md | 8 + doc/models/webhook-response.md | 29 +- doc/models/webhook-status.md | 8 + doc/models/webhook-subscription.md | 9 + doc/models/webhook.md | 26 +- pyproject.toml | 2 +- 834 files changed, 16172 insertions(+), 9378 deletions(-) create mode 100644 advancedbilling/models/collection_method_1.py create mode 100644 advancedbilling/models/get_one_time_token_bank_account_payment_profile.py create mode 100644 advancedbilling/models/group_status.py rename advancedbilling/models/{list_subcription_group_prepayment_item.py => list_subscription_group_prepayment_item.py} (97%) create mode 100644 advancedbilling/models/q_scope.py create mode 100644 advancedbilling/models/subscription_product_change_scheduled.py create mode 100644 advancedbilling/models/update_invoice.py create mode 100644 advancedbilling/models/update_invoice_item.py create mode 100644 advancedbilling/models/update_invoice_request.py create mode 100644 doc/models/collection-method-1.md create mode 100644 doc/models/containers/create-subscription-component-unit-balance.md create mode 100644 doc/models/containers/get-one-time-token-request-payment-profile.md create mode 100644 doc/models/containers/list-subscriptions-input-product.md create mode 100644 doc/models/containers/metered-usage-new-unit-balance.md create mode 100644 doc/models/containers/prepaid-usage-new-overage-unit-balance.md create mode 100644 doc/models/containers/prepaid-usage-new-unit-balance.md create mode 100644 doc/models/containers/subscription-component-unit-balance.md create mode 100644 doc/models/containers/update-invoice-item-component-id.md create mode 100644 doc/models/containers/update-invoice-item-price-point-id.md create mode 100644 doc/models/containers/update-invoice-item-product-id.md create mode 100644 doc/models/containers/update-invoice-item-product-price-point-id.md create mode 100644 doc/models/containers/update-invoice-item-quantity.md create mode 100644 doc/models/containers/update-invoice-item-unit-price.md create mode 100644 doc/models/get-one-time-token-bank-account-payment-profile.md create mode 100644 doc/models/group-status.md rename doc/models/{list-subcription-group-prepayment-item.md => list-subscription-group-prepayment-item.md} (54%) create mode 100644 doc/models/q-scope.md create mode 100644 doc/models/subscription-product-change-scheduled.md create mode 100644 doc/models/update-invoice-item.md create mode 100644 doc/models/update-invoice-request.md create mode 100644 doc/models/update-invoice.md diff --git a/README.md b/README.md index 145f9618..d7dcc732 100644 --- a/README.md +++ b/README.md @@ -30,22 +30,22 @@ The package is compatible with Python versions `3.7+`. Install the package from PyPi using the following pip command: ```bash -pip install maxio-advanced-billing-sdk==9.1.0 +pip install maxio-advanced-billing-sdk==10.0.0 ``` You can also view the package at: -https://pypi.python.org/pypi/maxio-advanced-billing-sdk/9.1.0 +https://pypi.python.org/pypi/maxio-advanced-billing-sdk/10.0.0 ## Initialize the API Client -**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/client.md) +**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/client.md) The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | | site | `str` | The subdomain for your Advanced Billing site.
*Default*: `"subdomain"` | -| environment | [`Environment`](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/README.md#environments) | The API environment.
**Default: `Environment.US`** | +| environment | [`Environment`](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/README.md#environments) | The API environment.
**Default: `Environment.US`** | | http_client_instance | `Union[Session, HttpClientProvider]` | The Http Client passed from the sdk user for making requests | | override_http_client_configuration | `bool` | The value which determines to override properties of the passed Http Client from the sdk user | | http_call_back | `HttpCallBack` | The callback value that is invoked before and after an HTTP call is made to an endpoint | @@ -54,8 +54,8 @@ The following parameters are configurable for the API Client: | backoff_factor | `float` | A backoff factor to apply between attempts after the second try.
**Default: 2** | | retry_statuses | `Array of int` | The http statuses on which retry is to be done.
**Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** | | retry_methods | `Array of string` | The http methods on which retry is to be done.
**Default: ["GET", "PUT"]** | -| proxy_settings | [`ProxySettings`](https://www.github.com/maxio-com/ab-python-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-python-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-python-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-python-sdk/tree/10.0.0/doc/auth/basic-authentication.md) | The credential object for Basic Authentication | The API client can be initialized as follows: @@ -85,7 +85,7 @@ from advancedbilling.advanced_billing_client import AdvancedBillingClient client = AdvancedBillingClient.from_environment(dotenv_path='/path/to/.env') ``` -See the [Environment-Based Client Initialization](https://www.github.com/maxio-com/ab-python-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-python-sdk/tree/10.0.0/doc/environment-based-client-initialization.md) section for details. ## Environments @@ -102,60 +102,60 @@ 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-python-sdk/tree/9.1.0/doc/auth/basic-authentication.md) +* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/auth/basic-authentication.md) ## List of APIs -* [API Exports](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/api-exports.md) -* [Advance Invoice](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/advance-invoice.md) -* [Billing Portal](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/billing-portal.md) -* [Component Price Points](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/component-price-points.md) -* [Custom Fields](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/custom-fields.md) -* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/events-based-billing-segments.md) -* [Payment Profiles](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/payment-profiles.md) -* [Product Families](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/product-families.md) -* [Product Price Points](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/product-price-points.md) -* [Proforma Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/proforma-invoices.md) -* [Reason Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/reason-codes.md) -* [Referral Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/referral-codes.md) -* [Sales Commissions](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/sales-commissions.md) -* [Subscription Components](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/subscription-components.md) -* [Subscription Groups](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/subscription-groups.md) -* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/subscription-group-invoice-account.md) -* [Subscription Group Status](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/subscription-group-status.md) -* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/subscription-invoice-account.md) -* [Subscription Notes](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/subscription-notes.md) -* [Subscription Products](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/subscription-products.md) -* [Subscription Renewals](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/subscription-renewals.md) -* [Subscription Status](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/subscription-status.md) -* [Coupons](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/coupons.md) -* [Components](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/components.md) -* [Customers](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/customers.md) -* [Events](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/events.md) -* [Insights](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/insights.md) -* [Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/invoices.md) -* [Offers](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/offers.md) -* [Products](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/products.md) -* [Sites](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/sites.md) -* [Subscriptions](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/subscriptions.md) -* [Webhooks](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/controllers/webhooks.md) +* [API Exports](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/api-exports.md) +* [Advance Invoice](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/advance-invoice.md) +* [Billing Portal](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/billing-portal.md) +* [Component Price Points](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/component-price-points.md) +* [Custom Fields](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/custom-fields.md) +* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/events-based-billing-segments.md) +* [Payment Profiles](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/payment-profiles.md) +* [Product Families](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/product-families.md) +* [Product Price Points](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/product-price-points.md) +* [Proforma Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/proforma-invoices.md) +* [Reason Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/reason-codes.md) +* [Referral Codes](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/referral-codes.md) +* [Sales Commissions](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/sales-commissions.md) +* [Subscription Components](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/subscription-components.md) +* [Subscription Groups](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/subscription-groups.md) +* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/subscription-group-invoice-account.md) +* [Subscription Group Status](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/subscription-group-status.md) +* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/subscription-invoice-account.md) +* [Subscription Notes](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/subscription-notes.md) +* [Subscription Products](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/subscription-products.md) +* [Subscription Renewals](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/subscription-renewals.md) +* [Subscription Status](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/subscription-status.md) +* [Coupons](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/coupons.md) +* [Components](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/components.md) +* [Customers](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/customers.md) +* [Events](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/events.md) +* [Insights](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/insights.md) +* [Invoices](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/invoices.md) +* [Offers](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/offers.md) +* [Products](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/products.md) +* [Sites](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/sites.md) +* [Subscriptions](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/subscriptions.md) +* [Webhooks](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/controllers/webhooks.md) ## SDK Infrastructure ### Configuration -* [ProxySettings](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/proxy-settings.md) -* [Environment-Based Client Initialization](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/environment-based-client-initialization.md) +* [ProxySettings](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/proxy-settings.md) +* [Environment-Based Client Initialization](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/environment-based-client-initialization.md) ### HTTP -* [HttpResponse](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/http-response.md) -* [HttpRequest](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/http-request.md) +* [HttpResponse](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/http-response.md) +* [HttpRequest](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/http-request.md) ### Utilities -* [ApiHelper](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/api-helper.md) -* [HttpDateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/http-date-time.md) -* [RFC3339DateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/rfc3339-date-time.md) -* [UnixDateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/9.1.0/doc/unix-date-time.md) +* [ApiHelper](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/api-helper.md) +* [HttpDateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/http-date-time.md) +* [RFC3339DateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/rfc3339-date-time.md) +* [UnixDateTime](https://www.github.com/maxio-com/ab-python-sdk/tree/10.0.0/doc/unix-date-time.md) diff --git a/advancedbilling/controllers/advance_invoice_controller.py b/advancedbilling/controllers/advance_invoice_controller.py index 684ed561..463ebfc8 100644 --- a/advancedbilling/controllers/advance_invoice_controller.py +++ b/advancedbilling/controllers/advance_invoice_controller.py @@ -42,8 +42,7 @@ def issue_advance_invoice(self, """Perform a POST request to /subscriptions/{subscription_id}/advance_invoice/issue.json. - Generate an invoice in advance for a subscription's next renewal date. [See - our + Issues 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, @@ -147,7 +146,7 @@ def void_advance_invoice(self, """Perform a POST request to /subscriptions/{subscription_id}/advance_invoice/void.json. - Void a subscription's existing advance invoice. Once voided, it can later be + 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 diff --git a/advancedbilling/controllers/base_controller.py b/advancedbilling/controllers/base_controller.py index 95e5d65e..467b75ac 100644 --- a/advancedbilling/controllers/base_controller.py +++ b/advancedbilling/controllers/base_controller.py @@ -31,7 +31,7 @@ class BaseController(object): @staticmethod def user_agent(): """Return UserAgent value.""" - return "AB SDK Python:9.1.0 on OS {os-info}" + return "AB SDK Python:10.0.0 on OS {os-info}" @staticmethod def user_agent_parameters(): diff --git a/advancedbilling/controllers/billing_portal_controller.py b/advancedbilling/controllers/billing_portal_controller.py index 9e11cedd..1fc299eb 100644 --- a/advancedbilling/controllers/billing_portal_controller.py +++ b/advancedbilling/controllers/billing_portal_controller.py @@ -139,7 +139,7 @@ def read_billing_portal_link(self, + 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`) + Management URL requests (with a response code `429`). Args: customer_id (int): The Chargify id of the customer diff --git a/advancedbilling/controllers/component_price_points_controller.py b/advancedbilling/controllers/component_price_points_controller.py index 3b293433..a2e9fe63 100644 --- a/advancedbilling/controllers/component_price_points_controller.py +++ b/advancedbilling/controllers/component_price_points_controller.py @@ -175,10 +175,6 @@ def list_component_price_points(self, 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. @@ -190,7 +186,8 @@ def list_component_price_points(self, desired values being the value. A list of parameters that can be used are:: component_id -- int -- The Advanced Billing id of the component - currency_prices -- bool -- Include an array of currency price data + currency_prices -- bool -- Include an array of currency price + data. page -- int -- 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 @@ -466,7 +463,7 @@ def read_component_price_point(self, using the handle, it must be prefixed with `handle:`. Example: `123` for an integer ID, or `handle:example-price_point-handle` for a string handle. - currency_prices (bool, optional): Include an array of currency price data + currency_prices (bool, optional): Include an array of currency price data. Returns: ComponentPricePointCurrencyOverageResponse: Response from the API. OK diff --git a/advancedbilling/controllers/components_controller.py b/advancedbilling/controllers/components_controller.py index f2dd3338..40e30289 100644 --- a/advancedbilling/controllers/components_controller.py +++ b/advancedbilling/controllers/components_controller.py @@ -60,9 +60,21 @@ def create_metered_component(self, 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-O verview). + 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`. Args: product_family_id (str): Either the product family's id or its handle @@ -129,9 +141,19 @@ def create_quantity_based_component(self, 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. + #### 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-O verview). + 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`. Args: product_family_id (str): Either the product family's id or its handle @@ -190,6 +212,10 @@ def create_on_off_component(self, For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-O verview). + 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`. Args: product_family_id (str): Either the product family's id or its handle @@ -253,6 +279,10 @@ def create_prepaid_usage_component(self, For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-O verview). + 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`. Args: product_family_id (str): Either the product family's id or its handle @@ -318,6 +348,10 @@ def create_event_based_component(self, For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-O verview). + 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`. Args: product_family_id (str): Either the product family's id or its handle @@ -460,6 +494,10 @@ def update_product_family_component(self, 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`. Args: product_family_id (int): The Advanced Billing id of the product family to @@ -596,8 +634,8 @@ def list_components(self, 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 -- bool -- Include archived items + will be used instead of end_date. + include_archived -- bool -- Include archived items. page -- int -- 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 @@ -672,6 +710,10 @@ def update_component(self, 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`. Args: component_id (str): The id or handle of the component @@ -756,7 +798,7 @@ def list_components_for_product_family(self, 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. + will be used instead of end_date. start_date -- str -- 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 diff --git a/advancedbilling/controllers/coupons_controller.py b/advancedbilling/controllers/coupons_controller.py index 028c9c76..c9fea293 100644 --- a/advancedbilling/controllers/coupons_controller.py +++ b/advancedbilling/controllers/coupons_controller.py @@ -1,10 +1,10 @@ -"""advanced_billing. - -This file was automatically generated for Maxio by APIMATIC v3.0 ( - https://www.apimatic.io ). -""" - -# ruff: noqa: D410, E501, E101, D206 +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: D410, E501, E101, D206 from apimatic_core.authentication.multiple.single_auth import ( Single, ) @@ -47,88 +47,80 @@ from advancedbilling.models.coupon_usage import ( CouponUsage, ) - - + + class CouponsController(BaseController): """A Controller to access Endpoints in the advancedbilling API.""" def __init__(self, config): """Initialize CouponsController object.""" super(CouponsController, self).__init__(config) - - def create_coupon(self, - product_family_id, + + def create_coupon(self, + product_family_id, body=None): - """Perform a POST request to - /product_families/{product_family_id}/coupons.json. - + """Perform a POST request to + /product_families/{product_family_id}/coupons.json. + 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-E - diting-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-Coup ons-and-Subscriptions) for information on applying a coupon to a subscription in the Advanced Billing UI. - - Args: + + Args: product_family_id (int): The Advanced Billing id of the product family to which the coupon belongs body (CouponRequest, optional): The request body parameter. - - Returns: + + Returns: CouponResponse: Response from the API. Created - - Raises: + + Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. - + """ - return super().new_api_call_builder.request( - RequestBuilder().server(Server.PRODUCTION) - .path("/product_families/{product_family_id}/coupons.json") - .http_method(HttpMethodEnum.POST) - .template_param(Parameter() - .key("product_family_id") - .value(product_family_id) - .is_required(True) - .should_encode(True)) - .header_param(Parameter() - .key("Content-Type") - .value("application/json")) - .body_param(Parameter() - .value(body)) - .header_param(Parameter() - .key("accept") - .value("application/json")) - .body_serializer(APIHelper.json_serialize) - .auth(Single("BasicAuth")), - ).response( - ResponseHandler() - .deserializer(APIHelper.json_deserialize) - .deserialize_into(CouponResponse.from_dictionary) - .local_error_template("422", - "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" - "nse.body}'.", - ErrorListResponseException), - ).execute() - - def list_coupons_for_product_family(self, + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/product_families/{product_family_id}/coupons.json") + .http_method(HttpMethodEnum.POST) + .template_param(Parameter() + .key("product_family_id") + .value(product_family_id) + .is_required(True) + .should_encode(True)) + .header_param(Parameter() + .key("Content-Type") + .value("application/json")) + .body_param(Parameter() + .value(body)) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .body_serializer(APIHelper.json_serialize) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(CouponResponse.from_dictionary) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), + ).execute() + + def list_coupons_for_product_family(self, options=dict()): - """Perform a GET request to - /product_families/{product_family_id}/coupons.json. - + """Perform a GET request to + /product_families/{product_family_id}/coupons.json. + Lists coupons for a specific product family in a site. - - Args: + + Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their @@ -150,59 +142,58 @@ def list_coupons_for_product_family(self, changed to 200. Use in query `per_page=200`. filter -- ListCouponsFilter -- Filter to use for List Coupons operations - currency_prices -- bool -- 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`. - - Returns: + currency_prices -- bool -- (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`. + + Returns: List[CouponResponse]: Response from the API. OK - - Raises: + + Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. - + """ - return super().new_api_call_builder.request( - RequestBuilder().server(Server.PRODUCTION) - .path("/product_families/{product_family_id}/coupons.json") - .http_method(HttpMethodEnum.GET) - .template_param(Parameter() - .key("product_family_id") - .value(options.get("product_family_id", None)) - .is_required(True) - .should_encode(True)) - .query_param(Parameter() - .key("page") - .value(options.get("page", None))) - .query_param(Parameter() - .key("per_page") - .value(options.get("per_page", None))) - .query_param(Parameter() - .key("filter") - .value(options.get("filter", None))) - .query_param(Parameter() - .key("currency_prices") - .value(options.get("currency_prices", None))) - .header_param(Parameter() - .key("accept") - .value("application/json")) - .array_serialization_format(SerializationFormats.CSV) - .auth(Single("BasicAuth")), - ).response( - ResponseHandler() - .deserializer(APIHelper.json_deserialize) - .deserialize_into(CouponResponse.from_dictionary), - ).execute() - - def find_coupon(self, - product_family_id=None, - code=None, + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/product_families/{product_family_id}/coupons.json") + .http_method(HttpMethodEnum.GET) + .template_param(Parameter() + .key("product_family_id") + .value(options.get("product_family_id", None)) + .is_required(True) + .should_encode(True)) + .query_param(Parameter() + .key("page") + .value(options.get("page", None))) + .query_param(Parameter() + .key("per_page") + .value(options.get("per_page", None))) + .query_param(Parameter() + .key("filter") + .value(options.get("filter", None))) + .query_param(Parameter() + .key("currency_prices") + .value(options.get("currency_prices", None))) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .array_serialization_format(SerializationFormats.CSV) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(CouponResponse.from_dictionary), + ).execute() + + def find_coupon(self, + product_family_id=None, + code=None, currency_prices=None): - """Perform a GET request to /coupons/find.json. - + """Perform a GET request to /coupons/find.json. + 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. @@ -210,230 +201,225 @@ def find_coupon(self, 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. - - Args: + + Args: product_family_id (int, optional): The Advanced Billing id of the product family to which the coupon belongs code (str, optional): The code of the coupon - currency_prices (bool, 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. - - Returns: + currency_prices (bool, 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. + + Returns: CouponResponse: Response from the API. OK - - Raises: + + Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. - + """ - return super().new_api_call_builder.request( - RequestBuilder().server(Server.PRODUCTION) - .path("/coupons/find.json") - .http_method(HttpMethodEnum.GET) - .query_param(Parameter() - .key("product_family_id") - .value(product_family_id)) - .query_param(Parameter() - .key("code") - .value(code)) - .query_param(Parameter() - .key("currency_prices") - .value(currency_prices)) - .header_param(Parameter() - .key("accept") - .value("application/json")) - .auth(Single("BasicAuth")), - ).response( - ResponseHandler() - .deserializer(APIHelper.json_deserialize) - .deserialize_into(CouponResponse.from_dictionary), - ).execute() - - def read_coupon(self, - product_family_id, - coupon_id, + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/coupons/find.json") + .http_method(HttpMethodEnum.GET) + .query_param(Parameter() + .key("product_family_id") + .value(product_family_id)) + .query_param(Parameter() + .key("code") + .value(code)) + .query_param(Parameter() + .key("currency_prices") + .value(currency_prices)) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(CouponResponse.from_dictionary), + ).execute() + + def read_coupon(self, + product_family_id, + coupon_id, currency_prices=None): - """Perform a GET request to - /product_families/{product_family_id}/coupons/{coupon_id}.json. - + """Perform a GET request to + /product_families/{product_family_id}/coupons/{coupon_id}.json. + 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. - - Args: + + Args: product_family_id (int): The Advanced Billing id of the product family to which the coupon belongs coupon_id (int): The Advanced Billing id of the coupon - currency_prices (bool, 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. - - Returns: + currency_prices (bool, 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. + + Returns: CouponResponse: Response from the API. OK - - Raises: + + Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. - + """ - return super().new_api_call_builder.request( - RequestBuilder().server(Server.PRODUCTION) - .path("/product_families/{product_family_id}/coupons/{coupon_id}.json") - .http_method(HttpMethodEnum.GET) - .template_param(Parameter() - .key("product_family_id") - .value(product_family_id) - .is_required(True) - .should_encode(True)) - .template_param(Parameter() - .key("coupon_id") - .value(coupon_id) - .is_required(True) - .should_encode(True)) - .query_param(Parameter() - .key("currency_prices") - .value(currency_prices)) - .header_param(Parameter() - .key("accept") - .value("application/json")) - .auth(Single("BasicAuth")), - ).response( - ResponseHandler() - .deserializer(APIHelper.json_deserialize) - .deserialize_into(CouponResponse.from_dictionary), - ).execute() - - def update_coupon(self, - product_family_id, - coupon_id, + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/product_families/{product_family_id}/coupons/{coupon_id}.json") + .http_method(HttpMethodEnum.GET) + .template_param(Parameter() + .key("product_family_id") + .value(product_family_id) + .is_required(True) + .should_encode(True)) + .template_param(Parameter() + .key("coupon_id") + .value(coupon_id) + .is_required(True) + .should_encode(True)) + .query_param(Parameter() + .key("currency_prices") + .value(currency_prices)) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(CouponResponse.from_dictionary), + ).execute() + + def update_coupon(self, + product_family_id, + coupon_id, body=None): - """Perform a PUT request to - /product_families/{product_family_id}/coupons/{coupon_id}.json. - + """Perform a PUT request to + /product_families/{product_family_id}/coupons/{coupon_id}.json. + Updates a coupon. You can restrict a coupon to only apply to specific products / components by optionally passing in hashes of `restricted_products` and/or `restricted_components` in the format: `{ "": boolean_value }` - - Args: + + Args: product_family_id (int): The Advanced Billing id of the product family to which the coupon belongs coupon_id (int): The Advanced Billing id of the coupon body (CouponRequest, optional): The request body parameter. - - Returns: + + Returns: CouponResponse: Response from the API. OK - - Raises: + + Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. - + """ - return super().new_api_call_builder.request( - RequestBuilder().server(Server.PRODUCTION) - .path("/product_families/{product_family_id}/coupons/{coupon_id}.json") - .http_method(HttpMethodEnum.PUT) - .template_param(Parameter() - .key("product_family_id") - .value(product_family_id) - .is_required(True) - .should_encode(True)) - .template_param(Parameter() - .key("coupon_id") - .value(coupon_id) - .is_required(True) - .should_encode(True)) - .header_param(Parameter() - .key("Content-Type") - .value("application/json")) - .body_param(Parameter() - .value(body)) - .header_param(Parameter() - .key("accept") - .value("application/json")) - .body_serializer(APIHelper.json_serialize) - .auth(Single("BasicAuth")), - ).response( - ResponseHandler() - .deserializer(APIHelper.json_deserialize) - .deserialize_into(CouponResponse.from_dictionary) - .local_error_template("422", - "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" - "nse.body}'.", - ErrorListResponseException), - ).execute() - - def archive_coupon(self, - product_family_id, + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/product_families/{product_family_id}/coupons/{coupon_id}.json") + .http_method(HttpMethodEnum.PUT) + .template_param(Parameter() + .key("product_family_id") + .value(product_family_id) + .is_required(True) + .should_encode(True)) + .template_param(Parameter() + .key("coupon_id") + .value(coupon_id) + .is_required(True) + .should_encode(True)) + .header_param(Parameter() + .key("Content-Type") + .value("application/json")) + .body_param(Parameter() + .value(body)) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .body_serializer(APIHelper.json_serialize) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(CouponResponse.from_dictionary) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorListResponseException), + ).execute() + + def archive_coupon(self, + product_family_id, coupon_id): - """Perform a DELETE request to - /product_families/{product_family_id}/coupons/{coupon_id}.json. - + """Perform a DELETE request to + /product_families/{product_family_id}/coupons/{coupon_id}.json. + Archives a coupon, making it unavailable for future use while remaining active on existing subscriptions. Archiving makes that Coupon unavailable for future use, but allows it to remain attached and functional on existing Subscriptions that are using it. The `archived_at` date and time will be assigned. - - Args: + + Args: product_family_id (int): The Advanced Billing id of the product family to which the coupon belongs coupon_id (int): The Advanced Billing id of the coupon - - Returns: + + Returns: CouponResponse: Response from the API. OK - - Raises: + + Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. - + """ - return super().new_api_call_builder.request( - RequestBuilder().server(Server.PRODUCTION) - .path("/product_families/{product_family_id}/coupons/{coupon_id}.json") - .http_method(HttpMethodEnum.DELETE) - .template_param(Parameter() - .key("product_family_id") - .value(product_family_id) - .is_required(True) - .should_encode(True)) - .template_param(Parameter() - .key("coupon_id") - .value(coupon_id) - .is_required(True) - .should_encode(True)) - .header_param(Parameter() - .key("accept") - .value("application/json")) - .auth(Single("BasicAuth")), - ).response( - ResponseHandler() - .deserializer(APIHelper.json_deserialize) - .deserialize_into(CouponResponse.from_dictionary), - ).execute() - - def list_coupons(self, + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/product_families/{product_family_id}/coupons/{coupon_id}.json") + .http_method(HttpMethodEnum.DELETE) + .template_param(Parameter() + .key("product_family_id") + .value(product_family_id) + .is_required(True) + .should_encode(True)) + .template_param(Parameter() + .key("coupon_id") + .value(coupon_id) + .is_required(True) + .should_encode(True)) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(CouponResponse.from_dictionary), + ).execute() + + def list_coupons(self, options=dict()): - """Perform a GET request to /coupons.json. - + """Perform a GET request to /coupons.json. + Lists coupons for a site. - - Args: + + Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their @@ -453,99 +439,98 @@ def list_coupons(self, changed to 200. Use in query `per_page=200`. filter -- ListCouponsFilter -- Filter to use for List Coupons operations - currency_prices -- bool -- 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`. - - Returns: + currency_prices -- bool -- (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`. + + Returns: List[CouponResponse]: Response from the API. OK - - Raises: + + Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. - + """ - return super().new_api_call_builder.request( - RequestBuilder().server(Server.PRODUCTION) - .path("/coupons.json") - .http_method(HttpMethodEnum.GET) - .query_param(Parameter() - .key("page") - .value(options.get("page", None))) - .query_param(Parameter() - .key("per_page") - .value(options.get("per_page", None))) - .query_param(Parameter() - .key("filter") - .value(options.get("filter", None))) - .query_param(Parameter() - .key("currency_prices") - .value(options.get("currency_prices", None))) - .header_param(Parameter() - .key("accept") - .value("application/json")) - .array_serialization_format(SerializationFormats.CSV) - .auth(Single("BasicAuth")), - ).response( - ResponseHandler() - .deserializer(APIHelper.json_deserialize) - .deserialize_into(CouponResponse.from_dictionary), - ).execute() - - def read_coupon_usage(self, - product_family_id, + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/coupons.json") + .http_method(HttpMethodEnum.GET) + .query_param(Parameter() + .key("page") + .value(options.get("page", None))) + .query_param(Parameter() + .key("per_page") + .value(options.get("per_page", None))) + .query_param(Parameter() + .key("filter") + .value(options.get("filter", None))) + .query_param(Parameter() + .key("currency_prices") + .value(options.get("currency_prices", None))) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .array_serialization_format(SerializationFormats.CSV) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(CouponResponse.from_dictionary), + ).execute() + + def read_coupon_usage(self, + product_family_id, coupon_id): - """Perform a GET request to - /product_families/{product_family_id}/coupons/{coupon_id}/usage.json. - + """Perform a GET request to + /product_families/{product_family_id}/coupons/{coupon_id}/usage.json. + Lists coupon usage details, one entry per product. - - Args: + + Args: product_family_id (int): The Advanced Billing id of the product family to which the coupon belongs. coupon_id (int): The Advanced Billing id of the coupon. - - Returns: + + Returns: List[CouponUsage]: Response from the API. OK - - Raises: + + Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. - + """ - return super().new_api_call_builder.request( - RequestBuilder().server(Server.PRODUCTION) - .path("/product_families/{product_family_id}/coupons/{coupon_id}/usage.json") - .http_method(HttpMethodEnum.GET) - .template_param(Parameter() - .key("product_family_id") - .value(product_family_id) - .is_required(True) - .should_encode(True)) - .template_param(Parameter() - .key("coupon_id") - .value(coupon_id) - .is_required(True) - .should_encode(True)) - .header_param(Parameter() - .key("accept") - .value("application/json")) - .auth(Single("BasicAuth")), - ).response( - ResponseHandler() - .deserializer(APIHelper.json_deserialize) - .deserialize_into(CouponUsage.from_dictionary), - ).execute() - - def validate_coupon(self, - code, + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/product_families/{product_family_id}/coupons/{coupon_id}/usage.json") + .http_method(HttpMethodEnum.GET) + .template_param(Parameter() + .key("product_family_id") + .value(product_family_id) + .is_required(True) + .should_encode(True)) + .template_param(Parameter() + .key("coupon_id") + .value(coupon_id) + .is_required(True) + .should_encode(True)) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(CouponUsage.from_dictionary), + ).execute() + + def validate_coupon(self, + code, product_family_id=None): - """Perform a GET request to /coupons/validate.json. - + """Perform a GET request to /coupons/validate.json. + 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. @@ -571,50 +556,50 @@ def validate_coupon(self, https://.chargify.com/coupons/validate.?code=& product_family_id= ``` - - Args: + + Args: code (str): The code of the coupon product_family_id (int, optional): The Advanced Billing id of the product family to which the coupon belongs - - Returns: + + Returns: CouponResponse: Response from the API. OK - - Raises: + + Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. - + """ - return super().new_api_call_builder.request( - RequestBuilder().server(Server.PRODUCTION) - .path("/coupons/validate.json") - .http_method(HttpMethodEnum.GET) - .query_param(Parameter() - .key("code") - .value(code) - .is_required(True)) - .query_param(Parameter() - .key("product_family_id") - .value(product_family_id)) - .header_param(Parameter() - .key("accept") - .value("application/json")) - .auth(Single("BasicAuth")), - ).response( - ResponseHandler() - .deserializer(APIHelper.json_deserialize) - .deserialize_into(CouponResponse.from_dictionary) - .local_error_template("404", - "Not Found: '{$response.body}'", - SingleStringErrorResponseException), - ).execute() - - def create_or_update_coupon_currency_prices(self, - coupon_id, + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/coupons/validate.json") + .http_method(HttpMethodEnum.GET) + .query_param(Parameter() + .key("code") + .value(code) + .is_required(True)) + .query_param(Parameter() + .key("product_family_id") + .value(product_family_id)) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(CouponResponse.from_dictionary) + .local_error_template("404", + "Not Found: '{$response.body}'", + SingleStringErrorResponseException), + ).execute() + + def create_or_update_coupon_currency_prices(self, + coupon_id, body=None): - """Perform a PUT request to /coupons/{coupon_id}/currency_prices.json. - + """Perform a PUT request to /coupons/{coupon_id}/currency_prices.json. + Creates and/or updates currency prices for an existing coupon. Multiple prices can be created or updated in a single request but each of the currencies must be defined on the site level already and the coupon must be @@ -622,54 +607,54 @@ def create_or_update_coupon_currency_prices(self, Currency pricing for coupons must mirror the setup of the primary coupon pricing - if the primary coupon is percentage based, you will not be able to define pricing in non-primary currencies. - - Args: + + Args: coupon_id (int): The Advanced Billing id of the coupon body (CouponCurrencyRequest, optional): The request body parameter. - - Returns: + + Returns: CouponCurrencyResponse: Response from the API. OK - - Raises: + + Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. - + """ - return super().new_api_call_builder.request( - RequestBuilder().server(Server.PRODUCTION) - .path("/coupons/{coupon_id}/currency_prices.json") - .http_method(HttpMethodEnum.PUT) - .template_param(Parameter() - .key("coupon_id") - .value(coupon_id) - .is_required(True) - .should_encode(True)) - .header_param(Parameter() - .key("Content-Type") - .value("application/json")) - .body_param(Parameter() - .value(body)) - .header_param(Parameter() - .key("accept") - .value("application/json")) - .body_serializer(APIHelper.json_serialize) - .auth(Single("BasicAuth")), - ).response( - ResponseHandler() - .deserializer(APIHelper.json_deserialize) - .deserialize_into(CouponCurrencyResponse.from_dictionary) - .local_error_template("422", - "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" - "nse.body}'.", - ErrorStringMapResponseException), - ).execute() - - def create_coupon_subcodes(self, - coupon_id, + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/coupons/{coupon_id}/currency_prices.json") + .http_method(HttpMethodEnum.PUT) + .template_param(Parameter() + .key("coupon_id") + .value(coupon_id) + .is_required(True) + .should_encode(True)) + .header_param(Parameter() + .key("Content-Type") + .value("application/json")) + .body_param(Parameter() + .value(body)) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .body_serializer(APIHelper.json_serialize) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(CouponCurrencyResponse.from_dictionary) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorStringMapResponseException), + ).execute() + + def create_coupon_subcodes(self, + coupon_id, body=None): - """Perform a POST request to /coupons/{coupon_id}/codes.json. - + """Perform a POST request to /coupons/{coupon_id}/codes.json. + Creates subcodes for an existing coupon. ## Coupon Subcodes Intro Coupon Subcodes allow you to create a set of unique codes that allow you to @@ -708,53 +693,53 @@ def create_coupon_subcodes(self, . 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.` - - Args: + `https://.chargify.com/coupons/567/codes/20%25OFF.`. + + Args: coupon_id (int): The Advanced Billing id of the coupon body (CouponSubcodes, optional): The request body parameter. - - Returns: + + Returns: CouponSubcodesResponse: Response from the API. OK - - Raises: + + Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. - + """ - return super().new_api_call_builder.request( - RequestBuilder().server(Server.PRODUCTION) - .path("/coupons/{coupon_id}/codes.json") - .http_method(HttpMethodEnum.POST) - .template_param(Parameter() - .key("coupon_id") - .value(coupon_id) - .is_required(True) - .should_encode(True)) - .header_param(Parameter() - .key("Content-Type") - .value("application/json")) - .body_param(Parameter() - .value(body)) - .header_param(Parameter() - .key("accept") - .value("application/json")) - .body_serializer(APIHelper.json_serialize) - .auth(Single("BasicAuth")), - ).response( - ResponseHandler() - .deserializer(APIHelper.json_deserialize) - .deserialize_into(CouponSubcodesResponse.from_dictionary), - ).execute() - - def list_coupon_subcodes(self, + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/coupons/{coupon_id}/codes.json") + .http_method(HttpMethodEnum.POST) + .template_param(Parameter() + .key("coupon_id") + .value(coupon_id) + .is_required(True) + .should_encode(True)) + .header_param(Parameter() + .key("Content-Type") + .value("application/json")) + .body_param(Parameter() + .value(body)) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .body_serializer(APIHelper.json_serialize) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(CouponSubcodesResponse.from_dictionary), + ).execute() + + def list_coupon_subcodes(self, options=dict()): - """Perform a GET request to /coupons/{coupon_id}/codes.json. - + """Perform a GET request to /coupons/{coupon_id}/codes.json. + Lists the subcodes attached to a coupon. - - Args: + + Args: options (dict, optional): Key-value pairs for any of the parameters to this API Endpoint. All parameters to the endpoint are supplied through the dictionary with their names being the key and their @@ -773,46 +758,46 @@ def list_coupon_subcodes(self, 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`. - - Returns: + + Returns: CouponSubcodes: Response from the API. OK - - Raises: + + Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. - + """ - return super().new_api_call_builder.request( - RequestBuilder().server(Server.PRODUCTION) - .path("/coupons/{coupon_id}/codes.json") - .http_method(HttpMethodEnum.GET) - .template_param(Parameter() - .key("coupon_id") - .value(options.get("coupon_id", None)) - .is_required(True) - .should_encode(True)) - .query_param(Parameter() - .key("page") - .value(options.get("page", None))) - .query_param(Parameter() - .key("per_page") - .value(options.get("per_page", None))) - .header_param(Parameter() - .key("accept") - .value("application/json")) - .auth(Single("BasicAuth")), - ).response( - ResponseHandler() - .deserializer(APIHelper.json_deserialize) - .deserialize_into(CouponSubcodes.from_dictionary), - ).execute() - - def update_coupon_subcodes(self, - coupon_id, + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/coupons/{coupon_id}/codes.json") + .http_method(HttpMethodEnum.GET) + .template_param(Parameter() + .key("coupon_id") + .value(options.get("coupon_id", None)) + .is_required(True) + .should_encode(True)) + .query_param(Parameter() + .key("page") + .value(options.get("page", None))) + .query_param(Parameter() + .key("per_page") + .value(options.get("per_page", None))) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(CouponSubcodes.from_dictionary), + ).execute() + + def update_coupon_subcodes(self, + coupon_id, body=None): - """Perform a PUT request to /coupons/{coupon_id}/codes.json. - + """Perform a PUT request to /coupons/{coupon_id}/codes.json. + Updates the subcodes for a coupon, replacing all existing subcodes with the new list. Send an array of new coupon subcodes. @@ -822,51 +807,51 @@ def update_coupon_subcodes(self, + The created subcodes, + Subcodes that were not created because they already exist, + Any subcodes not created because they are invalid. - - Args: + + Args: coupon_id (int): The Advanced Billing id of the coupon body (CouponSubcodes, optional): The request body parameter. - - Returns: + + Returns: CouponSubcodesResponse: Response from the API. OK - - Raises: + + Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. - + """ - return super().new_api_call_builder.request( - RequestBuilder().server(Server.PRODUCTION) - .path("/coupons/{coupon_id}/codes.json") - .http_method(HttpMethodEnum.PUT) - .template_param(Parameter() - .key("coupon_id") - .value(coupon_id) - .is_required(True) - .should_encode(True)) - .header_param(Parameter() - .key("Content-Type") - .value("application/json")) - .body_param(Parameter() - .value(body)) - .header_param(Parameter() - .key("accept") - .value("application/json")) - .body_serializer(APIHelper.json_serialize) - .auth(Single("BasicAuth")), - ).response( - ResponseHandler() - .deserializer(APIHelper.json_deserialize) - .deserialize_into(CouponSubcodesResponse.from_dictionary), - ).execute() - - def delete_coupon_subcode(self, - coupon_id, + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/coupons/{coupon_id}/codes.json") + .http_method(HttpMethodEnum.PUT) + .template_param(Parameter() + .key("coupon_id") + .value(coupon_id) + .is_required(True) + .should_encode(True)) + .header_param(Parameter() + .key("Content-Type") + .value("application/json")) + .body_param(Parameter() + .value(body)) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .body_serializer(APIHelper.json_serialize) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(CouponSubcodesResponse.from_dictionary), + ).execute() + + def delete_coupon_subcode(self, + coupon_id, subcode): - """Perform a DELETE request to - /coupons/{coupon_id}/codes/{subcode}.json. - + """Perform a DELETE request to + /coupons/{coupon_id}/codes/{subcode}.json. + Deletes a specific subcode from a coupon. ## Example Given a coupon with an ID of 567, and a coupon subcode of 20OFF, the URL to @@ -887,35 +872,35 @@ def delete_coupon_subcode(self, ## 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. - - Args: + @https://.chargify.com/coupons/567/codes/20%25OFF.. + + Args: coupon_id (int): The Advanced Billing id of the coupon to which the subcode belongs subcode (str): The subcode of the coupon - - Returns: + + Returns: void: Response from the API. OK - - Raises: + + Raises: APIException: When an error occurs while fetching the data from the remote API. This exception includes the HTTP Response code, an error message, and the HTTP body that was received in the request. - + """ - return super().new_api_call_builder.request( - RequestBuilder().server(Server.PRODUCTION) - .path("/coupons/{coupon_id}/codes/{subcode}.json") - .http_method(HttpMethodEnum.DELETE) - .template_param(Parameter() - .key("coupon_id") - .value(coupon_id) - .is_required(True) - .should_encode(True)) - .template_param(Parameter() - .key("subcode") - .value(subcode) - .is_required(True) - .should_encode(True)) - .auth(Single("BasicAuth")), - ).execute() + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/coupons/{coupon_id}/codes/{subcode}.json") + .http_method(HttpMethodEnum.DELETE) + .template_param(Parameter() + .key("coupon_id") + .value(coupon_id) + .is_required(True) + .should_encode(True)) + .template_param(Parameter() + .key("subcode") + .value(subcode) + .is_required(True) + .should_encode(True)) + .auth(Single("BasicAuth")), + ).execute() diff --git a/advancedbilling/controllers/customers_controller.py b/advancedbilling/controllers/customers_controller.py index 86a07f44..014b6f81 100644 --- a/advancedbilling/controllers/customers_controller.py +++ b/advancedbilling/controllers/customers_controller.py @@ -391,6 +391,12 @@ def list_customer_subscriptions(self, /customers/{customer_id}/subscriptions.json. 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'. Args: customer_id (int): The Chargify id of the customer diff --git a/advancedbilling/controllers/events_controller.py b/advancedbilling/controllers/events_controller.py index bbe74a34..578d9ff0 100644 --- a/advancedbilling/controllers/events_controller.py +++ b/advancedbilling/controllers/events_controller.py @@ -48,10 +48,21 @@ def list_events(self, 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-Activit - y). + See the [Site + Activity](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Acti + vity) article in the product documentation for details on how to record view + Events / Site Activty in the Advanced Billing UI. + 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” ## 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 @@ -83,7 +94,7 @@ def list_events(self, "event": { "id": 351, "key": "subscription_product_change", - "message": "Product changed on Marky Mark's subscription from 'Basic' + "message": "Product changed on Mark Alan's subscription from 'Basic' to 'Pro'", "subscription_id": 205, "event_specific_data": { @@ -100,7 +111,7 @@ def list_events(self, "event": { "id": 353, "key": "subscription_state_change", - "message": "State changed on Marky Mark's subscription to Pro from + "message": "State changed on Mark Alan's subscription to Pro from trialing to active", "subscription_id": 205, "event_specific_data": { @@ -131,9 +142,9 @@ def list_events(self, allowed values is 200; any per_page value over 200 will be changed to 200. Use in query `per_page=200`. since_id -- int -- Returns events with an id greater than or - equal to the one specified + equal to the one specified. max_id -- int -- Returns events with an id less than or equal to - the one specified + the one specified. direction -- Direction -- The sort direction of the returned events. filter -- List[EventKey] -- You can pass multiple event keys @@ -228,6 +239,17 @@ def list_subscription_events(self, ## Event Key The event type is identified by the key property. You can check supported keys [here]($m/Event%20Key). + 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” ## Event Specific Data Different event types may include additional data in `event_specific_data` property. @@ -256,9 +278,9 @@ def list_subscription_events(self, allowed values is 200; any per_page value over 200 will be changed to 200. Use in query `per_page=200`. since_id -- int -- Returns events with an id greater than or - equal to the one specified + equal to the one specified. max_id -- int -- Returns events with an id less than or equal to - the one specified + the one specified. direction -- Direction -- The sort direction of the returned events. filter -- List[EventKey] -- You can pass multiple event keys @@ -317,6 +339,17 @@ def read_events_count(self, """Perform a GET request to /events/count.json. 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” Args: options (dict, optional): Key-value pairs for any of the parameters to @@ -337,9 +370,9 @@ def read_events_count(self, allowed values is 200; any per_page value over 200 will be changed to 200. Use in query `per_page=200`. since_id -- int -- Returns events with an id greater than or - equal to the one specified + equal to the one specified. max_id -- int -- Returns events with an id less than or equal to - the one specified + the one specified. direction -- Direction -- The sort direction of the returned events. filter -- List[EventKey] -- You can pass multiple event keys diff --git a/advancedbilling/controllers/insights_controller.py b/advancedbilling/controllers/insights_controller.py index b1898edf..104c5f14 100644 --- a/advancedbilling/controllers/insights_controller.py +++ b/advancedbilling/controllers/insights_controller.py @@ -94,9 +94,9 @@ def read_mrr(self, Args: at_time (datetime, optional): submit a timestamp in ISO8601 format to - request MRR for a historic time + request MRR for a historic time. subscription_id (int, optional): submit the id of a subscription in order - to limit results + to limit results. Returns: MRRResponse: Response from the API. OK @@ -163,8 +163,8 @@ def list_mrr_movements(self, through the dictionary with their names being the key and their desired values being the value. A list of parameters that can be used are:: - subscription_id -- int -- optionally filter results by - subscription + subscription_id -- int -- (Optional) Filter results by + subscription. page -- int -- 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 @@ -220,8 +220,8 @@ def list_mrr_per_subscription(self, options=dict()): """Perform a GET request to /subscriptions_mrr.json. - 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. Args: options (dict, optional): Key-value pairs for any of the parameters to diff --git a/advancedbilling/controllers/invoices_controller.py b/advancedbilling/controllers/invoices_controller.py index 0c19f35c..8090f839 100644 --- a/advancedbilling/controllers/invoices_controller.py +++ b/advancedbilling/controllers/invoices_controller.py @@ -74,7 +74,7 @@ def refund_invoice(self, body=None): """Perform a POST request to /invoices/{uid}/refunds.json. - 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. @@ -129,10 +129,11 @@ def list_invoices(self, options=dict()): """Perform a GET request to /invoices.json. - 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`. Args: options (dict, optional): Key-value pairs for any of the parameters to @@ -172,13 +173,13 @@ def list_invoices(self, changed to 200. Use in query `per_page=200`. direction -- Direction -- The sort direction of the returned invoices. - line_items -- bool -- Include line items data - discounts -- bool -- Include discounts data - taxes -- bool -- Include taxes data - credits -- bool -- Include credits data - payments -- bool -- Include payments data - custom_fields -- bool -- Include custom fields data - refunds -- bool -- Include refunds data + line_items -- bool -- Include line items data. + discounts -- bool -- Include discounts data. + taxes -- bool -- Include taxes data. + credits -- bool -- Include credits data. + payments -- bool -- Include payments data. + custom_fields -- bool -- Include custom fields data. + refunds -- bool -- Include refunds data. date_field -- InvoiceDateField -- The type of filter you would like to apply to your search. Use in query `date_field=issue_date`. @@ -306,7 +307,7 @@ def read_invoice(self, uid): """Perform a GET request to /invoices/{uid}.json. - 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: @@ -355,9 +356,9 @@ def list_invoice_events(self, options=dict()): """Perform a GET request to /invoices/events.json. - 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 @@ -517,8 +518,7 @@ def record_payment_for_multiple_invoices(self, body=None): """Perform a POST request to /invoices/payments.json. - 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. ``` @@ -585,8 +585,8 @@ def list_credit_notes(self, options=dict()): """Perform a GET request to /credit_notes.json. - 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 @@ -611,11 +611,11 @@ def list_credit_notes(self, 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`. - line_items -- bool -- Include line items data - discounts -- bool -- Include discounts data - taxes -- bool -- Include taxes data - refunds -- bool -- Include refunds data - applications -- bool -- Include applications data + line_items -- bool -- Include line items data. + discounts -- bool -- Include discounts data. + taxes -- bool -- Include taxes data. + refunds -- bool -- Include refunds data. + applications -- bool -- Include applications data. Returns: ListCreditNotesResponse: Response from the API. OK @@ -668,7 +668,7 @@ def read_credit_note(self, uid): """Perform a GET request to /credit_notes/{uid}.json. - Use this endpoint to retrieve the details for a credit note. + Returns the details for a credit note. Args: uid (str): The unique identifier of the credit note @@ -707,7 +707,7 @@ def record_payment_for_subscription(self, """Perform a POST request to /subscriptions/{subscription_id}/payments.json. - 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. @@ -762,10 +762,9 @@ def reopen_invoice(self, uid): """Perform a POST request to /invoices/{uid}/reopen.json. - 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: @@ -823,9 +822,9 @@ def void_invoice(self, body=None): """Perform a POST request to /invoices/{uid}/void.json. - 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. Args: uid (str): The unique identifier for the invoice, this does not refer to @@ -875,9 +874,9 @@ def list_consolidated_invoice_segments(self, options=dict()): """Perform a GET request to /invoices/{invoice_uid}/segments.json. - 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`. Args: options (dict, optional): Key-value pairs for any of the parameters to @@ -944,7 +943,7 @@ def create_invoice(self, """Perform a POST request to /subscriptions/{subscription_id}/invoices.json. - 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 and @@ -1187,16 +1186,163 @@ def create_invoice(self, ErrorArrayMapResponseException), ).execute() + def update_invoice(self, + subscription_id, + uid, + body=None): + """Perform a PUT request to + /subscriptions/{subscription_id}/invoices/{uid}.json. + + 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. + + Args: + subscription_id (int): The Chargify id of the subscription. + uid (str): The unique identifier for the invoice, this does not refer to + the public facing invoice number. + body (UpdateInvoiceRequest, optional): The request body parameter. + + Returns: + InvoiceResponse: Response from the API. OK + + Raises: + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + + """ + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/subscriptions/{subscription_id}/invoices/{uid}.json") + .http_method(HttpMethodEnum.PUT) + .template_param(Parameter() + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) + .template_param(Parameter() + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) + .header_param(Parameter() + .key("Content-Type") + .value("application/json")) + .body_param(Parameter() + .value(body)) + .header_param(Parameter() + .key("accept") + .value("application/json")) + .body_serializer(APIHelper.json_serialize) + .auth(Single("BasicAuth")), + ).response( + ResponseHandler() + .deserializer(APIHelper.json_deserialize) + .deserialize_into(InvoiceResponse.from_dictionary) + .local_error_template("404", + "Not Found:'{$response.body}'", + ErrorListResponseException) + .local_error_template("422", + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$respo" + "nse.body}'.", + ErrorArrayMapResponseException), + ).execute() + + def delete_invoice(self, + subscription_id, + uid): + """Perform a DELETE request to + /subscriptions/{subscription_id}/invoices/{uid}.json. + + 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. + + Args: + subscription_id (int): The Chargify id of the subscription. + uid (str): The unique identifier for the invoice, this does not refer to + the public facing invoice number. + + Returns: + void: Response from the API. No Content + + Raises: + APIException: When an error occurs while fetching the data from the + remote API. This exception includes the HTTP Response code, an error + message, and the HTTP body that was received in the request. + + """ + return super().new_api_call_builder.request( + RequestBuilder().server(Server.PRODUCTION) + .path("/subscriptions/{subscription_id}/invoices/{uid}.json") + .http_method(HttpMethodEnum.DELETE) + .template_param(Parameter() + .key("subscription_id") + .value(subscription_id) + .is_required(True) + .should_encode(True)) + .template_param(Parameter() + .key("uid") + .value(uid) + .is_required(True) + .should_encode(True)) + .auth(Single("BasicAuth")), + ).execute() + def send_invoice(self, uid, body=None): """Perform a POST request to /invoices/{uid}/deliveries.json. - 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` @@ -1248,6 +1394,7 @@ def preview_customer_information_changes(self, """Perform a POST request to /invoices/{uid}/customer_information/preview.json. + 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 @@ -1298,9 +1445,9 @@ def update_customer_information(self, uid): """Perform a PUT request to /invoices/{uid}/customer_information.json. - 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. @@ -1348,9 +1495,9 @@ def issue_invoice(self, body=None): """Perform a POST request to /invoices/{uid}/issue.json. - 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/advancedbilling/controllers/payment_profiles_controller.py b/advancedbilling/controllers/payment_profiles_controller.py index 80c258b3..c3ce7801 100644 --- a/advancedbilling/controllers/payment_profiles_controller.py +++ b/advancedbilling/controllers/payment_profiles_controller.py @@ -170,7 +170,7 @@ def list_payment_profiles(self, options=dict()): """Perform a GET request to /payment_profiles.json. - Returns all active payment profiles for a site, or for one customer within a + Lists 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. @@ -623,8 +623,8 @@ def change_subscription_group_default_payment_profile(self, /subscription_groups/{uid}/payment_profiles/{payment_profile_id}/change_payment _profile.json. - 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, @@ -675,8 +675,10 @@ def read_one_time_token(self, chargify_token): """Perform a GET request to /one_time_tokens/{chargify_token}.json. - 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. @@ -723,8 +725,8 @@ def send_request_update_payment_email(self, """Perform a POST request to /subscriptions/{subscription_id}/request_payment_profiles_update.json. - 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 diff --git a/advancedbilling/controllers/product_families_controller.py b/advancedbilling/controllers/product_families_controller.py index 8f8c47ba..8022f103 100644 --- a/advancedbilling/controllers/product_families_controller.py +++ b/advancedbilling/controllers/product_families_controller.py @@ -96,7 +96,7 @@ def list_products_for_product_family(self, 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 -- bool -- Include archived products + include_archived -- bool -- Include archived products. include -- ListProductsInclude -- Allows including additional data in the response. Use in query `include=prepaid_product_price_point`. @@ -214,7 +214,7 @@ def list_product_families(self, options=dict()): """Perform a GET request to /product_families.json. - Returns a list of Product Families for a site. + Lists Product Families for a site. Args: options (dict, optional): Key-value pairs for any of the parameters to diff --git a/advancedbilling/controllers/product_price_points_controller.py b/advancedbilling/controllers/product_price_points_controller.py index 4a23590f..97f0a6af 100644 --- a/advancedbilling/controllers/product_price_points_controller.py +++ b/advancedbilling/controllers/product_price_points_controller.py @@ -143,11 +143,10 @@ def list_product_price_points(self, 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. - currency_prices -- bool -- 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 + currency_prices -- bool -- (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. @@ -284,13 +283,12 @@ def read_product_price_point(self, 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. - currency_prices (bool, 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 (bool, 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. Returns: ProductPricePointResponse: Response from the API. OK diff --git a/advancedbilling/controllers/products_controller.py b/advancedbilling/controllers/products_controller.py index 78e1c042..17ffb659 100644 --- a/advancedbilling/controllers/products_controller.py +++ b/advancedbilling/controllers/products_controller.py @@ -45,6 +45,11 @@ def create_product(self, /product_families/{product_family_id}/products.json. Creates a product in your Advanced Billing site. + 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. See the following product documentation for more information: + [Products Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Prod diff --git a/advancedbilling/controllers/proforma_invoices_controller.py b/advancedbilling/controllers/proforma_invoices_controller.py index a3f781a5..cd2ef5b0 100644 --- a/advancedbilling/controllers/proforma_invoices_controller.py +++ b/advancedbilling/controllers/proforma_invoices_controller.py @@ -110,12 +110,12 @@ def list_subscription_group_proforma_invoices(self, desired values being the value. A list of parameters that can be used are:: uid -- str -- The uid of the subscription group - line_items -- bool -- Include line items data - discounts -- bool -- Include discounts data - taxes -- bool -- Include taxes data - credits -- bool -- Include credits data - payments -- bool -- Include payments data - custom_fields -- bool -- Include custom fields data + line_items -- bool -- Include line items data. + discounts -- bool -- Include discounts data. + taxes -- bool -- Include taxes data. + credits -- bool -- Include credits data. + payments -- bool -- Include payments data. + custom_fields -- bool -- Include custom fields data. Returns: ListProformaInvoicesResponse: Response from the API. OK @@ -291,12 +291,12 @@ def list_proforma_invoices(self, changed to 200. Use in query `per_page=200`. direction -- Direction -- The sort direction of the returned invoices. - line_items -- bool -- Include line items data - discounts -- bool -- Include discounts data - taxes -- bool -- Include taxes data - credits -- bool -- Include credits data - payments -- bool -- Include payments data - custom_fields -- bool -- Include custom fields data + line_items -- bool -- Include line items data. + discounts -- bool -- Include discounts data. + taxes -- bool -- Include taxes data. + credits -- bool -- Include credits data. + payments -- bool -- Include payments data. + custom_fields -- bool -- Include custom fields data. Returns: ListProformaInvoicesResponse: Response from the API. OK @@ -485,12 +485,11 @@ def preview_proforma_invoice(self, """Perform a POST request to /subscriptions/{subscription_id}/proforma_invoices/preview.json. - 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/advancedbilling/controllers/sales_commissions_controller.py b/advancedbilling/controllers/sales_commissions_controller.py index ed75cf38..8e7855d0 100644 --- a/advancedbilling/controllers/sales_commissions_controller.py +++ b/advancedbilling/controllers/sales_commissions_controller.py @@ -59,7 +59,7 @@ def list_sales_commission_settings(self, 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`. Args: options (dict, optional): Key-value pairs for any of the parameters to @@ -129,7 +129,7 @@ def list_sales_reps(self, options=dict()): """Perform a GET request to /sellers/{seller_id}/sales_reps.json. - 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 @@ -145,7 +145,7 @@ def list_sales_reps(self, 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`. Args: options (dict, optional): Key-value pairs for any of the parameters to @@ -237,7 +237,7 @@ def read_sales_rep(self, 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`. Args: seller_id (str): The Chargify id of your seller account diff --git a/advancedbilling/controllers/sites_controller.py b/advancedbilling/controllers/sites_controller.py index 6992c429..42eeab9c 100644 --- a/advancedbilling/controllers/sites_controller.py +++ b/advancedbilling/controllers/sites_controller.py @@ -52,7 +52,7 @@ def read_site(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) + -Hierarchies-WhoPays). Returns: SiteResponse: Response from the API. OK @@ -119,7 +119,7 @@ def list_chargify_js_public_keys(self, options=dict()): """Perform a GET request to /chargify_js_keys.json. - Returns public keys used for Maxio.js (formerly Chargify.js). + Lists public keys used for Maxio.js (formerly Chargify.js). Args: options (dict, optional): Key-value pairs for any of the parameters to diff --git a/advancedbilling/controllers/subscription_components_controller.py b/advancedbilling/controllers/subscription_components_controller.py index 5eff1456..dfb3f5ad 100644 --- a/advancedbilling/controllers/subscription_components_controller.py +++ b/advancedbilling/controllers/subscription_components_controller.py @@ -433,7 +433,7 @@ def list_allocations(self, """Perform a GET request to /subscriptions/{subscription_id}/components/{component_id}/allocations.json. - 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. @@ -895,8 +895,8 @@ def list_usages(self, /subscriptions/{subscription_id_or_reference}/components/{component_id}/usages. json. - Returns a list of usages associated with a subscription for a particular - metered component. This will display the previously recorded components for a + 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 @@ -929,9 +929,9 @@ def list_usages(self, component_id -- int | str -- Either the Advanced Billing id for the component or the component's handle prefixed by `handle:` since_id -- int -- Returns usages with an id greater than or - equal to the one specified + equal to the one specified. max_id -- int -- Returns usages with an id less than or equal to - the one specified + the one specified. since_date -- date -- Returns usages with a created_at date greater than or equal to midnight (12:00 AM) on the date specified. @@ -1136,7 +1136,8 @@ def record_event(self, published. store_uid (str, optional): If you've attached your own Keen project as an Advanced Billing event data-store, use this parameter to indicate the - data-store. + data-store. This applies to Legacy Metering sites only — it has no + effect on Maxio Metering sites. body (EBBEvent, optional): The request body parameter. Returns: @@ -1187,7 +1188,8 @@ def bulk_record_events(self, published. store_uid (str, optional): If you've attached your own Keen project as an Advanced Billing event data-store, use this parameter to indicate the - data-store. + data-store. This applies to Legacy Metering sites only — it has no + effect on Maxio Metering sites. body (List[EBBEvent], optional): The request body parameter. Returns: diff --git a/advancedbilling/controllers/subscription_groups_controller.py b/advancedbilling/controllers/subscription_groups_controller.py index 8aa2b91a..bbc248b4 100644 --- a/advancedbilling/controllers/subscription_groups_controller.py +++ b/advancedbilling/controllers/subscription_groups_controller.py @@ -164,8 +164,8 @@ def list_subscription_groups(self, options=dict()): """Perform a GET request to /subscription_groups.json. - 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` @@ -416,7 +416,8 @@ def add_subscription_to_group(self, """Perform a POST request to /subscriptions/{subscription_id}/group.json. - 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-Advanced-B illing-Invoices-Overview) and [Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer @@ -490,7 +491,8 @@ def remove_subscription_from_group(self, """Perform a DELETE request to /subscriptions/{subscription_id}/group.json. - 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-Advanced-B illing-Invoices-Overview) and [Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer diff --git a/advancedbilling/controllers/subscription_renewals_controller.py b/advancedbilling/controllers/subscription_renewals_controller.py index fed8d38f..0ebd2cd6 100644 --- a/advancedbilling/controllers/subscription_renewals_controller.py +++ b/advancedbilling/controllers/subscription_renewals_controller.py @@ -351,7 +351,7 @@ def unpublish_scheduled_renewal_configuration(self, """Perform a PUT request to /subscriptions/{subscription_id}/scheduled_renewals/{id}/unpublish.json. - Returns a scheduled renewal configuration to an editable state. + Restores a scheduled renewal configuration to an editable state. Args: subscription_id (int): The Chargify id of the subscription. @@ -450,6 +450,12 @@ def create_scheduled_renewal_configuration_item(self, ration_id}/configuration_items.json. 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. Args: subscription_id (int): The Chargify id of the subscription. @@ -510,6 +516,12 @@ def update_scheduled_renewal_configuration_item(self, ration_id}/configuration_items/{id}.json. 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. Args: subscription_id (int): The Chargify id of the subscription. diff --git a/advancedbilling/controllers/subscriptions_controller.py b/advancedbilling/controllers/subscriptions_controller.py index 7f73e291..5274f6f4 100644 --- a/advancedbilling/controllers/subscriptions_controller.py +++ b/advancedbilling/controllers/subscriptions_controller.py @@ -50,6 +50,9 @@ from advancedbilling.models.subscription_response import ( SubscriptionResponse, ) +from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, +) class SubscriptionsController(BaseController): @@ -72,6 +75,58 @@ def create_subscription(self, To create a new customer, pass customer_attributes. 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-Co + nfigure-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]($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. @@ -143,8 +198,14 @@ def list_subscriptions(self, options=dict()): """Perform a GET request to /subscriptions.json. - 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 Use the query strings below to search for a subscription using the criteria available. The return value will be an array. @@ -171,17 +232,32 @@ def list_subscriptions(self, 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`. + sort -- SubscriptionSort -- The attribute by which to sort + direction -- SortingDirection -- Controls the order in which + results are returned. Use in query `direction=asc`. state -- SubscriptionStateFilter -- The current state of the subscription - product -- int -- The product id of the subscription. (Note that - the product handle cannot be used.) + product -- int | str | None -- Filter subscriptions by product. + Accepts product ID or exact product name. Product handle is + not supported. + q -- str -- Search string. + q_scope -- QScope -- Scope of fields used by the q search. + customer_id -- int -- The Advanced Billing id of the customer. product_price_point_id -- int -- The ID of the product price - point. If supplied, product is required + point. If supplied, product is required. coupon -- int -- 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 -- str -- The coupon code currently applied to the subscription + collection_method -- CollectionMethod1 -- The collection method + for the subscription. + branding_theme_id -- int -- 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/4379689566209 + 3-Understand-Branding-Themes#understand-branding-themes-0-0) + for more information. date_field -- SubscriptionDateField -- The type of filter you'd like to apply to your search. Allowed Values: , current_period_ends_at, current_period_starts_at, created_at, @@ -215,9 +291,12 @@ def list_subscriptions(self, specified in the parameter. Use in query `metadata[my-field]=value&metadata[other-field]=another_value` . - direction -- SortingDirection -- Controls the order in which - results are returned. Use in query `direction=asc`. - sort -- SubscriptionSort -- The attribute by which to sort + group_status -- GroupStatus -- Filter by whether a subscription + is in a group. + dunning_exemption -- bool -- Filter by dunning exemption status. + payment_gateways -- str -- Comma-separated payment gateway + identifiers. + currencies -- str -- Comma-separated currency codes. include -- List[SubscriptionListInclude] -- Allows including additional data in the response. Use in query: `include[]=self_service_page_token`. @@ -241,12 +320,29 @@ def list_subscriptions(self, .query_param(Parameter() .key("per_page") .value(options.get("per_page", None))) + .query_param(Parameter() + .key("sort") + .value(options.get("sort", None))) + .query_param(Parameter() + .key("direction") + .value(options.get("direction", None))) .query_param(Parameter() .key("state") .value(options.get("state", None))) .query_param(Parameter() .key("product") - .value(options.get("product", None))) + .value(options.get("product", None)) + .validator(lambda value: UnionTypeLookUp + .get("ListSubscriptionsInputProduct").validate(value))) + .query_param(Parameter() + .key("q") + .value(options.get("q", None))) + .query_param(Parameter() + .key("q_scope") + .value(options.get("q_scope", None))) + .query_param(Parameter() + .key("customer_id") + .value(options.get("customer_id", None))) .query_param(Parameter() .key("product_price_point_id") .value(options.get("product_price_point_id", None))) @@ -256,6 +352,12 @@ def list_subscriptions(self, .query_param(Parameter() .key("coupon_code") .value(options.get("coupon_code", None))) + .query_param(Parameter() + .key("collection_method") + .value(options.get("collection_method", None))) + .query_param(Parameter() + .key("branding_theme_id") + .value(options.get("branding_theme_id", None))) .query_param(Parameter() .key("date_field") .value(options.get("date_field", None))) @@ -277,11 +379,17 @@ def list_subscriptions(self, .key("metadata") .value(options.get("metadata", None))) .query_param(Parameter() - .key("direction") - .value(options.get("direction", None))) + .key("group_status") + .value(options.get("group_status", None))) .query_param(Parameter() - .key("sort") - .value(options.get("sort", None))) + .key("dunning_exemption") + .value(options.get("dunning_exemption", None))) + .query_param(Parameter() + .key("payment_gateways") + .value(options.get("payment_gateways", None))) + .query_param(Parameter() + .key("currencies") + .value(options.get("currencies", None))) .query_param(Parameter() .key("include") .value(options.get("include", None))) @@ -364,10 +472,16 @@ def update_subscription(self, 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. + 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`. Args: subscription_id (int): The Chargify id of the subscription. @@ -417,6 +531,12 @@ def read_subscription(self, """Perform a GET request to /subscriptions/{subscription_id}.json. 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 @@ -696,6 +816,23 @@ def preview_subscription(self, For more information, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-I nterface-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: diff --git a/advancedbilling/controllers/webhooks_controller.py b/advancedbilling/controllers/webhooks_controller.py index 66855162..5b4fb39a 100644 --- a/advancedbilling/controllers/webhooks_controller.py +++ b/advancedbilling/controllers/webhooks_controller.py @@ -260,7 +260,7 @@ def create_endpoint(self, def list_endpoints(self): """Perform a GET request to /endpoints.json. - Returns created endpoints for a site. + Lists endpoints configured for a site. Returns: List[Endpoint]: Response from the API. OK diff --git a/advancedbilling/models/__init__.py b/advancedbilling/models/__init__.py index c5fb95cd..fd6621f4 100644 --- a/advancedbilling/models/__init__.py +++ b/advancedbilling/models/__init__.py @@ -80,6 +80,7 @@ "clone_component_price_point", "clone_component_price_point_request", "collection_method", + "collection_method_1", "component", "component_allocation_change", "component_allocation_error_item", @@ -235,10 +236,12 @@ "failed_payment_event_data", "first_charge_type", "full_subscription_group_response", + "get_one_time_token_bank_account_payment_profile", "get_one_time_token_payment_profile", "get_one_time_token_request", "group_billing", "group_settings", + "group_status", "group_target", "group_target_type", "group_type", @@ -326,13 +329,13 @@ "list_segments_filter", "list_segments_response", "list_service_credits_response", - "list_subcription_group_prepayment_item", "list_subscription_components_filter", "list_subscription_components_for_site_filter", "list_subscription_components_include", "list_subscription_components_response", "list_subscription_components_sort", "list_subscription_group_prepayment", + "list_subscription_group_prepayment_item", "list_subscription_group_prepayment_response", "list_subscription_groups_item", "list_subscription_groups_meta", @@ -422,6 +425,7 @@ "proration", "public_key", "public_signup_page", + "q_scope", "quantity_based_component", "reactivate_subscription_group_request", "reactivate_subscription_group_response", @@ -546,6 +550,7 @@ "subscription_preview", "subscription_preview_response", "subscription_product_change", + "subscription_product_change_scheduled", "subscription_product_migration", "subscription_product_migration_request", "subscription_purge_type", @@ -570,6 +575,9 @@ "update_currency_prices_request", "update_customer", "update_customer_request", + "update_invoice", + "update_invoice_item", + "update_invoice_request", "update_metadata", "update_metadata_request", "update_metafield", diff --git a/advancedbilling/models/account_balances.py b/advancedbilling/models/account_balances.py index 42072ea6..82c690a4 100644 --- a/advancedbilling/models/account_balances.py +++ b/advancedbilling/models/account_balances.py @@ -16,9 +16,9 @@ class AccountBalances(object): Attributes: open_invoices (AccountBalance): The balance, in cents, of the sum of the - subscription's open, payable invoices. + subscription's open, payable invoices. pending_invoices (AccountBalance): The balance, in cents, of the sum of the - subscription's pending, payable invoices. + subscription's pending, payable invoices. pending_discounts (AccountBalance): The balance, in cents, of the subscription's Pending Discount account. service_credits (AccountBalance): The balance, in cents, of the diff --git a/advancedbilling/models/activate_subscription_request.py b/advancedbilling/models/activate_subscription_request.py index 2540d75b..9ad5123b 100644 --- a/advancedbilling/models/activate_subscription_request.py +++ b/advancedbilling/models/activate_subscription_request.py @@ -14,9 +14,9 @@ class ActivateSubscriptionRequest(object): Attributes: revert_on_failure (bool): 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`) + 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`). additional_properties (Dict[str, object]): The additional properties for the model. diff --git a/advancedbilling/models/agreement_acceptance.py b/advancedbilling/models/agreement_acceptance.py index 5302afb0..b9039849 100644 --- a/advancedbilling/models/agreement_acceptance.py +++ b/advancedbilling/models/agreement_acceptance.py @@ -16,7 +16,7 @@ class AgreementAcceptance(object): Attributes: ip_address (str): Required when providing agreement acceptance params. terms_url (str): Required when creating a subscription with Maxio Payments. - Either terms_url or provacy_policy_url required when providing + Either terms_url or privacy_policy_url is required when providing agreement_acceptance params. privacy_policy_url (str): The model property of type str. return_refund_policy_url (str): The model property of type str. diff --git a/advancedbilling/models/all_vaults.py b/advancedbilling/models/all_vaults.py index 17c0b2bf..ce59a630 100644 --- a/advancedbilling/models/all_vaults.py +++ b/advancedbilling/models/all_vaults.py @@ -52,10 +52,10 @@ class AllVaults(object): """ - _all_values = ["adyen", "authorizenet", "beanstream", "blue_snap", - "bogus", "braintree1", "braintree_blue", "checkout", "cybersource", "elavon", - "eway", "eway_rapid", "eway_rapid_std", "firstdata", "forte", "gocardless", - "litle", "maxio_payments", "maxp", "moduslink", "moneris", "nmi", "orbital", + _all_values = ["adyen", "authorizenet", "beanstream", "blue_snap", "bogus", "braintree1", + "braintree_blue", "checkout", "cybersource", "elavon", "eway", "eway_rapid", + "eway_rapid_std", "firstdata", "forte", "gocardless", "litle", + "maxio_payments", "maxp", "moduslink", "moneris", "nmi", "orbital", "payment_express", "paymill", "paypal", "paypal_complete", "pin", "square", "stripe", "stripe_connect", "trust_commerce", "unipaas", "wirecard"] ADYEN = "adyen" diff --git a/advancedbilling/models/allocate_components.py b/advancedbilling/models/allocate_components.py index e82f55ad..5138c648 100644 --- a/advancedbilling/models/allocate_components.py +++ b/advancedbilling/models/allocate_components.py @@ -27,7 +27,7 @@ class AllocateComponents(object): upgrading/downgrading. Defaults to the component and then site setting if one is not provided. payment_collection_method (CollectionMethod): (Optional) If not passed, the - allocation(s) will use the payment collection method on the subscription + allocation(s) will use the payment collection method on the subscription. initiate_dunning (bool): 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. diff --git a/advancedbilling/models/allocation.py b/advancedbilling/models/allocation.py index 1858b211..17cc5edb 100644 --- a/advancedbilling/models/allocation.py +++ b/advancedbilling/models/allocation.py @@ -15,21 +15,21 @@ class Allocation(object): """Implementation of the 'Allocation' model. Attributes: - allocation_id (int): The allocation unique id + allocation_id (int): The allocation unique ID component_id (int): The integer component ID for the allocation. This - references a component that you have created in your Product setup + references a component that you have created in your Product setup. component_handle (str): The handle of the component. This references a - component that you have created in your Product setup + component that you have created in your Product setup. subscription_id (int): The integer subscription ID for the allocation. This - references a unique subscription in your Site - quantity (int | str | None): The allocated quantity set in to effect by the + references a unique subscription in your Site. + quantity (int | str | None): The allocated quantity set into effect by the allocation. String for components supporting fractional quantities previous_quantity (int | str | None): The allocated quantity that was in effect before this allocation was created. String for components supporting fractional quantities memo (str): The memo passed when the allocation was created - timestamp (datetime): The time that the allocation was recorded, in format - and UTC timezone, i.e. 2012-11-20T22:00:37Z + timestamp (datetime): The time that the allocation was recorded, in ISO 8601 + format and UTC timezone, e.g., 2012-11-20T22:00:37Z created_at (datetime): Timestamp indicating when this allocation was created proration_upgrade_scheme (str): The scheme used if the proration was an upgrade. This is only present when the allocation was created mid-period. @@ -39,9 +39,9 @@ class Allocation(object): price_point_id (int): The model property of type int. price_point_name (str): The model property of type str. price_point_handle (str): The model property of type str. - interval (int): 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 + interval (int): 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): A string representing the interval unit for this component price point, either month or day. This property is only diff --git a/advancedbilling/models/allocation_preview_item.py b/advancedbilling/models/allocation_preview_item.py index 09f47fea..65a7853d 100644 --- a/advancedbilling/models/allocation_preview_item.py +++ b/advancedbilling/models/allocation_preview_item.py @@ -29,9 +29,9 @@ class AllocationPreviewItem(object): upgrading/downgrading. Defaults to the component and then site setting if one is not provided. price_point_id (int): The model property of type int. - interval (int): 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 + interval (int): 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): A string representing the interval unit for this component price point, either month or day. This property is only diff --git a/advancedbilling/models/allocation_preview_line_item.py b/advancedbilling/models/allocation_preview_line_item.py index 8f720f98..f132f4aa 100644 --- a/advancedbilling/models/allocation_preview_line_item.py +++ b/advancedbilling/models/allocation_preview_line_item.py @@ -23,7 +23,7 @@ class AllocationPreviewLineItem(object): component_id (int): The model property of type int. component_handle (str): The model property of type str. direction (AllocationPreviewDirection): Visible when using Fine-grained - Component Control + Component Control. additional_properties (Dict[str, object]): The additional properties for the model. diff --git a/advancedbilling/models/apple_pay_payment_profile.py b/advancedbilling/models/apple_pay_payment_profile.py index d2f180b5..8921651e 100644 --- a/advancedbilling/models/apple_pay_payment_profile.py +++ b/advancedbilling/models/apple_pay_payment_profile.py @@ -18,7 +18,7 @@ class ApplePayPaymentProfile(object): id (int): The Chargify-assigned ID of the Apple Pay payment profile. first_name (str): The first name of the Apple Pay account holder last_name (str): The last name of the Apple Pay account holder - customer_id (int): The Chargify-assigned id for the customer record to which + customer_id (int): The Chargify-assigned ID for the customer record to which the Apple Pay account belongs current_vault (ApplePayVault): The vault that stores the payment profile with the provided vault_token. diff --git a/advancedbilling/models/apply_credit_note_event_data.py b/advancedbilling/models/apply_credit_note_event_data.py index d51f5fff..f2b731f7 100644 --- a/advancedbilling/models/apply_credit_note_event_data.py +++ b/advancedbilling/models/apply_credit_note_event_data.py @@ -32,7 +32,7 @@ class ApplyCreditNoteEventData(object): memo (str): The credit note memo. role (str): The role of the credit note (e.g. 'general') consolidated_invoice (bool): Shows whether it was applied to consolidated - invoice or not + invoice or not. applied_credit_notes (List[AppliedCreditNoteData]): List of credit notes applied to children invoices (if consolidated invoice) additional_properties (Dict[str, object]): The additional properties for the diff --git a/advancedbilling/models/bank_account_attributes.py b/advancedbilling/models/bank_account_attributes.py index 6312d8a8..005d2b77 100644 --- a/advancedbilling/models/bank_account_attributes.py +++ b/advancedbilling/models/bank_account_attributes.py @@ -15,18 +15,18 @@ class BankAccountAttributes(object): chargify_token (str): The model property of type str. bank_name (str): (Required when creating a subscription with ACH or GoCardless) The name of the bank where the customer’s account resides - bank_routing_number (str): (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 (str): (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 (str): (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): Defaults to checking bank_branch_code (str): (Optional when creating a subscription with - GoCardless) Branch code. Alternatively, an IBAN can be provided + GoCardless) Branch code. Alternatively, an IBAN can be provided. bank_iban (str): (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can - be provided + be provided. bank_account_holder_type (BankAccountHolderType): Defaults to personal payment_type (PaymentType): The model property of type PaymentType. current_vault (BankAccountVault): The vault that stores the payment profile diff --git a/advancedbilling/models/bank_account_payment_profile.py b/advancedbilling/models/bank_account_payment_profile.py index 6f2fc29d..c5e716e2 100644 --- a/advancedbilling/models/bank_account_payment_profile.py +++ b/advancedbilling/models/bank_account_payment_profile.py @@ -17,10 +17,10 @@ class BankAccountPaymentProfile(object): Attributes: id (int): 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 + in order to re-use a stored payment profile for the same customer. first_name (str): The first name of the bank account holder last_name (str): The last name of the bank account holder - customer_id (int): The Chargify-assigned id for the customer record to which + customer_id (int): The Chargify-assigned ID for the customer record to which the bank account belongs current_vault (BankAccountVault): The vault that stores the payment profile with the provided vault_token. Use `bogus` for testing. @@ -40,15 +40,12 @@ class BankAccountPaymentProfile(object): bank_name (str): The bank where the account resides masked_bank_routing_number (str): 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 (str): A string representation of the stored bank - account number with all but the last 4 digits marked with X's (i.e. - 'XXXXXXX1111') + 'XXXXXXX1111'). payment_type will be bank_account. bank_account_type (BankAccountType): Defaults to checking bank_account_holder_type (BankAccountHolderType): Defaults to personal payment_type (PaymentType): The model property of type PaymentType. - verified (bool): denotes whether a bank account has been verified by - providing the amounts of two small deposits made into the account + verified (bool): Denotes whether a bank account has been verified by + providing the amounts of two small deposits made into the account. site_gateway_setting_id (int): The model property of type int. gateway_handle (str): The model property of type str. created_at (datetime): A timestamp indicating when this payment profile was @@ -78,7 +75,6 @@ class BankAccountPaymentProfile(object): "billing_address_2": "billing_address_2", "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", "verified": "verified", @@ -104,7 +100,6 @@ class BankAccountPaymentProfile(object): "billing_address_2", "bank_name", "masked_bank_routing_number", - "masked_bank_account_number", "bank_account_type", "bank_account_holder_type", "verified", @@ -123,7 +118,6 @@ class BankAccountPaymentProfile(object): "customer_vault_token", "billing_address_2", "masked_bank_routing_number", - "masked_bank_account_number", "site_gateway_setting_id", "gateway_handle", ] @@ -146,7 +140,6 @@ def __init__( billing_address_2=APIHelper.SKIP, bank_name=APIHelper.SKIP, masked_bank_routing_number=APIHelper.SKIP, - masked_bank_account_number=APIHelper.SKIP, bank_account_type=APIHelper.SKIP, bank_account_holder_type=APIHelper.SKIP, verified=False, @@ -187,8 +180,6 @@ def __init__( self.bank_name = bank_name if masked_bank_routing_number is not APIHelper.SKIP: self.masked_bank_routing_number = masked_bank_routing_number - if masked_bank_account_number is not APIHelper.SKIP: - self.masked_bank_account_number = masked_bank_account_number if bank_account_type is not APIHelper.SKIP: self.bank_account_type = bank_account_type if bank_account_holder_type is not APIHelper.SKIP: @@ -297,10 +288,6 @@ def from_dictionary(cls, dictionary.get("masked_bank_routing_number")\ if "masked_bank_routing_number" in dictionary.keys()\ else APIHelper.SKIP - masked_bank_account_number =\ - dictionary.get("masked_bank_account_number")\ - if "masked_bank_account_number" in dictionary.keys()\ - else APIHelper.SKIP bank_account_type =\ dictionary.get("bank_account_type")\ if dictionary.get("bank_account_type")\ @@ -349,7 +336,6 @@ def from_dictionary(cls, billing_address_2, bank_name, masked_bank_routing_number, - masked_bank_account_number, bank_account_type, bank_account_holder_type, verified, @@ -463,11 +449,6 @@ def __repr__(self): if hasattr(self, "masked_bank_routing_number") else None ) - _masked_bank_account_number=( - self.masked_bank_account_number - if hasattr(self, "masked_bank_account_number") - else None - ) _bank_account_type=( self.bank_account_type if hasattr(self, "bank_account_type") @@ -522,7 +503,6 @@ def __repr__(self): f"billing_address_2={_billing_address_2!r}, " f"bank_name={_bank_name!r}, " f"masked_bank_routing_number={_masked_bank_routing_number!r}, " - f"masked_bank_account_number={_masked_bank_account_number!r}, " f"bank_account_type={_bank_account_type!r}, " f"bank_account_holder_type={_bank_account_holder_type!r}, " f"payment_type={_payment_type!r}, " @@ -612,11 +592,6 @@ def __str__(self): if hasattr(self, "masked_bank_routing_number") else None ) - _masked_bank_account_number=( - self.masked_bank_account_number - if hasattr(self, "masked_bank_account_number") - else None - ) _bank_account_type=( self.bank_account_type if hasattr(self, "bank_account_type") @@ -671,7 +646,6 @@ def __str__(self): f"billing_address_2={_billing_address_2!s}, " f"bank_name={_bank_name!s}, " f"masked_bank_routing_number={_masked_bank_routing_number!s}, " - f"masked_bank_account_number={_masked_bank_account_number!s}, " f"bank_account_type={_bank_account_type!s}, " f"bank_account_holder_type={_bank_account_holder_type!s}, " f"payment_type={_payment_type!s}, " diff --git a/advancedbilling/models/bank_account_vault.py b/advancedbilling/models/bank_account_vault.py index d09cdbc1..0d72b24d 100644 --- a/advancedbilling/models/bank_account_vault.py +++ b/advancedbilling/models/bank_account_vault.py @@ -26,8 +26,8 @@ class BankAccountVault(object): """ - _all_values = ["authorizenet", "blue_snap", "bogus", "forte", - "gocardless", "maxio_payments", "maxp", "stripe_connect"] + _all_values = ["authorizenet", "blue_snap", "bogus", "forte", "gocardless", "maxio_payments", + "maxp", "stripe_connect"] AUTHORIZENET = "authorizenet" BLUE_SNAP = "blue_snap" diff --git a/advancedbilling/models/calendar_billing.py b/advancedbilling/models/calendar_billing.py index 1284e7b0..85680d2c 100644 --- a/advancedbilling/models/calendar_billing.py +++ b/advancedbilling/models/calendar_billing.py @@ -11,7 +11,7 @@ class CalendarBilling(object): """Implementation of the 'Calendar Billing' model. - (Optional). Cannot be used when also specifying next_billing_at + (Optional). Cannot be used when also specifying next_billing_at. Attributes: snap_day (int | str | None): A day of month that subscription will be diff --git a/advancedbilling/models/cancellation_options.py b/advancedbilling/models/cancellation_options.py index 650bd2f6..0e5b9b99 100644 --- a/advancedbilling/models/cancellation_options.py +++ b/advancedbilling/models/cancellation_options.py @@ -21,9 +21,9 @@ class CancellationOptions(object): 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): 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. + 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 (bool): 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 diff --git a/advancedbilling/models/card_type.py b/advancedbilling/models/card_type.py index 9f9d10dd..c8006529 100644 --- a/advancedbilling/models/card_type.py +++ b/advancedbilling/models/card_type.py @@ -53,12 +53,12 @@ class CardType(object): """ - _all_values = ["visa", "master", "elo", "cabal", "alelo", "discover", - "american_express", "naranja", "diners_club", "jcb", "dankort", "maestro", - "maestro_no_luhn", "forbrugsforeningen", "sodexo", "alia", "vr", "unionpay", - "carnet", "cartes_bancaires", "olimpica", "creditel", "confiable", - "synchrony", "routex", "mada", "bp_plus", "passcard", "edenred", "anda", - "tarjeta-d", "hipercard", "bogus", "switch", "solo", "laser"] + _all_values = ["visa", "master", "elo", "cabal", "alelo", "discover", "american_express", + "naranja", "diners_club", "jcb", "dankort", "maestro", "maestro_no_luhn", + "forbrugsforeningen", "sodexo", "alia", "vr", "unionpay", "carnet", + "cartes_bancaires", "olimpica", "creditel", "confiable", "synchrony", "routex", + "mada", "bp_plus", "passcard", "edenred", "anda", "tarjeta-d", "hipercard", + "bogus", "switch", "solo", "laser"] VISA = "visa" MASTER = "master" diff --git a/advancedbilling/models/chargify_ebb.py b/advancedbilling/models/chargify_ebb.py index 70fad524..eac05734 100644 --- a/advancedbilling/models/chargify_ebb.py +++ b/advancedbilling/models/chargify_ebb.py @@ -25,11 +25,11 @@ class ChargifyEBB(object): events within a stream will be silently ignored. Tokens expire after 31 days. subscription_id (int): Id of Maxio Advanced Billing Subscription which is - connected to this event. Provide `subscription_id` if you configured + connected to this event. Provide `subscription_id` if you configured `chargify.subscription_id` as Subscription Identifier in your Event Stream. subscription_reference (str): Reference of Maxio Advanced Billing - Subscription which is connected to this event. Provide + Subscription which is connected to this event. Provide `subscription_reference` if you configured `chargify.subscription_reference` as Subscription Identifier in your Event Stream. diff --git a/advancedbilling/models/collection_method_1.py b/advancedbilling/models/collection_method_1.py new file mode 100644 index 00000000..a06bd230 --- /dev/null +++ b/advancedbilling/models/collection_method_1.py @@ -0,0 +1,49 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 + +class CollectionMethod1(object): + """Implementation of the 'collection_method1' enum. + + Attributes: + AUTOMATIC: The enum member of type str. + REMITTANCE: The enum member of type str. + PREPAID: The enum member of type str. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + AUTOMATIC = "automatic" + + REMITTANCE = "remittance" + + PREPAID = "prepaid" + + @classmethod + def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" + if value is None: + return default + + # If numeric and matches directly + if isinstance(value, int): + for name, val in cls.__dict__.items(): + if not name.startswith("_") and val == value: + return val + + # If string, perform case-insensitive match + if isinstance(value, str): + value_lower = value.lower() + for name, val in cls.__dict__.items(): + if not name.startswith("_") and ( + name.lower() == value_lower or str(val).lower() == value_lower + ): + return val + + # Fallback to default + return default diff --git a/advancedbilling/models/component.py b/advancedbilling/models/component.py index b9920f1f..fc43a438 100644 --- a/advancedbilling/models/component.py +++ b/advancedbilling/models/component.py @@ -18,11 +18,11 @@ class Component(object): id (int): The unique ID assigned to the component by Chargify. This ID can be used to fetch the component from the API. name (str): The name of the Component, suitable for display on statements. - i.e. Text Messages. + e.g., Text Messages. handle (str): The component API handle pricing_scheme (PricingScheme): The model property of type PricingScheme. unit_name (str): The name of the unit that the component’s usage is measured - in. i.e. message + in. e.g., message unit_price (str): The amount the customer will be charged per unit. This field is only populated for ‘per_unit’ pricing schemes, otherwise it may be null. @@ -32,7 +32,7 @@ class Component(object): Component belongs product_family_handle (str): The handle of the Product Family to which the Component belongs - price_per_unit_in_cents (int): deprecated - use unit_price instead + price_per_unit_in_cents (int): deprecated - use unit_price instead. kind (ComponentKind): A handle for the component type archived (bool): Boolean flag describing whether a component is archived or not. @@ -72,13 +72,17 @@ class Component(object): event_based_billing_metric_id (int): (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 (int): 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 (int): 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): 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 (str): (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. additional_properties (Dict[str, object]): The additional properties for the model. @@ -121,6 +125,7 @@ class Component(object): "event_based_billing_metric_id": "event_based_billing_metric_id", "interval": "interval", "interval_unit": "interval_unit", + "unspsc_code": "unspsc_code", } _optionals = [ @@ -159,6 +164,7 @@ class Component(object): "event_based_billing_metric_id", "interval", "interval_unit", + "unspsc_code", ] _nullables = [ @@ -179,6 +185,7 @@ class Component(object): "use_site_exchange_rate", "accounting_code", "interval_unit", + "unspsc_code", ] def __init__( @@ -218,6 +225,7 @@ def __init__( event_based_billing_metric_id=APIHelper.SKIP, interval=APIHelper.SKIP, interval_unit=APIHelper.SKIP, + unspsc_code=APIHelper.SKIP, additional_properties=None): """Initialize a Component instance.""" # Initialize members of the class @@ -300,6 +308,8 @@ def __init__( self.interval = interval if interval_unit is not APIHelper.SKIP: self.interval_unit = interval_unit + if unspsc_code is not APIHelper.SKIP: + self.unspsc_code = unspsc_code # Add additional model properties to the instance if additional_properties is None: @@ -471,6 +481,10 @@ def from_dictionary(cls, dictionary.get("interval_unit")\ if "interval_unit" in dictionary.keys()\ else APIHelper.SKIP + unspsc_code =\ + dictionary.get("unspsc_code")\ + if "unspsc_code" in dictionary.keys()\ + else APIHelper.SKIP # Clean out expected properties from dictionary additional_properties =\ @@ -512,6 +526,7 @@ def from_dictionary(cls, event_based_billing_metric_id, interval, interval_unit, + unspsc_code, additional_properties) def __repr__(self): @@ -691,6 +706,11 @@ def __repr__(self): if hasattr(self, "interval_unit") else None ) + _unspsc_code=( + self.unspsc_code + if hasattr(self, "unspsc_code") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -729,6 +749,7 @@ def __repr__(self): f"event_based_billing_metric_id={_event_based_billing_metric_id!r}, " f"interval={_interval!r}, " f"interval_unit={_interval_unit!r}, " + f"unspsc_code={_unspsc_code!r}, " f"additional_properties={_additional_properties!r}, " f")" ) @@ -910,6 +931,11 @@ def __str__(self): if hasattr(self, "interval_unit") else None ) + _unspsc_code=( + self.unspsc_code + if hasattr(self, "unspsc_code") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -948,6 +974,7 @@ def __str__(self): f"event_based_billing_metric_id={_event_based_billing_metric_id!s}, " f"interval={_interval!s}, " f"interval_unit={_interval_unit!s}, " + f"unspsc_code={_unspsc_code!s}, " f"additional_properties={_additional_properties!s}, " f")" ) diff --git a/advancedbilling/models/component_custom_price.py b/advancedbilling/models/component_custom_price.py index 522961fb..5eb4d6e8 100644 --- a/advancedbilling/models/component_custom_price.py +++ b/advancedbilling/models/component_custom_price.py @@ -17,15 +17,15 @@ class ComponentCustomPrice(object): Attributes: tax_included (bool): Whether or not the price point includes tax - pricing_scheme (PricingScheme): Omit for On/Off components - interval (int): 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 + pricing_scheme (PricingScheme): Omit for On/Off components. + interval (int): 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): 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 (int): Optional id of the price point to use for list + list_price_point_id (int): (Optional) Id of the price point to use for list price calculations when overriding the customer price. use_default_list_price (bool): When true, list price calculations will continue to use the default price point even when a `custom_price` is diff --git a/advancedbilling/models/component_kind.py b/advancedbilling/models/component_kind.py index 985fc1aa..3ebc5e6e 100644 --- a/advancedbilling/models/component_kind.py +++ b/advancedbilling/models/component_kind.py @@ -22,8 +22,8 @@ class ComponentKind(object): """ - _all_values = ["metered_component", "quantity_based_component", - "on_off_component", "prepaid_usage_component", "event_based_component"] + _all_values = ["metered_component", "quantity_based_component", "on_off_component", + "prepaid_usage_component", "event_based_component"] METERED_COMPONENT = "metered_component" QUANTITY_BASED_COMPONENT = "quantity_based_component" diff --git a/advancedbilling/models/component_price_point.py b/advancedbilling/models/component_price_point.py index 081ee30c..79317d5b 100644 --- a/advancedbilling/models/component_price_point.py +++ b/advancedbilling/models/component_price_point.py @@ -24,7 +24,7 @@ class ComponentPricePoint(object): 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 (bool): Note: Refer to type attribute instead + default (bool): Note: Refer to type attribute instead. name (str): The model property of type str. pricing_scheme (PricingScheme): The identifier for the pricing scheme. See [Product @@ -44,9 +44,9 @@ class ComponentPricePoint(object): point's type is `custom`) The id of the subscription that the custom price point is for. tax_included (bool): The model property of type bool. - interval (int): 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 + interval (int): 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): A string representing the interval unit for this component price point, either month or day. This property is only diff --git a/advancedbilling/models/component_price_point_item.py b/advancedbilling/models/component_price_point_item.py index bc2654a4..a1474e21 100644 --- a/advancedbilling/models/component_price_point_item.py +++ b/advancedbilling/models/component_price_point_item.py @@ -19,9 +19,9 @@ class ComponentPricePointItem(object): [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. - interval (int): 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 + interval (int): 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): A string representing the interval unit for this component price point, either month or day. This property is only diff --git a/advancedbilling/models/coupon_payload.py b/advancedbilling/models/coupon_payload.py index 15782e62..9710bdeb 100644 --- a/advancedbilling/models/coupon_payload.py +++ b/advancedbilling/models/coupon_payload.py @@ -19,14 +19,14 @@ class CouponPayload(object): code (str): 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 “.”. description (str): 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 (str | float | None): Required when creating a new percentage - coupon. Can't be used together with amount_in_cents. Percentage discount + coupon. Can't be used together with amount_in_cents. Percentage discount. amount_in_cents (int): Required when creating a new flat amount coupon. Can't - be used together with percentage. Flat USD discount + be used together with percentage. Flat USD discount. allow_negative_balance (bool): If set to true, discount is not limited (credits will carry forward to next billing). Can't be used together with restrictions. diff --git a/advancedbilling/models/coupon_request.py b/advancedbilling/models/coupon_request.py index 086bd7c3..3dbe4106 100644 --- a/advancedbilling/models/coupon_request.py +++ b/advancedbilling/models/coupon_request.py @@ -18,10 +18,10 @@ class CouponRequest(object): coupon (CouponPayload): The model property of type CouponPayload. restricted_products (Dict[str, bool]): 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 + indicating if the coupon should be applicable to the product. restricted_components (Dict[str, bool]): 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 + booleans indicating if the coupon should be applicable to the component. additional_properties (Dict[str, object]): The additional properties for the model. diff --git a/advancedbilling/models/coupon_usage.py b/advancedbilling/models/coupon_usage.py index 9275883b..098f7f1e 100644 --- a/advancedbilling/models/coupon_usage.py +++ b/advancedbilling/models/coupon_usage.py @@ -18,10 +18,10 @@ class CouponUsage(object): savings (int): Dollar amount of customer savings as a result of the coupon. savings_in_cents (int): Dollar amount of customer savings as a result of the coupon. - revenue (int): Total revenue of the all subscriptions that have received a + revenue (int): Total revenue of all subscriptions that have received a discount from this coupon. - revenue_in_cents (int): Total revenue of the all subscriptions that have - received a discount from this coupon. + revenue_in_cents (int): Total revenue of all subscriptions that have received + a discount from this coupon. additional_properties (Dict[str, object]): The additional properties for the model. diff --git a/advancedbilling/models/create_allocation.py b/advancedbilling/models/create_allocation.py index 935cc60b..f0ad394d 100644 --- a/advancedbilling/models/create_allocation.py +++ b/advancedbilling/models/create_allocation.py @@ -21,7 +21,7 @@ class CreateAllocation(object): quantity (float): 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. + For On/Off components, use 1 for on and 0 for off. decimal_quantity (str): Decimal representation of the allocated quantity. Only valid when decimal allocations are enabled for the component. previous_quantity (float): The quantity that was in effect before this diff --git a/advancedbilling/models/create_component_price_point.py b/advancedbilling/models/create_component_price_point.py index 92a7d9f1..b4461716 100644 --- a/advancedbilling/models/create_component_price_point.py +++ b/advancedbilling/models/create_component_price_point.py @@ -29,10 +29,10 @@ class CreateComponentPricePoint(object): bulk. tax_included (bool): Whether or not the price point includes tax. Setting not supported when creating price points in bulk. - interval (int): 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 (int): 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): A string representing the interval unit for this price point, either month or day. This property is only available for sites with Multifrequency enabled. diff --git a/advancedbilling/models/create_customer.py b/advancedbilling/models/create_customer.py index b1ba4709..716fbebc 100644 --- a/advancedbilling/models/create_customer.py +++ b/advancedbilling/models/create_customer.py @@ -28,10 +28,18 @@ class CreateCustomer(object): locale (str): Set a specific language on a customer record. vat_number (str): The model property of type str. tax_exempt (bool): The model property of type bool. + surcharging (bool): Whether surcharging is enabled for the customer. Defaults + to `true` when omitted. Only applied on sites where surcharging control + is enabled. tax_exempt_reason (str): The model property of type str. parent_id (int): The parent ID in Chargify if applicable. Parent is another Customer object. salesforce_id (str): The Salesforce ID of the customer + branding_theme_id (int): 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. additional_properties (Dict[str, object]): The additional properties for the model. @@ -55,9 +63,11 @@ class CreateCustomer(object): "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", } _optionals = [ @@ -74,14 +84,17 @@ class CreateCustomer(object): "locale", "vat_number", "tax_exempt", + "surcharging", "tax_exempt_reason", "parent_id", "salesforce_id", + "branding_theme_id", ] _nullables = [ "parent_id", "salesforce_id", + "branding_theme_id", ] def __init__( @@ -102,9 +115,11 @@ def __init__( locale=APIHelper.SKIP, vat_number=APIHelper.SKIP, tax_exempt=APIHelper.SKIP, + surcharging=APIHelper.SKIP, tax_exempt_reason=APIHelper.SKIP, parent_id=APIHelper.SKIP, salesforce_id=APIHelper.SKIP, + branding_theme_id=APIHelper.SKIP, additional_properties=None): """Initialize a CreateCustomer instance.""" # Initialize members of the class @@ -137,12 +152,16 @@ def __init__( self.vat_number = vat_number if tax_exempt is not APIHelper.SKIP: self.tax_exempt = tax_exempt + if surcharging is not APIHelper.SKIP: + self.surcharging = surcharging if tax_exempt_reason is not APIHelper.SKIP: self.tax_exempt_reason = tax_exempt_reason if parent_id is not APIHelper.SKIP: self.parent_id = parent_id if salesforce_id is not APIHelper.SKIP: self.salesforce_id = salesforce_id + if branding_theme_id is not APIHelper.SKIP: + self.branding_theme_id = branding_theme_id # Add additional model properties to the instance if additional_properties is None: @@ -231,6 +250,10 @@ def from_dictionary(cls, dictionary.get("tax_exempt")\ if "tax_exempt" in dictionary.keys()\ else APIHelper.SKIP + surcharging =\ + dictionary.get("surcharging")\ + if "surcharging" in dictionary.keys()\ + else APIHelper.SKIP tax_exempt_reason =\ dictionary.get("tax_exempt_reason")\ if dictionary.get("tax_exempt_reason")\ @@ -243,6 +266,10 @@ def from_dictionary(cls, dictionary.get("salesforce_id")\ if "salesforce_id" in dictionary.keys()\ else APIHelper.SKIP + branding_theme_id =\ + dictionary.get("branding_theme_id")\ + if "branding_theme_id" in dictionary.keys()\ + else APIHelper.SKIP # Clean out expected properties from dictionary additional_properties =\ @@ -265,9 +292,11 @@ def from_dictionary(cls, locale, vat_number, tax_exempt, + surcharging, tax_exempt_reason, parent_id, salesforce_id, + branding_theme_id, additional_properties) def __repr__(self): @@ -340,6 +369,11 @@ def __repr__(self): if hasattr(self, "tax_exempt") else None ) + _surcharging=( + self.surcharging + if hasattr(self, "surcharging") + else None + ) _tax_exempt_reason=( self.tax_exempt_reason if hasattr(self, "tax_exempt_reason") @@ -355,6 +389,11 @@ def __repr__(self): if hasattr(self, "salesforce_id") else None ) + _branding_theme_id=( + self.branding_theme_id + if hasattr(self, "branding_theme_id") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -374,9 +413,11 @@ def __repr__(self): f"locale={_locale!r}, " f"vat_number={_vat_number!r}, " f"tax_exempt={_tax_exempt!r}, " + f"surcharging={_surcharging!r}, " f"tax_exempt_reason={_tax_exempt_reason!r}, " f"parent_id={_parent_id!r}, " f"salesforce_id={_salesforce_id!r}, " + f"branding_theme_id={_branding_theme_id!r}, " f"additional_properties={_additional_properties!r}, " f")" ) @@ -451,6 +492,11 @@ def __str__(self): if hasattr(self, "tax_exempt") else None ) + _surcharging=( + self.surcharging + if hasattr(self, "surcharging") + else None + ) _tax_exempt_reason=( self.tax_exempt_reason if hasattr(self, "tax_exempt_reason") @@ -466,6 +512,11 @@ def __str__(self): if hasattr(self, "salesforce_id") else None ) + _branding_theme_id=( + self.branding_theme_id + if hasattr(self, "branding_theme_id") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -485,9 +536,11 @@ def __str__(self): f"locale={_locale!s}, " f"vat_number={_vat_number!s}, " f"tax_exempt={_tax_exempt!s}, " + f"surcharging={_surcharging!s}, " f"tax_exempt_reason={_tax_exempt_reason!s}, " f"parent_id={_parent_id!s}, " f"salesforce_id={_salesforce_id!s}, " + f"branding_theme_id={_branding_theme_id!s}, " f"additional_properties={_additional_properties!s}, " f")" ) diff --git a/advancedbilling/models/create_invoice.py b/advancedbilling/models/create_invoice.py index f6c62083..260d78c5 100644 --- a/advancedbilling/models/create_invoice.py +++ b/advancedbilling/models/create_invoice.py @@ -35,10 +35,11 @@ class CreateInvoice(object): days in advance the due date should be. payment_instructions (str): The model property of type str. memo (str): A custom memo can be sent to override the site's default. - seller_address (CreateInvoiceAddress): Overrides the defaults for the site - billing_address (CreateInvoiceAddress): Overrides the default for the customer + seller_address (CreateInvoiceAddress): Overrides the defaults for the site. + billing_address (CreateInvoiceAddress): Overrides the default for the + customer. shipping_address (CreateInvoiceAddress): Overrides the default for the - customer + customer. coupons (List[CreateInvoiceCoupon]): The model property of type List[CreateInvoiceCoupon]. status (CreateInvoiceStatus): The model property of type CreateInvoiceStatus. diff --git a/advancedbilling/models/create_invoice_item.py b/advancedbilling/models/create_invoice_item.py index c69e4643..9156259c 100644 --- a/advancedbilling/models/create_invoice_item.py +++ b/advancedbilling/models/create_invoice_item.py @@ -14,11 +14,11 @@ class CreateInvoiceItem(object): Attributes: title (str): The model property of type str. quantity (float | str | None): The quantity can contain up to 8 decimal - places. i.e. 1.00 or 0.0012 or 0.00000065. If you submit a value with + 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. unit_price (float | str | None): The unit_price can contain up to 8 decimal - places. i.e. 1.00 or 0.0012 or 0.00000065. If you submit a value with + 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. taxable (bool): Set to true to automatically calculate taxes. Site must be diff --git a/advancedbilling/models/create_metafield.py b/advancedbilling/models/create_metafield.py index 925d9684..4c70c46f 100644 --- a/advancedbilling/models/create_metafield.py +++ b/advancedbilling/models/create_metafield.py @@ -21,7 +21,7 @@ class CreateMetafield(object): will override the existing settings. input_type (MetafieldInput): 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'. + set of values that can be selected. Defaults to 'text'. enum (List[str]): Only applicable when input_type is radio or dropdown. Empty strings will not be submitted. additional_properties (Dict[str, object]): The additional properties for the diff --git a/advancedbilling/models/create_or_update_endpoint.py b/advancedbilling/models/create_or_update_endpoint.py index 65610c10..7d33fc6d 100644 --- a/advancedbilling/models/create_or_update_endpoint.py +++ b/advancedbilling/models/create_or_update_endpoint.py @@ -8,7 +8,7 @@ class CreateOrUpdateEndpoint(object): """Implementation of the 'Create or Update Endpoint' model. - Used to Create or Update Endpoint + Used to Create or Update Endpoint. Attributes: url (str): The model property of type str. diff --git a/advancedbilling/models/create_or_update_endpoint_request.py b/advancedbilling/models/create_or_update_endpoint_request.py index 4869bd16..95e757f1 100644 --- a/advancedbilling/models/create_or_update_endpoint_request.py +++ b/advancedbilling/models/create_or_update_endpoint_request.py @@ -13,10 +13,10 @@ class CreateOrUpdateEndpointRequest(object): """Implementation of the 'Create or Update Endpoint Request' model. - Used to Create or Update Endpoint + Used to Create or Update Endpoint. Attributes: - endpoint (CreateOrUpdateEndpoint): Used to Create or Update Endpoint + endpoint (CreateOrUpdateEndpoint): Used to Create or Update Endpoint. additional_properties (Dict[str, object]): The additional properties for the model. diff --git a/advancedbilling/models/create_or_update_product.py b/advancedbilling/models/create_or_update_product.py index 2bc12cc2..8c56a656 100644 --- a/advancedbilling/models/create_or_update_product.py +++ b/advancedbilling/models/create_or_update_product.py @@ -20,23 +20,24 @@ class CreateOrUpdateProduct(object): have legacy hosted pages. For Public Signup Page users, read this attribute from under the signup page. price_in_cents (int): The product price, in integer cents - interval (int): 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 (int): 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): A string representing the interval unit for this product, either month or day trial_price_in_cents (int): The product trial price, in integer cents - trial_interval (int): The numerical trial interval. i.e. an interval of ‘30’ + trial_interval (int): 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): A string representing the trial interval unit for this product, either month or day - trial_type (TrialType): Indicates how a trial is handled when the trail + trial_type (TrialType): 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 (int): The numerical expiration interval. i.e. an + expiration_interval (int): 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): A string representing the @@ -45,6 +46,10 @@ class CreateOrUpdateProduct(object): tax_code (str): 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. + unspsc_code (str): (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. additional_properties (Dict[str, object]): The additional properties for the model. @@ -68,6 +73,7 @@ class CreateOrUpdateProduct(object): "expiration_interval_unit": "expiration_interval_unit", "auto_create_signup_page": "auto_create_signup_page", "tax_code": "tax_code", + "unspsc_code": "unspsc_code", } _optionals = [ @@ -82,12 +88,14 @@ class CreateOrUpdateProduct(object): "expiration_interval_unit", "auto_create_signup_page", "tax_code", + "unspsc_code", ] _nullables = [ "trial_interval_unit", "trial_type", "expiration_interval_unit", + "unspsc_code", ] def __init__( @@ -108,6 +116,7 @@ def __init__( expiration_interval_unit=APIHelper.SKIP, auto_create_signup_page=APIHelper.SKIP, tax_code=APIHelper.SKIP, + unspsc_code=APIHelper.SKIP, additional_properties=None): """Initialize a CreateOrUpdateProduct instance.""" # Initialize members of the class @@ -138,6 +147,8 @@ def __init__( self.auto_create_signup_page = auto_create_signup_page if tax_code is not APIHelper.SKIP: self.tax_code = tax_code + if unspsc_code is not APIHelper.SKIP: + self.unspsc_code = unspsc_code # Add additional model properties to the instance if additional_properties is None: @@ -226,6 +237,10 @@ def from_dictionary(cls, dictionary.get("tax_code")\ if dictionary.get("tax_code")\ else APIHelper.SKIP + unspsc_code =\ + dictionary.get("unspsc_code")\ + if "unspsc_code" in dictionary.keys()\ + else APIHelper.SKIP # Clean out expected properties from dictionary additional_properties =\ @@ -248,6 +263,7 @@ def from_dictionary(cls, expiration_interval_unit, auto_create_signup_page, tax_code, + unspsc_code, additional_properties) def __repr__(self): @@ -312,6 +328,11 @@ def __repr__(self): if hasattr(self, "tax_code") else None ) + _unspsc_code=( + self.unspsc_code + if hasattr(self, "unspsc_code") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -331,6 +352,7 @@ def __repr__(self): f"expiration_interval_unit={_expiration_interval_unit!r}, " f"auto_create_signup_page={_auto_create_signup_page!r}, " f"tax_code={_tax_code!r}, " + f"unspsc_code={_unspsc_code!r}, " f"additional_properties={_additional_properties!r}, " f")" ) @@ -397,6 +419,11 @@ def __str__(self): if hasattr(self, "tax_code") else None ) + _unspsc_code=( + self.unspsc_code + if hasattr(self, "unspsc_code") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -416,6 +443,7 @@ def __str__(self): f"expiration_interval_unit={_expiration_interval_unit!s}, " f"auto_create_signup_page={_auto_create_signup_page!s}, " f"tax_code={_tax_code!s}, " + f"unspsc_code={_unspsc_code!s}, " f"additional_properties={_additional_properties!s}, " f")" ) diff --git a/advancedbilling/models/create_or_update_segment_price.py b/advancedbilling/models/create_or_update_segment_price.py index f1418c34..1b396647 100644 --- a/advancedbilling/models/create_or_update_segment_price.py +++ b/advancedbilling/models/create_or_update_segment_price.py @@ -14,7 +14,7 @@ class CreateOrUpdateSegmentPrice(object): Attributes: starting_quantity (int): The model property of type int. ending_quantity (int): The model property of type int. - unit_price (str | float): The price can contain up to 8 decimal places. i.e. + unit_price (str | float): The price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065 additional_properties (Dict[str, object]): The additional properties for the model. diff --git a/advancedbilling/models/create_payment_profile.py b/advancedbilling/models/create_payment_profile.py index 368a7066..a33bfc68 100644 --- a/advancedbilling/models/create_payment_profile.py +++ b/advancedbilling/models/create_payment_profile.py @@ -25,32 +25,32 @@ class CreatePaymentProfile(object): card_type (CardType): The type of card used. expiration_month (int | str | None): (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 (int | str | None): (Optional when performing a Import via + month, as an integer or string, e.g., 5 + expiration_year (int | str | None): (Optional when performing an Import via vault_token, required otherwise) The 4-digit credit card expiration year, - as an integer or string, i.e. 2012 + as an integer or string, e.g., 2012 billing_address (str): The credit card or bank account billing street address - (i.e. 123 Main St.). This value is merely passed through to the payment + (e.g., 123 Main St.). This value is merely passed through to the payment gateway. - billing_address_2 (str): Second line of the customer’s billing address i.e. + billing_address_2 (str): Second line of the customer’s billing address e.g., Apt. 100 billing_city (str): The credit card or bank account billing address city - (i.e. “Boston”). This value is merely passed through to the payment + (e.g., “Boston”). This value is merely passed through to the payment gateway. billing_state (str): The credit card or bank account billing address state - (i.e. MA). This value is merely passed through to the payment gateway. + (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 (str): The credit card or bank account billing address + billing_country (str): “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 - this time. + this time.” billing_zip (str): The credit card or bank account billing address zip code - (i.e. 12345). This value is merely passed through to the payment gateway. + (e.g., 12345). This value is merely passed through to the payment gateway. current_vault (AllVaults): The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. vault_token (str): The “token” provided by your vault storage for an already @@ -82,16 +82,16 @@ class CreatePaymentProfile(object): account resides bank_iban (str): (Optional when creating with GoCardless, required with Stripe Direct Debit). International Bank Account Number. Alternatively, - local bank details can be provided + local bank details can be provided. bank_routing_number (str): (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 + It becomes bank_code while passing via GoCardless API. bank_account_number (str): (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 (str): (Optional when creating with GoCardless, required with Stripe BECS or BACS Direct Debit) Branch/Sort code. Alternatively, - an IBAN can be provided + an IBAN can be provided. bank_account_type (BankAccountType): Defaults to checking bank_account_holder_type (BankAccountHolderType): Defaults to personal last_four (str): (Optional) Used for creating subscription with payment diff --git a/advancedbilling/models/create_prepaid_usage_component_price_point.py b/advancedbilling/models/create_prepaid_usage_component_price_point.py index b3a2823e..a167b141 100644 --- a/advancedbilling/models/create_prepaid_usage_component_price_point.py +++ b/advancedbilling/models/create_prepaid_usage_component_price_point.py @@ -32,17 +32,17 @@ class CreatePrepaidUsageComponentPricePoint(object): defined on the site. rollover_prepaid_remainder (bool): (only for prepaid usage components) Boolean which controls whether or not remaining units should be rolled - over to the next period + over to the next period. renew_prepaid_allocation (bool): (only for prepaid usage components) Boolean which controls whether or not the allocated quantity should be renewed at - the beginning of each period + the beginning of each period. expiration_interval (float): (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`s after which rollover amounts should expire. expiration_interval_unit (ExpirationIntervalUnit): (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 + month or day. additional_properties (Dict[str, object]): The additional properties for the model. diff --git a/advancedbilling/models/create_prepayment.py b/advancedbilling/models/create_prepayment.py index 6edc5dab..d79e38e1 100644 --- a/advancedbilling/models/create_prepayment.py +++ b/advancedbilling/models/create_prepayment.py @@ -15,7 +15,7 @@ class CreatePrepayment(object): amount (float): The model property of type float. details (str): The model property of type str. memo (str): The model property of type str. - method (CreatePrepaymentMethod): :- When the `method` specified is + method (CreatePrepaymentMethod): 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 diff --git a/advancedbilling/models/create_prepayment_method.py b/advancedbilling/models/create_prepayment_method.py index eac27501..f15c36e1 100644 --- a/advancedbilling/models/create_prepayment_method.py +++ b/advancedbilling/models/create_prepayment_method.py @@ -9,7 +9,7 @@ class CreatePrepaymentMethod(object): """Implementation of the 'Create Prepayment Method' enum. - :- When the `method` specified is `"credit_card_on_file"`, the prepayment amount + 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/advancedbilling/models/create_product_family.py b/advancedbilling/models/create_product_family.py index e98be9f6..89ebe30f 100644 --- a/advancedbilling/models/create_product_family.py +++ b/advancedbilling/models/create_product_family.py @@ -15,6 +15,9 @@ class CreateProductFamily(object): name (str): The model property of type str. handle (str): The model property of type str. description (str): The model property of type str. + surcharging (bool): Whether surcharging applies to this product family. + Defaults to `true` when omitted. Only applied on sites where surcharging + is enabled. additional_properties (Dict[str, object]): The additional properties for the model. @@ -25,11 +28,13 @@ class CreateProductFamily(object): "name": "name", "handle": "handle", "description": "description", + "surcharging": "surcharging", } _optionals = [ "handle", "description", + "surcharging", ] _nullables = [ @@ -42,6 +47,7 @@ def __init__( name=None, handle=APIHelper.SKIP, description=APIHelper.SKIP, + surcharging=APIHelper.SKIP, additional_properties=None): """Initialize a CreateProductFamily instance.""" # Initialize members of the class @@ -50,6 +56,8 @@ def __init__( self.handle = handle if description is not APIHelper.SKIP: self.description = description + if surcharging is not APIHelper.SKIP: + self.surcharging = surcharging # Add additional model properties to the instance if additional_properties is None: @@ -86,6 +94,10 @@ def from_dictionary(cls, dictionary.get("description")\ if "description" in dictionary.keys()\ else APIHelper.SKIP + surcharging =\ + dictionary.get("surcharging")\ + if "surcharging" in dictionary.keys()\ + else APIHelper.SKIP # Clean out expected properties from dictionary additional_properties =\ @@ -95,6 +107,7 @@ def from_dictionary(cls, return cls(name, handle, description, + surcharging, additional_properties) def __repr__(self): @@ -110,12 +123,18 @@ def __repr__(self): if hasattr(self, "description") else None ) + _surcharging=( + self.surcharging + if hasattr(self, "surcharging") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" f"name={_name!r}, " f"handle={_handle!r}, " f"description={_description!r}, " + f"surcharging={_surcharging!r}, " f"additional_properties={_additional_properties!r}, " f")" ) @@ -133,12 +152,18 @@ def __str__(self): if hasattr(self, "description") else None ) + _surcharging=( + self.surcharging + if hasattr(self, "surcharging") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" f"name={_name!s}, " f"handle={_handle!s}, " f"description={_description!s}, " + f"surcharging={_surcharging!s}, " f"additional_properties={_additional_properties!s}, " f")" ) diff --git a/advancedbilling/models/create_product_price_point.py b/advancedbilling/models/create_product_price_point.py index 8f6af3aa..a9fc9485 100644 --- a/advancedbilling/models/create_product_price_point.py +++ b/advancedbilling/models/create_product_price_point.py @@ -15,19 +15,19 @@ class CreateProductPricePoint(object): name (str): The product price point name handle (str): The product price point API handle price_in_cents (int): The product price point price, in integer cents - interval (int): 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 (int): 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): A string representing the interval unit for this product price point, either month or day trial_price_in_cents (int): The product price point trial price, in integer cents - trial_interval (int): The numerical trial interval. i.e. an interval of ‘30’ + trial_interval (int): 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): A string representing the trial interval unit for this product price point, either month or day - trial_type (TrialType): Indicates how a trial is handled when the trail + trial_type (TrialType): 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 @@ -36,7 +36,7 @@ class CreateProductPricePoint(object): initial_charge_in_cents (int): The product price point initial charge, in integer cents initial_charge_after_trial (bool): The model property of type bool. - expiration_interval (int): The numerical expiration interval. i.e. an + expiration_interval (int): 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): A string representing the diff --git a/advancedbilling/models/create_subscription.py b/advancedbilling/models/create_subscription.py index a744ae7a..c9f338f5 100644 --- a/advancedbilling/models/create_subscription.py +++ b/advancedbilling/models/create_subscription.py @@ -71,6 +71,13 @@ class CreateSubscription(object): immediately) and 180. customer_id (int): The ID of an existing customer within Chargify. Required, unless a `customer_reference` or a set of `customer_attributes` is given. + branding_theme_id (int): 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) 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 @@ -102,7 +109,7 @@ class CreateSubscription(object): information about Date/Time Formats. defer_signup (bool): (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 + 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 @@ -122,7 +129,7 @@ class CreateSubscription(object): 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) + `bank_account` > id.) reference (str): The reference value (provided by your app) for the subscription itself. customer_attributes (CustomerAttributes): The model property of type @@ -139,7 +146,7 @@ class CreateSubscription(object): [Components](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Co mponents-Overview) for more information. calendar_billing (CalendarBilling): (Optional). Cannot be used when also - specifying next_billing_at + specifying next_billing_at. metafields (Dict[str, str]): (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. @@ -187,8 +194,7 @@ class CreateSubscription(object): subscription renewal. offer_id (str | int | None): 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 + either the Chargify id of the offer or its handle prefixed with `handle:`. prepaid_configuration (UpsertPrepaidConfiguration): The model property of type UpsertPrepaidConfiguration. previous_billing_at (datetime): Providing a previous_billing_at that is in @@ -236,6 +242,7 @@ class CreateSubscription(object): "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", @@ -291,6 +298,7 @@ class CreateSubscription(object): "receives_invoice_emails", "net_terms", "customer_id", + "branding_theme_id", "next_billing_at", "initial_billing_at", "defer_signup", @@ -333,6 +341,7 @@ class CreateSubscription(object): ] _nullables = [ + "branding_theme_id", "dunning_communication_delay_time_zone", ] @@ -349,6 +358,7 @@ def __init__( receives_invoice_emails=APIHelper.SKIP, net_terms=APIHelper.SKIP, customer_id=APIHelper.SKIP, + branding_theme_id=APIHelper.SKIP, next_billing_at=APIHelper.SKIP, initial_billing_at=APIHelper.SKIP, defer_signup=False, @@ -413,6 +423,8 @@ def __init__( self.net_terms = net_terms if customer_id is not APIHelper.SKIP: self.customer_id = customer_id + if branding_theme_id is not APIHelper.SKIP: + self.branding_theme_id = branding_theme_id if next_billing_at is not APIHelper.SKIP: self.next_billing_at =\ APIHelper.apply_datetime_converter( @@ -583,6 +595,10 @@ def from_dictionary(cls, dictionary.get("customer_id")\ if dictionary.get("customer_id")\ else APIHelper.SKIP + branding_theme_id =\ + dictionary.get("branding_theme_id")\ + if "branding_theme_id" in dictionary.keys()\ + else APIHelper.SKIP next_billing_at = APIHelper.RFC3339DateTime.from_value( dictionary.get("next_billing_at")).datetime\ if dictionary.get("next_billing_at") else APIHelper.SKIP @@ -765,6 +781,7 @@ def from_dictionary(cls, receives_invoice_emails, net_terms, customer_id, + branding_theme_id, next_billing_at, initial_billing_at, defer_signup, @@ -863,6 +880,11 @@ def __repr__(self): if hasattr(self, "customer_id") else None ) + _branding_theme_id=( + self.branding_theme_id + if hasattr(self, "branding_theme_id") + else None + ) _next_billing_at=( self.next_billing_at if hasattr(self, "next_billing_at") @@ -1072,6 +1094,7 @@ def __repr__(self): f"receives_invoice_emails={_receives_invoice_emails!r}, " f"net_terms={_net_terms!r}, " f"customer_id={_customer_id!r}, " + f"branding_theme_id={_branding_theme_id!r}, " f"next_billing_at={_next_billing_at!r}, " f"initial_billing_at={_initial_billing_at!r}, " f"defer_signup={_defer_signup!r}, " @@ -1172,6 +1195,11 @@ def __str__(self): if hasattr(self, "customer_id") else None ) + _branding_theme_id=( + self.branding_theme_id + if hasattr(self, "branding_theme_id") + else None + ) _next_billing_at=( self.next_billing_at if hasattr(self, "next_billing_at") @@ -1381,6 +1409,7 @@ def __str__(self): f"receives_invoice_emails={_receives_invoice_emails!s}, " f"net_terms={_net_terms!s}, " f"customer_id={_customer_id!s}, " + f"branding_theme_id={_branding_theme_id!s}, " f"next_billing_at={_next_billing_at!s}, " f"initial_billing_at={_initial_billing_at!s}, " f"defer_signup={_defer_signup!s}, " diff --git a/advancedbilling/models/create_subscription_component.py b/advancedbilling/models/create_subscription_component.py index 62553164..a7c05660 100644 --- a/advancedbilling/models/create_subscription_component.py +++ b/advancedbilling/models/create_subscription_component.py @@ -17,7 +17,7 @@ class CreateSubscriptionComponent(object): Attributes: component_id (int | str | None): The model property of type int | str | None. enabled (bool): Used for on/off components only. - unit_balance (int): Used for metered and events based components. + unit_balance (int | str | None): Used for metered and events based components. allocated_quantity (int | str | None): Used for quantity based components. quantity (int): Deprecated. Use `allocated_quantity` instead. price_point_id (int | str | None): The model property of type int | str | @@ -114,10 +114,12 @@ def from_dictionary(cls, dictionary.get("enabled")\ if "enabled" in dictionary.keys()\ else APIHelper.SKIP - unit_balance =\ - dictionary.get("unit_balance")\ - if dictionary.get("unit_balance")\ - else APIHelper.SKIP + unit_balance = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("CreateSubscriptionComponentUnitBalance"), + dictionary.get("unit_balance"), + False)\ + if dictionary.get("unit_balance") is not None\ + else APIHelper.SKIP allocated_quantity = APIHelper.deserialize_union_type( UnionTypeLookUp.get("CreateSubscriptionComponentAllocatedQuantity"), dictionary.get("allocated_quantity"), diff --git a/advancedbilling/models/credit_card_payment_profile.py b/advancedbilling/models/credit_card_payment_profile.py index 96d03dcc..03bc8f51 100644 --- a/advancedbilling/models/credit_card_payment_profile.py +++ b/advancedbilling/models/credit_card_payment_profile.py @@ -21,13 +21,13 @@ class CreditCardPaymentProfile(object): first_name (str): The first name of the card holder. last_name (str): The last name of the card holder. masked_card_number (str): A string representation of the credit card number - with all but the last 4 digits masked with X’s (i.e. + with all but the last 4 digits masked with X’s (e.g., ‘XXXX-XXXX-XXXX-1234’). card_type (CardType): The type of card used. expiration_month (int): An integer representing the expiration month of the card(1 – 12). expiration_year (int): An integer representing the 4-digit expiration year of - the card(i.e. ‘2012’). + the card(e.g., ‘2012’). customer_id (int): The Chargify-assigned id for the customer record to which the card belongs. current_vault (CreditCardVault): The vault that stores the payment profile @@ -48,8 +48,8 @@ class CreditCardPaymentProfile(object): disabled (bool): The model property of type bool. chargify_token (str): 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) + passed as a sole attribute of credit_card_attributes (e.g., + tok_9g6hw85pnpt6knmskpwp4ttt). site_gateway_setting_id (int): The model property of type int. gateway_handle (str): An identifier of connected gateway. created_at (datetime): A timestamp indicating when this payment profile was @@ -116,6 +116,7 @@ class CreditCardPaymentProfile(object): ] _nullables = [ + "card_type", "vault_token", "billing_address", "billing_city", @@ -256,7 +257,7 @@ def from_dictionary(cls, else APIHelper.SKIP card_type =\ dictionary.get("card_type")\ - if dictionary.get("card_type")\ + if "card_type" in dictionary.keys()\ else APIHelper.SKIP expiration_month =\ dictionary.get("expiration_month")\ diff --git a/advancedbilling/models/credit_card_vault.py b/advancedbilling/models/credit_card_vault.py index b9a01099..68e2934c 100644 --- a/advancedbilling/models/credit_card_vault.py +++ b/advancedbilling/models/credit_card_vault.py @@ -51,12 +51,12 @@ class CreditCardVault(object): """ - _all_values = ["adyen", "authorizenet", "beanstream", "blue_snap", - "bogus", "braintree1", "braintree_blue", "checkout", "cybersource", "elavon", - "eway", "eway_rapid", "eway_rapid_std", "firstdata", "forte", "litle", - "maxio_payments", "maxp", "moduslink", "moneris", "nmi", "orbital", - "payment_express", "paymill", "paypal", "paypal_complete", "pin", "square", - "stripe", "stripe_connect", "trust_commerce", "unipaas", "wirecard"] + _all_values = ["adyen", "authorizenet", "beanstream", "blue_snap", "bogus", "braintree1", + "braintree_blue", "checkout", "cybersource", "elavon", "eway", "eway_rapid", + "eway_rapid_std", "firstdata", "forte", "litle", "maxio_payments", "maxp", + "moduslink", "moneris", "nmi", "orbital", "payment_express", "paymill", + "paypal", "paypal_complete", "pin", "square", "stripe", "stripe_connect", + "trust_commerce", "unipaas", "wirecard"] ADYEN = "adyen" AUTHORIZENET = "authorizenet" diff --git a/advancedbilling/models/credit_note.py b/advancedbilling/models/credit_note.py index 7d5aed05..86705507 100644 --- a/advancedbilling/models/credit_note.py +++ b/advancedbilling/models/credit_note.py @@ -70,7 +70,7 @@ class CreditNote(object): seller (InvoiceSeller): Information about the seller (merchant) listed on the masthead of the credit note. customer (InvoiceCustomer): Information about the customer who is owner or - recipient the credited subscription. + recipient of the credited subscription. billing_address (InvoiceAddress): The billing address of the credit subscription. shipping_address (InvoiceAddress): The shipping address of the credited @@ -80,18 +80,18 @@ class CreditNote(object): representing the credit back to the customer. discount_amount (str): 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). + 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 (str): 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 + 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 (str): The credit note total, which is `subtotal_amount - - discount_amount + tax_amount`.' + discount_amount + tax_amount`. applied_amount (str): The amount of the credit note that has already been applied to invoices. remaining_amount (str): The amount of the credit note remaining to be applied @@ -106,7 +106,7 @@ class CreditNote(object): origin_invoices (List[OriginInvoice]): 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). additional_properties (Dict[str, object]): The additional properties for the model. diff --git a/advancedbilling/models/credit_note_line_item.py b/advancedbilling/models/credit_note_line_item.py index 2d54adbd..718dc114 100644 --- a/advancedbilling/models/credit_note_line_item.py +++ b/advancedbilling/models/credit_note_line_item.py @@ -26,9 +26,9 @@ class CreditNoteLineItem(object): This is a decimal number represented as a string. (See "About Decimal Numbers".) unit_price (str): 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`. + 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 (str): 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 diff --git a/advancedbilling/models/currency_overage_prices.py b/advancedbilling/models/currency_overage_prices.py index ae0da393..71ae2aa4 100644 --- a/advancedbilling/models/currency_overage_prices.py +++ b/advancedbilling/models/currency_overage_prices.py @@ -26,7 +26,7 @@ class CurrencyOveragePrices(object): 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 (bool): Note: Refer to type attribute instead + default (bool): Note: Refer to type attribute instead. name (str): The model property of type str. pricing_scheme (PricingScheme): The identifier for the pricing scheme. See [Product @@ -46,9 +46,9 @@ class CurrencyOveragePrices(object): point's type is `custom`) The id of the subscription that the custom price point is for. tax_included (bool): The model property of type bool. - interval (int): 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 + interval (int): 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): A string representing the interval unit for this component price point, either month or day. This property is only diff --git a/advancedbilling/models/customer.py b/advancedbilling/models/customer.py index 9587b5d1..89f33aa7 100644 --- a/advancedbilling/models/customer.py +++ b/advancedbilling/models/customer.py @@ -15,8 +15,8 @@ class Customer(object): first_name (str): The first name of the customer last_name (str): The last name of the customer email (str): The email address of the customer - cc_emails (str): 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 (str): “A comma-separated list of emails that should be cc’d on all + customer communications (e.g., “joe@example.com, sue@example.com”)” organization (str): 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. @@ -27,13 +27,13 @@ class Customer(object): in Chargify updated_at (datetime): The timestamp in which the customer object was last edited - address (str): The customer’s shipping street address (i.e. “123 Main St.”) - address_2 (str): Second line of the customer’s shipping address i.e. “Apt. + address (str): The customer’s shipping street address (e.g., “123 Main St.”) + address_2 (str): Second line of the customer’s shipping address e.g., “Apt. 100” - city (str): The customer’s shipping address city (i.e. “Boston”) - state (str): The customer’s shipping address state (i.e. “MA”) + city (str): The customer’s shipping address city (e.g., “Boston”) + state (str): The customer’s shipping address state (e.g., “MA”) state_name (str): The customer's full name of state - zip (str): The customer’s shipping address zip code (i.e. “12345”) + zip (str): The customer’s shipping address zip code (e.g., “12345”) country (str): The customer shipping address country country_name (str): The customer's full name of country phone (str): The phone number of the customer @@ -46,6 +46,8 @@ class Customer(object): Portal invite was last accepted tax_exempt (bool): The tax exempt status for the customer. Acceptable values are true or 1 for true and false or 0 for false. + surcharging (bool): Whether surcharging is enabled for the customer. Only + included on sites where surcharging control is enabled. vat_number (str): 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 @@ -60,6 +62,11 @@ class Customer(object): default_auto_renewal_profile_id (int): The default auto-renewal profile ID for the customer maxioid (str): The Maxio-generated unique identifier for the customer. + branding_theme_id (int): 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. additional_properties (Dict[str, object]): The additional properties for the model. @@ -90,6 +97,7 @@ class Customer(object): "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", @@ -98,6 +106,7 @@ class Customer(object): "tax_exempt_reason": "tax_exempt_reason", "default_auto_renewal_profile_id": "default_auto_renewal_profile_id", "maxioid": "maxioid", + "branding_theme_id": "branding_theme_id", } _optionals = [ @@ -124,6 +133,7 @@ class Customer(object): "portal_invite_last_sent_at", "portal_invite_last_accepted_at", "tax_exempt", + "surcharging", "vat_number", "parent_id", "locale", @@ -132,6 +142,7 @@ class Customer(object): "tax_exempt_reason", "default_auto_renewal_profile_id", "maxioid", + "branding_theme_id", ] _nullables = [ @@ -159,6 +170,7 @@ class Customer(object): "tax_exempt_reason", "default_auto_renewal_profile_id", "maxioid", + "branding_theme_id", ] def __init__( @@ -186,6 +198,7 @@ def __init__( portal_invite_last_sent_at=APIHelper.SKIP, portal_invite_last_accepted_at=APIHelper.SKIP, tax_exempt=APIHelper.SKIP, + surcharging=APIHelper.SKIP, vat_number=APIHelper.SKIP, parent_id=APIHelper.SKIP, locale=APIHelper.SKIP, @@ -194,6 +207,7 @@ def __init__( tax_exempt_reason=APIHelper.SKIP, default_auto_renewal_profile_id=APIHelper.SKIP, maxioid=APIHelper.SKIP, + branding_theme_id=APIHelper.SKIP, additional_properties=None): """Initialize a Customer instance.""" # Initialize members of the class @@ -258,6 +272,8 @@ def __init__( if portal_invite_last_accepted_at else None if tax_exempt is not APIHelper.SKIP: self.tax_exempt = tax_exempt + if surcharging is not APIHelper.SKIP: + self.surcharging = surcharging if vat_number is not APIHelper.SKIP: self.vat_number = vat_number if parent_id is not APIHelper.SKIP: @@ -274,6 +290,8 @@ def __init__( self.default_auto_renewal_profile_id = default_auto_renewal_profile_id if maxioid is not APIHelper.SKIP: self.maxioid = maxioid + if branding_theme_id is not APIHelper.SKIP: + self.branding_theme_id = branding_theme_id # Add additional model properties to the instance if additional_properties is None: @@ -397,6 +415,10 @@ def from_dictionary(cls, dictionary.get("tax_exempt")\ if "tax_exempt" in dictionary.keys()\ else APIHelper.SKIP + surcharging =\ + dictionary.get("surcharging")\ + if "surcharging" in dictionary.keys()\ + else APIHelper.SKIP vat_number =\ dictionary.get("vat_number")\ if "vat_number" in dictionary.keys()\ @@ -429,6 +451,10 @@ def from_dictionary(cls, dictionary.get("maxioid")\ if "maxioid" in dictionary.keys()\ else APIHelper.SKIP + branding_theme_id =\ + dictionary.get("branding_theme_id")\ + if "branding_theme_id" in dictionary.keys()\ + else APIHelper.SKIP # Clean out expected properties from dictionary additional_properties =\ @@ -458,6 +484,7 @@ def from_dictionary(cls, portal_invite_last_sent_at, portal_invite_last_accepted_at, tax_exempt, + surcharging, vat_number, parent_id, locale, @@ -466,6 +493,7 @@ def from_dictionary(cls, tax_exempt_reason, default_auto_renewal_profile_id, maxioid, + branding_theme_id, additional_properties) @classmethod @@ -606,6 +634,11 @@ def __repr__(self): if hasattr(self, "tax_exempt") else None ) + _surcharging=( + self.surcharging + if hasattr(self, "surcharging") + else None + ) _vat_number=( self.vat_number if hasattr(self, "vat_number") @@ -646,6 +679,11 @@ def __repr__(self): if hasattr(self, "maxioid") else None ) + _branding_theme_id=( + self.branding_theme_id + if hasattr(self, "branding_theme_id") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -672,6 +710,7 @@ def __repr__(self): f"portal_invite_last_sent_at={_portal_invite_last_sent_at!r}, " f"portal_invite_last_accepted_at={_portal_invite_last_accepted_at!r}, " f"tax_exempt={_tax_exempt!r}, " + f"surcharging={_surcharging!r}, " f"vat_number={_vat_number!r}, " f"parent_id={_parent_id!r}, " f"locale={_locale!r}, " @@ -680,6 +719,7 @@ def __repr__(self): f"tax_exempt_reason={_tax_exempt_reason!r}, " f"default_auto_renewal_profile_id={_default_auto_renewal_profile_id!r}, " f"maxioid={_maxioid!r}, " + f"branding_theme_id={_branding_theme_id!r}, " f"additional_properties={_additional_properties!r}, " f")" ) @@ -801,6 +841,11 @@ def __str__(self): if hasattr(self, "tax_exempt") else None ) + _surcharging=( + self.surcharging + if hasattr(self, "surcharging") + else None + ) _vat_number=( self.vat_number if hasattr(self, "vat_number") @@ -841,6 +886,11 @@ def __str__(self): if hasattr(self, "maxioid") else None ) + _branding_theme_id=( + self.branding_theme_id + if hasattr(self, "branding_theme_id") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -867,6 +917,7 @@ def __str__(self): f"portal_invite_last_sent_at={_portal_invite_last_sent_at!s}, " f"portal_invite_last_accepted_at={_portal_invite_last_accepted_at!s}, " f"tax_exempt={_tax_exempt!s}, " + f"surcharging={_surcharging!s}, " f"vat_number={_vat_number!s}, " f"parent_id={_parent_id!s}, " f"locale={_locale!s}, " @@ -875,6 +926,7 @@ def __str__(self): f"tax_exempt_reason={_tax_exempt_reason!s}, " f"default_auto_renewal_profile_id={_default_auto_renewal_profile_id!s}, " f"maxioid={_maxioid!s}, " + f"branding_theme_id={_branding_theme_id!s}, " f"additional_properties={_additional_properties!s}, " f")" ) diff --git a/advancedbilling/models/customer_attributes.py b/advancedbilling/models/customer_attributes.py index aa1679fc..1a8fc194 100644 --- a/advancedbilling/models/customer_attributes.py +++ b/advancedbilling/models/customer_attributes.py @@ -18,31 +18,35 @@ class CustomerAttributes(object): customer via attributes. email (str): The email address of the customer. Required when creating a customer via attributes. - cc_emails (str): A list of emails that should be cc’d on all customer - communications. Optional. - organization (str): The organization/company of the customer. Optional. - reference (str): 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 (str): (Optional) The customer’s shipping street address (i.e. “123 + cc_emails (str): (Optional) A list of emails that should be cc’d on all + customer communications. + organization (str): (Optional) The organization/company of the customer. + reference (str): (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 (str): (Optional) The customer’s shipping street address (e.g., “123 Main St.”). address_2 (str): (Optional) Second line of the customer’s shipping address - i.e. “Apt. 100” - city (str): (Optional) The customer’s shipping address city (i.e. “Boston”). - state (str): (Optional) The customer’s shipping address state (i.e. “MA”). + e.g., “Apt. 100” + city (str): (Optional) The customer’s shipping address city (e.g., “Boston”). + state (str): “(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 (str): (Optional) The customer’s shipping address zip code (i.e. “12345”). - country (str): (Optional) The customer shipping address country, required in + order to be valid for tax locale purposes.” + zip (str): (Optional) The customer’s shipping address zip code (e.g., + “12345”). + country (str): “(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”). + format (e.g., “US”).” phone (str): (Optional) The phone number of the customer. verified (bool): The model property of type bool. tax_exempt (bool): (Optional) The tax_exempt status of the customer. Acceptable values are true or 1 for true and false or 0 for false. - vat_number (str): (Optional) Supplying the VAT number allows EU customer’s to + surcharging (bool): (Optional) Whether surcharging is enabled for the + customer. Defaults to `true` when omitted. Only applied on sites where + surcharging control is enabled. + vat_number (str): (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 @@ -77,6 +81,7 @@ class CustomerAttributes(object): "phone": "phone", "verified": "verified", "tax_exempt": "tax_exempt", + "surcharging": "surcharging", "vat_number": "vat_number", "metafields": "metafields", "parent_id": "parent_id", @@ -100,6 +105,7 @@ class CustomerAttributes(object): "phone", "verified", "tax_exempt", + "surcharging", "vat_number", "metafields", "parent_id", @@ -131,6 +137,7 @@ def __init__( phone=APIHelper.SKIP, verified=APIHelper.SKIP, tax_exempt=APIHelper.SKIP, + surcharging=APIHelper.SKIP, vat_number=APIHelper.SKIP, metafields=APIHelper.SKIP, parent_id=APIHelper.SKIP, @@ -169,6 +176,8 @@ def __init__( self.verified = verified if tax_exempt is not APIHelper.SKIP: self.tax_exempt = tax_exempt + if surcharging is not APIHelper.SKIP: + self.surcharging = surcharging if vat_number is not APIHelper.SKIP: self.vat_number = vat_number if metafields is not APIHelper.SKIP: @@ -263,6 +272,10 @@ def from_dictionary(cls, dictionary.get("tax_exempt")\ if "tax_exempt" in dictionary.keys()\ else APIHelper.SKIP + surcharging =\ + dictionary.get("surcharging")\ + if "surcharging" in dictionary.keys()\ + else APIHelper.SKIP vat_number =\ dictionary.get("vat_number")\ if dictionary.get("vat_number")\ @@ -304,6 +317,7 @@ def from_dictionary(cls, phone, verified, tax_exempt, + surcharging, vat_number, metafields, parent_id, @@ -409,6 +423,11 @@ def __repr__(self): if hasattr(self, "tax_exempt") else None ) + _surcharging=( + self.surcharging + if hasattr(self, "surcharging") + else None + ) _vat_number=( self.vat_number if hasattr(self, "vat_number") @@ -452,6 +471,7 @@ def __repr__(self): f"phone={_phone!r}, " f"verified={_verified!r}, " f"tax_exempt={_tax_exempt!r}, " + f"surcharging={_surcharging!r}, " f"vat_number={_vat_number!r}, " f"metafields={_metafields!r}, " f"parent_id={_parent_id!r}, " @@ -538,6 +558,11 @@ def __str__(self): if hasattr(self, "tax_exempt") else None ) + _surcharging=( + self.surcharging + if hasattr(self, "surcharging") + else None + ) _vat_number=( self.vat_number if hasattr(self, "vat_number") @@ -581,6 +606,7 @@ def __str__(self): f"phone={_phone!s}, " f"verified={_verified!s}, " f"tax_exempt={_tax_exempt!s}, " + f"surcharging={_surcharging!s}, " f"vat_number={_vat_number!s}, " f"metafields={_metafields!s}, " f"parent_id={_parent_id!s}, " diff --git a/advancedbilling/models/debit_note.py b/advancedbilling/models/debit_note.py index 6f10fdb2..6a13e0fb 100644 --- a/advancedbilling/models/debit_note.py +++ b/advancedbilling/models/debit_note.py @@ -41,7 +41,7 @@ class DebitNote(object): site_id (int): ID of the site to which the debit note belongs. customer_id (int): ID of the customer to which the debit note belongs. subscription_id (int): ID of the subscription that generated the debit note. - number (int): A unique, identifier that appears on the debit note and in + number (int): A unique identifier that appears on the debit note and in places it is referenced. sequence_number (int): A monotonically increasing number assigned to debit notes as they are created. @@ -50,8 +50,8 @@ class DebitNote(object): 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 (str): A unique, identifying string of the - connected credit note. + origin_credit_note_number (str): A unique identifying string of the connected + credit note. issue_date (date): 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". @@ -69,8 +69,8 @@ class DebitNote(object): the currency of the credit note amount fields. seller (InvoiceSeller): Information about the seller (merchant) listed on the masthead of the debit note. - customer (InvoiceCustomer): Information about the customer who is owner or - recipient the debited subscription. + customer (InvoiceCustomer): Information about the customer who is the owner + or recipient of the debited subscription. billing_address (InvoiceAddress): The billing address of the debited subscription. shipping_address (InvoiceAddress): The shipping address of the debited diff --git a/advancedbilling/models/ebb_component.py b/advancedbilling/models/ebb_component.py index fe8b5bf8..efa1f91e 100644 --- a/advancedbilling/models/ebb_component.py +++ b/advancedbilling/models/ebb_component.py @@ -17,17 +17,17 @@ class EBBComponent(object): Attributes: name (str): A name for this component that is suitable for showing customers - and displaying on billing statements, ie. "Minutes". - unit_name (str): The name of the unit of measurement for the component. It + and displaying on billing statements, i.e., "Minutes". + unit_name (str): “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 + necessary. i.e., “message”, which may then be shown as “5 messages” on a + subscription’s component line-item” description (str): A description for the component that will be displayed to the user on the hosted signup page. handle (str): 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 '_'. + this component in subsequent requests. Must start with a letter or number + and may only contain lowercase letters, numbers, or the characters '.', + ':', '-', or '_'. taxable (bool): Boolean flag describing whether a component is taxable or not. pricing_scheme (PricingScheme): The identifier for the pricing scheme. See [Product @@ -42,7 +42,7 @@ class EBBComponent(object): List[ComponentPricePointItem]. unit_price (str | float | None): 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 0.0012 or 0.00000065 + decimal places. i.e., 1.00 or 0.0012 or 0.00000065 tax_code (str): 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. @@ -51,13 +51,17 @@ class EBBComponent(object): the component on generated invoices. event_based_billing_metric_id (int): The ID of an event based billing metric that will be attached to this component. - interval (int): 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 (int): 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): 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 (str): (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. additional_properties (Dict[str, object]): The additional properties for the model. @@ -79,6 +83,7 @@ class EBBComponent(object): "hide_date_range_on_invoice": "hide_date_range_on_invoice", "interval": "interval", "interval_unit": "interval_unit", + "unspsc_code": "unspsc_code", } _optionals = [ @@ -92,10 +97,12 @@ class EBBComponent(object): "hide_date_range_on_invoice", "interval", "interval_unit", + "unspsc_code", ] _nullables = [ "interval_unit", + "unspsc_code", ] def __init__( @@ -114,6 +121,7 @@ def __init__( hide_date_range_on_invoice=APIHelper.SKIP, interval=APIHelper.SKIP, interval_unit=APIHelper.SKIP, + unspsc_code=APIHelper.SKIP, additional_properties=None): """Initialize a EBBComponent instance.""" # Initialize members of the class @@ -141,6 +149,8 @@ def __init__( self.interval = interval if interval_unit is not APIHelper.SKIP: self.interval_unit = interval_unit + if unspsc_code is not APIHelper.SKIP: + self.unspsc_code = unspsc_code # Add additional model properties to the instance if additional_properties is None: @@ -235,6 +245,10 @@ def from_dictionary(cls, dictionary.get("interval_unit")\ if "interval_unit" in dictionary.keys()\ else APIHelper.SKIP + unspsc_code =\ + dictionary.get("unspsc_code")\ + if "unspsc_code" in dictionary.keys()\ + else APIHelper.SKIP # Clean out expected properties from dictionary additional_properties =\ @@ -255,6 +269,7 @@ def from_dictionary(cls, hide_date_range_on_invoice, interval, interval_unit, + unspsc_code, additional_properties) def __repr__(self): @@ -313,6 +328,11 @@ def __repr__(self): if hasattr(self, "interval_unit") else None ) + _unspsc_code=( + self.unspsc_code + if hasattr(self, "unspsc_code") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -330,6 +350,7 @@ def __repr__(self): f"event_based_billing_metric_id={_event_based_billing_metric_id!r}, " f"interval={_interval!r}, " f"interval_unit={_interval_unit!r}, " + f"unspsc_code={_unspsc_code!r}, " f"additional_properties={_additional_properties!r}, " f")" ) @@ -390,6 +411,11 @@ def __str__(self): if hasattr(self, "interval_unit") else None ) + _unspsc_code=( + self.unspsc_code + if hasattr(self, "unspsc_code") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -407,6 +433,7 @@ def __str__(self): f"event_based_billing_metric_id={_event_based_billing_metric_id!s}, " f"interval={_interval!s}, " f"interval_unit={_interval_unit!s}, " + f"unspsc_code={_unspsc_code!s}, " f"additional_properties={_additional_properties!s}, " f")" ) diff --git a/advancedbilling/models/event.py b/advancedbilling/models/event.py index fcb436f5..259db713 100644 --- a/advancedbilling/models/event.py +++ b/advancedbilling/models/event.py @@ -21,7 +21,8 @@ class Event(object): subscription_id (int): The model property of type int. customer_id (int): The model property of type int. created_at (datetime): The model property of type datetime. - event_specific_data (SubscriptionProductChange | SubscriptionStateChange | + event_specific_data (SubscriptionProductChange | + SubscriptionProductChangeScheduled | SubscriptionStateChange | PaymentRelatedEvents | RefundSuccess | ComponentAllocationChange | MeteredUsage | PrepaidUsage | DunningStepReached | InvoiceIssued | PendingCancellationChange | PrepaidSubscriptionBalanceChanged | @@ -32,7 +33,9 @@ class Event(object): ChjsTokenizationFailure | None): The schema varies based on the event key. The key-to-event data mapping is as follows: * `subscription_product_change` - SubscriptionProductChange * - `subscription_state_change` - SubscriptionStateChange * `signup_success`, + `subscription_product_change_scheduled` - + SubscriptionProductChangeScheduled * `subscription_state_change` - + SubscriptionStateChange * `signup_success`, `delayed_signup_creation_success`, `payment_success`, `payment_failure`, `renewal_success`, `renewal_failure`, `chargeback_lost`, `chargeback_accepted`, `chargeback_closed` - PaymentRelatedEvents * diff --git a/advancedbilling/models/event_key.py b/advancedbilling/models/event_key.py index 6ad79866..7beba7d7 100644 --- a/advancedbilling/models/event_key.py +++ b/advancedbilling/models/event_key.py @@ -22,6 +22,7 @@ class EventKey(object): RENEWAL_FAILURE: The enum member of type str. SUBSCRIPTION_STATE_CHANGE: The enum member of type str. SUBSCRIPTION_PRODUCT_CHANGE: The enum member of type str. + SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED: The enum member of type str. PENDING_CANCELLATION_CHANGE: The enum member of type str. EXPIRING_CARD: The enum member of type str. CUSTOMER_UPDATE: The enum member of type str. @@ -99,19 +100,19 @@ class EventKey(object): """ - _all_values = ["payment_success", "payment_failure", "signup_success", - "signup_failure", "delayed_signup_creation_success", - "delayed_signup_creation_failure", "billing_date_change", - "expiration_date_change", "renewal_success", "renewal_failure", - "subscription_state_change", "subscription_product_change", - "pending_cancellation_change", "expiring_card", "customer_update", - "customer_create", "customer_delete", "component_allocation_change", - "metered_usage", "prepaid_usage", "upgrade_downgrade_success", - "upgrade_downgrade_failure", "statement_closed", "statement_settled", - "subscription_card_update", "subscription_group_card_update", - "subscription_bank_account_update", "refund_success", "refund_failure", - "upcoming_renewal_notice", "trial_end_notice", "dunning_step_reached", - "invoice_issued", "invoice_pending", "prepaid_subscription_balance_changed", + _all_values = ["payment_success", "payment_failure", "signup_success", "signup_failure", + "delayed_signup_creation_success", "delayed_signup_creation_failure", + "billing_date_change", "expiration_date_change", "renewal_success", + "renewal_failure", "subscription_state_change", "subscription_product_change", + "subscription_product_change_scheduled", "pending_cancellation_change", + "expiring_card", "customer_update", "customer_create", "customer_delete", + "component_allocation_change", "metered_usage", "prepaid_usage", + "upgrade_downgrade_success", "upgrade_downgrade_failure", "statement_closed", + "statement_settled", "subscription_card_update", + "subscription_group_card_update", "subscription_bank_account_update", + "refund_success", "refund_failure", "upcoming_renewal_notice", + "trial_end_notice", "dunning_step_reached", "invoice_issued", + "invoice_pending", "prepaid_subscription_balance_changed", "subscription_group_signup_success", "subscription_group_signup_failure", "direct_debit_payment_paid_out", "direct_debit_payment_rejected", "direct_debit_payment_pending", "pending_payment_created", @@ -126,8 +127,8 @@ class EventKey(object): "subscription_group_paypal_account_update", "subscription_customer_change", "account_transaction_changed", "go_cardless_payment_paid_out", "go_cardless_payment_rejected", "go_cardless_payment_pending", - "stripe_direct_debit_payment_paid_out", - "stripe_direct_debit_payment_rejected", "stripe_direct_debit_payment_pending", + "stripe_direct_debit_payment_paid_out", "stripe_direct_debit_payment_rejected", + "stripe_direct_debit_payment_pending", "maxio_payments_direct_debit_payment_paid_out", "maxio_payments_direct_debit_payment_rejected", "maxio_payments_direct_debit_payment_pending", @@ -162,6 +163,8 @@ class EventKey(object): SUBSCRIPTION_PRODUCT_CHANGE = "subscription_product_change" + SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED = "subscription_product_change_scheduled" + PENDING_CANCELLATION_CHANGE = "pending_cancellation_change" EXPIRING_CARD = "expiring_card" diff --git a/advancedbilling/models/failed_payment_action.py b/advancedbilling/models/failed_payment_action.py index 039349b4..7de5ce22 100644 --- a/advancedbilling/models/failed_payment_action.py +++ b/advancedbilling/models/failed_payment_action.py @@ -20,8 +20,8 @@ class FailedPaymentAction(object): - `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). + will most likely go into "past_due" or "canceled" state (depending upon net terms + and dunning settings). Attributes: LEAVE_OPEN_INVOICE: The enum member of type str. diff --git a/advancedbilling/models/get_one_time_token_bank_account_payment_profile.py b/advancedbilling/models/get_one_time_token_bank_account_payment_profile.py new file mode 100644 index 00000000..afa03e93 --- /dev/null +++ b/advancedbilling/models/get_one_time_token_bank_account_payment_profile.py @@ -0,0 +1,696 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.api_helper import APIHelper +from advancedbilling.models.bank_account_holder_type import ( + BankAccountHolderType, +) +from advancedbilling.models.bank_account_type import ( + BankAccountType, +) +from advancedbilling.models.bank_account_vault import ( + BankAccountVault, +) + + +class GetOneTimeTokenBankAccountPaymentProfile(object): + """Implementation of the 'Get One Time Token Bank Account Payment Profile' model. + + Attributes: + id (str): The model property of type str. + first_name (str): The model property of type str. + last_name (str): The model property of type str. + customer_id (str): The model property of type str. + current_vault (BankAccountVault): The vault that stores the payment profile + with the provided vault_token. Use `bogus` for testing. + vault_token (str): The model property of type str. + billing_address (str): The model property of type str. + billing_address_2 (str): The model property of type str. + billing_city (str): The model property of type str. + billing_country (str): The model property of type str. + billing_state (str): The model property of type str. + billing_zip (str): The model property of type str. + bank_name (str): The model property of type str. + masked_bank_routing_number (str): The model property of type str. + masked_bank_account_number (str): The model property of type str. + bank_account_type (BankAccountType): Defaults to checking + bank_account_holder_type (BankAccountHolderType): Defaults to personal + payment_type (str): The model property of type str. + disabled (bool): The model property of type bool. + site_gateway_setting_id (int): The model property of type int. + customer_vault_token (str): The model property of type str. + gateway_handle (str): The model property of type str. + verified (bool): The model property of type bool. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "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", + } + + _optionals = [ + "id", + "customer_id", + "billing_address_2", + "customer_vault_token", + "gateway_handle", + "verified", + ] + + _nullables = [ + "id", + "customer_id", + "customer_vault_token", + "gateway_handle", + "verified", + ] + + def __init__( + self, + first_name=None, + last_name=None, + current_vault=None, + vault_token=None, + billing_address=None, + billing_city=None, + billing_country=None, + billing_state=None, + billing_zip=None, + bank_name=None, + masked_bank_routing_number=None, + masked_bank_account_number=None, + bank_account_type=None, + bank_account_holder_type=None, + payment_type=None, + disabled=None, + site_gateway_setting_id=None, + id=APIHelper.SKIP, + customer_id=APIHelper.SKIP, + billing_address_2=APIHelper.SKIP, + customer_vault_token=APIHelper.SKIP, + gateway_handle=APIHelper.SKIP, + verified=APIHelper.SKIP, + additional_properties=None): + """Initialize a GetOneTimeTokenBankAccountPaymentProfile instance.""" + # Initialize members of the class + if id is not APIHelper.SKIP: + self.id = id + self.first_name = first_name + self.last_name = last_name + if customer_id is not APIHelper.SKIP: + self.customer_id = customer_id + self.current_vault = current_vault + self.vault_token = vault_token + self.billing_address = billing_address + if billing_address_2 is not APIHelper.SKIP: + self.billing_address_2 = billing_address_2 + self.billing_city = billing_city + self.billing_country = billing_country + self.billing_state = billing_state + self.billing_zip = billing_zip + self.bank_name = bank_name + self.masked_bank_routing_number = masked_bank_routing_number + self.masked_bank_account_number = masked_bank_account_number + self.bank_account_type = bank_account_type + self.bank_account_holder_type = bank_account_holder_type + self.payment_type = payment_type + self.disabled = disabled + self.site_gateway_setting_id = site_gateway_setting_id + if customer_vault_token is not APIHelper.SKIP: + self.customer_vault_token = customer_vault_token + if gateway_handle is not APIHelper.SKIP: + self.gateway_handle = gateway_handle + if verified is not APIHelper.SKIP: + self.verified = verified + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + first_name =\ + dictionary.get("first_name")\ + if dictionary.get("first_name")\ + else None + last_name =\ + dictionary.get("last_name")\ + if dictionary.get("last_name")\ + else None + current_vault =\ + dictionary.get("current_vault")\ + if dictionary.get("current_vault")\ + else None + vault_token =\ + dictionary.get("vault_token")\ + if dictionary.get("vault_token")\ + else None + billing_address =\ + dictionary.get("billing_address")\ + if dictionary.get("billing_address")\ + else None + billing_city =\ + dictionary.get("billing_city")\ + if dictionary.get("billing_city")\ + else None + billing_country =\ + dictionary.get("billing_country")\ + if dictionary.get("billing_country")\ + else None + billing_state =\ + dictionary.get("billing_state")\ + if dictionary.get("billing_state")\ + else None + billing_zip =\ + dictionary.get("billing_zip")\ + if dictionary.get("billing_zip")\ + else None + bank_name =\ + dictionary.get("bank_name")\ + if dictionary.get("bank_name")\ + else None + masked_bank_routing_number =\ + dictionary.get("masked_bank_routing_number")\ + if dictionary.get("masked_bank_routing_number")\ + else None + masked_bank_account_number =\ + dictionary.get("masked_bank_account_number")\ + if dictionary.get("masked_bank_account_number")\ + else None + bank_account_type =\ + dictionary.get("bank_account_type")\ + if dictionary.get("bank_account_type")\ + else None + bank_account_holder_type =\ + dictionary.get("bank_account_holder_type")\ + if dictionary.get("bank_account_holder_type")\ + else None + payment_type =\ + dictionary.get("payment_type")\ + if dictionary.get("payment_type")\ + else None + disabled =\ + dictionary.get("disabled")\ + if "disabled" in dictionary.keys()\ + else None + site_gateway_setting_id =\ + dictionary.get("site_gateway_setting_id")\ + if dictionary.get("site_gateway_setting_id")\ + else None + id =\ + dictionary.get("id")\ + if "id" in dictionary.keys()\ + else APIHelper.SKIP + customer_id =\ + dictionary.get("customer_id")\ + if "customer_id" in dictionary.keys()\ + else APIHelper.SKIP + billing_address_2 =\ + dictionary.get("billing_address_2")\ + if dictionary.get("billing_address_2")\ + else APIHelper.SKIP + customer_vault_token =\ + dictionary.get("customer_vault_token")\ + if "customer_vault_token" in dictionary.keys()\ + else APIHelper.SKIP + gateway_handle =\ + dictionary.get("gateway_handle")\ + if "gateway_handle" in dictionary.keys()\ + else APIHelper.SKIP + verified =\ + dictionary.get("verified")\ + if "verified" in dictionary.keys()\ + else APIHelper.SKIP + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(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, + customer_id, + billing_address_2, + customer_vault_token, + gateway_handle, + verified, + additional_properties) + + @classmethod + def validate(cls, dictionary): + """Validate dictionary against class required properties + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + boolean : if dictionary is valid contains required properties. + + """ + if isinstance(dictionary, cls): + return APIHelper.is_valid_type( + value=dictionary.first_name, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.last_name, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.current_vault, + type_callable=lambda value: + BankAccountVault.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.vault_token, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.billing_address, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.billing_city, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.billing_country, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.billing_state, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.billing_zip, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.bank_name, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.masked_bank_routing_number, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.masked_bank_account_number, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.bank_account_type, + type_callable=lambda value: + BankAccountType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.bank_account_holder_type, + type_callable=lambda value: + BankAccountHolderType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.payment_type, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.disabled, + type_callable=lambda value: + isinstance( + value, + bool, + )) \ + and APIHelper.is_valid_type( + value=dictionary.site_gateway_setting_id, + type_callable=lambda value: + isinstance( + value, + int, + )) + + if not isinstance(dictionary, dict): + return False + + return APIHelper.is_valid_type( + value=dictionary.get("first_name"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("last_name"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("current_vault"), + type_callable=lambda value: + BankAccountVault.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("vault_token"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("billing_address"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("billing_city"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("billing_country"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("billing_state"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("billing_zip"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("bank_name"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("masked_bank_routing_number"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("masked_bank_account_number"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("bank_account_type"), + type_callable=lambda value: + BankAccountType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("bank_account_holder_type"), + type_callable=lambda value: + BankAccountHolderType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("payment_type"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("disabled"), + type_callable=lambda value: + isinstance( + value, + bool, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("site_gateway_setting_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) + + def __repr__(self): + """Return a unambiguous string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _first_name=self.first_name + _last_name=self.last_name + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _current_vault=self.current_vault + _vault_token=self.vault_token + _billing_address=self.billing_address + _billing_address_2=( + self.billing_address_2 + if hasattr(self, "billing_address_2") + else None + ) + _billing_city=self.billing_city + _billing_country=self.billing_country + _billing_state=self.billing_state + _billing_zip=self.billing_zip + _bank_name=self.bank_name + _masked_bank_routing_number=self.masked_bank_routing_number + _masked_bank_account_number=self.masked_bank_account_number + _bank_account_type=self.bank_account_type + _bank_account_holder_type=self.bank_account_holder_type + _payment_type=self.payment_type + _disabled=self.disabled + _site_gateway_setting_id=self.site_gateway_setting_id + _customer_vault_token=( + self.customer_vault_token + if hasattr(self, "customer_vault_token") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _verified=( + self.verified + if hasattr(self, "verified") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!r}, " + f"first_name={_first_name!r}, " + f"last_name={_last_name!r}, " + f"customer_id={_customer_id!r}, " + f"current_vault={_current_vault!r}, " + f"vault_token={_vault_token!r}, " + f"billing_address={_billing_address!r}, " + f"billing_address_2={_billing_address_2!r}, " + f"billing_city={_billing_city!r}, " + f"billing_country={_billing_country!r}, " + f"billing_state={_billing_state!r}, " + f"billing_zip={_billing_zip!r}, " + f"bank_name={_bank_name!r}, " + f"masked_bank_routing_number={_masked_bank_routing_number!r}, " + f"masked_bank_account_number={_masked_bank_account_number!r}, " + f"bank_account_type={_bank_account_type!r}, " + f"bank_account_holder_type={_bank_account_holder_type!r}, " + f"payment_type={_payment_type!r}, " + f"disabled={_disabled!r}, " + f"site_gateway_setting_id={_site_gateway_setting_id!r}, " + f"customer_vault_token={_customer_vault_token!r}, " + f"gateway_handle={_gateway_handle!r}, " + f"verified={_verified!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _id=( + self.id + if hasattr(self, "id") + else None + ) + _first_name=self.first_name + _last_name=self.last_name + _customer_id=( + self.customer_id + if hasattr(self, "customer_id") + else None + ) + _current_vault=self.current_vault + _vault_token=self.vault_token + _billing_address=self.billing_address + _billing_address_2=( + self.billing_address_2 + if hasattr(self, "billing_address_2") + else None + ) + _billing_city=self.billing_city + _billing_country=self.billing_country + _billing_state=self.billing_state + _billing_zip=self.billing_zip + _bank_name=self.bank_name + _masked_bank_routing_number=self.masked_bank_routing_number + _masked_bank_account_number=self.masked_bank_account_number + _bank_account_type=self.bank_account_type + _bank_account_holder_type=self.bank_account_holder_type + _payment_type=self.payment_type + _disabled=self.disabled + _site_gateway_setting_id=self.site_gateway_setting_id + _customer_vault_token=( + self.customer_vault_token + if hasattr(self, "customer_vault_token") + else None + ) + _gateway_handle=( + self.gateway_handle + if hasattr(self, "gateway_handle") + else None + ) + _verified=( + self.verified + if hasattr(self, "verified") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"id={_id!s}, " + f"first_name={_first_name!s}, " + f"last_name={_last_name!s}, " + f"customer_id={_customer_id!s}, " + f"current_vault={_current_vault!s}, " + f"vault_token={_vault_token!s}, " + f"billing_address={_billing_address!s}, " + f"billing_address_2={_billing_address_2!s}, " + f"billing_city={_billing_city!s}, " + f"billing_country={_billing_country!s}, " + f"billing_state={_billing_state!s}, " + f"billing_zip={_billing_zip!s}, " + f"bank_name={_bank_name!s}, " + f"masked_bank_routing_number={_masked_bank_routing_number!s}, " + f"masked_bank_account_number={_masked_bank_account_number!s}, " + f"bank_account_type={_bank_account_type!s}, " + f"bank_account_holder_type={_bank_account_holder_type!s}, " + f"payment_type={_payment_type!s}, " + f"disabled={_disabled!s}, " + f"site_gateway_setting_id={_site_gateway_setting_id!s}, " + f"customer_vault_token={_customer_vault_token!s}, " + f"gateway_handle={_gateway_handle!s}, " + f"verified={_verified!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/get_one_time_token_payment_profile.py b/advancedbilling/models/get_one_time_token_payment_profile.py index d2521bf2..66b548d1 100644 --- a/advancedbilling/models/get_one_time_token_payment_profile.py +++ b/advancedbilling/models/get_one_time_token_payment_profile.py @@ -6,6 +6,12 @@ # ruff: noqa: E501 from advancedbilling.api_helper import APIHelper +from advancedbilling.models.card_type import ( + CardType, +) +from advancedbilling.models.credit_card_vault import ( + CreditCardVault, +) class GetOneTimeTokenPaymentProfile(object): @@ -268,6 +274,237 @@ def from_dictionary(cls, gateway_handle, additional_properties) + @classmethod + def validate(cls, dictionary): + """Validate dictionary against class required properties + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + boolean : if dictionary is valid contains required properties. + + """ + if isinstance(dictionary, cls): + return APIHelper.is_valid_type( + value=dictionary.first_name, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.last_name, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.masked_card_number, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.card_type, + type_callable=lambda value: + CardType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.expiration_month, + type_callable=lambda value: + isinstance( + value, + float, + )) \ + and APIHelper.is_valid_type( + value=dictionary.expiration_year, + type_callable=lambda value: + isinstance( + value, + float, + )) \ + and APIHelper.is_valid_type( + value=dictionary.current_vault, + type_callable=lambda value: + CreditCardVault.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.vault_token, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.billing_address, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.billing_city, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.billing_country, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.billing_state, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.billing_zip, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.payment_type, + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.disabled, + type_callable=lambda value: + isinstance( + value, + bool, + )) \ + and APIHelper.is_valid_type( + value=dictionary.site_gateway_setting_id, + type_callable=lambda value: + isinstance( + value, + int, + )) + + if not isinstance(dictionary, dict): + return False + + return APIHelper.is_valid_type( + value=dictionary.get("first_name"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("last_name"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("masked_card_number"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("card_type"), + type_callable=lambda value: + CardType.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("expiration_month"), + type_callable=lambda value: + isinstance( + value, + float, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("expiration_year"), + type_callable=lambda value: + isinstance( + value, + float, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("current_vault"), + type_callable=lambda value: + CreditCardVault.validate(value)) \ + and APIHelper.is_valid_type( + value=dictionary.get("vault_token"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("billing_address"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("billing_city"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("billing_country"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("billing_state"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("billing_zip"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("payment_type"), + type_callable=lambda value: + isinstance( + value, + str, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("disabled"), + type_callable=lambda value: + isinstance( + value, + bool, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("site_gateway_setting_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) + def __repr__(self): """Return a unambiguous string representation.""" _id=( diff --git a/advancedbilling/models/get_one_time_token_request.py b/advancedbilling/models/get_one_time_token_request.py index 93cd9c6a..6c54be42 100644 --- a/advancedbilling/models/get_one_time_token_request.py +++ b/advancedbilling/models/get_one_time_token_request.py @@ -5,17 +5,16 @@ """ # ruff: noqa: E501 -from advancedbilling.models.get_one_time_token_payment_profile import ( - GetOneTimeTokenPaymentProfile, -) +from advancedbilling.api_helper import APIHelper class GetOneTimeTokenRequest(object): """Implementation of the 'Get One Time Token Request' model. Attributes: - payment_profile (GetOneTimeTokenPaymentProfile): The model property of type - GetOneTimeTokenPaymentProfile. + payment_profile (GetOneTimeTokenPaymentProfile | + GetOneTimeTokenBankAccountPaymentProfile): The model property of type + GetOneTimeTokenPaymentProfile | GetOneTimeTokenBankAccountPaymentProfile. additional_properties (Dict[str, object]): The additional properties for the model. @@ -53,14 +52,20 @@ def from_dictionary(cls, object: An instance of this structure class. """ + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) + if not isinstance(dictionary, dict) or dictionary is None: return None # Extract variables from the dictionary - payment_profile =\ - GetOneTimeTokenPaymentProfile.from_dictionary( - dictionary.get("payment_profile"))\ - if dictionary.get("payment_profile") else None + payment_profile = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("GetOneTimeTokenRequestPaymentProfile"), + dictionary.get("payment_profile"), + False)\ + if dictionary.get("payment_profile") is not None\ + else None # Clean out expected properties from dictionary additional_properties =\ @@ -70,6 +75,33 @@ def from_dictionary(cls, return cls(payment_profile, additional_properties) + @classmethod + def validate(cls, dictionary): + """Validate dictionary against class required properties + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + boolean : if dictionary is valid contains required properties. + + """ + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) + + if isinstance(dictionary, cls): + return (UnionTypeLookUp.get("GetOneTimeTokenRequestPaymentProfile") + .validate(dictionary.payment_profile).is_valid) + + if not isinstance(dictionary, dict): + return False + + return (UnionTypeLookUp.get("GetOneTimeTokenRequestPaymentProfile") + .validate(dictionary.get("payment_profile")).is_valid) + def __repr__(self): """Return a unambiguous string representation.""" _payment_profile=self.payment_profile diff --git a/advancedbilling/models/group_billing.py b/advancedbilling/models/group_billing.py index d3321a1a..5a03329b 100644 --- a/advancedbilling/models/group_billing.py +++ b/advancedbilling/models/group_billing.py @@ -8,7 +8,7 @@ class GroupBilling(object): """Implementation of the 'Group Billing' model. - Optional attributes related to billing date and accrual. Note: Only applicable + (Optional) Attributes related to billing date and accrual. Note: Only applicable for new subscriptions. Attributes: diff --git a/advancedbilling/models/group_settings.py b/advancedbilling/models/group_settings.py index 8bf6ef2a..d7767cce 100644 --- a/advancedbilling/models/group_settings.py +++ b/advancedbilling/models/group_settings.py @@ -20,7 +20,7 @@ class GroupSettings(object): Attributes: target (GroupTarget): Attributes of the target customer who will be the responsible payer of the created subscription. Required. - billing (GroupBilling): Optional attributes related to billing date and + billing (GroupBilling): (Optional) Attributes related to billing date and accrual. Note: Only applicable for new subscriptions. additional_properties (Dict[str, object]): The additional properties for the model. diff --git a/advancedbilling/models/group_status.py b/advancedbilling/models/group_status.py new file mode 100644 index 00000000..1076fbe5 --- /dev/null +++ b/advancedbilling/models/group_status.py @@ -0,0 +1,46 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 + +class GroupStatus(object): + """Implementation of the 'group_status' enum. + + Attributes: + UNGROUPED: The enum member of type str. + GROUPED: The enum member of type str. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + UNGROUPED = "ungrouped" + + GROUPED = "grouped" + + @classmethod + def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" + if value is None: + return default + + # If numeric and matches directly + if isinstance(value, int): + for name, val in cls.__dict__.items(): + if not name.startswith("_") and val == value: + return val + + # If string, perform case-insensitive match + if isinstance(value, str): + value_lower = value.lower() + for name, val in cls.__dict__.items(): + if not name.startswith("_") and ( + name.lower() == value_lower or str(val).lower() == value_lower + ): + return val + + # Fallback to default + return default diff --git a/advancedbilling/models/group_target.py b/advancedbilling/models/group_target.py index 8e0243b4..8aef77d3 100644 --- a/advancedbilling/models/group_target.py +++ b/advancedbilling/models/group_target.py @@ -20,8 +20,8 @@ class GroupTarget(object): Attributes: mtype (GroupTargetType): The type of object indicated by the id attribute. id (int): 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". additional_properties (Dict[str, object]): The additional properties for the model. diff --git a/advancedbilling/models/group_target_type.py b/advancedbilling/models/group_target_type.py index 3d3b53da..4d31af6f 100644 --- a/advancedbilling/models/group_target_type.py +++ b/advancedbilling/models/group_target_type.py @@ -14,7 +14,7 @@ class GroupTargetType(object): Attributes: CUSTOMER: The enum member of type str. SUBSCRIPTION: The enum member of type str. - SELF: The enum member of type str. + ENUM_SELF: The enum member of type str. PARENT: The enum member of type str. ELDEST: The enum member of type str. additional_properties (Dict[str, object]): The additional properties for the diff --git a/advancedbilling/models/historic_usage.py b/advancedbilling/models/historic_usage.py index 20f9de9a..ef9fca82 100644 --- a/advancedbilling/models/historic_usage.py +++ b/advancedbilling/models/historic_usage.py @@ -11,8 +11,8 @@ class HistoricUsage(object): """Implementation of the 'Historic Usage' model. - 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. Attributes: total_usage_quantity (float): Total usage of a component for billing period diff --git a/advancedbilling/models/invoice.py b/advancedbilling/models/invoice.py index d88febdc..43116865 100644 --- a/advancedbilling/models/invoice.py +++ b/advancedbilling/models/invoice.py @@ -70,12 +70,12 @@ class Invoice(object): appropriate to show to customers, the number is usually shorter and consumable by the customer and the merchant alike. sequence_number (int): A monotonically increasing number assigned to invoices - as they are created. This number is unique within a site and can be used + as they are created. This number is unique within a site and can be used to sort and order invoices. transaction_time (datetime): The model property of type datetime. created_at (datetime): The model property of type datetime. updated_at (datetime): The model property of type datetime. - issue_date (date): Date the invoice was issued to the customer. This is the + issue_date (date): 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): Date the invoice is due. The format is `"YYYY-MM-DD"`. @@ -97,7 +97,7 @@ class Invoice(object): currency (str): The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. consolidation_level (InvoiceConsolidationLevel): Consolidation level of the - invoice, which is applicable to invoice consolidation. It will hold one + 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 @@ -121,12 +121,12 @@ class Invoice(object): seller (InvoiceSeller): Information about the seller (merchant) listed on the masthead of the invoice. customer (InvoiceCustomer): Information about the customer who is owner or - recipient the invoiced subscription. + recipient of the invoiced subscription. payer (InvoicePayer): The model property of type InvoicePayer. recipient_emails (List[str]): The model property of type List[str]. net_terms (int): The model property of type int. - memo (str): The memo printed on invoices of any collection type. This - message is in control of the merchant. + memo (str): The memo printed on invoices of any collection type. This message + is in control of the merchant. billing_address (InvoiceAddress): The invoice billing address. shipping_address (InvoiceAddress): The invoice shipping address. subtotal_amount (str): Subtotal of the invoice, which is the sum of all line @@ -134,7 +134,7 @@ class Invoice(object): discount_amount (str): Total discount applied to the invoice. tax_amount (str): Total tax on the invoice. total_amount (str): The invoice total, which is `subtotal_amount - - discount_amount + tax_amount`.' + discount_amount + tax_amount`. credit_amount (str): The amount of credit (from credit notes) applied to this invoice. Credits offset the amount due from the customer. debit_amount (str): The model property of type str. @@ -161,6 +161,10 @@ class Invoice(object): previous_balance_data (InvoicePreviousBalance): The model property of type InvoicePreviousBalance. public_url_expires_on (date): The format is `"YYYY-MM-DD"`. + branding_theme_id (int): 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. additional_properties (Dict[str, object]): The additional properties for the model. @@ -224,6 +228,7 @@ class Invoice(object): "public_url": "public_url", "previous_balance_data": "previous_balance_data", "public_url_expires_on": "public_url_expires_on", + "branding_theme_id": "branding_theme_id", } _optionals = [ @@ -283,6 +288,7 @@ class Invoice(object): "public_url", "previous_balance_data", "public_url_expires_on", + "branding_theme_id", ] _nullables = [ @@ -292,6 +298,7 @@ class Invoice(object): "subscription_group_id", "parent_invoice_number", "group_primary_subscription_id", + "branding_theme_id", ] def __init__( @@ -352,6 +359,7 @@ def __init__( public_url=APIHelper.SKIP, previous_balance_data=APIHelper.SKIP, public_url_expires_on=APIHelper.SKIP, + branding_theme_id=APIHelper.SKIP, additional_properties=None): """Initialize a Invoice instance.""" # Initialize members of the class @@ -476,6 +484,8 @@ def __init__( self.previous_balance_data = previous_balance_data if public_url_expires_on is not APIHelper.SKIP: self.public_url_expires_on = public_url_expires_on + if branding_theme_id is not APIHelper.SKIP: + self.branding_theme_id = branding_theme_id # Add additional model properties to the instance if additional_properties is None: @@ -761,6 +771,10 @@ def from_dictionary(cls, public_url_expires_on = dateutil.parser.parse( dictionary.get("public_url_expires_on")).date()\ if dictionary.get("public_url_expires_on") else APIHelper.SKIP + branding_theme_id =\ + dictionary.get("branding_theme_id")\ + if "branding_theme_id" in dictionary.keys()\ + else APIHelper.SKIP # Clean out expected properties from dictionary additional_properties =\ @@ -823,6 +837,7 @@ def from_dictionary(cls, public_url, previous_balance_data, public_url_expires_on, + branding_theme_id, additional_properties) @classmethod @@ -1128,6 +1143,11 @@ def __repr__(self): if hasattr(self, "public_url_expires_on") else None ) + _branding_theme_id=( + self.branding_theme_id + if hasattr(self, "branding_theme_id") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -1187,6 +1207,7 @@ def __repr__(self): f"public_url={_public_url!r}, " f"previous_balance_data={_previous_balance_data!r}, " f"public_url_expires_on={_public_url_expires_on!r}, " + f"branding_theme_id={_branding_theme_id!r}, " f"additional_properties={_additional_properties!r}, " f")" ) @@ -1473,6 +1494,11 @@ def __str__(self): if hasattr(self, "public_url_expires_on") else None ) + _branding_theme_id=( + self.branding_theme_id + if hasattr(self, "branding_theme_id") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -1532,6 +1558,7 @@ def __str__(self): f"public_url={_public_url!s}, " f"previous_balance_data={_previous_balance_data!s}, " f"public_url_expires_on={_public_url_expires_on!s}, " + f"branding_theme_id={_branding_theme_id!s}, " f"additional_properties={_additional_properties!s}, " f")" ) diff --git a/advancedbilling/models/invoice_customer.py b/advancedbilling/models/invoice_customer.py index 8e42ffc5..b032ab95 100644 --- a/advancedbilling/models/invoice_customer.py +++ b/advancedbilling/models/invoice_customer.py @@ -11,7 +11,7 @@ class InvoiceCustomer(object): """Implementation of the 'Invoice Customer' model. - Information about the customer who is owner or recipient the invoiced + Information about the customer who is owner or recipient of the invoiced subscription. Attributes: diff --git a/advancedbilling/models/invoice_discount_source_type.py b/advancedbilling/models/invoice_discount_source_type.py index ee5907fa..9cff3917 100644 --- a/advancedbilling/models/invoice_discount_source_type.py +++ b/advancedbilling/models/invoice_discount_source_type.py @@ -12,7 +12,7 @@ class InvoiceDiscountSourceType(object): Attributes: COUPON: The enum member of type str. REFERRAL: The enum member of type str. - ENUM_AD HOC COUPON: The enum member of type str. + ENUM_AD_HOC_COUPON: The enum member of type str. additional_properties (Dict[str, object]): The additional properties for the model. diff --git a/advancedbilling/models/invoice_event_payment_method.py b/advancedbilling/models/invoice_event_payment_method.py index db3f5f44..cae6c482 100644 --- a/advancedbilling/models/invoice_event_payment_method.py +++ b/advancedbilling/models/invoice_event_payment_method.py @@ -20,8 +20,7 @@ class InvoiceEventPaymentMethod(object): """ - _all_values = ["apple_pay", "bank_account", "credit_card", "external", - "paypal_account"] + _all_values = ["apple_pay", "bank_account", "credit_card", "external", "paypal_account"] APPLE_PAY = "apple_pay" BANK_ACCOUNT = "bank_account" diff --git a/advancedbilling/models/invoice_event_type.py b/advancedbilling/models/invoice_event_type.py index 40a9b48b..b6862b0a 100644 --- a/advancedbilling/models/invoice_event_type.py +++ b/advancedbilling/models/invoice_event_type.py @@ -32,9 +32,9 @@ class InvoiceEventType(object): """ - _all_values = ["issue_invoice", "apply_credit_note", "create_credit_note", - "apply_payment", "apply_debit_note", "create_debit_note", "refund_invoice", - "void_invoice", "void_remainder", "backport_invoice", "change_invoice_status", + _all_values = ["issue_invoice", "apply_credit_note", "create_credit_note", "apply_payment", + "apply_debit_note", "create_debit_note", "refund_invoice", "void_invoice", + "void_remainder", "backport_invoice", "change_invoice_status", "change_invoice_collection_method", "remove_payment", "failed_payment", "change_chargeback_status"] ISSUE_INVOICE = "issue_invoice" diff --git a/advancedbilling/models/invoice_line_item.py b/advancedbilling/models/invoice_line_item.py index 870e1cbc..8461cafb 100644 --- a/advancedbilling/models/invoice_line_item.py +++ b/advancedbilling/models/invoice_line_item.py @@ -17,22 +17,21 @@ class InvoiceLineItem(object): """Implementation of the 'Invoice Line Item' model. Attributes: - uid (str): Unique identifier for the line item. Useful when - cross-referencing the line against individual discounts in the - `discounts` or `taxes` lists. + uid (str): Unique identifier for the line item. Useful when cross-referencing + the line against individual discounts in the `discounts` or `taxes` lists. title (str): A short descriptor for the charge or item represented by this line. description (str): Detailed description for the charge or item represented by - this line. May include proration details in plain text. Note: this + 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 (str): 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 (str): 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`. + 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 (str): 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 @@ -60,7 +59,7 @@ class InvoiceLineItem(object): total_amount (str): 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`. tiered_unit_price (bool): When `true`, indicates that the actual pricing @@ -69,16 +68,16 @@ class InvoiceLineItem(object): period_range_start (date): 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), + 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): 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. + 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 (int): The model property of type int. product_id (int): The ID of the product subscribed when the charge was made. This may be set even for component charges, so true product-only diff --git a/advancedbilling/models/invoice_payment_method_type.py b/advancedbilling/models/invoice_payment_method_type.py index 9b2d49a1..ee386391 100644 --- a/advancedbilling/models/invoice_payment_method_type.py +++ b/advancedbilling/models/invoice_payment_method_type.py @@ -23,8 +23,7 @@ class InvoicePaymentMethodType(object): """ - _all_values = ["credit_card", "check", "cash", "money_order", "ach", - "other"] + _all_values = ["credit_card", "check", "cash", "money_order", "ach", "other"] CREDIT_CARD = "credit_card" CHECK = "check" diff --git a/advancedbilling/models/invoice_role.py b/advancedbilling/models/invoice_role.py index 091c07c1..fad1a5a1 100644 --- a/advancedbilling/models/invoice_role.py +++ b/advancedbilling/models/invoice_role.py @@ -25,9 +25,8 @@ class InvoiceRole(object): """ - _all_values = ["unset", "signup", "renewal", "usage", "reactivation", - "proration", "migration", "adhoc", "backport", - "backport-balance-reconciliation"] + _all_values = ["unset", "signup", "renewal", "usage", "reactivation", "proration", + "migration", "adhoc", "backport", "backport-balance-reconciliation"] UNSET = "unset" SIGNUP = "signup" diff --git a/advancedbilling/models/invoice_status.py b/advancedbilling/models/invoice_status.py index 8ed955b8..39fe6d6f 100644 --- a/advancedbilling/models/invoice_status.py +++ b/advancedbilling/models/invoice_status.py @@ -26,8 +26,7 @@ class InvoiceStatus(object): """ - _all_values = ["draft", "open", "paid", "pending", "voided", "canceled", - "processing"] + _all_values = ["draft", "open", "paid", "pending", "voided", "canceled", "processing"] DRAFT = "draft" OPEN = "open" diff --git a/advancedbilling/models/issue_invoice_event_data.py b/advancedbilling/models/issue_invoice_event_data.py index 9ed1bb75..1bd964db 100644 --- a/advancedbilling/models/issue_invoice_event_data.py +++ b/advancedbilling/models/issue_invoice_event_data.py @@ -21,7 +21,7 @@ class IssueInvoiceEventData(object): Attributes: consolidation_level (InvoiceConsolidationLevel): Consolidation level of the - invoice, which is applicable to invoice consolidation. It will hold one + 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 diff --git a/advancedbilling/models/issue_invoice_request.py b/advancedbilling/models/issue_invoice_request.py index ab4dcee0..33fc0e34 100644 --- a/advancedbilling/models/issue_invoice_request.py +++ b/advancedbilling/models/issue_invoice_request.py @@ -19,7 +19,7 @@ class IssueInvoiceRequest(object): 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 + invoice history; subscription will most likely go into "past_due" or "canceled" state (depending upon net terms and dunning settings). additional_properties (Dict[str, object]): The additional properties for the model. diff --git a/advancedbilling/models/item_category.py b/advancedbilling/models/item_category.py index b6e90661..ea3c9c7a 100644 --- a/advancedbilling/models/item_category.py +++ b/advancedbilling/models/item_category.py @@ -13,10 +13,10 @@ class ItemCategory(object): Physical Goods, Other Attributes: - ENUM_BUSINESS SOFTWARE: The enum member of type str. - ENUM_CONSUMER SOFTWARE: The enum member of type str. - ENUM_DIGITAL SERVICES: The enum member of type str. - ENUM_PHYSICAL GOODS: The enum member of type str. + ENUM_BUSINESS_SOFTWARE: The enum member of type str. + ENUM_CONSUMER_SOFTWARE: The enum member of type str. + ENUM_DIGITAL_SERVICES: The enum member of type str. + ENUM_PHYSICAL_GOODS: The enum member of type str. OTHER: The enum member of type str. additional_properties (Dict[str, object]): The additional properties for the model. diff --git a/advancedbilling/models/list_subscription_group_prepayment.py b/advancedbilling/models/list_subscription_group_prepayment.py index bba51724..e276e585 100644 --- a/advancedbilling/models/list_subscription_group_prepayment.py +++ b/advancedbilling/models/list_subscription_group_prepayment.py @@ -5,8 +5,8 @@ """ # ruff: noqa: E501 -from advancedbilling.models.list_subcription_group_prepayment_item import ( - ListSubcriptionGroupPrepaymentItem, +from advancedbilling.models.list_subscription_group_prepayment_item import ( + ListSubscriptionGroupPrepaymentItem, ) @@ -14,8 +14,8 @@ class ListSubscriptionGroupPrepayment(object): """Implementation of the 'List Subscription Group Prepayment' model. Attributes: - prepayment (ListSubcriptionGroupPrepaymentItem): The model property of type - ListSubcriptionGroupPrepaymentItem. + prepayment (ListSubscriptionGroupPrepaymentItem): The model property of type + ListSubscriptionGroupPrepaymentItem. additional_properties (Dict[str, object]): The additional properties for the model. @@ -58,7 +58,7 @@ def from_dictionary(cls, # Extract variables from the dictionary prepayment =\ - ListSubcriptionGroupPrepaymentItem.from_dictionary( + ListSubscriptionGroupPrepaymentItem.from_dictionary( dictionary.get("prepayment"))\ if dictionary.get("prepayment") else None diff --git a/advancedbilling/models/list_subcription_group_prepayment_item.py b/advancedbilling/models/list_subscription_group_prepayment_item.py similarity index 97% rename from advancedbilling/models/list_subcription_group_prepayment_item.py rename to advancedbilling/models/list_subscription_group_prepayment_item.py index 5450390c..fce7ae4c 100644 --- a/advancedbilling/models/list_subcription_group_prepayment_item.py +++ b/advancedbilling/models/list_subscription_group_prepayment_item.py @@ -8,8 +8,8 @@ from advancedbilling.api_helper import APIHelper -class ListSubcriptionGroupPrepaymentItem(object): - """Implementation of the 'List Subcription Group Prepayment Item' model. +class ListSubscriptionGroupPrepaymentItem(object): + """Implementation of the 'List Subscription Group Prepayment Item' model. Attributes: id (int): The model property of type int. @@ -63,7 +63,7 @@ def __init__( payment_type=APIHelper.SKIP, created_at=APIHelper.SKIP, additional_properties=None): - """Initialize a ListSubcriptionGroupPrepaymentItem instance.""" + """Initialize a ListSubscriptionGroupPrepaymentItem instance.""" # Initialize members of the class if id is not APIHelper.SKIP: self.id = id diff --git a/advancedbilling/models/metafield.py b/advancedbilling/models/metafield.py index 3eae69ff..34daa877 100644 --- a/advancedbilling/models/metafield.py +++ b/advancedbilling/models/metafield.py @@ -24,7 +24,7 @@ class Metafield(object): to in Advanced Billing. input_type (MetafieldInput): 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'. + set of values that can be selected. Defaults to 'text'. enum (str | List[str] | None): The model property of type str | List[str] | None. additional_properties (Dict[str, object]): The additional properties for the diff --git a/advancedbilling/models/metafield_input.py b/advancedbilling/models/metafield_input.py index 024fa7ee..8d4062a0 100644 --- a/advancedbilling/models/metafield_input.py +++ b/advancedbilling/models/metafield_input.py @@ -10,8 +10,8 @@ class MetafieldInput(object): """Implementation of the 'Metafield Input' enum. 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'. + Dropdown and radio metafields have a set of values that can be selected. Defaults + to 'text'. Attributes: BALANCE_TRACKER: The enum member of type str. diff --git a/advancedbilling/models/metered_component.py b/advancedbilling/models/metered_component.py index 0107efda..d900d9b8 100644 --- a/advancedbilling/models/metered_component.py +++ b/advancedbilling/models/metered_component.py @@ -17,17 +17,17 @@ class MeteredComponent(object): Attributes: name (str): A name for this component that is suitable for showing customers - and displaying on billing statements, ie. "Minutes". + and displaying on billing statements, e.g., "Minutes". unit_name (str): 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 + necessary. e.g., “message”, which may then be shown as “5 messages” on a subscription’s component line-item description (str): A description for the component that will be displayed to the user on the hosted signup page. handle (str): 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 '_'. + this component in subsequent requests. Must start with a letter or number + and may only contain lowercase letters, numbers, or the characters '.', + ':', '-', or '_'. taxable (bool): Boolean flag describing whether a component is taxable or not. pricing_scheme (PricingScheme): The identifier for the pricing scheme. See [Product @@ -44,7 +44,7 @@ class MeteredComponent(object): 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 0.00000065 + places. e.g., 1.00 or 0.0012 or 0.00000065 tax_code (str): 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. @@ -54,13 +54,17 @@ class MeteredComponent(object): display_on_hosted_page (bool): The model property of type bool. allow_fractional_quantities (bool): The model property of type bool. public_signup_page_ids (List[int]): The model property of type List[int]. - interval (int): 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 (int): 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): 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 (str): (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. additional_properties (Dict[str, object]): The additional properties for the model. @@ -84,6 +88,7 @@ class MeteredComponent(object): "public_signup_page_ids": "public_signup_page_ids", "interval": "interval", "interval_unit": "interval_unit", + "unspsc_code": "unspsc_code", } _optionals = [ @@ -100,10 +105,12 @@ class MeteredComponent(object): "public_signup_page_ids", "interval", "interval_unit", + "unspsc_code", ] _nullables = [ "interval_unit", + "unspsc_code", ] def __init__( @@ -124,6 +131,7 @@ def __init__( public_signup_page_ids=APIHelper.SKIP, interval=APIHelper.SKIP, interval_unit=APIHelper.SKIP, + unspsc_code=APIHelper.SKIP, additional_properties=None): """Initialize a MeteredComponent instance.""" # Initialize members of the class @@ -156,6 +164,8 @@ def __init__( self.interval = interval if interval_unit is not APIHelper.SKIP: self.interval_unit = interval_unit + if unspsc_code is not APIHelper.SKIP: + self.unspsc_code = unspsc_code # Add additional model properties to the instance if additional_properties is None: @@ -258,6 +268,10 @@ def from_dictionary(cls, dictionary.get("interval_unit")\ if "interval_unit" in dictionary.keys()\ else APIHelper.SKIP + unspsc_code =\ + dictionary.get("unspsc_code")\ + if "unspsc_code" in dictionary.keys()\ + else APIHelper.SKIP # Clean out expected properties from dictionary additional_properties =\ @@ -280,6 +294,7 @@ def from_dictionary(cls, public_signup_page_ids, interval, interval_unit, + unspsc_code, additional_properties) def __repr__(self): @@ -352,6 +367,11 @@ def __repr__(self): if hasattr(self, "interval_unit") else None ) + _unspsc_code=( + self.unspsc_code + if hasattr(self, "unspsc_code") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -371,6 +391,7 @@ def __repr__(self): f"public_signup_page_ids={_public_signup_page_ids!r}, " f"interval={_interval!r}, " f"interval_unit={_interval_unit!r}, " + f"unspsc_code={_unspsc_code!r}, " f"additional_properties={_additional_properties!r}, " f")" ) @@ -445,6 +466,11 @@ def __str__(self): if hasattr(self, "interval_unit") else None ) + _unspsc_code=( + self.unspsc_code + if hasattr(self, "unspsc_code") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -464,6 +490,7 @@ def __str__(self): f"public_signup_page_ids={_public_signup_page_ids!s}, " f"interval={_interval!s}, " f"interval_unit={_interval_unit!s}, " + f"unspsc_code={_unspsc_code!s}, " f"additional_properties={_additional_properties!s}, " f")" ) diff --git a/advancedbilling/models/metered_usage.py b/advancedbilling/models/metered_usage.py index 5cad0486..d8942dee 100644 --- a/advancedbilling/models/metered_usage.py +++ b/advancedbilling/models/metered_usage.py @@ -13,7 +13,7 @@ class MeteredUsage(object): Attributes: previous_unit_balance (str): The model property of type str. - new_unit_balance (int): The model property of type int. + new_unit_balance (int | str): The model property of type int | str. usage_quantity (int): The model property of type int. component_id (int): The model property of type int. component_handle (str): The model property of type str. @@ -70,6 +70,10 @@ def from_dictionary(cls, object: An instance of this structure class. """ + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) + if not isinstance(dictionary, dict) or dictionary is None: return None @@ -78,10 +82,12 @@ def from_dictionary(cls, dictionary.get("previous_unit_balance")\ if dictionary.get("previous_unit_balance")\ else None - new_unit_balance =\ - dictionary.get("new_unit_balance")\ - if dictionary.get("new_unit_balance")\ - else None + new_unit_balance = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("MeteredUsageNewUnitBalance"), + dictionary.get("new_unit_balance"), + False)\ + if dictionary.get("new_unit_balance") is not None\ + else None usage_quantity =\ dictionary.get("usage_quantity")\ if dictionary.get("usage_quantity")\ @@ -125,6 +131,10 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) + if isinstance(dictionary, cls): return APIHelper.is_valid_type( value=dictionary.previous_unit_balance, @@ -133,13 +143,8 @@ def validate(cls, dictionary): value, str, )) \ - and APIHelper.is_valid_type( - value=dictionary.new_unit_balance, - type_callable=lambda value: - isinstance( - value, - int, - )) \ + and (UnionTypeLookUp.get("MeteredUsageNewUnitBalance") + .validate(dictionary.new_unit_balance).is_valid) \ and APIHelper.is_valid_type( value=dictionary.usage_quantity, type_callable=lambda value: @@ -179,13 +184,8 @@ def validate(cls, dictionary): value, str, )) \ - and APIHelper.is_valid_type( - value=dictionary.get("new_unit_balance"), - type_callable=lambda value: - isinstance( - value, - int, - )) \ + and (UnionTypeLookUp.get("MeteredUsageNewUnitBalance") + .validate(dictionary.get("new_unit_balance")).is_valid) \ and APIHelper.is_valid_type( value=dictionary.get("usage_quantity"), type_callable=lambda value: diff --git a/advancedbilling/models/offer_item.py b/advancedbilling/models/offer_item.py index 6da1a13d..a6344ee5 100644 --- a/advancedbilling/models/offer_item.py +++ b/advancedbilling/models/offer_item.py @@ -24,9 +24,9 @@ class OfferItem(object): price_point_name (str): The model property of type str. currency_prices (List[CurrencyPrice]): The model property of type List[CurrencyPrice]. - interval (int): 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 + interval (int): 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): A string representing the interval unit for this component price point, either month or day. This property is only diff --git a/advancedbilling/models/on_off_component.py b/advancedbilling/models/on_off_component.py index 99d4e26b..0b4519a4 100644 --- a/advancedbilling/models/on_off_component.py +++ b/advancedbilling/models/on_off_component.py @@ -16,13 +16,13 @@ class OnOffComponent(object): Attributes: name (str): A name for this component that is suitable for showing customers - and displaying on billing statements, ie. "Minutes". + and displaying on billing statements, e.g., "Minutes". description (str): A description for the component that will be displayed to the user on the hosted signup page. handle (str): 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 '_'. + this component in subsequent requests. Must start with a letter or number + and may only contain lowercase letters, numbers, or the characters '.', + ':', '-', or '_'. taxable (bool): Boolean flag describing whether a component is taxable or not. upgrade_charge (CreditType): The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if @@ -34,7 +34,7 @@ class OnOffComponent(object): List[ComponentPricePointItem]. unit_price (str | float): 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 + can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065 tax_code (str): 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. @@ -44,13 +44,17 @@ class OnOffComponent(object): display_on_hosted_page (bool): The model property of type bool. allow_fractional_quantities (bool): The model property of type bool. public_signup_page_ids (List[int]): The model property of type List[int]. - interval (int): 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 (int): 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): 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 (str): (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. additional_properties (Dict[str, object]): The additional properties for the model. @@ -73,6 +77,7 @@ class OnOffComponent(object): "public_signup_page_ids": "public_signup_page_ids", "interval": "interval", "interval_unit": "interval_unit", + "unspsc_code": "unspsc_code", } _optionals = [ @@ -89,12 +94,14 @@ class OnOffComponent(object): "public_signup_page_ids", "interval", "interval_unit", + "unspsc_code", ] _nullables = [ "upgrade_charge", "downgrade_credit", "interval_unit", + "unspsc_code", ] def __init__( @@ -114,6 +121,7 @@ def __init__( public_signup_page_ids=APIHelper.SKIP, interval=APIHelper.SKIP, interval_unit=APIHelper.SKIP, + unspsc_code=APIHelper.SKIP, additional_properties=None): """Initialize a OnOffComponent instance.""" # Initialize members of the class @@ -145,6 +153,8 @@ def __init__( self.interval = interval if interval_unit is not APIHelper.SKIP: self.interval_unit = interval_unit + if unspsc_code is not APIHelper.SKIP: + self.unspsc_code = unspsc_code # Add additional model properties to the instance if additional_properties is None: @@ -239,6 +249,10 @@ def from_dictionary(cls, dictionary.get("interval_unit")\ if "interval_unit" in dictionary.keys()\ else APIHelper.SKIP + unspsc_code =\ + dictionary.get("unspsc_code")\ + if "unspsc_code" in dictionary.keys()\ + else APIHelper.SKIP # Clean out expected properties from dictionary additional_properties =\ @@ -260,6 +274,7 @@ def from_dictionary(cls, public_signup_page_ids, interval, interval_unit, + unspsc_code, additional_properties) @classmethod @@ -372,6 +387,11 @@ def __repr__(self): if hasattr(self, "interval_unit") else None ) + _unspsc_code=( + self.unspsc_code + if hasattr(self, "unspsc_code") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -390,6 +410,7 @@ def __repr__(self): f"public_signup_page_ids={_public_signup_page_ids!r}, " f"interval={_interval!r}, " f"interval_unit={_interval_unit!r}, " + f"unspsc_code={_unspsc_code!r}, " f"additional_properties={_additional_properties!r}, " f")" ) @@ -463,6 +484,11 @@ def __str__(self): if hasattr(self, "interval_unit") else None ) + _unspsc_code=( + self.unspsc_code + if hasattr(self, "unspsc_code") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -481,6 +507,7 @@ def __str__(self): f"public_signup_page_ids={_public_signup_page_ids!s}, " f"interval={_interval!s}, " f"interval_unit={_interval_unit!s}, " + f"unspsc_code={_unspsc_code!s}, " f"additional_properties={_additional_properties!s}, " f")" ) diff --git a/advancedbilling/models/pause_request.py b/advancedbilling/models/pause_request.py index 507d5273..03c665d5 100644 --- a/advancedbilling/models/pause_request.py +++ b/advancedbilling/models/pause_request.py @@ -14,7 +14,7 @@ class PauseRequest(object): """Implementation of the 'Pause Request' model. - Allows to pause a Subscription + Allows you to pause a Subscription. Attributes: hold (AutoResume): The model property of type AutoResume. diff --git a/advancedbilling/models/payment_profile_attributes.py b/advancedbilling/models/payment_profile_attributes.py index e649487b..595c587a 100644 --- a/advancedbilling/models/payment_profile_attributes.py +++ b/advancedbilling/models/payment_profile_attributes.py @@ -16,8 +16,8 @@ class PaymentProfileAttributes(object): Attributes: chargify_token (str): (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) + passed as a sole attribute of `payment_profile_attributes` (e.g., + tok_9g6hw85pnpt6knmskpwp4ttt). id (int): The model property of type int. payment_type (PaymentType): The model property of type PaymentType. first_name (str): (Optional) First name on card or bank account. If omitted, @@ -25,44 +25,44 @@ class PaymentProfileAttributes(object): last_name (str): (Optional) Last name on card or bank account. If omitted, the last_name from customer attributes will be used. masked_card_number (str): The model property of type str. - full_number (str): The full credit card number (string representation, i.e. + full_number (str): The full credit card number (string representation, e.g., 5424000000000015) card_type (CardType): (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. + 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 (int | str | None): (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 + expiration month, as an integer or string, e.g., 5 expiration_year (int | str | None): (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 + expiration year, as an integer or string, e.g., 2012 billing_address (str): (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 + billing street address (e.g., 123 Main St.). This value is merely passed through to the payment gateway. billing_address_2 (str): (Optional) Second line of the customer’s billing - address i.e. Apt. 100 + address, e.g., Apt. 100 billing_city (str): (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 + (e.g., “Boston”). This value is merely passed through to the payment gateway. billing_state (str): (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 + 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 (str): (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 this time. billing_zip (str): (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 + code (e.g., 12345). This value is merely passed through to the payment gateway. current_vault (AllVaults): (Optional, used only for Subscription Import) The vault that stores the payment profile with the provided vault_token. @@ -90,7 +90,7 @@ class PaymentProfileAttributes(object): the payment gateway. last_four (str): (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 + 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. additional_properties (Dict[str, object]): The additional properties for the model. diff --git a/advancedbilling/models/payment_type.py b/advancedbilling/models/payment_type.py index f13ca574..b49f33e4 100644 --- a/advancedbilling/models/payment_type.py +++ b/advancedbilling/models/payment_type.py @@ -19,8 +19,7 @@ class PaymentType(object): """ - _all_values = ["credit_card", "bank_account", "paypal_account", - "apple_pay"] + _all_values = ["credit_card", "bank_account", "paypal_account", "apple_pay"] CREDIT_CARD = "credit_card" BANK_ACCOUNT = "bank_account" diff --git a/advancedbilling/models/prepaid_usage.py b/advancedbilling/models/prepaid_usage.py index 86c36d59..c73a387c 100644 --- a/advancedbilling/models/prepaid_usage.py +++ b/advancedbilling/models/prepaid_usage.py @@ -17,8 +17,8 @@ class PrepaidUsage(object): Attributes: previous_unit_balance (str): The model property of type str. previous_overage_unit_balance (str): The model property of type str. - new_unit_balance (int): The model property of type int. - new_overage_unit_balance (int): The model property of type int. + new_unit_balance (int | str): The model property of type int | str. + new_overage_unit_balance (int | str): The model property of type int | str. usage_quantity (int): The model property of type int. overage_usage_quantity (int): The model property of type int. component_id (int): The model property of type int. @@ -90,6 +90,10 @@ def from_dictionary(cls, object: An instance of this structure class. """ + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) + if not isinstance(dictionary, dict) or dictionary is None: return None @@ -102,14 +106,18 @@ def from_dictionary(cls, dictionary.get("previous_overage_unit_balance")\ if dictionary.get("previous_overage_unit_balance")\ else None - new_unit_balance =\ - dictionary.get("new_unit_balance")\ - if dictionary.get("new_unit_balance")\ - else None - new_overage_unit_balance =\ - dictionary.get("new_overage_unit_balance")\ - if dictionary.get("new_overage_unit_balance")\ - else None + new_unit_balance = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("PrepaidUsageNewUnitBalance"), + dictionary.get("new_unit_balance"), + False)\ + if dictionary.get("new_unit_balance") is not None\ + else None + new_overage_unit_balance = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("PrepaidUsageNewOverageUnitBalance"), + dictionary.get("new_overage_unit_balance"), + False)\ + if dictionary.get("new_overage_unit_balance") is not None\ + else None usage_quantity =\ dictionary.get("usage_quantity")\ if dictionary.get("usage_quantity")\ @@ -167,6 +175,10 @@ def validate(cls, dictionary): boolean : if dictionary is valid contains required properties. """ + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) + if isinstance(dictionary, cls): return APIHelper.is_valid_type( value=dictionary.previous_unit_balance, @@ -182,20 +194,10 @@ def validate(cls, dictionary): value, str, )) \ - and APIHelper.is_valid_type( - value=dictionary.new_unit_balance, - type_callable=lambda value: - isinstance( - value, - int, - )) \ - and APIHelper.is_valid_type( - value=dictionary.new_overage_unit_balance, - type_callable=lambda value: - isinstance( - value, - int, - )) \ + and (UnionTypeLookUp.get("PrepaidUsageNewUnitBalance") + .validate(dictionary.new_unit_balance).is_valid) \ + and (UnionTypeLookUp.get("PrepaidUsageNewOverageUnitBalance") + .validate(dictionary.new_overage_unit_balance).is_valid) \ and APIHelper.is_valid_type( value=dictionary.usage_quantity, type_callable=lambda value: @@ -255,20 +257,10 @@ def validate(cls, dictionary): value, str, )) \ - and APIHelper.is_valid_type( - value=dictionary.get("new_unit_balance"), - type_callable=lambda value: - isinstance( - value, - int, - )) \ - and APIHelper.is_valid_type( - value=dictionary.get("new_overage_unit_balance"), - type_callable=lambda value: - isinstance( - value, - int, - )) \ + and (UnionTypeLookUp.get("PrepaidUsageNewUnitBalance") + .validate(dictionary.get("new_unit_balance")).is_valid) \ + and (UnionTypeLookUp.get("PrepaidUsageNewOverageUnitBalance") + .validate(dictionary.get("new_overage_unit_balance")).is_valid) \ and APIHelper.is_valid_type( value=dictionary.get("usage_quantity"), type_callable=lambda value: diff --git a/advancedbilling/models/prepaid_usage_component.py b/advancedbilling/models/prepaid_usage_component.py index 9a83cc64..fabe50fa 100644 --- a/advancedbilling/models/prepaid_usage_component.py +++ b/advancedbilling/models/prepaid_usage_component.py @@ -20,17 +20,17 @@ class PrepaidUsageComponent(object): Attributes: name (str): A name for this component that is suitable for showing customers - and displaying on billing statements, ie. "Minutes". + and displaying on billing statements, e.g., "Minutes". unit_name (str): 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 + necessary. e.g., “message”, which may then be shown as “5 messages” on a subscription’s component line-item description (str): A description for the component that will be displayed to the user on the hosted signup page. handle (str): 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 '_'. + this component in subsequent requests. Must start with a letter or number + and may only contain lowercase letters, numbers, or the characters '.', + ':', '-', or '_'. taxable (bool): Boolean flag describing whether a component is taxable or not. pricing_scheme (PricingScheme): The identifier for the pricing scheme. See [Product @@ -53,7 +53,7 @@ class PrepaidUsageComponent(object): 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 0.00000065 + places. e.g., 1.00 or 0.0012 or 0.00000065 tax_code (str): 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. @@ -62,9 +62,9 @@ class PrepaidUsageComponent(object): the component on generated invoices. overage_pricing (OveragePricing): The model property of type OveragePricing. rollover_prepaid_remainder (bool): 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. renew_prepaid_allocation (bool): Boolean which controls whether or not the - allocated quantity should be renewed at the beginning of each period + allocated quantity should be renewed at the beginning of each period. expiration_interval (float): (only for prepaid usage components where rollover_prepaid_remainder is true) The number of `expiration_interval_unit`s after which rollover amounts should expire @@ -73,6 +73,10 @@ class PrepaidUsageComponent(object): display_on_hosted_page (bool): The model property of type bool. allow_fractional_quantities (bool): The model property of type bool. public_signup_page_ids (List[int]): The model property of type List[int]. + unspsc_code (str): (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. additional_properties (Dict[str, object]): The additional properties for the model. @@ -101,6 +105,7 @@ class PrepaidUsageComponent(object): "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", } _optionals = [ @@ -121,12 +126,14 @@ class PrepaidUsageComponent(object): "display_on_hosted_page", "allow_fractional_quantities", "public_signup_page_ids", + "unspsc_code", ] _nullables = [ "upgrade_charge", "downgrade_credit", "expiration_interval_unit", + "unspsc_code", ] def __init__( @@ -152,6 +159,7 @@ def __init__( display_on_hosted_page=APIHelper.SKIP, allow_fractional_quantities=APIHelper.SKIP, public_signup_page_ids=APIHelper.SKIP, + unspsc_code=APIHelper.SKIP, additional_properties=None): """Initialize a PrepaidUsageComponent instance.""" # Initialize members of the class @@ -193,6 +201,8 @@ def __init__( self.allow_fractional_quantities = allow_fractional_quantities if public_signup_page_ids is not APIHelper.SKIP: self.public_signup_page_ids = public_signup_page_ids + if unspsc_code is not APIHelper.SKIP: + self.unspsc_code = unspsc_code # Add additional model properties to the instance if additional_properties is None: @@ -315,6 +325,10 @@ def from_dictionary(cls, dictionary.get("public_signup_page_ids")\ if dictionary.get("public_signup_page_ids")\ else APIHelper.SKIP + unspsc_code =\ + dictionary.get("unspsc_code")\ + if "unspsc_code" in dictionary.keys()\ + else APIHelper.SKIP # Clean out expected properties from dictionary additional_properties =\ @@ -342,6 +356,7 @@ def from_dictionary(cls, display_on_hosted_page, allow_fractional_quantities, public_signup_page_ids, + unspsc_code, additional_properties) def __repr__(self): @@ -435,6 +450,11 @@ def __repr__(self): if hasattr(self, "public_signup_page_ids") else None ) + _unspsc_code=( + self.unspsc_code + if hasattr(self, "unspsc_code") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -459,6 +479,7 @@ def __repr__(self): f"display_on_hosted_page={_display_on_hosted_page!r}, " f"allow_fractional_quantities={_allow_fractional_quantities!r}, " f"public_signup_page_ids={_public_signup_page_ids!r}, " + f"unspsc_code={_unspsc_code!r}, " f"additional_properties={_additional_properties!r}, " f")" ) @@ -554,6 +575,11 @@ def __str__(self): if hasattr(self, "public_signup_page_ids") else None ) + _unspsc_code=( + self.unspsc_code + if hasattr(self, "unspsc_code") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -578,6 +604,7 @@ def __str__(self): f"display_on_hosted_page={_display_on_hosted_page!s}, " f"allow_fractional_quantities={_allow_fractional_quantities!s}, " f"public_signup_page_ids={_public_signup_page_ids!s}, " + f"unspsc_code={_unspsc_code!s}, " f"additional_properties={_additional_properties!s}, " f")" ) diff --git a/advancedbilling/models/price.py b/advancedbilling/models/price.py index 6694770b..5df609e8 100644 --- a/advancedbilling/models/price.py +++ b/advancedbilling/models/price.py @@ -15,7 +15,7 @@ class Price(object): starting_quantity (int | str): The model property of type int | str. ending_quantity (int | str | None): The model property of type int | str | None. - unit_price (float | str): The price can contain up to 8 decimal places. i.e. + unit_price (float | str): The price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065 additional_properties (Dict[str, object]): The additional properties for the model. diff --git a/advancedbilling/models/product.py b/advancedbilling/models/product.py index 711f21f5..49fe1084 100644 --- a/advancedbilling/models/product.py +++ b/advancedbilling/models/product.py @@ -22,21 +22,22 @@ class Product(object): name (str): The product name handle (str): The product API handle description (str): The product description - accounting_code (str): E.g. Internal ID or SKU Number + accounting_code (str): E.g., Internal ID or SKU Number request_credit_card (bool): 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 (int): 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 + unit to calculate the full interval. expiration_interval_unit (ExpirationIntervalUnit): A string representing the expiration interval unit for this product, either month, day or never created_at (datetime): Timestamp indicating when this product was created updated_at (datetime): Timestamp indicating when this product was last updated price_in_cents (int): The product price, in integer cents - interval (int): 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 (int): 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): A string representing the interval unit for this product, either month or day initial_charge_in_cents (int): The up front charge you have specified. @@ -45,7 +46,7 @@ class Product(object): trial_interval (int): 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 + calculate the full interval. trial_interval_unit (IntervalUnit): A string representing the trial interval unit for this product, either month or day archived_at (datetime): Timestamp indicating when this product was archived @@ -61,7 +62,7 @@ class Product(object): update_return_params (str): 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). product_family (ProductFamily): The model property of type ProductFamily. public_signup_pages (List[PublicSignupPage]): The model property of type List[PublicSignupPage]. @@ -82,6 +83,10 @@ class Product(object): Software, Digital Services, Physical Goods, Other product_price_point_id (int): The model property of type int. product_price_point_handle (str): The model property of type str. + unspsc_code (str): (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. additional_properties (Dict[str, object]): The additional properties for the model. @@ -126,6 +131,7 @@ class Product(object): "item_category": "item_category", "product_price_point_id": "product_price_point_id", "product_price_point_handle": "product_price_point_handle", + "unspsc_code": "unspsc_code", } _optionals = [ @@ -166,6 +172,7 @@ class Product(object): "item_category", "product_price_point_id", "product_price_point_handle", + "unspsc_code", ] _nullables = [ @@ -187,6 +194,7 @@ class Product(object): "use_site_exchange_rate", "item_category", "product_price_point_handle", + "unspsc_code", ] def __init__( @@ -228,6 +236,7 @@ def __init__( item_category=APIHelper.SKIP, product_price_point_id=APIHelper.SKIP, product_price_point_handle=APIHelper.SKIP, + unspsc_code=APIHelper.SKIP, additional_properties=None): """Initialize a Product instance.""" # Initialize members of the class @@ -314,6 +323,8 @@ def __init__( self.product_price_point_id = product_price_point_id if product_price_point_handle is not APIHelper.SKIP: self.product_price_point_handle = product_price_point_handle + if unspsc_code is not APIHelper.SKIP: + self.unspsc_code = unspsc_code # Add additional model properties to the instance if additional_properties is None: @@ -492,6 +503,10 @@ def from_dictionary(cls, dictionary.get("product_price_point_handle")\ if "product_price_point_handle" in dictionary.keys()\ else APIHelper.SKIP + unspsc_code =\ + dictionary.get("unspsc_code")\ + if "unspsc_code" in dictionary.keys()\ + else APIHelper.SKIP # Clean out expected properties from dictionary additional_properties =\ @@ -535,6 +550,7 @@ def from_dictionary(cls, item_category, product_price_point_id, product_price_point_handle, + unspsc_code, additional_properties) def __repr__(self): @@ -724,6 +740,11 @@ def __repr__(self): if hasattr(self, "product_price_point_handle") else None ) + _unspsc_code=( + self.unspsc_code + if hasattr(self, "unspsc_code") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -764,6 +785,7 @@ def __repr__(self): f"item_category={_item_category!r}, " f"product_price_point_id={_product_price_point_id!r}, " f"product_price_point_handle={_product_price_point_handle!r}, " + f"unspsc_code={_unspsc_code!r}, " f"additional_properties={_additional_properties!r}, " f")" ) @@ -955,6 +977,11 @@ def __str__(self): if hasattr(self, "product_price_point_handle") else None ) + _unspsc_code=( + self.unspsc_code + if hasattr(self, "unspsc_code") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -995,6 +1022,7 @@ def __str__(self): f"item_category={_item_category!s}, " f"product_price_point_id={_product_price_point_id!s}, " f"product_price_point_handle={_product_price_point_handle!s}, " + f"unspsc_code={_unspsc_code!s}, " f"additional_properties={_additional_properties!s}, " f")" ) diff --git a/advancedbilling/models/product_family.py b/advancedbilling/models/product_family.py index 3b4295da..2e75de69 100644 --- a/advancedbilling/models/product_family.py +++ b/advancedbilling/models/product_family.py @@ -17,6 +17,8 @@ class ProductFamily(object): handle (str): The model property of type str. accounting_code (str): The model property of type str. description (str): The model property of type str. + surcharging (bool): Whether surcharging applies to this product family. Only + included on sites where surcharging is enabled. created_at (datetime): The model property of type datetime. updated_at (datetime): The model property of type datetime. archived_at (datetime): Timestamp indicating when this product family was @@ -33,6 +35,7 @@ class ProductFamily(object): "handle": "handle", "accounting_code": "accounting_code", "description": "description", + "surcharging": "surcharging", "created_at": "created_at", "updated_at": "updated_at", "archived_at": "archived_at", @@ -44,6 +47,7 @@ class ProductFamily(object): "handle", "accounting_code", "description", + "surcharging", "created_at", "updated_at", "archived_at", @@ -62,6 +66,7 @@ def __init__( handle=APIHelper.SKIP, accounting_code=APIHelper.SKIP, description=APIHelper.SKIP, + surcharging=APIHelper.SKIP, created_at=APIHelper.SKIP, updated_at=APIHelper.SKIP, archived_at=APIHelper.SKIP, @@ -78,6 +83,8 @@ def __init__( self.accounting_code = accounting_code if description is not APIHelper.SKIP: self.description = description + if surcharging is not APIHelper.SKIP: + self.surcharging = surcharging if created_at is not APIHelper.SKIP: self.created_at =\ APIHelper.apply_datetime_converter( @@ -137,6 +144,10 @@ def from_dictionary(cls, dictionary.get("description")\ if "description" in dictionary.keys()\ else APIHelper.SKIP + surcharging =\ + dictionary.get("surcharging")\ + if "surcharging" in dictionary.keys()\ + else APIHelper.SKIP created_at = APIHelper.RFC3339DateTime.from_value( dictionary.get("created_at")).datetime\ if dictionary.get("created_at") else APIHelper.SKIP @@ -161,6 +172,7 @@ def from_dictionary(cls, handle, accounting_code, description, + surcharging, created_at, updated_at, archived_at, @@ -193,6 +205,11 @@ def __repr__(self): if hasattr(self, "description") else None ) + _surcharging=( + self.surcharging + if hasattr(self, "surcharging") + else None + ) _created_at=( self.created_at if hasattr(self, "created_at") @@ -216,6 +233,7 @@ def __repr__(self): f"handle={_handle!r}, " f"accounting_code={_accounting_code!r}, " f"description={_description!r}, " + f"surcharging={_surcharging!r}, " f"created_at={_created_at!r}, " f"updated_at={_updated_at!r}, " f"archived_at={_archived_at!r}, " @@ -250,6 +268,11 @@ def __str__(self): if hasattr(self, "description") else None ) + _surcharging=( + self.surcharging + if hasattr(self, "surcharging") + else None + ) _created_at=( self.created_at if hasattr(self, "created_at") @@ -273,6 +296,7 @@ def __str__(self): f"handle={_handle!s}, " f"accounting_code={_accounting_code!s}, " f"description={_description!s}, " + f"surcharging={_surcharging!s}, " f"created_at={_created_at!s}, " f"updated_at={_updated_at!s}, " f"archived_at={_archived_at!s}, " diff --git a/advancedbilling/models/product_price_point.py b/advancedbilling/models/product_price_point.py index 33cb5ec7..8ba71fb1 100644 --- a/advancedbilling/models/product_price_point.py +++ b/advancedbilling/models/product_price_point.py @@ -19,19 +19,19 @@ class ProductPricePoint(object): name (str): The product price point name handle (str): The product price point API handle price_in_cents (int): The product price point price, in integer cents - interval (int): 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 (int): 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): A string representing the interval unit for this product price point, either month or day trial_price_in_cents (int): The product price point trial price, in integer cents - trial_interval (int): The numerical trial interval. i.e. an interval of ‘30’ + trial_interval (int): 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 + point trial would last 30 days. trial_interval_unit (IntervalUnit): A string representing the trial interval unit for this product price point, either month or day - trial_type (TrialType): Indicates how a trial is handled when the trail + trial_type (TrialType): 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 @@ -41,9 +41,9 @@ class ProductPricePoint(object): initial_charge_in_cents (int): The product price point initial charge, in integer cents initial_charge_after_trial (bool): The model property of type bool. - expiration_interval (int): The numerical expiration interval. i.e. an + expiration_interval (int): 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 + day would mean this product price point would expire after 30 days. expiration_interval_unit (ExpirationIntervalUnit): A string representing the expiration interval unit for this product price point, either month, day or never diff --git a/advancedbilling/models/proforma_invoice.py b/advancedbilling/models/proforma_invoice.py index 82fbe118..0481c9d7 100644 --- a/advancedbilling/models/proforma_invoice.py +++ b/advancedbilling/models/proforma_invoice.py @@ -61,7 +61,7 @@ class ProformaInvoice(object): payment_instructions (str): The model property of type str. currency (str): The model property of type str. consolidation_level (InvoiceConsolidationLevel): Consolidation level of the - invoice, which is applicable to invoice consolidation. It will hold one + 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 @@ -73,11 +73,11 @@ class ProformaInvoice(object): product_name (str): The model property of type str. product_family_name (str): The model property of type str. role (ProformaInvoiceRole): 'proforma' value is deprecated in favor of - proforma_adhoc and proforma_automatic + proforma_adhoc and proforma_automatic. seller (InvoiceSeller): Information about the seller (merchant) listed on the masthead of the invoice. customer (InvoiceCustomer): Information about the customer who is owner or - recipient the invoiced subscription. + recipient of the invoiced subscription. memo (str): The model property of type str. billing_address (InvoiceAddress): The model property of type InvoiceAddress. shipping_address (InvoiceAddress): The model property of type InvoiceAddress. diff --git a/advancedbilling/models/proforma_invoice_role.py b/advancedbilling/models/proforma_invoice_role.py index b3198e69..8d2fb0ca 100644 --- a/advancedbilling/models/proforma_invoice_role.py +++ b/advancedbilling/models/proforma_invoice_role.py @@ -9,7 +9,7 @@ class ProformaInvoiceRole(object): """Implementation of the 'Proforma Invoice Role' enum. - 'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic + 'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic. Attributes: UNSET: The enum member of type str. diff --git a/advancedbilling/models/public_signup_page.py b/advancedbilling/models/public_signup_page.py index d1f69320..3d2ea0d4 100644 --- a/advancedbilling/models/public_signup_page.py +++ b/advancedbilling/models/public_signup_page.py @@ -14,11 +14,11 @@ class PublicSignupPage(object): Attributes: id (int): The id of the signup page (public_signup_pages only) return_url (str): The url to which a customer will be returned after a - successful signup (public_signup_pages only) + successful signup (public_signup_pages only). return_params (str): The params to be appended to the return_url (public_signup_pages only) url (str): The url where the signup page can be viewed (public_signup_pages - only) + only). additional_properties (Dict[str, object]): The additional properties for the model. diff --git a/advancedbilling/models/q_scope.py b/advancedbilling/models/q_scope.py new file mode 100644 index 00000000..227597aa --- /dev/null +++ b/advancedbilling/models/q_scope.py @@ -0,0 +1,61 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 + +class QScope(object): + """Implementation of the 'q_scope' enum. + + Attributes: + FULL_NAME: The enum member of type str. + FIRST_NAME: The enum member of type str. + LAST_NAME: The enum member of type str. + ORGANIZATION: The enum member of type str. + CUSTOMER_REFERENCE: The enum member of type str. + SUBSCRIPTION_REFERENCE: The enum member of type str. + LAST_FOUR: The enum member of type str. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + FULL_NAME = "full_name" + + FIRST_NAME = "first_name" + + LAST_NAME = "last_name" + + ORGANIZATION = "organization" + + CUSTOMER_REFERENCE = "customer_reference" + + SUBSCRIPTION_REFERENCE = "subscription_reference" + + LAST_FOUR = "last_four" + + @classmethod + def from_value(cls, value, default=None): + """Return the matching enum value for the given input.""" + if value is None: + return default + + # If numeric and matches directly + if isinstance(value, int): + for name, val in cls.__dict__.items(): + if not name.startswith("_") and val == value: + return val + + # If string, perform case-insensitive match + if isinstance(value, str): + value_lower = value.lower() + for name, val in cls.__dict__.items(): + if not name.startswith("_") and ( + name.lower() == value_lower or str(val).lower() == value_lower + ): + return val + + # Fallback to default + return default diff --git a/advancedbilling/models/quantity_based_component.py b/advancedbilling/models/quantity_based_component.py index 022bede5..388052ae 100644 --- a/advancedbilling/models/quantity_based_component.py +++ b/advancedbilling/models/quantity_based_component.py @@ -17,17 +17,17 @@ class QuantityBasedComponent(object): Attributes: name (str): A name for this component that is suitable for showing customers - and displaying on billing statements, ie. "Minutes". - unit_name (str): The name of the unit of measurement for the component. It + and displaying on billing statements, e.g., "Minutes". + unit_name (str): “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 + necessary. e.g., “message”, which may then be shown as “5 messages” on a + subscription’s component line-item.” description (str): A description for the component that will be displayed to the user on the hosted signup page. handle (str): 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 '_'. + this component in subsequent requests. Must start with a letter or number + and may only contain lowercase letters, numbers, or the characters '.', + ':', '-', or '_'. taxable (bool): Boolean flag describing whether a component is taxable or not. pricing_scheme (PricingScheme): The identifier for the pricing scheme. See [Product @@ -50,7 +50,7 @@ class QuantityBasedComponent(object): 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 0.00000065 + places. e.g., 1.00 or 0.0012 or 0.00000065 tax_code (str): 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. @@ -61,13 +61,17 @@ class QuantityBasedComponent(object): display_on_hosted_page (bool): The model property of type bool. allow_fractional_quantities (bool): The model property of type bool. public_signup_page_ids (List[int]): The model property of type List[int]. - interval (int): 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 (int): 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): 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 (str): (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. additional_properties (Dict[str, object]): The additional properties for the model. @@ -94,6 +98,7 @@ class QuantityBasedComponent(object): "public_signup_page_ids": "public_signup_page_ids", "interval": "interval", "interval_unit": "interval_unit", + "unspsc_code": "unspsc_code", } _optionals = [ @@ -113,12 +118,14 @@ class QuantityBasedComponent(object): "public_signup_page_ids", "interval", "interval_unit", + "unspsc_code", ] _nullables = [ "upgrade_charge", "downgrade_credit", "interval_unit", + "unspsc_code", ] def __init__( @@ -142,6 +149,7 @@ def __init__( public_signup_page_ids=APIHelper.SKIP, interval=APIHelper.SKIP, interval_unit=APIHelper.SKIP, + unspsc_code=APIHelper.SKIP, additional_properties=None): """Initialize a QuantityBasedComponent instance.""" # Initialize members of the class @@ -180,6 +188,8 @@ def __init__( self.interval = interval if interval_unit is not APIHelper.SKIP: self.interval_unit = interval_unit + if unspsc_code is not APIHelper.SKIP: + self.unspsc_code = unspsc_code # Add additional model properties to the instance if additional_properties is None: @@ -294,6 +304,10 @@ def from_dictionary(cls, dictionary.get("interval_unit")\ if "interval_unit" in dictionary.keys()\ else APIHelper.SKIP + unspsc_code =\ + dictionary.get("unspsc_code")\ + if "unspsc_code" in dictionary.keys()\ + else APIHelper.SKIP # Clean out expected properties from dictionary additional_properties =\ @@ -319,6 +333,7 @@ def from_dictionary(cls, public_signup_page_ids, interval, interval_unit, + unspsc_code, additional_properties) def __repr__(self): @@ -406,6 +421,11 @@ def __repr__(self): if hasattr(self, "interval_unit") else None ) + _unspsc_code=( + self.unspsc_code + if hasattr(self, "unspsc_code") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -428,6 +448,7 @@ def __repr__(self): f"public_signup_page_ids={_public_signup_page_ids!r}, " f"interval={_interval!r}, " f"interval_unit={_interval_unit!r}, " + f"unspsc_code={_unspsc_code!r}, " f"additional_properties={_additional_properties!r}, " f")" ) @@ -517,6 +538,11 @@ def __str__(self): if hasattr(self, "interval_unit") else None ) + _unspsc_code=( + self.unspsc_code + if hasattr(self, "unspsc_code") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -539,6 +565,7 @@ def __str__(self): f"public_signup_page_ids={_public_signup_page_ids!s}, " f"interval={_interval!s}, " f"interval_unit={_interval_unit!s}, " + f"unspsc_code={_unspsc_code!s}, " f"additional_properties={_additional_properties!s}, " f")" ) diff --git a/advancedbilling/models/reactivate_subscription_request.py b/advancedbilling/models/reactivate_subscription_request.py index ff3834cd..44235f46 100644 --- a/advancedbilling/models/reactivate_subscription_request.py +++ b/advancedbilling/models/reactivate_subscription_request.py @@ -16,7 +16,7 @@ class ReactivateSubscriptionRequest(object): Attributes: calendar_billing (ReactivationBilling): These values are only applicable to - subscriptions using calendar billing + subscriptions using calendar billing. include_trial (bool): 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. diff --git a/advancedbilling/models/reactivation_billing.py b/advancedbilling/models/reactivation_billing.py index 17fe9113..3b8199e6 100644 --- a/advancedbilling/models/reactivation_billing.py +++ b/advancedbilling/models/reactivation_billing.py @@ -8,15 +8,15 @@ class ReactivationBilling(object): """Implementation of the 'Reactivation Billing' model. - These values are only applicable to subscriptions using calendar billing + These values are only applicable to subscriptions using calendar billing. Attributes: reactivation_charge (ReactivationCharge): 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 + 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. additional_properties (Dict[str, object]): The additional properties for the model. diff --git a/advancedbilling/models/reactivation_charge.py b/advancedbilling/models/reactivation_charge.py index ffa84f5e..46e1a2a4 100644 --- a/advancedbilling/models/reactivation_charge.py +++ b/advancedbilling/models/reactivation_charge.py @@ -10,10 +10,10 @@ class ReactivationCharge(object): """Implementation of the 'Reactivation Charge' enum. 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 + `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. Attributes: PRORATED: The enum member of type str. diff --git a/advancedbilling/models/refund_consolidated_invoice.py b/advancedbilling/models/refund_consolidated_invoice.py index 8bb53dec..f0e1d024 100644 --- a/advancedbilling/models/refund_consolidated_invoice.py +++ b/advancedbilling/models/refund_consolidated_invoice.py @@ -11,7 +11,7 @@ class RefundConsolidatedInvoice(object): """Implementation of the 'Refund Consolidated Invoice' model. - Refund consolidated invoice + Refund consolidated invoice. Attributes: memo (str): A description for the refund diff --git a/advancedbilling/models/refund_invoice.py b/advancedbilling/models/refund_invoice.py index f01db173..860301a4 100644 --- a/advancedbilling/models/refund_invoice.py +++ b/advancedbilling/models/refund_invoice.py @@ -23,8 +23,8 @@ class RefundInvoice(object): the customer). Defaults to `false`. apply_credit (bool): If set to true, creates credit and applies it to an invoice. Defaults to `false`. - void_invoice (bool): If `apply_credit` set to false and refunding full - amount, if `void_invoice` set to true, invoice will be voided after + void_invoice (bool): 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`. additional_properties (Dict[str, object]): The additional properties for the model. diff --git a/advancedbilling/models/refund_invoice_event_data.py b/advancedbilling/models/refund_invoice_event_data.py index cf0771e6..0e7a7bc8 100644 --- a/advancedbilling/models/refund_invoice_event_data.py +++ b/advancedbilling/models/refund_invoice_event_data.py @@ -20,7 +20,7 @@ class RefundInvoiceEventData(object): apply_credit (bool): If true, credit was created and applied it to the invoice. consolidation_level (InvoiceConsolidationLevel): Consolidation level of the - invoice, which is applicable to invoice consolidation. It will hold one + 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 diff --git a/advancedbilling/models/register.py b/advancedbilling/models/register.py index de9d4c08..56dbf1c2 100644 --- a/advancedbilling/models/register.py +++ b/advancedbilling/models/register.py @@ -16,7 +16,7 @@ class Register(object): maxio_id (str): The model property of type str. name (str): The model property of type str. currency_code (str): The ISO 4217 currency code (3 character string) - representing the currency of invoice transaction. + representing the currency of an invoice transaction. additional_properties (Dict[str, object]): The additional properties for the model. diff --git a/advancedbilling/models/renewal_preview_request.py b/advancedbilling/models/renewal_preview_request.py index cc35c7d6..4c1d2b23 100644 --- a/advancedbilling/models/renewal_preview_request.py +++ b/advancedbilling/models/renewal_preview_request.py @@ -15,7 +15,7 @@ class RenewalPreviewRequest(object): """Implementation of the 'Renewal Preview Request' model. Attributes: - components (List[RenewalPreviewComponent]): An optional array of component + components (List[RenewalPreviewComponent]): (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 diff --git a/advancedbilling/models/scheduled_renewal_component_custom_price.py b/advancedbilling/models/scheduled_renewal_component_custom_price.py index fa3b758b..67462e16 100644 --- a/advancedbilling/models/scheduled_renewal_component_custom_price.py +++ b/advancedbilling/models/scheduled_renewal_component_custom_price.py @@ -19,7 +19,7 @@ class ScheduledRenewalComponentCustomPrice(object): Attributes: tax_included (bool): Whether or not the price point includes tax - pricing_scheme (PricingScheme): Omit for On/Off components + pricing_scheme (PricingScheme): Omit for On/Off components. prices (List[Price]): On/off components only need one price bracket starting at 1. additional_properties (Dict[str, object]): The additional properties for the diff --git a/advancedbilling/models/scheduled_renewal_item_request_body_component.py b/advancedbilling/models/scheduled_renewal_item_request_body_component.py index b09c2903..046b7043 100644 --- a/advancedbilling/models/scheduled_renewal_item_request_body_component.py +++ b/advancedbilling/models/scheduled_renewal_item_request_body_component.py @@ -18,7 +18,7 @@ class ScheduledRenewalItemRequestBodyComponent(object): item_type (str): Item type to add. Either Product or Component. item_id (int): Product or component identifier. price_point_id (int): Price point identifier. - quantity (int): Optional quantity for the item. + quantity (int): (Optional) Quantity for the item. custom_price (ScheduledRenewalComponentCustomPrice): Custom pricing for a component within a scheduled renewal. additional_properties (Dict[str, object]): The additional properties for the diff --git a/advancedbilling/models/scheduled_renewal_item_request_body_product.py b/advancedbilling/models/scheduled_renewal_item_request_body_product.py index 5ae8e836..3817eb30 100644 --- a/advancedbilling/models/scheduled_renewal_item_request_body_product.py +++ b/advancedbilling/models/scheduled_renewal_item_request_body_product.py @@ -18,7 +18,7 @@ class ScheduledRenewalItemRequestBodyProduct(object): item_type (str): Item type to add. Either Product or Component. item_id (int): Product or component identifier. price_point_id (int): Price point identifier. - quantity (int): Optional quantity for the item. + quantity (int): (Optional) Quantity for the item. custom_price (ScheduledRenewalProductPricePoint): Custom pricing for a product within a scheduled renewal. additional_properties (Dict[str, object]): The additional properties for the diff --git a/advancedbilling/models/scheduled_renewal_product_price_point.py b/advancedbilling/models/scheduled_renewal_product_price_point.py index 4293e28c..325e1abe 100644 --- a/advancedbilling/models/scheduled_renewal_product_price_point.py +++ b/advancedbilling/models/scheduled_renewal_product_price_point.py @@ -25,7 +25,7 @@ class ScheduledRenewalProductPricePoint(object): tax_included (bool): (Optional) initial_charge_in_cents (int): The product price point initial charge, in integer cents. - expiration_interval (int): The numerical expiration interval. i.e. an + expiration_interval (int): 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): A string representing the diff --git a/advancedbilling/models/service_credit_1.py b/advancedbilling/models/service_credit_1.py index 541f5564..03b542f1 100644 --- a/advancedbilling/models/service_credit_1.py +++ b/advancedbilling/models/service_credit_1.py @@ -18,7 +18,7 @@ class ServiceCredit1(object): entry_type (ServiceCreditType): The type of entry memo (str): The memo attached to the entry invoice_uid (str): The invoice uid associated with the entry. Only present - for debit entries + for debit entries. remaining_balance_in_cents (int): The remaining balance for the entry created_at (datetime): The date and time the entry was created additional_properties (Dict[str, object]): The additional properties for the diff --git a/advancedbilling/models/subscription.py b/advancedbilling/models/subscription.py index 53dd8cc7..7cdffbe7 100644 --- a/advancedbilling/models/subscription.py +++ b/advancedbilling/models/subscription.py @@ -97,27 +97,27 @@ class Subscription(object): total_revenue_in_cents (int): Gives the total revenue from the subscription in the number of cents. product_price_in_cents (int): (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 (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 (int): The version of the product for the subscription. Note that this is a deprecated field kept for backwards-compatibility. current_period_ends_at (datetime): Timestamp relating to the end of the - current (recurring) period (i.e.,when the next regularly scheduled + current (recurring) period (i.e., when the next regularly scheduled attempted charge will occur) next_assessment_at (datetime): 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) + 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): Timestamp for when the trial period (if any) began trial_ended_at (datetime): Timestamp for when the trial period (if any) ended - activated_at (datetime): 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): 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): Timestamp giving the expiration date of this subscription (if any) created_at (datetime): The creation date for this subscription @@ -135,11 +135,11 @@ class Subscription(object): previous_state (SubscriptionState): 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) + state). signup_payment_id (int): The ID of the transaction that generated the revenue signup_revenue (str): The revenue, formatted as a string of decimal separated - dollars and,cents, from the subscription signup ($50.00 would be - formatted as,50.00) + dollars and cents, from the subscription signup ($50.00 would be + formatted as 50.00) delayed_cancel_at (datetime): Timestamp for when the subscription is currently set to cancel. coupon_code (str): (deprecated) The coupon code of the single coupon @@ -172,7 +172,7 @@ class Subscription(object): coupon_uses_allowed (int): (deprecated) How many times the subscription's single coupon may be used. This field has no replacement for multiple coupons. - reason_code (str): The churn reason code associated to a cancelled + reason_code (str): The churn reason code associated to a canceled subscription. automatically_resume_at (datetime): The date the subscription is scheduled to automatically resume from the on_hold state. @@ -201,14 +201,14 @@ class Subscription(object): for the customer. This will ensure the card will be charged successfully at renewal. reference (str): The reference value (provided by your app) for the - subscription istelf. + subscription itself. on_hold_at (datetime): The timestamp of the most recent on hold action. prepaid_dunning (bool): Boolean representing whether the subscription is prepaid and currently in dunning. Only returned for Relationship - Invoicing sites with the feature enabled + Invoicing sites with the feature enabled. coupons (List[SubscriptionIncludedCoupon]): 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. + this data you also have to include the following param in the request: + `include[]=coupons`. Only in Read Subscription Endpoint. dunning_communication_delay_enabled (bool): 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 diff --git a/advancedbilling/models/subscription_component.py b/advancedbilling/models/subscription_component.py index 11b5b5c8..8dc3a5aa 100644 --- a/advancedbilling/models/subscription_component.py +++ b/advancedbilling/models/subscription_component.py @@ -23,8 +23,8 @@ class SubscriptionComponent(object): kind (ComponentKind): A handle for the component type unit_name (str): The model property of type str. enabled (bool): (for on/off components) indicates if the component is enabled - for the subscription - unit_balance (int): The model property of type int. + for the subscription. + unit_balance (int | str | None): The model property of type int | str | None. currency (str): The model property of type str. allocated_quantity (int | str | None): For Quantity-based components: The current allocation for the component on the given subscription. For @@ -52,14 +52,14 @@ class SubscriptionComponent(object): use_site_exchange_rate (bool): The model property of type bool. description (str): The model property of type str. allow_fractional_quantities (bool): The model property of type bool. - subscription (SubscriptionComponentSubscription): An optional object, will be - returned if provided `include=subscription` query param. + subscription (SubscriptionComponentSubscription): (Optional) Object that will + be returned if the `include=subscription` query param is provided. historic_usages (List[HistoricUsage]): The model property of type List[HistoricUsage]. display_on_hosted_page (bool): The model property of type bool. - interval (int): 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 + interval (int): 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): A string representing the interval unit for this component price point, either month or day. This property is only @@ -313,10 +313,12 @@ def from_dictionary(cls, dictionary.get("enabled")\ if "enabled" in dictionary.keys()\ else APIHelper.SKIP - unit_balance =\ - dictionary.get("unit_balance")\ - if dictionary.get("unit_balance")\ - else APIHelper.SKIP + unit_balance = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("SubscriptionComponentUnitBalance"), + dictionary.get("unit_balance"), + False)\ + if dictionary.get("unit_balance") is not None\ + else APIHelper.SKIP currency =\ dictionary.get("currency")\ if dictionary.get("currency")\ diff --git a/advancedbilling/models/subscription_component_subscription.py b/advancedbilling/models/subscription_component_subscription.py index 971cea81..fe66b90e 100644 --- a/advancedbilling/models/subscription_component_subscription.py +++ b/advancedbilling/models/subscription_component_subscription.py @@ -11,8 +11,8 @@ class SubscriptionComponentSubscription(object): """Implementation of the 'Subscription Component Subscription' model. - 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. Attributes: state (SubscriptionState): The state of a subscription. * **Live States** diff --git a/advancedbilling/models/subscription_custom_price.py b/advancedbilling/models/subscription_custom_price.py index d8c75771..9a9740d1 100644 --- a/advancedbilling/models/subscription_custom_price.py +++ b/advancedbilling/models/subscription_custom_price.py @@ -27,7 +27,7 @@ class SubscriptionCustomPrice(object): trial_price_in_cents (str | int | None): (Optional) trial_interval (str | int | None): (Optional) trial_interval_unit (IntervalUnit): (Optional) - trial_type (TrialType): Indicates how a trial is handled when the trail + trial_type (TrialType): 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 diff --git a/advancedbilling/models/subscription_group_bank_account.py b/advancedbilling/models/subscription_group_bank_account.py index 9791f42f..f80c82d5 100644 --- a/advancedbilling/models/subscription_group_bank_account.py +++ b/advancedbilling/models/subscription_group_bank_account.py @@ -18,13 +18,13 @@ class SubscriptionGroupBankAccount(object): Required when creating a subscription with GoCardless and bank_iban is blank) The customerʼs bank account number bank_routing_number (str): (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 + Optional when creating a subscription with GoCardless.) The routing + number of the bank. It becomes bank_code while passing via GoCardless API. bank_iban (str): (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can - be provided + be provided. bank_branch_code (str): (Optional when creating a subscription with - GoCardless) Branch code. Alternatively, an IBAN can be provided + GoCardless) Branch code. Alternatively, an IBAN can be provided. bank_account_type (BankAccountType): Defaults to checking bank_account_holder_type (BankAccountHolderType): Defaults to personal payment_type (PaymentType): The model property of type PaymentType. diff --git a/advancedbilling/models/subscription_group_signup_item.py b/advancedbilling/models/subscription_group_signup_item.py index 3c670025..6a4d49d7 100644 --- a/advancedbilling/models/subscription_group_signup_item.py +++ b/advancedbilling/models/subscription_group_signup_item.py @@ -31,9 +31,9 @@ class SubscriptionGroupSignupItem(object): particular price point. offer_id (int): 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:` + Chargify ID of the offer or its handle prefixed with `handle:`. reference (str): The reference value (provided by your app) for the - subscription itelf. + subscription itself. primary (bool): One of the subscriptions must be marked as primary in the group. currency (str): (Optional) If Multi-Currency is enabled and the currency is @@ -49,7 +49,7 @@ class SubscriptionGroupSignupItem(object): subscription. A subscription can have up to 30 custom price points. Exceeding this limit will result in an API error. calendar_billing (CalendarBilling): (Optional). Cannot be used when also - specifying next_billing_at + specifying next_billing_at. metafields (Dict[str, str]): (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. diff --git a/advancedbilling/models/subscription_list_include.py b/advancedbilling/models/subscription_list_include.py index 1bca832d..b179a958 100644 --- a/advancedbilling/models/subscription_list_include.py +++ b/advancedbilling/models/subscription_list_include.py @@ -11,6 +11,10 @@ class SubscriptionListInclude(object): Attributes: SELF_SERVICE_PAGE_TOKEN: The enum member of type str. + CURRENT_ACCOUNT_BALANCE_IN_CENTS: The enum member of type str. + CURRENT_BILLING_AMOUNT: The enum member of type str. + THREE_DS_ACTION_LINK: The enum member of type str. + COUPONS: The enum member of type str. additional_properties (Dict[str, object]): The additional properties for the model. @@ -18,6 +22,14 @@ class SubscriptionListInclude(object): SELF_SERVICE_PAGE_TOKEN = "self_service_page_token" + CURRENT_ACCOUNT_BALANCE_IN_CENTS = "current_account_balance_in_cents" + + CURRENT_BILLING_AMOUNT = "current_billing_amount" + + THREE_DS_ACTION_LINK = "three_ds_action_link" + + COUPONS = "coupons" + @classmethod def from_value(cls, value, default=None): """Return the matching enum value for the given input.""" diff --git a/advancedbilling/models/subscription_product_change_scheduled.py b/advancedbilling/models/subscription_product_change_scheduled.py new file mode 100644 index 00000000..2a6140c6 --- /dev/null +++ b/advancedbilling/models/subscription_product_change_scheduled.py @@ -0,0 +1,235 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.api_helper import APIHelper + + +class SubscriptionProductChangeScheduled(object): + """Implementation of the 'Subscription Product Change Scheduled' model. + + Attributes: + previous_product_id (int): The model property of type int. + new_product_id (int): The model property of type int. + previous_product_price_point_id (int): The model property of type int. + new_product_price_point_id (int): The model property of type int. + effective_at (datetime): When the scheduled product change takes effect (the + subscription's next renewal). + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "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", + } + + _optionals = [ + "previous_product_price_point_id", + "new_product_price_point_id", + "effective_at", + ] + + _nullables = [ + "previous_product_price_point_id", + "new_product_price_point_id", + "effective_at", + ] + + def __init__( + self, + previous_product_id=None, + new_product_id=None, + previous_product_price_point_id=APIHelper.SKIP, + new_product_price_point_id=APIHelper.SKIP, + effective_at=APIHelper.SKIP, + additional_properties=None): + """Initialize a SubscriptionProductChangeScheduled instance.""" + # Initialize members of the class + self.previous_product_id = previous_product_id + self.new_product_id = new_product_id + if previous_product_price_point_id is not APIHelper.SKIP: + self.previous_product_price_point_id = previous_product_price_point_id + if new_product_price_point_id is not APIHelper.SKIP: + self.new_product_price_point_id = new_product_price_point_id + if effective_at is not APIHelper.SKIP: + self.effective_at =\ + APIHelper.apply_datetime_converter( + effective_at, APIHelper.RFC3339DateTime)\ + if effective_at else None + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + previous_product_id =\ + dictionary.get("previous_product_id")\ + if dictionary.get("previous_product_id")\ + else None + new_product_id =\ + dictionary.get("new_product_id")\ + if dictionary.get("new_product_id")\ + else None + previous_product_price_point_id =\ + dictionary.get("previous_product_price_point_id")\ + if "previous_product_price_point_id" in dictionary.keys()\ + else APIHelper.SKIP + new_product_price_point_id =\ + dictionary.get("new_product_price_point_id")\ + if "new_product_price_point_id" in dictionary.keys()\ + else APIHelper.SKIP + if "effective_at" in dictionary.keys(): + effective_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("effective_at")).datetime\ + if dictionary.get("effective_at") else None + + else: + effective_at = APIHelper.SKIP + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(previous_product_id, + new_product_id, + previous_product_price_point_id, + new_product_price_point_id, + effective_at, + additional_properties) + + @classmethod + def validate(cls, dictionary): + """Validate dictionary against class required properties + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + boolean : if dictionary is valid contains required properties. + + """ + if isinstance(dictionary, cls): + return APIHelper.is_valid_type( + value=dictionary.previous_product_id, + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.new_product_id, + type_callable=lambda value: + isinstance( + value, + int, + )) + + if not isinstance(dictionary, dict): + return False + + return APIHelper.is_valid_type( + value=dictionary.get("previous_product_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) \ + and APIHelper.is_valid_type( + value=dictionary.get("new_product_id"), + type_callable=lambda value: + isinstance( + value, + int, + )) + + def __repr__(self): + """Return a unambiguous string representation.""" + _previous_product_id=self.previous_product_id + _new_product_id=self.new_product_id + _previous_product_price_point_id=( + self.previous_product_price_point_id + if hasattr(self, "previous_product_price_point_id") + else None + ) + _new_product_price_point_id=( + self.new_product_price_point_id + if hasattr(self, "new_product_price_point_id") + else None + ) + _effective_at=( + self.effective_at + if hasattr(self, "effective_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"previous_product_id={_previous_product_id!r}, " + f"new_product_id={_new_product_id!r}, " + f"previous_product_price_point_id={_previous_product_price_point_id!r}, " + f"new_product_price_point_id={_new_product_price_point_id!r}, " + f"effective_at={_effective_at!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _previous_product_id=self.previous_product_id + _new_product_id=self.new_product_id + _previous_product_price_point_id=( + self.previous_product_price_point_id + if hasattr(self, "previous_product_price_point_id") + else None + ) + _new_product_price_point_id=( + self.new_product_price_point_id + if hasattr(self, "new_product_price_point_id") + else None + ) + _effective_at=( + self.effective_at + if hasattr(self, "effective_at") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"previous_product_id={_previous_product_id!s}, " + f"new_product_id={_new_product_id!s}, " + f"previous_product_price_point_id={_previous_product_price_point_id!s}, " + f"new_product_price_point_id={_new_product_price_point_id!s}, " + f"effective_at={_effective_at!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/subscription_state.py b/advancedbilling/models/subscription_state.py index a69b618d..d3ae11d0 100644 --- a/advancedbilling/models/subscription_state.py +++ b/advancedbilling/models/subscription_state.py @@ -95,9 +95,9 @@ class SubscriptionState(object): """ - _all_values = ["pending", "failed_to_create", "trialing", "assessing", - "active", "soft_failure", "past_due", "suspended", "canceled", "expired", - "paused", "unpaid", "trial_ended", "on_hold", "awaiting_signup"] + _all_values = ["pending", "failed_to_create", "trialing", "assessing", "active", + "soft_failure", "past_due", "suspended", "canceled", "expired", "paused", + "unpaid", "trial_ended", "on_hold", "awaiting_signup"] PENDING = "pending" FAILED_TO_CREATE = "failed_to_create" diff --git a/advancedbilling/models/subscription_state_filter.py b/advancedbilling/models/subscription_state_filter.py index ae922f80..3d50a1c6 100644 --- a/advancedbilling/models/subscription_state_filter.py +++ b/advancedbilling/models/subscription_state_filter.py @@ -16,10 +16,15 @@ class SubscriptionStateFilter(object): CANCELED: The enum member of type str. EXPIRED: The enum member of type str. EXPIRED_CARDS: The enum member of type str. + ENUM_EXPIRED_CARDS_LIVE_SUBSCRIPTIONS: The enum member of type str. + ENUM_EXPIRED_CARDS_ALL_SUBSCRIPTIONS: The enum member of type str. ON_HOLD: The enum member of type str. + AWAITING_SIGNUP: The enum member of type str. + AWAITING_SIGNUP_DATE: The enum member of type str. PAST_DUE: The enum member of type str. PENDING_CANCELLATION: The enum member of type str. PENDING_RENEWAL: The enum member of type str. + PREPAID_DUNNING: The enum member of type str. SUSPENDED: The enum member of type str. TRIAL_ENDED: The enum member of type str. TRIALING: The enum member of type str. @@ -37,14 +42,24 @@ class SubscriptionStateFilter(object): EXPIRED_CARDS = "expired_cards" + ENUM_EXPIRED_CARDS_LIVE_SUBSCRIPTIONS = "expired_cards_(live_subscriptions)" + + ENUM_EXPIRED_CARDS_ALL_SUBSCRIPTIONS = "expired_cards_(all_subscriptions)" + ON_HOLD = "on_hold" + AWAITING_SIGNUP = "awaiting_signup" + + AWAITING_SIGNUP_DATE = "awaiting_signup_date" + PAST_DUE = "past_due" PENDING_CANCELLATION = "pending_cancellation" PENDING_RENEWAL = "pending_renewal" + PREPAID_DUNNING = "prepaid_dunning" + SUSPENDED = "suspended" TRIAL_ENDED = "trial_ended" diff --git a/advancedbilling/models/tax_configuration_kind.py b/advancedbilling/models/tax_configuration_kind.py index 7db7e563..fffa885e 100644 --- a/advancedbilling/models/tax_configuration_kind.py +++ b/advancedbilling/models/tax_configuration_kind.py @@ -11,9 +11,9 @@ class TaxConfigurationKind(object): Attributes: CUSTOM: The enum member of type str. - ENUM_MANAGED AVALARA: The enum member of type str. - ENUM_LINKED AVALARA: The enum member of type str. - ENUM_DIGITAL RIVER: The enum member of type str. + ENUM_MANAGED_AVALARA: The enum member of type str. + ENUM_LINKED_AVALARA: The enum member of type str. + ENUM_DIGITAL_RIVER: The enum member of type str. additional_properties (Dict[str, object]): The additional properties for the model. diff --git a/advancedbilling/models/trial_type.py b/advancedbilling/models/trial_type.py index 7363ac85..fa4853f8 100644 --- a/advancedbilling/models/trial_type.py +++ b/advancedbilling/models/trial_type.py @@ -9,7 +9,7 @@ class TrialType(object): """Implementation of the 'Trial Type' enum. - 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 will diff --git a/advancedbilling/models/update_component.py b/advancedbilling/models/update_component.py index f645f685..032cf0a2 100644 --- a/advancedbilling/models/update_component.py +++ b/advancedbilling/models/update_component.py @@ -14,7 +14,7 @@ class UpdateComponent(object): Attributes: handle (str): The model property of type str. name (str): The name of the Component, suitable for display on statements. - i.e. Text Messages. + e.g., Text Messages. description (str): The description of the component. accounting_code (str): The model property of type str. taxable (bool): Boolean flag describing whether a component is taxable or not. @@ -27,6 +27,10 @@ class UpdateComponent(object): upgrade_charge (CreditType): The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. + unspsc_code (str): (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. additional_properties (Dict[str, object]): The additional properties for the model. @@ -43,6 +47,7 @@ class UpdateComponent(object): "item_category": "item_category", "display_on_hosted_page": "display_on_hosted_page", "upgrade_charge": "upgrade_charge", + "unspsc_code": "unspsc_code", } _optionals = [ @@ -55,6 +60,7 @@ class UpdateComponent(object): "item_category", "display_on_hosted_page", "upgrade_charge", + "unspsc_code", ] _nullables = [ @@ -63,6 +69,7 @@ class UpdateComponent(object): "tax_code", "item_category", "upgrade_charge", + "unspsc_code", ] def __init__( @@ -76,6 +83,7 @@ def __init__( item_category=APIHelper.SKIP, display_on_hosted_page=APIHelper.SKIP, upgrade_charge=APIHelper.SKIP, + unspsc_code=APIHelper.SKIP, additional_properties=None): """Initialize a UpdateComponent instance.""" # Initialize members of the class @@ -97,6 +105,8 @@ def __init__( self.display_on_hosted_page = display_on_hosted_page if upgrade_charge is not APIHelper.SKIP: self.upgrade_charge = upgrade_charge + if unspsc_code is not APIHelper.SKIP: + self.unspsc_code = unspsc_code # Add additional model properties to the instance if additional_properties is None: @@ -157,6 +167,10 @@ def from_dictionary(cls, dictionary.get("upgrade_charge")\ if "upgrade_charge" in dictionary.keys()\ else APIHelper.SKIP + unspsc_code =\ + dictionary.get("unspsc_code")\ + if "unspsc_code" in dictionary.keys()\ + else APIHelper.SKIP # Clean out expected properties from dictionary additional_properties =\ @@ -172,6 +186,7 @@ def from_dictionary(cls, item_category, display_on_hosted_page, upgrade_charge, + unspsc_code, additional_properties) def __repr__(self): @@ -221,6 +236,11 @@ def __repr__(self): if hasattr(self, "upgrade_charge") else None ) + _unspsc_code=( + self.unspsc_code + if hasattr(self, "unspsc_code") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -233,6 +253,7 @@ def __repr__(self): f"item_category={_item_category!r}, " f"display_on_hosted_page={_display_on_hosted_page!r}, " f"upgrade_charge={_upgrade_charge!r}, " + f"unspsc_code={_unspsc_code!r}, " f"additional_properties={_additional_properties!r}, " f")" ) @@ -284,6 +305,11 @@ def __str__(self): if hasattr(self, "upgrade_charge") else None ) + _unspsc_code=( + self.unspsc_code + if hasattr(self, "unspsc_code") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -296,6 +322,7 @@ def __str__(self): f"item_category={_item_category!s}, " f"display_on_hosted_page={_display_on_hosted_page!s}, " f"upgrade_charge={_upgrade_charge!s}, " + f"unspsc_code={_unspsc_code!s}, " f"additional_properties={_additional_properties!s}, " f")" ) diff --git a/advancedbilling/models/update_component_price_point.py b/advancedbilling/models/update_component_price_point.py index da68c973..a861ca96 100644 --- a/advancedbilling/models/update_component_price_point.py +++ b/advancedbilling/models/update_component_price_point.py @@ -25,9 +25,9 @@ class UpdateComponentPricePoint(object): define your own prices for each currency if you have multiple currencies defined on the site. tax_included (bool): Whether or not the price point includes tax - interval (int): 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 + interval (int): 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): A string representing the interval unit for this component price point, either month or day. This property is only diff --git a/advancedbilling/models/update_customer.py b/advancedbilling/models/update_customer.py index ce79e402..61942263 100644 --- a/advancedbilling/models/update_customer.py +++ b/advancedbilling/models/update_customer.py @@ -28,11 +28,18 @@ class UpdateCustomer(object): locale (str): Set a specific language on a customer record. vat_number (str): The model property of type str. tax_exempt (bool): The model property of type bool. + surcharging (bool): Whether surcharging is enabled for the customer. Only + applied on sites where surcharging control is enabled. tax_exempt_reason (str): The model property of type str. parent_id (int): The model property of type int. verified (bool): Is the customer verified to use ACH as a payment method. - Available only on Authorize.Net gateway + Available only on the Authorize.Net gateway. salesforce_id (str): The Salesforce ID of the customer + branding_theme_id (int): 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. additional_properties (Dict[str, object]): The additional properties for the model. @@ -56,10 +63,12 @@ class UpdateCustomer(object): "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", } _optionals = [ @@ -79,16 +88,19 @@ class UpdateCustomer(object): "locale", "vat_number", "tax_exempt", + "surcharging", "tax_exempt_reason", "parent_id", "verified", "salesforce_id", + "branding_theme_id", ] _nullables = [ "parent_id", "verified", "salesforce_id", + "branding_theme_id", ] def __init__( @@ -109,10 +121,12 @@ def __init__( locale=APIHelper.SKIP, vat_number=APIHelper.SKIP, tax_exempt=APIHelper.SKIP, + surcharging=APIHelper.SKIP, tax_exempt_reason=APIHelper.SKIP, parent_id=APIHelper.SKIP, verified=APIHelper.SKIP, salesforce_id=APIHelper.SKIP, + branding_theme_id=APIHelper.SKIP, additional_properties=None): """Initialize a UpdateCustomer instance.""" # Initialize members of the class @@ -148,6 +162,8 @@ def __init__( self.vat_number = vat_number if tax_exempt is not APIHelper.SKIP: self.tax_exempt = tax_exempt + if surcharging is not APIHelper.SKIP: + self.surcharging = surcharging if tax_exempt_reason is not APIHelper.SKIP: self.tax_exempt_reason = tax_exempt_reason if parent_id is not APIHelper.SKIP: @@ -156,6 +172,8 @@ def __init__( self.verified = verified if salesforce_id is not APIHelper.SKIP: self.salesforce_id = salesforce_id + if branding_theme_id is not APIHelper.SKIP: + self.branding_theme_id = branding_theme_id # Add additional model properties to the instance if additional_properties is None: @@ -244,6 +262,10 @@ def from_dictionary(cls, dictionary.get("tax_exempt")\ if "tax_exempt" in dictionary.keys()\ else APIHelper.SKIP + surcharging =\ + dictionary.get("surcharging")\ + if "surcharging" in dictionary.keys()\ + else APIHelper.SKIP tax_exempt_reason =\ dictionary.get("tax_exempt_reason")\ if dictionary.get("tax_exempt_reason")\ @@ -260,6 +282,10 @@ def from_dictionary(cls, dictionary.get("salesforce_id")\ if "salesforce_id" in dictionary.keys()\ else APIHelper.SKIP + branding_theme_id =\ + dictionary.get("branding_theme_id")\ + if "branding_theme_id" in dictionary.keys()\ + else APIHelper.SKIP # Clean out expected properties from dictionary additional_properties =\ @@ -282,10 +308,12 @@ def from_dictionary(cls, locale, vat_number, tax_exempt, + surcharging, tax_exempt_reason, parent_id, verified, salesforce_id, + branding_theme_id, additional_properties) def __repr__(self): @@ -370,6 +398,11 @@ def __repr__(self): if hasattr(self, "tax_exempt") else None ) + _surcharging=( + self.surcharging + if hasattr(self, "surcharging") + else None + ) _tax_exempt_reason=( self.tax_exempt_reason if hasattr(self, "tax_exempt_reason") @@ -390,6 +423,11 @@ def __repr__(self): if hasattr(self, "salesforce_id") else None ) + _branding_theme_id=( + self.branding_theme_id + if hasattr(self, "branding_theme_id") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -409,10 +447,12 @@ def __repr__(self): f"locale={_locale!r}, " f"vat_number={_vat_number!r}, " f"tax_exempt={_tax_exempt!r}, " + f"surcharging={_surcharging!r}, " f"tax_exempt_reason={_tax_exempt_reason!r}, " f"parent_id={_parent_id!r}, " f"verified={_verified!r}, " f"salesforce_id={_salesforce_id!r}, " + f"branding_theme_id={_branding_theme_id!r}, " f"additional_properties={_additional_properties!r}, " f")" ) @@ -499,6 +539,11 @@ def __str__(self): if hasattr(self, "tax_exempt") else None ) + _surcharging=( + self.surcharging + if hasattr(self, "surcharging") + else None + ) _tax_exempt_reason=( self.tax_exempt_reason if hasattr(self, "tax_exempt_reason") @@ -519,6 +564,11 @@ def __str__(self): if hasattr(self, "salesforce_id") else None ) + _branding_theme_id=( + self.branding_theme_id + if hasattr(self, "branding_theme_id") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" @@ -538,10 +588,12 @@ def __str__(self): f"locale={_locale!s}, " f"vat_number={_vat_number!s}, " f"tax_exempt={_tax_exempt!s}, " + f"surcharging={_surcharging!s}, " f"tax_exempt_reason={_tax_exempt_reason!s}, " f"parent_id={_parent_id!s}, " f"verified={_verified!s}, " f"salesforce_id={_salesforce_id!s}, " + f"branding_theme_id={_branding_theme_id!s}, " f"additional_properties={_additional_properties!s}, " f")" ) diff --git a/advancedbilling/models/update_invoice.py b/advancedbilling/models/update_invoice.py new file mode 100644 index 00000000..da9eb85b --- /dev/null +++ b/advancedbilling/models/update_invoice.py @@ -0,0 +1,324 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +import dateutil.parser + +from advancedbilling.api_helper import APIHelper +from advancedbilling.models.create_invoice_address import ( + CreateInvoiceAddress, +) +from advancedbilling.models.create_invoice_coupon import ( + CreateInvoiceCoupon, +) +from advancedbilling.models.update_invoice_item import ( + UpdateInvoiceItem, +) + + +class UpdateInvoice(object): + """Implementation of the 'Update Invoice' model. + + Attributes of a draft ad hoc invoice which can be updated. Only the submitted + attributes are changed. + + Attributes: + line_items (List[UpdateInvoiceItem]): 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): 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 (int): 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 (str): Custom payment instructions displayed on the + invoice. + memo (str): A custom memo displayed on the invoice. + seller_address (CreateInvoiceAddress): Replaces the seller address on the + invoice + billing_address (CreateInvoiceAddress): Replaces the billing address on the + invoice + shipping_address (CreateInvoiceAddress): Replaces the shipping address on the + invoice + coupons (List[CreateInvoiceCoupon]): When present, replaces all discounts + currently applied to the invoice. Send an empty array to remove all + discounts. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "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", + } + + _optionals = [ + "line_items", + "issue_date", + "net_terms", + "payment_instructions", + "memo", + "seller_address", + "billing_address", + "shipping_address", + "coupons", + ] + + def __init__( + self, + line_items=APIHelper.SKIP, + issue_date=APIHelper.SKIP, + net_terms=APIHelper.SKIP, + payment_instructions=APIHelper.SKIP, + memo=APIHelper.SKIP, + seller_address=APIHelper.SKIP, + billing_address=APIHelper.SKIP, + shipping_address=APIHelper.SKIP, + coupons=APIHelper.SKIP, + additional_properties=None): + """Initialize a UpdateInvoice instance.""" + # Initialize members of the class + if line_items is not APIHelper.SKIP: + self.line_items = line_items + if issue_date is not APIHelper.SKIP: + self.issue_date = issue_date + if net_terms is not APIHelper.SKIP: + self.net_terms = net_terms + if payment_instructions is not APIHelper.SKIP: + self.payment_instructions = payment_instructions + if memo is not APIHelper.SKIP: + self.memo = memo + if seller_address is not APIHelper.SKIP: + self.seller_address = seller_address + if billing_address is not APIHelper.SKIP: + self.billing_address = billing_address + if shipping_address is not APIHelper.SKIP: + self.shipping_address = shipping_address + if coupons is not APIHelper.SKIP: + self.coupons = coupons + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + line_items = None + if dictionary.get("line_items") is not None: + line_items = [ + UpdateInvoiceItem.from_dictionary(x) + for x in dictionary.get("line_items") + ] + else: + line_items = APIHelper.SKIP + issue_date = dateutil.parser.parse( + dictionary.get("issue_date")).date()\ + if dictionary.get("issue_date") else APIHelper.SKIP + net_terms =\ + dictionary.get("net_terms")\ + if dictionary.get("net_terms")\ + else APIHelper.SKIP + payment_instructions =\ + dictionary.get("payment_instructions")\ + if dictionary.get("payment_instructions")\ + else APIHelper.SKIP + memo =\ + dictionary.get("memo")\ + if dictionary.get("memo")\ + else APIHelper.SKIP + seller_address =\ + CreateInvoiceAddress.from_dictionary( + dictionary.get("seller_address"))\ + if "seller_address" in dictionary.keys()\ + else APIHelper.SKIP + billing_address =\ + CreateInvoiceAddress.from_dictionary( + dictionary.get("billing_address"))\ + if "billing_address" in dictionary.keys()\ + else APIHelper.SKIP + shipping_address =\ + CreateInvoiceAddress.from_dictionary( + dictionary.get("shipping_address"))\ + if "shipping_address" in dictionary.keys()\ + else APIHelper.SKIP + coupons = None + if dictionary.get("coupons") is not None: + coupons = [ + CreateInvoiceCoupon.from_dictionary(x) + for x in dictionary.get("coupons") + ] + else: + coupons = APIHelper.SKIP + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(line_items, + issue_date, + net_terms, + payment_instructions, + memo, + seller_address, + billing_address, + shipping_address, + coupons, + additional_properties) + + def __repr__(self): + """Return a unambiguous string representation.""" + _line_items=( + self.line_items + if hasattr(self, "line_items") + else None + ) + _issue_date=( + self.issue_date + if hasattr(self, "issue_date") + else None + ) + _net_terms=( + self.net_terms + if hasattr(self, "net_terms") + else None + ) + _payment_instructions=( + self.payment_instructions + if hasattr(self, "payment_instructions") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _seller_address=( + self.seller_address + if hasattr(self, "seller_address") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _shipping_address=( + self.shipping_address + if hasattr(self, "shipping_address") + else None + ) + _coupons=( + self.coupons + if hasattr(self, "coupons") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"line_items={_line_items!r}, " + f"issue_date={_issue_date!r}, " + f"net_terms={_net_terms!r}, " + f"payment_instructions={_payment_instructions!r}, " + f"memo={_memo!r}, " + f"seller_address={_seller_address!r}, " + f"billing_address={_billing_address!r}, " + f"shipping_address={_shipping_address!r}, " + f"coupons={_coupons!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _line_items=( + self.line_items + if hasattr(self, "line_items") + else None + ) + _issue_date=( + self.issue_date + if hasattr(self, "issue_date") + else None + ) + _net_terms=( + self.net_terms + if hasattr(self, "net_terms") + else None + ) + _payment_instructions=( + self.payment_instructions + if hasattr(self, "payment_instructions") + else None + ) + _memo=( + self.memo + if hasattr(self, "memo") + else None + ) + _seller_address=( + self.seller_address + if hasattr(self, "seller_address") + else None + ) + _billing_address=( + self.billing_address + if hasattr(self, "billing_address") + else None + ) + _shipping_address=( + self.shipping_address + if hasattr(self, "shipping_address") + else None + ) + _coupons=( + self.coupons + if hasattr(self, "coupons") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"line_items={_line_items!s}, " + f"issue_date={_issue_date!s}, " + f"net_terms={_net_terms!s}, " + f"payment_instructions={_payment_instructions!s}, " + f"memo={_memo!s}, " + f"seller_address={_seller_address!s}, " + f"billing_address={_billing_address!s}, " + f"shipping_address={_shipping_address!s}, " + f"coupons={_coupons!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_invoice_item.py b/advancedbilling/models/update_invoice_item.py new file mode 100644 index 00000000..7a79a056 --- /dev/null +++ b/advancedbilling/models/update_invoice_item.py @@ -0,0 +1,437 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.api_helper import APIHelper + + +class UpdateInvoiceItem(object): + """Implementation of the 'Update Invoice Item' model. + + 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. + + Attributes: + title (str): The model property of type str. + quantity (float | str | None): 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. + unit_price (float | str | None): 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. + taxable (bool): 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 (str): 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 (str): YYYY-MM-DD + period_range_end (str): YYYY-MM-DD + product_id (str | int | None): Product handle or product id. + component_id (str | int | None): Component handle or component id. + price_point_id (str | int | None): Price point handle or id. For component. + product_price_point_id (str | int | None): The model property of type str | + int | None. + description (str): The model property of type str. + uid (str): 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 (bool): Set to `true` together with `uid` to remove the matching line + item from the invoice. Line items not referenced in the request remain + unchanged. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "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", + } + + _optionals = [ + "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", + ] + + def __init__( + self, + title=APIHelper.SKIP, + quantity=APIHelper.SKIP, + unit_price=APIHelper.SKIP, + taxable=APIHelper.SKIP, + tax_code=APIHelper.SKIP, + period_range_start=APIHelper.SKIP, + period_range_end=APIHelper.SKIP, + product_id=APIHelper.SKIP, + component_id=APIHelper.SKIP, + price_point_id=APIHelper.SKIP, + product_price_point_id=APIHelper.SKIP, + description=APIHelper.SKIP, + uid=APIHelper.SKIP, + destroy=APIHelper.SKIP, + additional_properties=None): + """Initialize a UpdateInvoiceItem instance.""" + # Initialize members of the class + if title is not APIHelper.SKIP: + self.title = title + if quantity is not APIHelper.SKIP: + self.quantity = quantity + if unit_price is not APIHelper.SKIP: + self.unit_price = unit_price + if taxable is not APIHelper.SKIP: + self.taxable = taxable + if tax_code is not APIHelper.SKIP: + self.tax_code = tax_code + if period_range_start is not APIHelper.SKIP: + self.period_range_start = period_range_start + if period_range_end is not APIHelper.SKIP: + self.period_range_end = period_range_end + if product_id is not APIHelper.SKIP: + self.product_id = product_id + if component_id is not APIHelper.SKIP: + self.component_id = component_id + if price_point_id is not APIHelper.SKIP: + self.price_point_id = price_point_id + if product_price_point_id is not APIHelper.SKIP: + self.product_price_point_id = product_price_point_id + if description is not APIHelper.SKIP: + self.description = description + if uid is not APIHelper.SKIP: + self.uid = uid + if destroy is not APIHelper.SKIP: + self.destroy = destroy + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + from advancedbilling.utilities.union_type_lookup import ( + UnionTypeLookUp, + ) + + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + title =\ + dictionary.get("title")\ + if dictionary.get("title")\ + else APIHelper.SKIP + quantity = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("UpdateInvoiceItemQuantity"), + dictionary.get("quantity"), + False)\ + if dictionary.get("quantity") is not None\ + else APIHelper.SKIP + unit_price = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("UpdateInvoiceItemUnitPrice"), + dictionary.get("unit_price"), + False)\ + if dictionary.get("unit_price") is not None\ + else APIHelper.SKIP + taxable =\ + dictionary.get("taxable")\ + if "taxable" in dictionary.keys()\ + else APIHelper.SKIP + tax_code =\ + dictionary.get("tax_code")\ + if dictionary.get("tax_code")\ + else APIHelper.SKIP + period_range_start =\ + dictionary.get("period_range_start")\ + if dictionary.get("period_range_start")\ + else APIHelper.SKIP + period_range_end =\ + dictionary.get("period_range_end")\ + if dictionary.get("period_range_end")\ + else APIHelper.SKIP + product_id = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("UpdateInvoiceItemProductId"), + dictionary.get("product_id"), + False)\ + if dictionary.get("product_id") is not None\ + else APIHelper.SKIP + component_id = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("UpdateInvoiceItemComponentId"), + dictionary.get("component_id"), + False)\ + if dictionary.get("component_id") is not None\ + else APIHelper.SKIP + price_point_id = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("UpdateInvoiceItemPricePointId"), + dictionary.get("price_point_id"), + False)\ + if dictionary.get("price_point_id") is not None\ + else APIHelper.SKIP + product_price_point_id = APIHelper.deserialize_union_type( + UnionTypeLookUp.get("UpdateInvoiceItemProductPricePointId"), + dictionary.get("product_price_point_id"), + False)\ + if dictionary.get("product_price_point_id") is not None\ + else APIHelper.SKIP + description =\ + dictionary.get("description")\ + if dictionary.get("description")\ + else APIHelper.SKIP + uid =\ + dictionary.get("uid")\ + if dictionary.get("uid")\ + else APIHelper.SKIP + destroy =\ + dictionary.get("_destroy")\ + if "_destroy" in dictionary.keys()\ + else APIHelper.SKIP + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(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, + additional_properties) + + def __repr__(self): + """Return a unambiguous string representation.""" + _title=( + self.title + if hasattr(self, "title") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _taxable=( + self.taxable + if hasattr(self, "taxable") + else None + ) + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _period_range_start=( + self.period_range_start + if hasattr(self, "period_range_start") + else None + ) + _period_range_end=( + self.period_range_end + if hasattr(self, "period_range_end") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _destroy=( + self.destroy + if hasattr(self, "destroy") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"title={_title!r}, " + f"quantity={_quantity!r}, " + f"unit_price={_unit_price!r}, " + f"taxable={_taxable!r}, " + f"tax_code={_tax_code!r}, " + f"period_range_start={_period_range_start!r}, " + f"period_range_end={_period_range_end!r}, " + f"product_id={_product_id!r}, " + f"component_id={_component_id!r}, " + f"price_point_id={_price_point_id!r}, " + f"product_price_point_id={_product_price_point_id!r}, " + f"description={_description!r}, " + f"uid={_uid!r}, " + f"destroy={_destroy!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _title=( + self.title + if hasattr(self, "title") + else None + ) + _quantity=( + self.quantity + if hasattr(self, "quantity") + else None + ) + _unit_price=( + self.unit_price + if hasattr(self, "unit_price") + else None + ) + _taxable=( + self.taxable + if hasattr(self, "taxable") + else None + ) + _tax_code=( + self.tax_code + if hasattr(self, "tax_code") + else None + ) + _period_range_start=( + self.period_range_start + if hasattr(self, "period_range_start") + else None + ) + _period_range_end=( + self.period_range_end + if hasattr(self, "period_range_end") + else None + ) + _product_id=( + self.product_id + if hasattr(self, "product_id") + else None + ) + _component_id=( + self.component_id + if hasattr(self, "component_id") + else None + ) + _price_point_id=( + self.price_point_id + if hasattr(self, "price_point_id") + else None + ) + _product_price_point_id=( + self.product_price_point_id + if hasattr(self, "product_price_point_id") + else None + ) + _description=( + self.description + if hasattr(self, "description") + else None + ) + _uid=( + self.uid + if hasattr(self, "uid") + else None + ) + _destroy=( + self.destroy + if hasattr(self, "destroy") + else None + ) + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"title={_title!s}, " + f"quantity={_quantity!s}, " + f"unit_price={_unit_price!s}, " + f"taxable={_taxable!s}, " + f"tax_code={_tax_code!s}, " + f"period_range_start={_period_range_start!s}, " + f"period_range_end={_period_range_end!s}, " + f"product_id={_product_id!s}, " + f"component_id={_component_id!s}, " + f"price_point_id={_price_point_id!s}, " + f"product_price_point_id={_product_price_point_id!s}, " + f"description={_description!s}, " + f"uid={_uid!s}, " + f"destroy={_destroy!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_invoice_request.py b/advancedbilling/models/update_invoice_request.py new file mode 100644 index 00000000..4474501e --- /dev/null +++ b/advancedbilling/models/update_invoice_request.py @@ -0,0 +1,95 @@ +"""advanced_billing. + +This file was automatically generated for Maxio by APIMATIC v3.0 ( + https://www.apimatic.io ). +""" + +# ruff: noqa: E501 +from advancedbilling.models.update_invoice import ( + UpdateInvoice, +) + + +class UpdateInvoiceRequest(object): + """Implementation of the 'Update Invoice Request' model. + + Request payload for updating a draft ad hoc invoice. + + Attributes: + invoice (UpdateInvoice): Attributes of a draft ad hoc invoice which can be + updated. Only the submitted attributes are changed. + additional_properties (Dict[str, object]): The additional properties for the + model. + + """ + + # Create a mapping from Model property names to API property names + _names = { + "invoice": "invoice", + } + + def __init__( + self, + invoice=None, + additional_properties=None): + """Initialize a UpdateInvoiceRequest instance.""" + # Initialize members of the class + self.invoice = invoice + + # Add additional model properties to the instance + if additional_properties is None: + additional_properties = {} + self.additional_properties = additional_properties + + @classmethod + def from_dictionary(cls, + dictionary): + """Create an instance of this model from a dictionary + + Args: + dictionary (dictionary): A dictionary representation of the object + as obtained from the deserialization of the server's response. The + keys MUST match property names in the API description. + + Returns: + object: An instance of this structure class. + + """ + if not isinstance(dictionary, dict) or dictionary is None: + return None + + # Extract variables from the dictionary + invoice =\ + UpdateInvoice.from_dictionary( + dictionary.get("invoice"))\ + if dictionary.get("invoice") else None + + # Clean out expected properties from dictionary + additional_properties =\ + {k: v for k, v in dictionary.items() if k not in cls._names.values()} + + # Return an object of this model + return cls(invoice, + additional_properties) + + def __repr__(self): + """Return a unambiguous string representation.""" + _invoice=self.invoice + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"invoice={_invoice!r}, " + f"additional_properties={_additional_properties!r}, " + f")" + ) + + def __str__(self): + """Return a human-readable string representation.""" + _invoice=self.invoice + _additional_properties=self.additional_properties + return ( + f"{self.__class__.__name__}(" + f"invoice={_invoice!s}, " + f"additional_properties={_additional_properties!s}, " + f")" + ) diff --git a/advancedbilling/models/update_metafield.py b/advancedbilling/models/update_metafield.py index 81bb1a35..710ca29b 100644 --- a/advancedbilling/models/update_metafield.py +++ b/advancedbilling/models/update_metafield.py @@ -22,7 +22,7 @@ class UpdateMetafield(object): will override the existing settings. input_type (MetafieldInput): 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'. + set of values that can be selected. Defaults to 'text'. enum (List[str]): Only applicable when input_type is radio or dropdown. additional_properties (Dict[str, object]): The additional properties for the model. diff --git a/advancedbilling/models/update_payment_profile.py b/advancedbilling/models/update_payment_profile.py index 55a3679d..89bb9bfd 100644 --- a/advancedbilling/models/update_payment_profile.py +++ b/advancedbilling/models/update_payment_profile.py @@ -18,33 +18,33 @@ class UpdatePaymentProfile(object): card_type (CardType): The type of card used. expiration_month (str): (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 (str): (Optional when performing a Import via vault_token, + integer or string, e.g., 5 + expiration_year (str): (Optional when performing an Import via vault_token, required otherwise) The 4-digit credit card expiration year, as an - integer or string, i.e. 2012 + integer or string, e.g., 2012 current_vault (AllVaults): The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. billing_address (str): The credit card or bank account billing street address - (i.e. 123 Main St.). This value is merely passed through to the payment + (e.g., 123 Main St.). This value is merely passed through to the payment gateway. billing_city (str): The credit card or bank account billing address city - (i.e. “Boston”). This value is merely passed through to the payment + (e.g., “Boston”). This value is merely passed through to the payment gateway. billing_state (str): The credit card or bank account billing address state - (i.e. MA). This value is merely passed through to the payment gateway. + (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 (str): The credit card or bank account billing address zip code - (i.e. 12345). This value is merely passed through to the payment gateway. + (e.g., 12345). This value is merely passed through to the payment gateway. billing_country (str): 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 this time. - billing_address_2 (str): Second line of the customer’s billing address i.e. + billing_address_2 (str): Second line of the customer’s billing address, e.g., Apt. 100 additional_properties (Dict[str, object]): The additional properties for the model. diff --git a/advancedbilling/models/update_price.py b/advancedbilling/models/update_price.py index f5ed51f9..36061c29 100644 --- a/advancedbilling/models/update_price.py +++ b/advancedbilling/models/update_price.py @@ -16,7 +16,7 @@ class UpdatePrice(object): ending_quantity (int | str | None): The model property of type int | str | None. unit_price (float | str | None): 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 destroy (bool): The model property of type bool. starting_quantity (int | str | None): The model property of type int | str | None. diff --git a/advancedbilling/models/update_subscription.py b/advancedbilling/models/update_subscription.py index f86d23de..c1f5a5ee 100644 --- a/advancedbilling/models/update_subscription.py +++ b/advancedbilling/models/update_subscription.py @@ -24,9 +24,9 @@ class UpdateSubscription(object): credit_card_attributes (CreditCardAttributes): The model property of type CreditCardAttributes. product_handle (str): Set to the handle of a different product to change the - subscription's product + subscription's product. product_id (int): Set to the id of a different product to change the - subscription's product + subscription's product. product_change_delayed (bool): The model property of type bool. next_product_id (str): Set to an empty string to cancel a delayed product change. @@ -37,7 +37,7 @@ class UpdateSubscription(object): 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 + 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 @@ -59,6 +59,13 @@ class UpdateSubscription(object): States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773 -Subscription-States) for more information. next_billing_at (datetime): The model property of type datetime. + branding_theme_id (int): 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): Timestamp giving the expiration date of this subscription (if any). You may manually change the expiration date at any point during a subscription period. @@ -99,6 +106,7 @@ class UpdateSubscription(object): "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", @@ -125,6 +133,7 @@ class UpdateSubscription(object): "initial_billing_at", "defer_signup", "next_billing_at", + "branding_theme_id", "expires_at", "payment_collection_method", "receives_invoice_emails", @@ -140,6 +149,7 @@ class UpdateSubscription(object): ] _nullables = [ + "branding_theme_id", "dunning_communication_delay_time_zone", ] @@ -155,6 +165,7 @@ def __init__( initial_billing_at=APIHelper.SKIP, defer_signup=False, next_billing_at=APIHelper.SKIP, + branding_theme_id=APIHelper.SKIP, expires_at=APIHelper.SKIP, payment_collection_method=APIHelper.SKIP, receives_invoice_emails=APIHelper.SKIP, @@ -195,6 +206,8 @@ def __init__( APIHelper.apply_datetime_converter( next_billing_at, APIHelper.RFC3339DateTime)\ if next_billing_at else None + if branding_theme_id is not APIHelper.SKIP: + self.branding_theme_id = branding_theme_id if expires_at is not APIHelper.SKIP: self.expires_at =\ APIHelper.apply_datetime_converter( @@ -293,6 +306,10 @@ def from_dictionary(cls, next_billing_at = APIHelper.RFC3339DateTime.from_value( dictionary.get("next_billing_at")).datetime\ if dictionary.get("next_billing_at") else APIHelper.SKIP + branding_theme_id =\ + dictionary.get("branding_theme_id")\ + if "branding_theme_id" in dictionary.keys()\ + else APIHelper.SKIP expires_at = APIHelper.RFC3339DateTime.from_value( dictionary.get("expires_at")).datetime\ if dictionary.get("expires_at") else APIHelper.SKIP @@ -363,6 +380,7 @@ def from_dictionary(cls, initial_billing_at, defer_signup, next_billing_at, + branding_theme_id, expires_at, payment_collection_method, receives_invoice_emails, @@ -429,6 +447,11 @@ def __repr__(self): if hasattr(self, "next_billing_at") else None ) + _branding_theme_id=( + self.branding_theme_id + if hasattr(self, "branding_theme_id") + else None + ) _expires_at=( self.expires_at if hasattr(self, "expires_at") @@ -502,6 +525,7 @@ def __repr__(self): f"initial_billing_at={_initial_billing_at!r}, " f"defer_signup={_defer_signup!r}, " f"next_billing_at={_next_billing_at!r}, " + f"branding_theme_id={_branding_theme_id!r}, " f"expires_at={_expires_at!r}, " f"payment_collection_method={_payment_collection_method!r}, " f"receives_invoice_emails={_receives_invoice_emails!r}, " @@ -570,6 +594,11 @@ def __str__(self): if hasattr(self, "next_billing_at") else None ) + _branding_theme_id=( + self.branding_theme_id + if hasattr(self, "branding_theme_id") + else None + ) _expires_at=( self.expires_at if hasattr(self, "expires_at") @@ -643,6 +672,7 @@ def __str__(self): f"initial_billing_at={_initial_billing_at!s}, " f"defer_signup={_defer_signup!s}, " f"next_billing_at={_next_billing_at!s}, " + f"branding_theme_id={_branding_theme_id!s}, " f"expires_at={_expires_at!s}, " f"payment_collection_method={_payment_collection_method!s}, " f"receives_invoice_emails={_receives_invoice_emails!s}, " diff --git a/advancedbilling/models/webhook.py b/advancedbilling/models/webhook.py index 8a2671a2..aae3df79 100644 --- a/advancedbilling/models/webhook.py +++ b/advancedbilling/models/webhook.py @@ -13,7 +13,7 @@ class Webhook(object): Attributes: event (str): A string describing which event type produced the given webhook - id (int): The unique identifier for the webhooks (unique across all of + id (int): 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): Timestamp indicating when the webhook was created @@ -29,10 +29,10 @@ class Webhook(object): last_sent_at (datetime): Timestamp indicating when the most recent attempt was made to send the webhook last_sent_url (str): The url that the endpoint was last sent to. - successful (bool): 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 (bool): “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 (str): The data sent within the webhook post signature (str): The calculated webhook signature signature_hmac_sha_256 (str): The calculated HMAC-SHA-256 webhook signature diff --git a/advancedbilling/models/webhook_subscription.py b/advancedbilling/models/webhook_subscription.py index f48ad938..b067e5c7 100644 --- a/advancedbilling/models/webhook_subscription.py +++ b/advancedbilling/models/webhook_subscription.py @@ -40,6 +40,7 @@ class WebhookSubscription(object): SUBSCRIPTION_CARD_UPDATE: The enum member of type str. SUBSCRIPTION_GROUP_CARD_UPDATE: The enum member of type str. SUBSCRIPTION_PRODUCT_CHANGE: The enum member of type str. + SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED: The enum member of type str. SUBSCRIPTION_STATE_CHANGE: The enum member of type str. TRIAL_END_NOTICE: The enum member of type str. UPCOMING_RENEWAL_NOTICE: The enum member of type str. @@ -114,6 +115,8 @@ class WebhookSubscription(object): SUBSCRIPTION_PRODUCT_CHANGE = "subscription_product_change" + SUBSCRIPTION_PRODUCT_CHANGE_SCHEDULED = "subscription_product_change_scheduled" + SUBSCRIPTION_STATE_CHANGE = "subscription_state_change" TRIAL_END_NOTICE = "trial_end_notice" diff --git a/advancedbilling/utilities/union_type_lookup.py b/advancedbilling/utilities/union_type_lookup.py index c80d597a..1655d566 100644 --- a/advancedbilling/utilities/union_type_lookup.py +++ b/advancedbilling/utilities/union_type_lookup.py @@ -96,6 +96,12 @@ from advancedbilling.models.failed_payment_event import ( FailedPaymentEvent, ) +from advancedbilling.models.get_one_time_token_bank_account_payment_profile import ( + GetOneTimeTokenBankAccountPaymentProfile, +) +from advancedbilling.models.get_one_time_token_payment_profile import ( + GetOneTimeTokenPaymentProfile, +) from advancedbilling.models.invoice_issued import ( InvoiceIssued, ) @@ -183,6 +189,9 @@ from advancedbilling.models.subscription_product_change import ( SubscriptionProductChange, ) +from advancedbilling.models.subscription_product_change_scheduled import ( + SubscriptionProductChangeScheduled, +) from advancedbilling.models.subscription_state_change import ( SubscriptionStateChange, ) @@ -308,6 +317,15 @@ class UnionTypeLookUp: LeafType(str), ], ), + "ListSubscriptionsInputProduct": lambda: OneOf( + [ + LeafType(int), + LeafType(str), + ], + Context.create( + is_optional=True, + ), + ), "CreateUsageSubscriptionIdOrReference": lambda: OneOf( [ LeafType(int), @@ -732,6 +750,15 @@ class UnionTypeLookUp: is_optional=True, ), ), + "CreateSubscriptionComponentUnitBalance": lambda: OneOf( + [ + LeafType(int), + LeafType(str), + ], + Context.create( + is_optional=True, + ), + ), "CreateSubscriptionComponentAllocatedQuantity": lambda: OneOf( [ LeafType(int), @@ -780,6 +807,7 @@ class UnionTypeLookUp: "EventEventSpecificData": lambda: OneOf( [ LeafType(SubscriptionProductChange), + LeafType(SubscriptionProductChangeScheduled), LeafType(SubscriptionStateChange), LeafType(PaymentRelatedEvents), LeafType(RefundSuccess), @@ -804,6 +832,12 @@ class UnionTypeLookUp: is_nullable=True, ), ), + "GetOneTimeTokenRequestPaymentProfile": lambda: AnyOf( + [ + LeafType(GetOneTimeTokenPaymentProfile), + LeafType(GetOneTimeTokenBankAccountPaymentProfile), + ], + ), "IssueServiceCreditAmount": lambda: OneOf( [ LeafType(float), @@ -832,6 +866,12 @@ class UnionTypeLookUp: is_optional=True, ), ), + "MeteredUsageNewUnitBalance": lambda: OneOf( + [ + LeafType(int), + LeafType(str), + ], + ), "OnOffComponentUnitPrice": lambda: OneOf( [ LeafType(str), @@ -880,6 +920,18 @@ class UnionTypeLookUp: )), ], ), + "PrepaidUsageNewUnitBalance": lambda: OneOf( + [ + LeafType(int), + LeafType(str), + ], + ), + "PrepaidUsageNewOverageUnitBalance": lambda: OneOf( + [ + LeafType(int), + LeafType(str), + ], + ), "PrepaidUsageComponentUnitPrice": lambda: OneOf( [ LeafType(str), @@ -1036,6 +1088,15 @@ class UnionTypeLookUp: is_optional=True, ), ), + "SubscriptionComponentUnitBalance": lambda: OneOf( + [ + LeafType(int), + LeafType(str), + ], + Context.create( + is_optional=True, + ), + ), "SubscriptionComponentAllocatedQuantity": lambda: OneOf( [ LeafType(int), @@ -1163,6 +1224,60 @@ class UnionTypeLookUp: is_optional=True, ), ), + "UpdateInvoiceItemQuantity": lambda: OneOf( + [ + LeafType(float), + LeafType(str), + ], + Context.create( + is_optional=True, + ), + ), + "UpdateInvoiceItemUnitPrice": lambda: OneOf( + [ + LeafType(float), + LeafType(str), + ], + Context.create( + is_optional=True, + ), + ), + "UpdateInvoiceItemProductId": lambda: OneOf( + [ + LeafType(str), + LeafType(int), + ], + Context.create( + is_optional=True, + ), + ), + "UpdateInvoiceItemComponentId": lambda: OneOf( + [ + LeafType(str), + LeafType(int), + ], + Context.create( + is_optional=True, + ), + ), + "UpdateInvoiceItemPricePointId": lambda: OneOf( + [ + LeafType(str), + LeafType(int), + ], + Context.create( + is_optional=True, + ), + ), + "UpdateInvoiceItemProductPricePointId": lambda: OneOf( + [ + LeafType(str), + LeafType(int), + ], + Context.create( + is_optional=True, + ), + ), "UpdateMetafieldsRequestMetafields": lambda: OneOf( [ LeafType(UpdateMetafield), diff --git a/doc/controllers/advance-invoice.md b/doc/controllers/advance-invoice.md index 2a8220f4..aa84108d 100644 --- a/doc/controllers/advance-invoice.md +++ b/doc/controllers/advance-invoice.md @@ -17,7 +17,7 @@ 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. +Issues 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. @@ -112,7 +112,7 @@ print(result) # Void Advance Invoice -Void a subscription's existing advance invoice. Once voided, it can later be regenerated if desired. +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](../../doc/models/invoice.md). ```python diff --git a/doc/controllers/billing-portal.md b/doc/controllers/billing-portal.md index d3c20362..d44ae9ec 100644 --- a/doc/controllers/billing-portal.md +++ b/doc/controllers/billing-portal.md @@ -85,7 +85,7 @@ Returns the exact URL required for a subscriber to access the Billing Portal. + We will not generate a new URL 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 will be blocked from further Management URL requests (with a response code `429`). ```python def read_billing_portal_link(self, diff --git a/doc/controllers/component-price-points.md b/doc/controllers/component-price-points.md index d13392f7..734f29e4 100644 --- a/doc/controllers/component-price-points.md +++ b/doc/controllers/component-price-points.md @@ -176,8 +176,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. ```python @@ -194,7 +192,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `component_id` | `int` | Template, Required | The Advanced Billing id of the component | -| `currency_prices` | `bool` | Query, Optional | Include an array of currency price data | +| `currency_prices` | `bool` | Query, Optional | Include an array of currency price data. | | `page` | `int` | 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` | `int` | 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` | [`List[PricePointType]`](../../doc/models/price-point-type.md) | Query, Optional | Use in query: `filter[type]=catalog,default`. | @@ -638,7 +636,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `component_id` | int \| str | Template, Required | This is a container for one-of cases. | | `price_point_id` | int \| str | Template, Required | This is a container for one-of cases. | -| `currency_prices` | `bool` | Query, Optional | Include an array of currency price data | +| `currency_prices` | `bool` | Query, Optional | Include an array of currency price data. | ## Response Type diff --git a/doc/controllers/components.md b/doc/controllers/components.md index a7afefda..2e8d1235 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`. + ```python def create_metered_component(self, product_family_id, @@ -158,8 +164,14 @@ 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. +#### 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`. + ```python def create_quantity_based_component(self, product_family_id, @@ -277,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`. + ```python def create_on_off_component(self, product_family_id, @@ -379,6 +393,8 @@ Prepaid components allow customers to pre-purchase units that can be used up ove 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`. + ```python def create_prepaid_usage_component(self, product_family_id, @@ -521,6 +537,8 @@ So, instead of reporting usage directly for each component (as you would with me 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`. + ```python def create_event_based_component(self, product_family_id, @@ -767,6 +785,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`. + ```python def update_product_family_component(self, product_family_id, @@ -945,8 +965,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `start_date` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `bool` | Query, Optional | Include archived items | +| `end_datetime` | `str` | 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` | `bool` | Query, Optional | Include archived items. | | `page` | `int` | 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` | `int` | 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 | @@ -1082,6 +1102,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`. + ```python def update_component(self, component_id, @@ -1184,7 +1206,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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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 02a9fba5..0c5e4705 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. @@ -125,7 +121,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `page` | `int` | 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` | `int` | 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` | `bool` | 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` | `bool` | 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 @@ -276,7 +272,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `product_family_id` | `int` | Query, Optional | The Advanced Billing id of the product family to which the coupon belongs | | `code` | `str` | Query, Optional | The code of the coupon | -| `currency_prices` | `bool` | 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` | `bool` | 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 @@ -301,8 +297,6 @@ print(result) 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. ```python @@ -322,7 +316,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `product_family_id` | `int` | Template, Required | The Advanced Billing id of the product family to which the coupon belongs | | `coupon_id` | `int` | Template, Required | The Advanced Billing id of the coupon | -| `currency_prices` | `bool` | 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` | `bool` | 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 @@ -575,7 +569,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `page` | `int` | 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` | `int` | 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` | `bool` | 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` | `bool` | 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 @@ -931,7 +925,7 @@ 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.`. ```python def create_coupon_subcodes(self, @@ -1141,7 +1135,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.. ```python def delete_coupon_subcode(self, diff --git a/doc/controllers/customers.md b/doc/controllers/customers.md index d4f6a83f..b925397a 100644 --- a/doc/controllers/customers.md +++ b/doc/controllers/customers.md @@ -123,6 +123,7 @@ print(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" @@ -222,7 +223,8 @@ print(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 } }, { @@ -248,6 +250,7 @@ print(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 } }, @@ -274,6 +277,7 @@ print(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 } } @@ -343,6 +347,7 @@ print(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", @@ -426,6 +431,7 @@ print(result) "portal_invite_last_sent_at": null, "portal_invite_last_accepted_at": null, "tax_exempt": false, + "surcharging": false, "vat_number": "012345678" } } @@ -512,6 +518,8 @@ print(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'. + ```python def list_customer_subscriptions(self, customer_id) diff --git a/doc/controllers/events.md b/doc/controllers/events.md index 7543a91a..7e19c2c8 100644 --- a/doc/controllers/events.md +++ b/doc/controllers/events.md @@ -23,7 +23,21 @@ Lists events for a site. 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-Activity). +Within the Advanced Billing UI, "Events" are referred to as "Site Activity". See the [Site Activity](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Activity) article in the product documentation for details on how to record view Events / Site Activty in the Advanced Billing UI. + +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” ## List Events for a Site @@ -59,7 +73,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 +91,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", @@ -103,8 +117,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `page` | `int` | 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` | `int` | 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` | `int` | Query, Optional | Returns events with an id greater than or equal to the one specified | -| `max_id` | `int` | Query, Optional | Returns events with an id less than or equal to the one specified | +| `since_id` | `int` | Query, Optional | Returns events with an id greater than or equal to the one specified. | +| `max_id` | `int` | 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**: `"desc"` | | `filter` | [`List[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. | @@ -207,6 +221,20 @@ Lists events for a subscription. The event type is identified by the key property. You can check supported keys [here](../../doc/models/event-key.md). +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” + ## Event Specific Data Different event types may include additional data in `event_specific_data` property. @@ -229,8 +257,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | | `page` | `int` | 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` | `int` | 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` | `int` | Query, Optional | Returns events with an id greater than or equal to the one specified | -| `max_id` | `int` | Query, Optional | Returns events with an id less than or equal to the one specified | +| `since_id` | `int` | Query, Optional | Returns events with an id greater than or equal to the one specified. | +| `max_id` | `int` | 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**: `"desc"` | | `filter` | [`List[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 @@ print(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” + ```python def read_events_count(self, options=dict()) @@ -320,8 +362,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `page` | `int` | 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` | `int` | 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` | `int` | Query, Optional | Returns events with an id greater than or equal to the one specified | -| `max_id` | `int` | Query, Optional | Returns events with an id less than or equal to the one specified | +| `since_id` | `int` | Query, Optional | Returns events with an id greater than or equal to the one specified. | +| `max_id` | `int` | 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**: `"desc"` | | `filter` | [`List[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 0c26e5b7..b09b4be1 100644 --- a/doc/controllers/insights.md +++ b/doc/controllers/insights.md @@ -89,8 +89,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` | `int` | 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` | `int` | Query, Optional | submit the id of a subscription in order to limit results. | ## Response Type @@ -168,7 +168,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscription_id` | `int` | Query, Optional | optionally filter results by subscription | +| `subscription_id` | `int` | Query, Optional | (Optional) Filter results by subscription. | | `page` | `int` | 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` | `int` | 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`. | @@ -247,7 +247,7 @@ print(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. ```python def list_mrr_per_subscription(self, diff --git a/doc/controllers/invoices.md b/doc/controllers/invoices.md index fbd4eba1..f8a97c48 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 @@ -94,7 +96,7 @@ print(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`. ```python def list_invoices(self, @@ -118,13 +120,13 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `page` | `int` | 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` | `int` | 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**: `"desc"` | -| `line_items` | `bool` | Query, Optional | Include line items data

**Default**: `False` | -| `discounts` | `bool` | Query, Optional | Include discounts data

**Default**: `False` | -| `taxes` | `bool` | Query, Optional | Include taxes data

**Default**: `False` | -| `credits` | `bool` | Query, Optional | Include credits data

**Default**: `False` | -| `payments` | `bool` | Query, Optional | Include payments data

**Default**: `False` | -| `custom_fields` | `bool` | Query, Optional | Include custom fields data

**Default**: `False` | -| `refunds` | `bool` | Query, Optional | Include refunds data

**Default**: `False` | +| `line_items` | `bool` | Query, Optional | Include line items data.

**Default**: `False` | +| `discounts` | `bool` | Query, Optional | Include discounts data.

**Default**: `False` | +| `taxes` | `bool` | Query, Optional | Include taxes data.

**Default**: `False` | +| `credits` | `bool` | Query, Optional | Include credits data.

**Default**: `False` | +| `payments` | `bool` | Query, Optional | Include payments data.

**Default**: `False` | +| `custom_fields` | `bool` | Query, Optional | Include custom fields data.

**Default**: `False` | +| `refunds` | `bool` | 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**: `"due_date"` | | `start_datetime` | `str` | 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` | `str` | 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. | @@ -449,7 +451,7 @@ print(result) # Read Invoice -Use this endpoint to retrieve the details for an invoice. +Returns the details for an invoice. ## PDF Invoice retrieval @@ -607,7 +609,7 @@ print(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: @@ -1115,7 +1117,7 @@ print(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. @@ -1224,7 +1226,7 @@ print(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`. @@ -1244,11 +1246,11 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `subscription_id` | `int` | Query, Optional | The subscription's Advanced Billing id | | `page` | `int` | 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` | `int` | 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` | `bool` | Query, Optional | Include line items data

**Default**: `False` | -| `discounts` | `bool` | Query, Optional | Include discounts data

**Default**: `False` | -| `taxes` | `bool` | Query, Optional | Include taxes data

**Default**: `False` | -| `refunds` | `bool` | Query, Optional | Include refunds data

**Default**: `False` | -| `applications` | `bool` | Query, Optional | Include applications data

**Default**: `False` | +| `line_items` | `bool` | Query, Optional | Include line items data.

**Default**: `False` | +| `discounts` | `bool` | Query, Optional | Include discounts data.

**Default**: `False` | +| `taxes` | `bool` | Query, Optional | Include taxes data.

**Default**: `False` | +| `refunds` | `bool` | Query, Optional | Include refunds data.

**Default**: `False` | +| `applications` | `bool` | Query, Optional | Include applications data.

**Default**: `False` | ## Response Type @@ -1582,7 +1584,7 @@ print(result) # Read Credit Note -Use this endpoint to retrieve the details for a credit note. +Returns the details for a credit note. ```python def read_credit_note(self, @@ -1932,7 +1934,7 @@ print(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. @@ -2015,7 +2017,7 @@ print(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: @@ -2068,7 +2070,7 @@ print(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. ```python def void_invoice(self, @@ -2121,7 +2123,7 @@ print(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`. ```python def list_consolidated_invoice_segments(self, @@ -2436,7 +2438,7 @@ print(result) # Create Invoice -This endpoint will allow you to create an ad hoc invoice. +Creates an ad hoc invoice. ### Basic Behavior @@ -2796,9 +2798,160 @@ print(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. + +```python +def update_invoice(self, + subscription_id, + uid, + body=None) +``` + +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | +| `uid` | `str` | 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 + +```python +subscription_id = 222 + +uid = 'uid0' + +body = UpdateInvoiceRequest( + invoice=UpdateInvoice( + net_terms=30, + memo='Updated memo' + ) +) + +result = invoices_controller.update_invoice( + subscription_id, + uid, + body=body +) +print(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. + +```python +def delete_invoice(self, + subscription_id, + uid) +``` + +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscription_id` | `int` | Template, Required | The Chargify id of the subscription. | +| `uid` | `str` | 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 + +```python +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. @@ -2861,7 +3014,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. @@ -2958,7 +3111,7 @@ print(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. @@ -3190,7 +3343,7 @@ print(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/payment-profiles.md b/doc/controllers/payment-profiles.md index 48122e2b..ae6adbbf 100644 --- a/doc/controllers/payment-profiles.md +++ b/doc/controllers/payment-profiles.md @@ -136,7 +136,7 @@ print(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 will return an empty array, not a 404. ```python def list_payment_profiles(self, @@ -753,7 +753,7 @@ print(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. @@ -834,7 +834,7 @@ print(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. @@ -879,7 +879,7 @@ print(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 6adab612..068643e2 100644 --- a/doc/controllers/product-families.md +++ b/doc/controllers/product-families.md @@ -42,7 +42,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` | `bool` | Query, Optional | Include archived products | +| `include_archived` | `bool` | 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 @@ -211,7 +211,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) body = CreateProductFamilyRequest( product_family=CreateProductFamily( name='Acme Projects', - description='Amazing project management tool' + description='Amazing project management tool', + surcharging=False ) ) @@ -230,7 +231,8 @@ print(result) "name": "Acme Projects", "description": "Amazing project management tool", "handle": "acme-projects", - "accounting_code": null + "accounting_code": null, + "surcharging": false } } ``` @@ -244,7 +246,7 @@ print(result) # List Product Families -Returns a list of Product Families for a site. +Lists Product Families for a site. ```python def list_product_families(self, @@ -292,6 +294,7 @@ print(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 @@ -304,6 +307,7 @@ print(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" @@ -359,6 +363,7 @@ print(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 c1e5b1a6..66e7d978 100644 --- a/doc/controllers/product-price-points.md +++ b/doc/controllers/product-price-points.md @@ -134,7 +134,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `product_id` | int \| str | Template, Required | This is a container for one-of cases. | | `page` | `int` | 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` | `int` | 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` | `bool` | 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` | `bool` | 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` | [`List[PricePointType]`](../../doc/models/price-point-type.md) | Query, Optional | Use in query: `filter[type]=catalog,default`. | | `archived` | `bool` | Query, Optional | Set to include archived price points in the response. | @@ -289,7 +289,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `product_id` | int \| str | Template, Required | This is a container for one-of cases. | | `price_point_id` | int \| str | Template, Required | This is a container for one-of cases. | -| `currency_prices` | `bool` | 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` | `bool` | 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 0f6a84ce..eef246b9 100644 --- a/doc/controllers/products.md +++ b/doc/controllers/products.md @@ -22,6 +22,8 @@ products_controller = client.products Creates a product in your Advanced Billing site. +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. + See the following product documentation for more information: + [Products Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Products-Overview) diff --git a/doc/controllers/proforma-invoices.md b/doc/controllers/proforma-invoices.md index 36371e79..5981aa21 100644 --- a/doc/controllers/proforma-invoices.md +++ b/doc/controllers/proforma-invoices.md @@ -88,12 +88,12 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `uid` | `str` | Template, Required | The uid of the subscription group | -| `line_items` | `bool` | Query, Optional | Include line items data

**Default**: `False` | -| `discounts` | `bool` | Query, Optional | Include discounts data

**Default**: `False` | -| `taxes` | `bool` | Query, Optional | Include taxes data

**Default**: `False` | -| `credits` | `bool` | Query, Optional | Include credits data

**Default**: `False` | -| `payments` | `bool` | Query, Optional | Include payments data

**Default**: `False` | -| `custom_fields` | `bool` | Query, Optional | Include custom fields data

**Default**: `False` | +| `line_items` | `bool` | Query, Optional | Include line items data.

**Default**: `False` | +| `discounts` | `bool` | Query, Optional | Include discounts data.

**Default**: `False` | +| `taxes` | `bool` | Query, Optional | Include taxes data.

**Default**: `False` | +| `credits` | `bool` | Query, Optional | Include credits data.

**Default**: `False` | +| `payments` | `bool` | Query, Optional | Include payments data.

**Default**: `False` | +| `custom_fields` | `bool` | Query, Optional | Include custom fields data.

**Default**: `False` | ## Response Type @@ -240,12 +240,12 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `page` | `int` | 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` | `int` | 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**: `"desc"` | -| `line_items` | `bool` | Query, Optional | Include line items data

**Default**: `False` | -| `discounts` | `bool` | Query, Optional | Include discounts data

**Default**: `False` | -| `taxes` | `bool` | Query, Optional | Include taxes data

**Default**: `False` | -| `credits` | `bool` | Query, Optional | Include credits data

**Default**: `False` | -| `payments` | `bool` | Query, Optional | Include payments data

**Default**: `False` | -| `custom_fields` | `bool` | Query, Optional | Include custom fields data

**Default**: `False` | +| `line_items` | `bool` | Query, Optional | Include line items data.

**Default**: `False` | +| `discounts` | `bool` | Query, Optional | Include discounts data.

**Default**: `False` | +| `taxes` | `bool` | Query, Optional | Include taxes data.

**Default**: `False` | +| `credits` | `bool` | Query, Optional | Include credits data.

**Default**: `False` | +| `payments` | `bool` | Query, Optional | Include payments data.

**Default**: `False` | +| `custom_fields` | `bool` | Query, Optional | Include custom fields data.

**Default**: `False` | ## Response Type @@ -391,7 +391,7 @@ print(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/sales-commissions.md b/doc/controllers/sales-commissions.md index 97b4f09d..8a40c86c 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`. ```python def list_sales_commission_settings(self, @@ -102,7 +102,7 @@ print(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`. ```python def list_sales_reps(self, @@ -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`. ```python def read_sales_rep(self, diff --git a/doc/controllers/sites.md b/doc/controllers/sites.md index 68b22eaf..1af79049 100644 --- a/doc/controllers/sites.md +++ b/doc/controllers/sites.md @@ -32,7 +32,7 @@ If the site has RI enabled then you will see more settings like: "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) +[Who Pays & Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays). ```python def read_site(self) @@ -147,7 +147,7 @@ sites_controller.clear_site( # 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). ```python def list_chargify_js_public_keys(self, diff --git a/doc/controllers/subscription-components.md b/doc/controllers/subscription-components.md index dd81b43c..bc60b30f 100644 --- a/doc/controllers/subscription-components.md +++ b/doc/controllers/subscription-components.md @@ -565,7 +565,7 @@ print(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 @@ -1230,7 +1230,7 @@ print(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. @@ -1261,8 +1261,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `subscription_id_or_reference` | int \| str | Template, Required | This is a container for one-of cases. | | `component_id` | int \| str | Template, Required | This is a container for one-of cases. | -| `since_id` | `int` | Query, Optional | Returns usages with an id greater than or equal to the one specified | -| `max_id` | `int` | Query, Optional | Returns usages with an id less than or equal to the one specified | +| `since_id` | `int` | Query, Optional | Returns usages with an id greater than or equal to the one specified. | +| `max_id` | `int` | 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` | `int` | 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` | @@ -1472,7 +1472,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `api_handle` | `str` | Template, Required | Identifies the Stream for which the event should be published. | -| `store_uid` | `str` | 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` | `str` | 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 | - | ## Response Type @@ -1524,7 +1524,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `api_handle` | `str` | Template, Required | Identifies the Stream for which the events should be published. | -| `store_uid` | `str` | 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` | `str` | 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` | [`List[EBBEvent]`](../../doc/models/ebb-event.md) | Body, Optional | - | ## Response Type diff --git a/doc/controllers/subscription-groups.md b/doc/controllers/subscription-groups.md index e787e77c..705b5385 100644 --- a/doc/controllers/subscription-groups.md +++ b/doc/controllers/subscription-groups.md @@ -168,7 +168,7 @@ print(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 @@ -555,7 +555,7 @@ print(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. @@ -644,7 +644,7 @@ print(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. ```python def remove_subscription_from_group(self, diff --git a/doc/controllers/subscription-renewals.md b/doc/controllers/subscription-renewals.md index 53a2d5e7..c39a1aad 100644 --- a/doc/controllers/subscription-renewals.md +++ b/doc/controllers/subscription-renewals.md @@ -580,7 +580,7 @@ print(result) # Unpublish Scheduled Renewal Configuration -Returns a scheduled renewal configuration to an editable state. +Restores a scheduled renewal configuration to an editable state. ```python def unpublish_scheduled_renewal_configuration(self, @@ -746,6 +746,8 @@ print(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. + ```python def create_scheduled_renewal_configuration_item(self, subscription_id, @@ -834,6 +836,8 @@ print(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. + ```python def update_scheduled_renewal_configuration_item(self, subscription_id, diff --git a/doc/controllers/subscription-status.md b/doc/controllers/subscription-status.md index 186894be..6fcb2505 100644 --- a/doc/controllers/subscription-status.md +++ b/doc/controllers/subscription-status.md @@ -561,7 +561,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscription_id` | `int` | 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 @@ -728,7 +728,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscription_id` | `int` | 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 diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md index fce8608b..a7b16ebc 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 @@ -249,7 +291,9 @@ print(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 @@ -274,19 +318,28 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `page` | `int` | 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` | `int` | 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**: `"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` | `int` | Query, Optional | The product id of the subscription. (Note that the product handle cannot be used.) | -| `product_price_point_id` | `int` | Query, Optional | The ID of the product price point. If supplied, product is required | +| `product` | int \| str \| None | Query, Optional | This is a container for one-of cases. | +| `q` | `str` | Query, Optional | Search string. | +| `q_scope` | [`QScope`](../../doc/models/q-scope.md) | Query, Optional | Scope of fields used by the q search. | +| `customer_id` | `int` | Query, Optional | The Advanced Billing id of the customer. | +| `product_price_point_id` | `int` | Query, Optional | The ID of the product price point. If supplied, product is required. | | `coupon` | `int` | 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` | `str` | 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` | `int` | 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` | `Dict[str, str]` | 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**: `"signup_date"` | +| `group_status` | [`GroupStatus`](../../doc/models/group-status.md) | Query, Optional | Filter by whether a subscription is in a group. | +| `dunning_exemption` | `bool` | Query, Optional | Filter by dunning exemption status. | +| `payment_gateways` | `str` | Query, Optional | Comma-separated payment gateway identifiers. | +| `currencies` | `str` | Query, Optional | Comma-separated currency codes. | | `include` | [`List[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 @@ -301,10 +354,6 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) collect = { 'page': 1, 'per_page': 50, - 'start_date': dateutil.parser.parse('2022-07-01').date(), - 'end_date': dateutil.parser.parse('2022-08-01').date(), - 'start_datetime': dateutil.parser.parse('2022-07-01 09:00:05'), - 'end_datetime': dateutil.parser.parse('2022-08-01 10:00:05'), 'sort': SubscriptionSort.SIGNUP_DATE, 'include': [ SubscriptionListInclude.SELF_SERVICE_PAGE_TOKEN @@ -365,7 +414,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`. ```python def update_subscription(self, @@ -530,6 +581,8 @@ print(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. @@ -968,6 +1021,22 @@ A subscription will not be created by utilizing this endpoint; it is meant to se For more information, see our documentation [here](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: diff --git a/doc/controllers/webhooks.md b/doc/controllers/webhooks.md index d8e3fdc5..46412cac 100644 --- a/doc/controllers/webhooks.md +++ b/doc/controllers/webhooks.md @@ -75,7 +75,7 @@ print(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 @@ print(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" } @@ -215,7 +215,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 @@ -270,7 +270,7 @@ print(result) # List Endpoints -Returns created endpoints for a site. +Lists endpoints configured for a site. ```python def list_endpoints(self) @@ -346,7 +346,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `endpoint_id` | `int` | 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 24f50796..0c68ef29 100644 --- a/doc/models/account-balance.md +++ b/doc/models/account-balance.md @@ -13,13 +13,15 @@ | `automatic_balance_in_cents` | `int` | Optional | The automatic balance in cents. | | `remittance_balance_in_cents` | `int` | 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 + +```python +from advancedbilling.models.account_balance import AccountBalance + +account_balance = AccountBalance( + 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..d877fcee 100644 --- a/doc/models/account-balances.md +++ b/doc/models/account-balances.md @@ -9,41 +9,44 @@ | 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 + +```python +from advancedbilling.models.account_balance import AccountBalance +from advancedbilling.models.account_balances import AccountBalances + +account_balances = AccountBalances( + open_invoices=AccountBalance( + balance_in_cents=40, + automatic_balance_in_cents=202, + remittance_balance_in_cents=170 + ), + pending_invoices=AccountBalance( + balance_in_cents=0, + automatic_balance_in_cents=242, + remittance_balance_in_cents=46 + ), + pending_discounts=AccountBalance( + balance_in_cents=88, + automatic_balance_in_cents=154, + remittance_balance_in_cents=134 + ), + service_credits=AccountBalance( + balance_in_cents=84, + automatic_balance_in_cents=70, + remittance_balance_in_cents=38 + ), + prepayments=AccountBalance( + 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 fa30df97..46b8d6da 100644 --- a/doc/models/ach-agreement.md +++ b/doc/models/ach-agreement.md @@ -16,14 +16,16 @@ | `authorizer_last_name` | `str` | Optional | (Required when providing ACH agreement params) The last name of the person authorizing the ACH agreement. | | `ip_address` | `str` | 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 + +```python +from advancedbilling.models.ach_agreement import ACHAgreement + +ach_agreement = ACHAgreement( + 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 c20e32ee..a07f939a 100644 --- a/doc/models/activate-event-based-component.md +++ b/doc/models/activate-event-based-component.md @@ -13,33 +13,42 @@ | `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 + +```python +import dateutil.parser + +from advancedbilling.models.activate_event_based_component import ActivateEventBasedComponent +from advancedbilling.models.billing_schedule import BillingSchedule +from advancedbilling.models.component_custom_price import ComponentCustomPrice +from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme + +activate_event_based_component = ActivateEventBasedComponent( + price_point_id=166, + billing_schedule=BillingSchedule( + initial_billing_at=dateutil.parser.parse('2016-03-13').date() + ), + custom_price=ComponentCustomPrice( + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ), + Price( + 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 7f32e301..f5c4881a 100644 --- a/doc/models/activate-subscription-request.md +++ b/doc/models/activate-subscription-request.md @@ -9,13 +9,15 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `revert_on_failure` | `bool` | 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` | `bool` | 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 -} +```python +from advancedbilling.models.activate_subscription_request import ActivateSubscriptionRequest + +activate_subscription_request = ActivateSubscriptionRequest( + revert_on_failure=False +) ``` diff --git a/doc/models/add-coupons-request.md b/doc/models/add-coupons-request.md index a39227ff..7b880db6 100644 --- a/doc/models/add-coupons-request.md +++ b/doc/models/add-coupons-request.md @@ -11,14 +11,16 @@ | --- | --- | --- | --- | | `codes` | `List[str]` | Optional | - | -## Example (as JSON) - -```json -{ - "codes": [ - "codes0", - "codes1" - ] -} +## Example + +```python +from advancedbilling.models.add_coupons_request import AddCouponsRequest + +add_coupons_request = AddCouponsRequest( + 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..01ab507b 100644 --- a/doc/models/add-subscription-to-a-group.md +++ b/doc/models/add-subscription-to-a-group.md @@ -11,21 +11,27 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.add_subscription_to_a_group import AddSubscriptionToAGroup +from advancedbilling.models.group_billing import GroupBilling +from advancedbilling.models.group_settings import GroupSettings +from advancedbilling.models.group_target import GroupTarget +from advancedbilling.models.group_target_type import GroupTargetType + +add_subscription_to_a_group = AddSubscriptionToAGroup( + group=GroupSettings( + target=GroupTarget( + mtype=GroupTargetType.PARENT, + id=236 + ), + billing=GroupBilling( + accrue=False, + align_date=False, + prorate=False + ) + ) +) ``` diff --git a/doc/models/address-change.md b/doc/models/address-change.md index 81b4da7f..f6a1dc0d 100644 --- a/doc/models/address-change.md +++ b/doc/models/address-change.md @@ -12,24 +12,27 @@ | `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 + +```python +from advancedbilling.models.address_change import AddressChange +from advancedbilling.models.invoice_address import InvoiceAddress + +address_change = AddressChange( + before=InvoiceAddress( + street='street0', + line_2='line24', + city='city0', + state='state6', + zip='zip4' + ), + after=InvoiceAddress( + street='street2', + line_2='line26', + city='city8', + state='state2', + zip='zip4' + ) +) ``` diff --git a/doc/models/agreement-acceptance.md b/doc/models/agreement-acceptance.md index d955239e..ba55993f 100644 --- a/doc/models/agreement-acceptance.md +++ b/doc/models/agreement-acceptance.md @@ -12,21 +12,23 @@ Required when creating a subscription with Maxio Payments. | Name | Type | Tags | Description | | --- | --- | --- | --- | | `ip_address` | `str` | Optional | Required when providing agreement acceptance params. | -| `terms_url` | `str` | Optional | Required when creating a subscription with Maxio Payments. Either terms_url or provacy_policy_url required when providing agreement_acceptance params. | +| `terms_url` | `str` | 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` | `str` | Optional | - | | `return_refund_policy_url` | `str` | Optional | - | | `delivery_policy_url` | `str` | Optional | - | | `secure_checkout_policy_url` | `str` | 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" -} +```python +from advancedbilling.models.agreement_acceptance import AgreementAcceptance + +agreement_acceptance = AgreementAcceptance( + 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..8ea723e9 100644 --- a/doc/models/all-vaults.md +++ b/doc/models/all-vaults.md @@ -46,3 +46,11 @@ The vault that stores the payment profile with the provided `vault_token`. Use ` | `UNIPAAS` | | `WIRECARD` | +## Example + +```python +from advancedbilling.models.all_vaults import AllVaults + +all_vaults = AllVaults.STRIPE_CONNECT +``` + diff --git a/doc/models/allocate-components.md b/doc/models/allocate-components.md index 80d9c377..21fa58df 100644 --- a/doc/models/allocate-components.md +++ b/doc/models/allocate-components.md @@ -15,35 +15,31 @@ | `accrue_charge` | `bool` | 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` | `bool` | 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" - } - ], - "accrue_charge": false, - "upgrade_charge": "full" -} +## Example + +```python +from advancedbilling.models.allocate_components import AllocateComponents +from advancedbilling.models.create_allocation import CreateAllocation +from advancedbilling.models.credit_type import CreditType + +allocate_components = AllocateComponents( + proration_upgrade_scheme='proration_upgrade_scheme2', + proration_downgrade_scheme='proration_downgrade_scheme0', + allocations=[ + CreateAllocation( + 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=CreditType.PRORATED +) ``` diff --git a/doc/models/allocation-expiration-date.md b/doc/models/allocation-expiration-date.md index 5e0c1c6f..9746120b 100644 --- a/doc/models/allocation-expiration-date.md +++ b/doc/models/allocation-expiration-date.md @@ -11,11 +11,15 @@ | --- | --- | --- | --- | | `expires_at` | `datetime` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "expires_at": "2016-03-13T12:52:32.123Z" -} +```python +import dateutil.parser + +from advancedbilling.models.allocation_expiration_date import AllocationExpirationDate + +allocation_expiration_date = AllocationExpirationDate( + expires_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/allocation-preview-direction.md b/doc/models/allocation-preview-direction.md index 2e124430..96411b69 100644 --- a/doc/models/allocation-preview-direction.md +++ b/doc/models/allocation-preview-direction.md @@ -12,3 +12,11 @@ | `UPGRADE` | | `DOWNGRADE` | +## Example + +```python +from advancedbilling.models.allocation_preview_direction import AllocationPreviewDirection + +allocation_preview_direction = AllocationPreviewDirection.UPGRADE +``` + diff --git a/doc/models/allocation-preview-item.md b/doc/models/allocation-preview-item.md index 74caf08f..30346d8d 100644 --- a/doc/models/allocation-preview-item.md +++ b/doc/models/allocation-preview-item.md @@ -21,22 +21,24 @@ | `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` | `int` | Optional | - | -| `interval` | `int` | 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` | `int` | 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` | `int` | Optional | - | | `price_point_handle` | `str` | Optional | - | | `price_point_name` | `str` | Optional | - | | `component_handle` | `str` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "component_id": 54, - "subscription_id": 54, - "quantity": 78, - "previous_quantity": 192, - "memo": "memo6" -} +```python +from advancedbilling.models.allocation_preview_item import AllocationPreviewItem + +allocation_preview_item = AllocationPreviewItem( + 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..2197d3be 100644 --- a/doc/models/allocation-preview-line-item-kind.md +++ b/doc/models/allocation-preview-line-item-kind.md @@ -16,3 +16,11 @@ A handle for the line item kind for allocation preview | `COUPON` | | `TAX` | +## Example + +```python +from advancedbilling.models.allocation_preview_line_item_kind import AllocationPreviewLineItemKind + +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 88c8dee9..e5e7a6c7 100644 --- a/doc/models/allocation-preview-line-item.md +++ b/doc/models/allocation-preview-line-item.md @@ -17,17 +17,21 @@ | `taxable_amount_in_cents` | `int` | Optional | - | | `component_id` | `int` | Optional | - | | `component_handle` | `str` | 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 + +```python +from advancedbilling.models.allocation_preview_line_item import AllocationPreviewLineItem +from advancedbilling.models.allocation_preview_line_item_kind import AllocationPreviewLineItemKind +from advancedbilling.models.line_item_transaction_type import LineItemTransactionType + +allocation_preview_line_item = AllocationPreviewLineItem( + 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..e75d0de5 100644 --- a/doc/models/allocation-preview-response.md +++ b/doc/models/allocation-preview-response.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | | `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 + +```python +import dateutil.parser + +from advancedbilling.models.allocation_preview import AllocationPreview +from advancedbilling.models.allocation_preview_response import AllocationPreviewResponse + +allocation_preview_response = AllocationPreviewResponse( + allocation_preview=AllocationPreview( + start_date=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + end_date=dateutil.parser.parse('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 7931ff55..5aecd50d 100644 --- a/doc/models/allocation-preview.md +++ b/doc/models/allocation-preview.md @@ -23,15 +23,19 @@ | `period_type` | `str` | Optional | - | | `existing_balance_in_cents` | `int` | 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 + +```python +import dateutil.parser + +from advancedbilling.models.allocation_preview import AllocationPreview + +allocation_preview = AllocationPreview( + start_date=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + end_date=dateutil.parser.parse('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..220d7c68 100644 --- a/doc/models/allocation-response.md +++ b/doc/models/allocation-response.md @@ -11,17 +11,20 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.allocation import Allocation +from advancedbilling.models.allocation_response import AllocationResponse + +allocation_response = AllocationResponse( + allocation=Allocation( + 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 e10321f2..bb5decfe 100644 --- a/doc/models/allocation-settings.md +++ b/doc/models/allocation-settings.md @@ -13,13 +13,16 @@ | `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` | `str` | Optional | Either "true" or "false". | -## Example (as JSON) - -```json -{ - "upgrade_charge": "none", - "downgrade_credit": "prorated", - "accrue_charge": "accrue_charge0" -} +## Example + +```python +from advancedbilling.models.allocation_settings import AllocationSettings +from advancedbilling.models.credit_type import CreditType + +allocation_settings = AllocationSettings( + 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 cb0c6007..cf2da8f5 100644 --- a/doc/models/allocation.md +++ b/doc/models/allocation.md @@ -9,21 +9,21 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `allocation_id` | `int` | Optional | The allocation unique id | -| `component_id` | `int` | Optional | The integer component ID for the allocation. This references a component that you have created in your Product setup | -| `component_handle` | `str` | Optional | The handle of the component. This references a component that you have created in your Product setup | -| `subscription_id` | `int` | Optional | The integer subscription ID for the allocation. This references a unique subscription in your Site | +| `allocation_id` | `int` | Optional | The allocation unique ID | +| `component_id` | `int` | Optional | The integer component ID for the allocation. This references a component that you have created in your Product setup. | +| `component_handle` | `str` | Optional | The handle of the component. This references a component that you have created in your Product setup. | +| `subscription_id` | `int` | Optional | The integer subscription ID for the allocation. This references a unique subscription in your Site. | | `quantity` | int \| str \| None | Optional | This is a container for one-of cases. | | `previous_quantity` | int \| str \| None | Optional | This is a container for one-of cases. | | `memo` | `str` | 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` | `str` | Optional | The scheme used if the proration was an upgrade. This is only present when the allocation was created mid-period. | | `proration_downgrade_scheme` | `str` | Optional | The scheme used if the proration was a downgrade. This is only present when the allocation was created mid-period. | | `price_point_id` | `int` | Optional | - | | `price_point_name` | `str` | Optional | - | | `price_point_handle` | `str` | Optional | - | -| `interval` | `int` | 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` | `int` | 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` | `int` | Optional | - | | `accrue_charge` | `bool` | 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,17 @@ | `used_quantity` | `int` | Optional | - | | `charge_id` | `int` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "allocation_id": 102, - "component_id": 144, - "component_handle": "component_handle0", - "subscription_id": 144, - "quantity": 168 -} +```python +from advancedbilling.models.allocation import Allocation + +allocation = Allocation( + 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 21363428..d787b67e 100644 --- a/doc/models/apple-pay-payment-profile.md +++ b/doc/models/apple-pay-payment-profile.md @@ -12,7 +12,7 @@ | `id` | `int` | Optional | The Chargify-assigned ID of the Apple Pay payment profile. | | `first_name` | `str` | Optional | The first name of the Apple Pay account holder | | `last_name` | `str` | Optional | The last name of the Apple Pay account holder | -| `customer_id` | `int` | Optional | The Chargify-assigned id for the customer record to which the Apple Pay account belongs | +| `customer_id` | `int` | 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` | `str` | Optional | The “token” provided by your vault storage for an already stored payment profile | | `billing_address` | `str` | Optional | The current billing street address for the Apple Pay account | @@ -28,16 +28,20 @@ | `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 + +```python +from advancedbilling.models.apple_pay_payment_profile import ApplePayPaymentProfile +from advancedbilling.models.apple_pay_vault import ApplePayVault +from advancedbilling.models.payment_type import PaymentType + +apple_pay_payment_profile = ApplePayPaymentProfile( + 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..960f8939 100644 --- a/doc/models/apple-pay-vault.md +++ b/doc/models/apple-pay-vault.md @@ -13,3 +13,11 @@ The vault that stores the payment profile with the provided vault_token. | --- | | `BRAINTREE_BLUE` | +## Example + +```python +from advancedbilling.models.apple_pay_vault import ApplePayVault + +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 1035b9af..82902e59 100644 --- a/doc/models/applied-credit-note-data.md +++ b/doc/models/applied-credit-note-data.md @@ -12,12 +12,14 @@ | `uid` | `str` | Optional | The UID of the credit note | | `number` | `str` | Optional | The number of the credit note | -## Example (as JSON) +## Example -```json -{ - "uid": "uid2", - "number": "number0" -} +```python +from advancedbilling.models.applied_credit_note_data import AppliedCreditNoteData + +applied_credit_note_data = AppliedCreditNoteData( + 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 60930b95..936358e8 100644 --- a/doc/models/apply-credit-note-event-data.md +++ b/doc/models/apply-credit-note-event-data.md @@ -19,32 +19,41 @@ 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` | `str` | Optional | The credit note memo. | | `role` | `str` | Optional | The role of the credit note (e.g. 'general') | -| `consolidated_invoice` | `bool` | Optional | Shows whether it was applied to consolidated invoice or not | +| `consolidated_invoice` | `bool` | Optional | Shows whether it was applied to consolidated invoice or not. | | `applied_credit_notes` | [`List[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 + +```python +import dateutil.parser + +from advancedbilling.models.applied_credit_note_data import AppliedCreditNoteData +from advancedbilling.models.apply_credit_note_event_data import ApplyCreditNoteEventData + +apply_credit_note_event_data = ApplyCreditNoteEventData( + uid='uid8', + credit_note_number='credit_note_number8', + credit_note_uid='credit_note_uid8', + original_amount='original_amount2', + applied_amount='applied_amount0', + transaction_time=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + memo='memo2', + role='role8', + consolidated_invoice=False, + applied_credit_notes=[ + AppliedCreditNoteData( + uid='uid4', + number='number8' + ), + AppliedCreditNoteData( + uid='uid4', + number='number8' + ), + AppliedCreditNoteData( + uid='uid4', + number='number8' + ) + ] +) ``` diff --git a/doc/models/apply-credit-note-event.md b/doc/models/apply-credit-note-event.md index 552875aa..ac60a69c 100644 --- a/doc/models/apply-credit-note-event.md +++ b/doc/models/apply-credit-note-event.md @@ -15,49 +15,57 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"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 + +```python +import dateutil.parser + +from advancedbilling.models.applied_credit_note_data import AppliedCreditNoteData +from advancedbilling.models.apply_credit_note_event import ApplyCreditNoteEvent +from advancedbilling.models.apply_credit_note_event_data import ApplyCreditNoteEventData +from advancedbilling.models.invoice import Invoice +from advancedbilling.models.invoice_event_type import InvoiceEventType + +apply_credit_note_event = ApplyCreditNoteEvent( + id=56, + timestamp=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + invoice=Invoice( + id=166, + uid='uid6', + site_id=92, + customer_id=204, + subscription_id=20, + issue_date=dateutil.parser.parse('2024-01-01').date(), + due_date=dateutil.parser.parse('2024-01-01').date(), + paid_date=dateutil.parser.parse('2024-01-01').date(), + public_url_expires_on=dateutil.parser.parse('2024-01-21').date() + ), + event_type=InvoiceEventType.APPLY_CREDIT_NOTE, + event_data=ApplyCreditNoteEventData( + uid='uid6', + credit_note_number='credit_note_number0', + credit_note_uid='credit_note_uid0', + original_amount='original_amount0', + applied_amount='applied_amount2', + transaction_time=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + memo='memo0', + role='role0', + consolidated_invoice=False, + applied_credit_notes=[ + AppliedCreditNoteData( + uid='uid4', + number='number8' + ), + AppliedCreditNoteData( + uid='uid4', + number='number8' + ), + AppliedCreditNoteData( + 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 93bd5c2b..74d6b230 100644 --- a/doc/models/apply-debit-note-event-data.md +++ b/doc/models/apply-debit-note-event-data.md @@ -18,16 +18,20 @@ Example schema for an `apply_debit_note` event | `memo` | `str` | 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 + +```python +import dateutil.parser + +from advancedbilling.models.apply_debit_note_event_data import ApplyDebitNoteEventData + +apply_debit_note_event_data = ApplyDebitNoteEventData( + debit_note_number='debit_note_number2', + debit_note_uid='debit_note_uid8', + original_amount='original_amount6', + applied_amount='applied_amount6', + memo='memo6', + transaction_time=dateutil.parser.parse('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 9e927529..95b1acea 100644 --- a/doc/models/apply-debit-note-event.md +++ b/doc/models/apply-debit-note-event.md @@ -15,32 +15,39 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"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 + +```python +import dateutil.parser + +from advancedbilling.models.apply_debit_note_event import ApplyDebitNoteEvent +from advancedbilling.models.apply_debit_note_event_data import ApplyDebitNoteEventData +from advancedbilling.models.invoice import Invoice +from advancedbilling.models.invoice_event_type import InvoiceEventType + +apply_debit_note_event = ApplyDebitNoteEvent( + id=216, + timestamp=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + invoice=Invoice( + id=166, + uid='uid6', + site_id=92, + customer_id=204, + subscription_id=20, + issue_date=dateutil.parser.parse('2024-01-01').date(), + due_date=dateutil.parser.parse('2024-01-01').date(), + paid_date=dateutil.parser.parse('2024-01-01').date(), + public_url_expires_on=dateutil.parser.parse('2024-01-21').date() + ), + event_type=InvoiceEventType.APPLY_DEBIT_NOTE, + event_data=ApplyDebitNoteEventData( + debit_note_number='debit_note_number6', + debit_note_uid='debit_note_uid2', + original_amount='original_amount0', + applied_amount='applied_amount2', + memo='memo0', + transaction_time=dateutil.parser.parse('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 c3766532..135ff8b4 100644 --- a/doc/models/apply-payment-event-data.md +++ b/doc/models/apply-payment-event-data.md @@ -23,23 +23,30 @@ Example schema for an `apply_payment` event | `prepayment` | `bool` | Optional | - | | `external` | `bool` | 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 + +```python +import dateutil.parser + +from advancedbilling.models.apply_payment_event_data import ApplyPaymentEventData +from advancedbilling.models.invoice_consolidation_level import InvoiceConsolidationLevel +from advancedbilling.models.invoice_event_payment_method import InvoiceEventPaymentMethod +from advancedbilling.models.payment_method_apple_pay import PaymentMethodApplePay + +apply_payment_event_data = ApplyPaymentEventData( + consolidation_level=InvoiceConsolidationLevel.PARENT, + memo='memo2', + original_amount='original_amount2', + applied_amount='applied_amount0', + transaction_time=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + payment_method=PaymentMethodApplePay( + mtype=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 cdb2d959..fc4d8eb0 100644 --- a/doc/models/apply-payment-event.md +++ b/doc/models/apply-payment-event.md @@ -15,39 +15,49 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"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 + +```python +import dateutil.parser + +from advancedbilling.models.apply_payment_event import ApplyPaymentEvent +from advancedbilling.models.apply_payment_event_data import ApplyPaymentEventData +from advancedbilling.models.invoice import Invoice +from advancedbilling.models.invoice_consolidation_level import InvoiceConsolidationLevel +from advancedbilling.models.invoice_event_payment_method import InvoiceEventPaymentMethod +from advancedbilling.models.invoice_event_type import InvoiceEventType +from advancedbilling.models.payment_method_apple_pay import PaymentMethodApplePay + +apply_payment_event = ApplyPaymentEvent( + id=244, + timestamp=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + invoice=Invoice( + id=166, + uid='uid6', + site_id=92, + customer_id=204, + subscription_id=20, + issue_date=dateutil.parser.parse('2024-01-01').date(), + due_date=dateutil.parser.parse('2024-01-01').date(), + paid_date=dateutil.parser.parse('2024-01-01').date(), + public_url_expires_on=dateutil.parser.parse('2024-01-21').date() + ), + event_type=InvoiceEventType.APPLY_PAYMENT, + event_data=ApplyPaymentEventData( + consolidation_level=InvoiceConsolidationLevel.CHILD, + memo='memo0', + original_amount='original_amount0', + applied_amount='applied_amount2', + transaction_time=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + payment_method=PaymentMethodApplePay( + mtype=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 496b0765..dbf201e3 100644 --- a/doc/models/attribute-error.md +++ b/doc/models/attribute-error.md @@ -11,14 +11,17 @@ | --- | --- | --- | --- | | `attribute` | `List[str]` | Required | - | -## Example (as JSON) - -```json -{ - "attribute": [ - "attribute6", - "attribute7" - ] -} +## Example + +```python +from advancedbilling.models.attribute_error import AttributeError + +attribute_error = AttributeError( + attribute=[ + 'attribute6', + 'attribute5', + 'attribute4' + ] +) ``` diff --git a/doc/models/auto-invite.md b/doc/models/auto-invite.md index c467ad11..341dd0a5 100644 --- a/doc/models/auto-invite.md +++ b/doc/models/auto-invite.md @@ -12,3 +12,11 @@ | `NO` | Do not send the invitation email. | | `YES` | Automatically send the invitation email. | +## Example + +```python +from advancedbilling.models.auto_invite import AutoInvite + +auto_invite = AutoInvite.NO +``` + diff --git a/doc/models/auto-resume.md b/doc/models/auto-resume.md index 30ebdc87..269bbff6 100644 --- a/doc/models/auto-resume.md +++ b/doc/models/auto-resume.md @@ -11,11 +11,15 @@ | --- | --- | --- | --- | | `automatically_resume_at` | `datetime` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "automatically_resume_at": "2016-03-13T12:52:32.123Z" -} +```python +import dateutil.parser + +from advancedbilling.models.auto_resume import AutoResume + +auto_resume = AutoResume( + automatically_resume_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/available-actions.md b/doc/models/available-actions.md index 29da049d..ce8d01e2 100644 --- a/doc/models/available-actions.md +++ b/doc/models/available-actions.md @@ -11,14 +11,17 @@ | --- | --- | --- | --- | | `send_email` | [`SendEmail`](../../doc/models/send-email.md) | Optional | - | -## Example (as JSON) - -```json -{ - "send_email": { - "can_execute": false, - "url": "url0" - } -} +## Example + +```python +from advancedbilling.models.available_actions import AvailableActions +from advancedbilling.models.send_email import SendEmail + +available_actions = AvailableActions( + send_email=SendEmail( + can_execute=False, + url='url0' + ) +) ``` diff --git a/doc/models/backport-invoice-event.md b/doc/models/backport-invoice-event.md index 76145bcf..66a3e10a 100644 --- a/doc/models/backport-invoice-event.md +++ b/doc/models/backport-invoice-event.md @@ -15,35 +15,41 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"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 + +```python +import dateutil.parser + +from advancedbilling.models.backport_invoice_event import BackportInvoiceEvent +from advancedbilling.models.invoice import Invoice +from advancedbilling.models.invoice_event_type import InvoiceEventType + +backport_invoice_event = BackportInvoiceEvent( + id=236, + timestamp=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + invoice=Invoice( + id=166, + uid='uid6', + site_id=92, + customer_id=204, + subscription_id=20, + issue_date=dateutil.parser.parse('2024-01-01').date(), + due_date=dateutil.parser.parse('2024-01-01').date(), + paid_date=dateutil.parser.parse('2024-01-01').date(), + public_url_expires_on=dateutil.parser.parse('2024-01-21').date() + ), + event_type=InvoiceEventType.BACKPORT_INVOICE, + event_data=Invoice( + id=206, + uid='uid6', + site_id=132, + customer_id=244, + subscription_id=60, + issue_date=dateutil.parser.parse('2024-01-01').date(), + due_date=dateutil.parser.parse('2024-01-01').date(), + paid_date=dateutil.parser.parse('2024-01-01').date(), + public_url_expires_on=dateutil.parser.parse('2024-01-21').date() + ) +) ``` diff --git a/doc/models/bank-account-attributes.md b/doc/models/bank-account-attributes.md index e11d3b09..9c4f5c69 100644 --- a/doc/models/bank-account-attributes.md +++ b/doc/models/bank-account-attributes.md @@ -11,26 +11,29 @@ | --- | --- | --- | --- | | `chargify_token` | `str` | Optional | - | | `bank_name` | `str` | Optional | (Required when creating a subscription with ACH or GoCardless) The name of the bank where the customer’s account resides | -| `bank_routing_number` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | Optional | (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided | -| `bank_iban` | `str` | Optional | (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided | +| `bank_branch_code` | `str` | Optional | (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided. | +| `bank_iban` | `str` | 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` | `str` | Optional | - | | `customer_vault_token` | `str` | 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" -} +```python +from advancedbilling.models.bank_account_attributes import BankAccountAttributes +from advancedbilling.models.bank_account_type import BankAccountType + +bank_account_attributes = BankAccountAttributes( + 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..ba25b140 100644 --- a/doc/models/bank-account-holder-type.md +++ b/doc/models/bank-account-holder-type.md @@ -14,3 +14,11 @@ Defaults to personal | `PERSONAL` | | `BUSINESS` | +## Example + +```python +from advancedbilling.models.bank_account_holder_type import BankAccountHolderType + +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 cd17fe6a..18b3f428 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` | `int` | 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` | `int` | 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` | `str` | Optional | The first name of the bank account holder | | `last_name` | `str` | Optional | The last name of the bank account holder | -| `customer_id` | `int` | Optional | The Chargify-assigned id for the customer record to which the bank account belongs | +| `customer_id` | `int` | 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` | `str` | Optional | The "token" provided by your vault storage for an already stored payment profile | | `billing_address` | `str` | Optional | The current billing street address for the bank account | @@ -23,28 +23,31 @@ | `customer_vault_token` | `str` | Optional | (only for Authorize.Net CIM storage): the customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token. | | `billing_address_2` | `str` | Optional | The current billing street address, second line, for the bank account | | `bank_name` | `str` | Optional | The bank where the account resides | -| `masked_bank_routing_number` | `str` | 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` | `str` | 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` | `str` | 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. | | `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**: `"bank_account"` | -| `verified` | `bool` | Optional | denotes whether a bank account has been verified by providing the amounts of two small deposits made into the account

**Default**: `False` | +| `verified` | `bool` | 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` | `int` | Optional | - | | `gateway_handle` | `str` | 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 + +```python +from advancedbilling.models.bank_account_payment_profile import BankAccountPaymentProfile +from advancedbilling.models.bank_account_vault import BankAccountVault +from advancedbilling.models.payment_type import PaymentType + +bank_account_payment_profile = BankAccountPaymentProfile( + 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..55510c9f 100644 --- a/doc/models/bank-account-response.md +++ b/doc/models/bank-account-response.md @@ -11,19 +11,24 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.bank_account_payment_profile import BankAccountPaymentProfile +from advancedbilling.models.bank_account_response import BankAccountResponse +from advancedbilling.models.bank_account_vault import BankAccountVault +from advancedbilling.models.payment_type import PaymentType + +bank_account_response = BankAccountResponse( + payment_profile=BankAccountPaymentProfile( + 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..bd00b46c 100644 --- a/doc/models/bank-account-type.md +++ b/doc/models/bank-account-type.md @@ -14,3 +14,11 @@ Defaults to checking | `CHECKING` | | `SAVINGS` | +## Example + +```python +from advancedbilling.models.bank_account_type import BankAccountType + +bank_account_type = BankAccountType.CHECKING +``` + diff --git a/doc/models/bank-account-vault.md b/doc/models/bank-account-vault.md index 9ff1b83a..1058c1a6 100644 --- a/doc/models/bank-account-vault.md +++ b/doc/models/bank-account-vault.md @@ -20,3 +20,11 @@ The vault that stores the payment profile with the provided vault_token. Use `bo | `MAXP` | | `STRIPE_CONNECT` | +## Example + +```python +from advancedbilling.models.bank_account_vault import BankAccountVault + +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..9c8132fb 100644 --- a/doc/models/bank-account-verification-request.md +++ b/doc/models/bank-account-verification-request.md @@ -11,14 +11,17 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.bank_account_verification import BankAccountVerification +from advancedbilling.models.bank_account_verification_request import BankAccountVerificationRequest + +bank_account_verification_request = BankAccountVerificationRequest( + bank_account_verification=BankAccountVerification( + 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 290d21ba..c8a992f3 100644 --- a/doc/models/bank-account-verification.md +++ b/doc/models/bank-account-verification.md @@ -12,12 +12,14 @@ | `deposit_1_in_cents` | `int` | Optional | - | | `deposit_2_in_cents` | `int` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "deposit_1_in_cents": 142, - "deposit_2_in_cents": 132 -} +```python +from advancedbilling.models.bank_account_verification import BankAccountVerification + +bank_account_verification = BankAccountVerification( + 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 a6c9d721..c4c980d3 100644 --- a/doc/models/base-refund-error.md +++ b/doc/models/base-refund-error.md @@ -11,24 +11,19 @@ | --- | --- | --- | --- | | `base` | `List[Any]` | Optional | - | -## Example (as JSON) - -```json -{ - "base": [ - { - "key1": "val1", - "key2": "val2" - }, - { - "key1": "val1", - "key2": "val2" - }, - { - "key1": "val1", - "key2": "val2" - } - ] -} +## Example + +```python +import jsonpickle + +from advancedbilling.models.base_refund_error import BaseRefundError + +base_refund_error = BaseRefundError( + base=[ + jsonpickle.decode('{"key1":"val1","key2":"val2"}'), + jsonpickle.decode('{"key1":"val1","key2":"val2"}'), + jsonpickle.decode('{"key1":"val1","key2":"val2"}') + ] +) ``` diff --git a/doc/models/base-string-error.md b/doc/models/base-string-error.md index 89474870..64bb6587 100644 --- a/doc/models/base-string-error.md +++ b/doc/models/base-string-error.md @@ -13,13 +13,16 @@ The error is base if it is not directly associated with a single attribute. | --- | --- | --- | --- | | `base` | `List[str]` | Optional | - | -## Example (as JSON) - -```json -{ - "base": [ - "base3" - ] -} +## Example + +```python +from advancedbilling.models.base_string_error import BaseStringError + +base_string_error = BaseStringError( + base=[ + 'base3', + 'base4' + ] +) ``` diff --git a/doc/models/basic-date-field.md b/doc/models/basic-date-field.md index 8bb95917..6a6bb9ee 100644 --- a/doc/models/basic-date-field.md +++ b/doc/models/basic-date-field.md @@ -16,7 +16,9 @@ Allows to filter by `created_at` or `updated_at`. ## Example -``` -updated_at +```python +from advancedbilling.models.basic_date_field import BasicDateField + +basic_date_field = BasicDateField.UPDATED_AT ``` diff --git a/doc/models/batch-job-response.md b/doc/models/batch-job-response.md index 575293fd..b8da0b86 100644 --- a/doc/models/batch-job-response.md +++ b/doc/models/batch-job-response.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | | `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 + +```python +import dateutil.parser + +from advancedbilling.models.batch_job import BatchJob +from advancedbilling.models.batch_job_response import BatchJobResponse + +batch_job_response = BatchJobResponse( + batchjob=BatchJob( + id=54, + finished_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + row_count=62, + created_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + completed='completed4' + ) +) ``` diff --git a/doc/models/batch-job.md b/doc/models/batch-job.md index 80dbef63..d839f464 100644 --- a/doc/models/batch-job.md +++ b/doc/models/batch-job.md @@ -15,15 +15,19 @@ | `created_at` | `datetime` | Optional | - | | `completed` | `str` | 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 + +```python +import dateutil.parser + +from advancedbilling.models.batch_job import BatchJob + +batch_job = BatchJob( + id=240, + finished_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + row_count=248, + created_at=dateutil.parser.parse('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 2b8bc37f..3f5ce12f 100644 --- a/doc/models/billing-manifest-item.md +++ b/doc/models/billing-manifest-item.md @@ -24,15 +24,19 @@ | `period_range_start` | `str` | Optional | - | | `period_range_end` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "transaction_type": "info_transaction", - "kind": "baseline", - "amount_in_cents": 216, - "memo": "memo4", - "discount_amount_in_cents": 236 -} +## Example + +```python +from advancedbilling.models.billing_manifest_item import BillingManifestItem +from advancedbilling.models.billing_manifest_line_item_kind import BillingManifestLineItemKind +from advancedbilling.models.line_item_transaction_type import LineItemTransactionType + +billing_manifest_item = BillingManifestItem( + 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..7ce04a4d 100644 --- a/doc/models/billing-manifest-line-item-kind.md +++ b/doc/models/billing-manifest-line-item-kind.md @@ -18,3 +18,11 @@ A handle for the billing manifest line item kind | `COMPONENT` | | `TAX` | +## Example + +```python +from advancedbilling.models.billing_manifest_line_item_kind import BillingManifestLineItemKind + +billing_manifest_line_item_kind = BillingManifestLineItemKind.COMPONENT +``` + diff --git a/doc/models/billing-manifest.md b/doc/models/billing-manifest.md index a47a83c3..0286419f 100644 --- a/doc/models/billing-manifest.md +++ b/doc/models/billing-manifest.md @@ -19,37 +19,42 @@ | `period_type` | `str` | Optional | - | | `existing_balance_in_cents` | `int` | 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 - } - ], - "total_in_cents": 192, - "total_discount_in_cents": 178, - "total_tax_in_cents": 172, - "subtotal_in_cents": 48 -} +## Example + +```python +from advancedbilling.models.billing_manifest import BillingManifest +from advancedbilling.models.billing_manifest_item import BillingManifestItem +from advancedbilling.models.billing_manifest_line_item_kind import BillingManifestLineItemKind +from advancedbilling.models.line_item_transaction_type import LineItemTransactionType + +billing_manifest = BillingManifest( + line_items=[ + BillingManifestItem( + transaction_type=LineItemTransactionType.CREDIT, + kind=BillingManifestLineItemKind.COMPONENT, + amount_in_cents=24, + memo='memo2', + discount_amount_in_cents=172 + ), + BillingManifestItem( + transaction_type=LineItemTransactionType.CREDIT, + kind=BillingManifestLineItemKind.COMPONENT, + amount_in_cents=24, + memo='memo2', + discount_amount_in_cents=172 + ), + BillingManifestItem( + transaction_type=LineItemTransactionType.CREDIT, + kind=BillingManifestLineItemKind.COMPONENT, + amount_in_cents=24, + memo='memo2', + discount_amount_in_cents=172 + ) + ], + 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 9c0a428d..f4fc98d1 100644 --- a/doc/models/billing-schedule.md +++ b/doc/models/billing-schedule.md @@ -13,11 +13,15 @@ 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" -} +```python +import dateutil.parser + +from advancedbilling.models.billing_schedule import BillingSchedule + +billing_schedule = BillingSchedule( + initial_billing_at=dateutil.parser.parse('2026-01-01').date() +) ``` diff --git a/doc/models/breakouts.md b/doc/models/breakouts.md index 20795702..ca5edd69 100644 --- a/doc/models/breakouts.md +++ b/doc/models/breakouts.md @@ -14,14 +14,16 @@ | `usage_amount_in_cents` | `int` | Optional | - | | `usage_amount_formatted` | `str` | 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 + +```python +from advancedbilling.models.breakouts import Breakouts + +breakouts = Breakouts( + 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 fd88175e..3d6a5858 100644 --- a/doc/models/bulk-components-price-point-assignment.md +++ b/doc/models/bulk-components-price-point-assignment.md @@ -11,16 +11,19 @@ | --- | --- | --- | --- | | `components` | [`List[ComponentPricePointAssignment]`](../../doc/models/component-price-point-assignment.md) | Optional | - | -## Example (as JSON) - -```json -{ - "components": [ - { - "component_id": 108, - "price_point": "String5" - } - ] -} +## Example + +```python +from advancedbilling.models.bulk_components_price_point_assignment import BulkComponentsPricePointAssignment +from advancedbilling.models.component_price_point_assignment import ComponentPricePointAssignment + +bulk_components_price_point_assignment = BulkComponentsPricePointAssignment( + components=[ + ComponentPricePointAssignment( + 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 c3330592..574207ba 100644 --- a/doc/models/bulk-create-product-price-points-request.md +++ b/doc/models/bulk-create-product-price-points-request.md @@ -11,24 +11,29 @@ | --- | --- | --- | --- | | `price_points` | [`List[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 + +```python +from advancedbilling.models.bulk_create_product_price_points_request import BulkCreateProductPricePointsRequest +from advancedbilling.models.create_product_price_point import CreateProductPricePoint +from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.trial_type import TrialType + +bulk_create_product_price_points_request = BulkCreateProductPricePointsRequest( + price_points=[ + CreateProductPricePoint( + 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 890b1a92..72ca83ce 100644 --- a/doc/models/bulk-create-product-price-points-response.md +++ b/doc/models/bulk-create-product-price-points-response.md @@ -11,19 +11,22 @@ | --- | --- | --- | --- | | `price_points` | [`List[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 + +```python +from advancedbilling.models.bulk_create_product_price_points_response import BulkCreateProductPricePointsResponse +from advancedbilling.models.product_price_point import ProductPricePoint + +bulk_create_product_price_points_response = BulkCreateProductPricePointsResponse( + price_points=[ + ProductPricePoint( + 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 4cdd0f47..2f609461 100644 --- a/doc/models/bulk-create-segments.md +++ b/doc/models/bulk-create-segments.md @@ -11,36 +11,89 @@ | --- | --- | --- | --- | | `segments` | [`List[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 + +```python +from advancedbilling.models.bulk_create_segments import BulkCreateSegments +from advancedbilling.models.create_or_update_segment_price import CreateOrUpdateSegmentPrice +from advancedbilling.models.create_segment import CreateSegment +from advancedbilling.models.pricing_scheme import PricingScheme + +bulk_create_segments = BulkCreateSegments( + segments=[ + CreateSegment( + 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( + unit_price='String3', + starting_quantity=64, + ending_quantity=38 + ), + CreateOrUpdateSegmentPrice( + unit_price='String3', + starting_quantity=64, + ending_quantity=38 + ), + CreateOrUpdateSegmentPrice( + unit_price='String3', + starting_quantity=64, + ending_quantity=38 + ) + ] + ), + CreateSegment( + 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( + unit_price='String3', + starting_quantity=64, + ending_quantity=38 + ), + CreateOrUpdateSegmentPrice( + unit_price='String3', + starting_quantity=64, + ending_quantity=38 + ), + CreateOrUpdateSegmentPrice( + unit_price='String3', + starting_quantity=64, + ending_quantity=38 + ) + ] + ), + CreateSegment( + 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( + unit_price='String3', + starting_quantity=64, + ending_quantity=38 + ), + CreateOrUpdateSegmentPrice( + unit_price='String3', + starting_quantity=64, + ending_quantity=38 + ), + CreateOrUpdateSegmentPrice( + 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 61201002..72199339 100644 --- a/doc/models/bulk-update-segments-item.md +++ b/doc/models/bulk-update-segments-item.md @@ -13,19 +13,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` | [`List[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 + +```python +from advancedbilling.models.bulk_update_segments_item import BulkUpdateSegmentsItem +from advancedbilling.models.create_or_update_segment_price import CreateOrUpdateSegmentPrice +from advancedbilling.models.pricing_scheme import PricingScheme + +bulk_update_segments_item = BulkUpdateSegmentsItem( + id=156, + pricing_scheme=PricingScheme.PER_UNIT, + prices=[ + CreateOrUpdateSegmentPrice( + 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 2ee401ae..e99abc3a 100644 --- a/doc/models/bulk-update-segments.md +++ b/doc/models/bulk-update-segments.md @@ -11,54 +11,59 @@ | --- | --- | --- | --- | | `segments` | [`List[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" - } - ] - }, - { - "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" - } - ] - } - ] -} +```python +from advancedbilling.models.bulk_update_segments import BulkUpdateSegments +from advancedbilling.models.bulk_update_segments_item import BulkUpdateSegmentsItem +from advancedbilling.models.create_or_update_segment_price import CreateOrUpdateSegmentPrice +from advancedbilling.models.pricing_scheme import PricingScheme + +bulk_update_segments = BulkUpdateSegments( + segments=[ + BulkUpdateSegmentsItem( + id=50, + pricing_scheme=PricingScheme.STAIRSTEP, + prices=[ + CreateOrUpdateSegmentPrice( + unit_price='String3', + starting_quantity=64, + ending_quantity=38 + ), + CreateOrUpdateSegmentPrice( + unit_price='String3', + starting_quantity=64, + ending_quantity=38 + ), + CreateOrUpdateSegmentPrice( + unit_price='String3', + starting_quantity=64, + ending_quantity=38 + ) + ] + ), + BulkUpdateSegmentsItem( + id=50, + pricing_scheme=PricingScheme.STAIRSTEP, + prices=[ + CreateOrUpdateSegmentPrice( + unit_price='String3', + starting_quantity=64, + ending_quantity=38 + ), + CreateOrUpdateSegmentPrice( + unit_price='String3', + starting_quantity=64, + ending_quantity=38 + ), + CreateOrUpdateSegmentPrice( + unit_price='String3', + starting_quantity=64, + ending_quantity=38 + ) + ] + ) + ] +) ``` diff --git a/doc/models/calendar-billing.md b/doc/models/calendar-billing.md index 93451e59..687db6a1 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,15 @@ | `snap_day` | int \| str \| None | 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" -} +```python +from advancedbilling.models.calendar_billing import CalendarBilling +from advancedbilling.models.first_charge_type import FirstChargeType + +calendar_billing = CalendarBilling( + 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 60dafb36..38e63571 100644 --- a/doc/models/cancel-grouped-subscriptions-request.md +++ b/doc/models/cancel-grouped-subscriptions-request.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `charge_unbilled_usage` | `bool` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "charge_unbilled_usage": false -} +```python +from advancedbilling.models.cancel_grouped_subscriptions_request import CancelGroupedSubscriptionsRequest + +cancel_grouped_subscriptions_request = CancelGroupedSubscriptionsRequest( + charge_unbilled_usage=False +) ``` diff --git a/doc/models/cancellation-method.md b/doc/models/cancellation-method.md index b0b7765a..ea38a162 100644 --- a/doc/models/cancellation-method.md +++ b/doc/models/cancellation-method.md @@ -18,3 +18,11 @@ The process used to cancel the subscription, if the subscription has been cancel | `UNKNOWN` | | `IMPORTED` | +## Example + +```python +from advancedbilling.models.cancellation_method import CancellationMethod + +cancellation_method = CancellationMethod.UNKNOWN +``` + diff --git a/doc/models/cancellation-options.md b/doc/models/cancellation-options.md index c2d397f7..cbbfb8f1 100644 --- a/doc/models/cancellation-options.md +++ b/doc/models/cancellation-options.md @@ -12,18 +12,22 @@ | `cancellation_message` | `str` | Optional | An indication as to why the subscription is being canceled. For your internal use. | | `reason_code` | `str` | 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` | `bool` | 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` | `bool` | 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 -} +```python +import dateutil.parser + +from advancedbilling.models.cancellation_options import CancellationOptions + +cancellation_options = CancellationOptions( + cancellation_message='cancellation_message0', + reason_code='reason_code6', + cancel_at_end_of_period=False, + scheduled_cancellation_at=dateutil.parser.parse('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..c2b00c82 100644 --- a/doc/models/cancellation-request.md +++ b/doc/models/cancellation-request.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | | `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 + +```python +import dateutil.parser + +from advancedbilling.models.cancellation_options import CancellationOptions +from advancedbilling.models.cancellation_request import CancellationRequest + +cancellation_request = CancellationRequest( + subscription=CancellationOptions( + cancellation_message='cancellation_message2', + reason_code='reason_code8', + cancel_at_end_of_period=False, + scheduled_cancellation_at=dateutil.parser.parse('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..257b3aa9 100644 --- a/doc/models/card-type.md +++ b/doc/models/card-type.md @@ -48,3 +48,11 @@ The type of card used. | `SOLO` | | `LASER` | +## Example + +```python +from advancedbilling.models.card_type import CardType + +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..310c193b 100644 --- a/doc/models/change-chargeback-status-event-data.md +++ b/doc/models/change-chargeback-status-event-data.md @@ -13,11 +13,14 @@ 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" -} +```python +from advancedbilling.models.change_chargeback_status_event_data import ChangeChargebackStatusEventData +from advancedbilling.models.chargeback_status import ChargebackStatus + +change_chargeback_status_event_data = ChangeChargebackStatusEventData( + chargeback_status=ChargebackStatus.OPEN +) ``` diff --git a/doc/models/change-chargeback-status-event.md b/doc/models/change-chargeback-status-event.md index d351a759..43d0aae8 100644 --- a/doc/models/change-chargeback-status-event.md +++ b/doc/models/change-chargeback-status-event.md @@ -15,27 +15,35 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"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 + +```python +import dateutil.parser + +from advancedbilling.models.change_chargeback_status_event import ChangeChargebackStatusEvent +from advancedbilling.models.change_chargeback_status_event_data import ChangeChargebackStatusEventData +from advancedbilling.models.chargeback_status import ChargebackStatus +from advancedbilling.models.invoice import Invoice +from advancedbilling.models.invoice_event_type import InvoiceEventType + +change_chargeback_status_event = ChangeChargebackStatusEvent( + id=114, + timestamp=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + invoice=Invoice( + id=166, + uid='uid6', + site_id=92, + customer_id=204, + subscription_id=20, + issue_date=dateutil.parser.parse('2024-01-01').date(), + due_date=dateutil.parser.parse('2024-01-01').date(), + paid_date=dateutil.parser.parse('2024-01-01').date(), + public_url_expires_on=dateutil.parser.parse('2024-01-21').date() + ), + event_type=InvoiceEventType.CHANGE_CHARGEBACK_STATUS, + event_data=ChangeChargebackStatusEventData( + 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 49fff9a4..2e201c60 100644 --- a/doc/models/change-invoice-collection-method-event-data.md +++ b/doc/models/change-invoice-collection-method-event-data.md @@ -14,12 +14,14 @@ Example schema for an `change_invoice_collection_method` event | `from_collection_method` | `str` | Required | The previous collection method of the invoice. | | `to_collection_method` | `str` | 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" -} +```python +from advancedbilling.models.change_invoice_collection_method_event_data import ChangeInvoiceCollectionMethodEventData + +change_invoice_collection_method_event_data = ChangeInvoiceCollectionMethodEventData( + 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 cee7a7f2..2248e854 100644 --- a/doc/models/change-invoice-collection-method-event.md +++ b/doc/models/change-invoice-collection-method-event.md @@ -15,28 +15,35 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"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 + +```python +import dateutil.parser + +from advancedbilling.models.change_invoice_collection_method_event import ChangeInvoiceCollectionMethodEvent +from advancedbilling.models.change_invoice_collection_method_event_data import ChangeInvoiceCollectionMethodEventData +from advancedbilling.models.invoice import Invoice +from advancedbilling.models.invoice_event_type import InvoiceEventType + +change_invoice_collection_method_event = ChangeInvoiceCollectionMethodEvent( + id=216, + timestamp=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + invoice=Invoice( + id=166, + uid='uid6', + site_id=92, + customer_id=204, + subscription_id=20, + issue_date=dateutil.parser.parse('2024-01-01').date(), + due_date=dateutil.parser.parse('2024-01-01').date(), + paid_date=dateutil.parser.parse('2024-01-01').date(), + public_url_expires_on=dateutil.parser.parse('2024-01-21').date() + ), + event_type=InvoiceEventType.CHANGE_INVOICE_COLLECTION_METHOD, + event_data=ChangeInvoiceCollectionMethodEventData( + 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 1e076ecb..7c630e36 100644 --- a/doc/models/change-invoice-status-event-data.md +++ b/doc/models/change-invoice-status-event-data.md @@ -17,15 +17,19 @@ 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 + +```python +from advancedbilling.models.change_invoice_status_event_data import ChangeInvoiceStatusEventData +from advancedbilling.models.invoice_consolidation_level import InvoiceConsolidationLevel +from advancedbilling.models.invoice_status import InvoiceStatus + +change_invoice_status_event_data = ChangeInvoiceStatusEventData( + 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 86fd1083..468db4a0 100644 --- a/doc/models/change-invoice-status-event.md +++ b/doc/models/change-invoice-status-event.md @@ -15,31 +15,40 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"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 + +```python +import dateutil.parser + +from advancedbilling.models.change_invoice_status_event import ChangeInvoiceStatusEvent +from advancedbilling.models.change_invoice_status_event_data import ChangeInvoiceStatusEventData +from advancedbilling.models.invoice import Invoice +from advancedbilling.models.invoice_consolidation_level import InvoiceConsolidationLevel +from advancedbilling.models.invoice_event_type import InvoiceEventType +from advancedbilling.models.invoice_status import InvoiceStatus + +change_invoice_status_event = ChangeInvoiceStatusEvent( + id=36, + timestamp=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + invoice=Invoice( + id=166, + uid='uid6', + site_id=92, + customer_id=204, + subscription_id=20, + issue_date=dateutil.parser.parse('2024-01-01').date(), + due_date=dateutil.parser.parse('2024-01-01').date(), + paid_date=dateutil.parser.parse('2024-01-01').date(), + public_url_expires_on=dateutil.parser.parse('2024-01-21').date() + ), + event_type=InvoiceEventType.CHANGE_INVOICE_STATUS, + event_data=ChangeInvoiceStatusEventData( + 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..a7c902ea 100644 --- a/doc/models/chargeback-status.md +++ b/doc/models/chargeback-status.md @@ -16,3 +16,11 @@ The current chargeback status. | `WON` | | `CLOSED` | +## Example + +```python +from advancedbilling.models.chargeback_status import ChargebackStatus + +chargeback_status = ChargebackStatus.OPEN +``` + diff --git a/doc/models/chargify-ebb.md b/doc/models/chargify-ebb.md index 7539e669..d466900f 100644 --- a/doc/models/chargify-ebb.md +++ b/doc/models/chargify-ebb.md @@ -16,15 +16,19 @@ | `subscription_id` | `int` | 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` | `str` | 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 + +```python +import dateutil.parser + +from advancedbilling.models.chargify_ebb import ChargifyEBB + +chargify_ebb = ChargifyEBB( + timestamp=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + id='id4', + created_at=dateutil.parser.parse('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 52fac741..28f65ddc 100644 --- a/doc/models/chjs-tokenization-failure.md +++ b/doc/models/chjs-tokenization-failure.md @@ -12,16 +12,19 @@ | `errors` | `str` | 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 + +```python +from advancedbilling.models.chjs_tokenization_failure import ChjsTokenizationFailure +from advancedbilling.models.payment_profile_params import PaymentProfileParams + +chjs_tokenization_failure = ChjsTokenizationFailure( + errors='errors4', + payment_profile_params=PaymentProfileParams( + 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 76ab9dad..7db14dd9 100644 --- a/doc/models/chjs-tokenization-success.md +++ b/doc/models/chjs-tokenization-success.md @@ -12,17 +12,20 @@ | `payment_profile` | [`TokenizedPaymentProfile`](../../doc/models/tokenized-payment-profile.md) | Required | - | | `gateway_customer_id` | `int` | 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 + +```python +from advancedbilling.models.chjs_tokenization_success import ChjsTokenizationSuccess +from advancedbilling.models.tokenized_payment_profile import TokenizedPaymentProfile + +chjs_tokenization_success = ChjsTokenizationSuccess( + payment_profile=TokenizedPaymentProfile( + 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..1fcd9c88 100644 --- a/doc/models/cleanup-scope.md +++ b/doc/models/cleanup-scope.md @@ -14,3 +14,11 @@ all: Will clear all products, customers, and related subscriptions from the site | `ALL` | | `CUSTOMERS` | +## Example + +```python +from advancedbilling.models.cleanup_scope import CleanupScope + +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..ce559a91 100644 --- a/doc/models/clone-component-price-point-request.md +++ b/doc/models/clone-component-price-point-request.md @@ -11,14 +11,17 @@ | --- | --- | --- | --- | | `price_point` | [`CloneComponentPricePoint`](../../doc/models/clone-component-price-point.md) | Required | - | -## Example (as JSON) - -```json -{ - "price_point": { - "name": "name0", - "handle": "handle6" - } -} +## Example + +```python +from advancedbilling.models.clone_component_price_point import CloneComponentPricePoint +from advancedbilling.models.clone_component_price_point_request import CloneComponentPricePointRequest + +clone_component_price_point_request = CloneComponentPricePointRequest( + price_point=CloneComponentPricePoint( + name='name0', + handle='handle6' + ) +) ``` diff --git a/doc/models/clone-component-price-point.md b/doc/models/clone-component-price-point.md index ae8e21cf..eecf6d3d 100644 --- a/doc/models/clone-component-price-point.md +++ b/doc/models/clone-component-price-point.md @@ -12,12 +12,14 @@ | `name` | `str` | Required | - | | `handle` | `str` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "name": "name2", - "handle": "handle8" -} +```python +from advancedbilling.models.clone_component_price_point import CloneComponentPricePoint + +clone_component_price_point = CloneComponentPricePoint( + 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..bd693892 --- /dev/null +++ b/doc/models/collection-method-1.md @@ -0,0 +1,23 @@ + +# Collection Method 1 + +## Enumeration + +`CollectionMethod1` + +## Fields + +| Name | +| --- | +| `AUTOMATIC` | +| `REMITTANCE` | +| `PREPAID` | + +## Example + +```python +from advancedbilling.models.collection_method_1 import CollectionMethod1 + +collection_method_1 = CollectionMethod1.AUTOMATIC +``` + diff --git a/doc/models/collection-method.md b/doc/models/collection-method.md index 50b7215d..71676ab7 100644 --- a/doc/models/collection-method.md +++ b/doc/models/collection-method.md @@ -16,3 +16,11 @@ The type of payment collection to be used in the subscription. For legacy Statem | `PREPAID` | | `INVOICE` | +## Example + +```python +from advancedbilling.models.collection_method import CollectionMethod + +collection_method = CollectionMethod.PREPAID +``` + diff --git a/doc/models/component-allocation-change.md b/doc/models/component-allocation-change.md index 91f5f347..98975a24 100644 --- a/doc/models/component-allocation-change.md +++ b/doc/models/component-allocation-change.md @@ -17,17 +17,19 @@ | `allocation_id` | `int` | Required | - | | `allocated_quantity` | int \| str \| None | 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 + +```python +from advancedbilling.models.component_allocation_change import ComponentAllocationChange + +component_allocation_change = ComponentAllocationChange( + 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 d8cdb32a..82323816 100644 --- a/doc/models/component-allocation-error-exception.md +++ b/doc/models/component-allocation-error-exception.md @@ -11,30 +11,14 @@ | --- | --- | --- | --- | | `errors` | [`List[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 + +```python +try: + # make the API call +except ComponentAllocationErrorException as e: + print(e) +except APIException as e: + print(e) ``` diff --git a/doc/models/component-allocation-error-item.md b/doc/models/component-allocation-error-item.md index b515afa5..105cbbe4 100644 --- a/doc/models/component-allocation-error-item.md +++ b/doc/models/component-allocation-error-item.md @@ -14,14 +14,16 @@ | `kind` | `str` | Optional | - | | `on` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "component_id": 188, - "message": "message0", - "kind": "kind8", - "on": "on0" -} +## Example + +```python +from advancedbilling.models.component_allocation_error_item import ComponentAllocationErrorItem + +component_allocation_error_item = ComponentAllocationErrorItem( + 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 3721503f..53c783c4 100644 --- a/doc/models/component-cost-data-rate-tier.md +++ b/doc/models/component-cost-data-rate-tier.md @@ -15,15 +15,17 @@ | `unit_price` | `str` | Optional | - | | `amount` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "starting_quantity": 132, - "ending_quantity": 106, - "quantity": "quantity0", - "unit_price": "unit_price2", - "amount": "amount6" -} +## Example + +```python +from advancedbilling.models.component_cost_data_rate_tier import ComponentCostDataRateTier + +component_cost_data_rate_tier = ComponentCostDataRateTier( + 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 f1fece65..fa7da538 100644 --- a/doc/models/component-cost-data.md +++ b/doc/models/component-cost-data.md @@ -17,15 +17,17 @@ | `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` | [`List[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 + +```python +from advancedbilling.models.component_cost_data import ComponentCostData + +component_cost_data = ComponentCostData( + 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 6398c5b6..e8e4ffd4 100644 --- a/doc/models/component-currency-price.md +++ b/doc/models/component-currency-price.md @@ -16,15 +16,17 @@ | `price_id` | `int` | Optional | - | | `price_point_id` | `int` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 4, - "currency": "currency8", - "price": "price4", - "formatted_price": "formatted_price6", - "price_id": 162 -} +## Example + +```python +from advancedbilling.models.component_currency_price import ComponentCurrencyPrice + +component_currency_price = ComponentCurrencyPrice( + 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 e4d536ac..229712b2 100644 --- a/doc/models/component-currency-prices-response.md +++ b/doc/models/component-currency-prices-response.md @@ -11,19 +11,22 @@ | --- | --- | --- | --- | | `currency_prices` | [`List[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 + +```python +from advancedbilling.models.component_currency_price import ComponentCurrencyPrice +from advancedbilling.models.component_currency_prices_response import ComponentCurrencyPricesResponse + +component_currency_prices_response = ComponentCurrencyPricesResponse( + currency_prices=[ + ComponentCurrencyPrice( + 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 59101d58..d73e3f6e 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` | `bool` | Optional | Whether or not the price point includes tax | -| `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | Omit for On/Off components | -| `interval` | `int` | 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` | `int` | 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` | `int` | Optional | Optional id of the price point to use for list price calculations when
overriding the customer price. | +| `list_price_point_id` | `int` | Optional | (Optional) Id of the price point to use for list price calculations when
overriding the customer price. | | `use_default_list_price` | `bool` | Optional | When true, list price calculations will continue to use the default price point even when a `custom_price` is supplied. | | `prices` | [`List[Price]`](../../doc/models/price.md) | Required | On/off components only need one price bracket starting at 1. | | `renew_prepaid_allocation` | `bool` | Optional | Applicable only to prepaid usage components. Controls whether the allocated quantity renews each period. | @@ -23,22 +23,27 @@ Create or update custom pricing unique to the subscription. Used in place of `pr | `expiration_interval` | `int` | 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) - -```json -{ - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ], - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 162, - "interval_unit": "day", - "list_price_point_id": 146 -} +## Example + +```python +from advancedbilling.models.component_custom_price import ComponentCustomPrice +from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme + +component_custom_price = ComponentCustomPrice( + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ) + ], + 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..ff419917 100644 --- a/doc/models/component-kind.md +++ b/doc/models/component-kind.md @@ -17,3 +17,11 @@ A handle for the component type | `PREPAID_USAGE_COMPONENT` | | `EVENT_BASED_COMPONENT` | +## Example + +```python +from advancedbilling.models.component_kind import ComponentKind + +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 79d48059..0350b8a2 100644 --- a/doc/models/component-price-point-assignment.md +++ b/doc/models/component-price-point-assignment.md @@ -12,12 +12,14 @@ | `component_id` | `int` | Optional | - | | `price_point` | str \| int \| None | Optional | This is a container for one-of cases. | -## Example (as JSON) +## Example -```json -{ - "component_id": 114, - "price_point": "String9" -} +```python +from advancedbilling.models.component_price_point_assignment import ComponentPricePointAssignment + +component_price_point_assignment = ComponentPricePointAssignment( + 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..4171aad3 100644 --- a/doc/models/component-price-point-currency-overage-response.md +++ b/doc/models/component-price-point-currency-overage-response.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.component_price_point_currency_overage_response import ComponentPricePointCurrencyOverageResponse +from advancedbilling.models.currency_overage_prices import CurrencyOveragePrices +from advancedbilling.models.price_point_type import PricePointType +from advancedbilling.models.pricing_scheme import PricingScheme + +component_price_point_currency_overage_response = ComponentPricePointCurrencyOverageResponse( + price_point=CurrencyOveragePrices( + id=248, + mtype=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 396fd3c4..a9491682 100644 --- a/doc/models/component-price-point-error-exception.md +++ b/doc/models/component-price-point-error-exception.md @@ -11,22 +11,14 @@ | --- | --- | --- | --- | | `errors` | [`List[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 + +```python +try: + # make the API call +except ComponentPricePointErrorException as e: + print(e) +except APIException as e: + print(e) ``` diff --git a/doc/models/component-price-point-error-item.md b/doc/models/component-price-point-error-item.md index db1ca0cb..cd1e80fa 100644 --- a/doc/models/component-price-point-error-item.md +++ b/doc/models/component-price-point-error-item.md @@ -13,13 +13,15 @@ | `message` | `str` | Optional | - | | `price_point` | `int` | Optional | - | -## Example (as JSON) - -```json -{ - "component_id": 206, - "message": "message4", - "price_point": 152 -} +## Example + +```python +from advancedbilling.models.component_price_point_error_item import ComponentPricePointErrorItem + +component_price_point_error_item = ComponentPricePointErrorItem( + 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 b87b583a..eda226fe 100644 --- a/doc/models/component-price-point-item.md +++ b/doc/models/component-price-point-item.md @@ -12,19 +12,23 @@ | `name` | `str` | Optional | - | | `handle` | `str` | 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` | `int` | 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` | `int` | 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` | [`List[Price]`](../../doc/models/price.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "name": "name6", - "handle": "handle2", - "pricing_scheme": "per_unit", - "interval": 196, - "interval_unit": "day" -} +```python +from advancedbilling.models.component_price_point_item import ComponentPricePointItem +from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.pricing_scheme import PricingScheme + +component_price_point_item = ComponentPricePointItem( + 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..568726f6 100644 --- a/doc/models/component-price-point-response.md +++ b/doc/models/component-price-point-response.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.component_price_point import ComponentPricePoint +from advancedbilling.models.component_price_point_response import ComponentPricePointResponse +from advancedbilling.models.price_point_type import PricePointType +from advancedbilling.models.pricing_scheme import PricingScheme + +component_price_point_response = ComponentPricePointResponse( + price_point=ComponentPricePoint( + id=248, + mtype=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 74f6f5a6..3b58b955 100644 --- a/doc/models/component-price-point.md +++ b/doc/models/component-price-point.md @@ -11,7 +11,7 @@ | --- | --- | --- | --- | | `id` | `int` | Optional | - | | `mtype` | [`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` | `bool` | Optional | Note: Refer to type attribute instead | +| `default` | `bool` | Optional | Note: Refer to type attribute instead. | | `name` | `str` | 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` | `int` | Optional | - | @@ -23,7 +23,7 @@ | `use_site_exchange_rate` | `bool` | 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` | `int` | 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` | `bool` | Optional | - | -| `interval` | `int` | 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` | `int` | 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` | [`List[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` | [`List[ComponentPrice]`](../../doc/models/component-price.md) | Optional | Applicable only to prepaid usage components. An array of overage price brackets. | @@ -33,15 +33,19 @@ | `expiration_interval` | `int` | 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" -} +```python +from advancedbilling.models.component_price_point import ComponentPricePoint +from advancedbilling.models.price_point_type import PricePointType +from advancedbilling.models.pricing_scheme import PricingScheme + +component_price_point = ComponentPricePoint( + id=160, + mtype=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 0284c738..0949f6e6 100644 --- a/doc/models/component-price-points-response.md +++ b/doc/models/component-price-points-response.md @@ -12,32 +12,38 @@ | `price_points` | [`List[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" - } - ], - "meta": { - "total_count": 150, - "current_page": 126, - "total_pages": 138, - "per_page": 152 - } -} +## Example + +```python +from advancedbilling.models.component_price_point import ComponentPricePoint +from advancedbilling.models.component_price_points_response import ComponentPricePointsResponse +from advancedbilling.models.list_public_keys_meta import ListPublicKeysMeta +from advancedbilling.models.price_point_type import PricePointType +from advancedbilling.models.pricing_scheme import PricingScheme + +component_price_points_response = ComponentPricePointsResponse( + price_points=[ + ComponentPricePoint( + id=40, + mtype=PricePointType.DEFAULT, + default=False, + name='name2', + pricing_scheme=PricingScheme.PER_UNIT + ), + ComponentPricePoint( + id=40, + mtype=PricePointType.DEFAULT, + default=False, + name='name2', + pricing_scheme=PricingScheme.PER_UNIT + ) + ], + meta=ListPublicKeysMeta( + 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 685a4577..baf582ca 100644 --- a/doc/models/component-price.md +++ b/doc/models/component-price.md @@ -18,15 +18,17 @@ | `formatted_unit_price` | `str` | Optional | - | | `segment_id` | `int` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 234, - "component_id": 88, - "starting_quantity": 104, - "ending_quantity": 78, - "unit_price": "unit_price0" -} +## Example + +```python +from advancedbilling.models.component_price import ComponentPrice + +component_price = ComponentPrice( + 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..a798fe50 100644 --- a/doc/models/component-response.md +++ b/doc/models/component-response.md @@ -11,18 +11,23 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.component import Component +from advancedbilling.models.component_response import ComponentResponse +from advancedbilling.models.item_category import ItemCategory +from advancedbilling.models.pricing_scheme import PricingScheme + +component_response = ComponentResponse( + component=Component( + 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 37004c28..20fd2f61 100644 --- a/doc/models/component.md +++ b/doc/models/component.md @@ -10,15 +10,15 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `id` | `int` | Optional | The unique ID assigned to the component by Chargify. This ID can be used to fetch the component from the API. | -| `name` | `str` | Optional | The name of the Component, suitable for display on statements. i.e. Text Messages. | +| `name` | `str` | Optional | The name of the Component, suitable for display on statements. e.g., Text Messages. | | `handle` | `str` | Optional | The component API handle | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | - | -| `unit_name` | `str` | Optional | The name of the unit that the component’s usage is measured in. i.e. message | +| `unit_name` | `str` | Optional | The name of the unit that the component’s usage is measured in. e.g., message | | `unit_price` | `str` | 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` | `int` | Optional | The id of the Product Family to which the Component belongs | | `product_family_name` | `str` | Optional | The name of the Product Family to which the Component belongs | | `product_family_handle` | `str` | Optional | The handle of the Product Family to which the Component belongs | -| `price_per_unit_in_cents` | `int` | Optional | deprecated - use unit_price instead | +| `price_per_unit_in_cents` | `int` | Optional | deprecated - use unit_price instead. | | `kind` | [`ComponentKind`](../../doc/models/component-kind.md) | Optional | A handle for the component type | | `archived` | `bool` | Optional | Boolean flag describing whether a component is archived or not. | | `description` | `str` | Optional | The description of the component. | @@ -42,19 +42,24 @@ | `use_site_exchange_rate` | `bool` | Optional | - | | `accounting_code` | `str` | Optional | E.g. Internal ID or SKU Number | | `event_based_billing_metric_id` | `int` | 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` | `int` | 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` | `int` | 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` | `str` | 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 -{ - "item_category": "Business Software", - "id": 24, - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "unit_name": "unit_name4" -} +## Example + +```python +from advancedbilling.models.component import Component +from advancedbilling.models.item_category import ItemCategory +from advancedbilling.models.pricing_scheme import PricingScheme + +component = Component( + 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..c6098ae0 100644 --- a/doc/models/compounding-strategy.md +++ b/doc/models/compounding-strategy.md @@ -14,3 +14,11 @@ Applicable only to stackable coupons. For `compound`, Percentage-based discounts | `COMPOUND` | | `FULLPRICE` | +## Example + +```python +from advancedbilling.models.compounding_strategy import CompoundingStrategy + +compounding_strategy = CompoundingStrategy.COMPOUND +``` + diff --git a/doc/models/consolidated-invoice.md b/doc/models/consolidated-invoice.md index c7a09dde..c326de5b 100644 --- a/doc/models/consolidated-invoice.md +++ b/doc/models/consolidated-invoice.md @@ -11,26 +11,22 @@ | --- | --- | --- | --- | | `invoices` | [`List[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 + +```python +from advancedbilling.models.consolidated_invoice import ConsolidatedInvoice +from advancedbilling.models.invoice import Invoice + +consolidated_invoice = ConsolidatedInvoice( + invoices=[ + Invoice( + 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..351334f8 --- /dev/null +++ b/doc/models/containers/create-subscription-component-unit-balance.md @@ -0,0 +1,34 @@ + +# Create Subscription Component Unit Balance + +## Data Type + +`int | str` + +## Cases + +| Type | +| --- | +| `int` | +| `str` | + +## int + +### Initialization Code + +#### Example + +```python +value = 0 +``` + +## str + +### Initialization Code + +#### Example + +```python +value = 'String0' +``` + diff --git a/doc/models/containers/event-event-specific-data.md b/doc/models/containers/event-event-specific-data.md index 6d845132..c4686347 100644 --- a/doc/models/containers/event-event-specific-data.md +++ b/doc/models/containers/event-event-specific-data.md @@ -3,13 +3,14 @@ ## Data Type -`SubscriptionProductChange | SubscriptionStateChange | PaymentRelatedEvents | RefundSuccess | ComponentAllocationChange | MeteredUsage | PrepaidUsage | DunningStepReached | InvoiceIssued | PendingCancellationChange | PrepaidSubscriptionBalanceChanged | ProformaInvoiceIssued | SubscriptionGroupSignupEventData | CreditAccountBalanceChanged | PrepaymentAccountBalanceChanged | PaymentCollectionMethodChanged | ItemPricePointChanged | CustomFieldValueChange | ChjsTokenizationSuccess | ChjsTokenizationFailure` +`SubscriptionProductChange | SubscriptionProductChangeScheduled | SubscriptionStateChange | PaymentRelatedEvents | RefundSuccess | ComponentAllocationChange | MeteredUsage | PrepaidUsage | DunningStepReached | InvoiceIssued | PendingCancellationChange | PrepaidSubscriptionBalanceChanged | ProformaInvoiceIssued | SubscriptionGroupSignupEventData | CreditAccountBalanceChanged | PrepaymentAccountBalanceChanged | PaymentCollectionMethodChanged | ItemPricePointChanged | CustomFieldValueChange | ChjsTokenizationSuccess | ChjsTokenizationFailure` ## Cases | Type | | --- | | [`SubscriptionProductChange`](../../../doc/models/subscription-product-change.md) | +| [`SubscriptionProductChangeScheduled`](../../../doc/models/subscription-product-change-scheduled.md) | | [`SubscriptionStateChange`](../../../doc/models/subscription-state-change.md) | | [`PaymentRelatedEvents`](../../../doc/models/payment-related-events.md) | | [`RefundSuccess`](../../../doc/models/refund-success.md) | @@ -43,6 +44,19 @@ value = SubscriptionProductChange( ) ``` +## SubscriptionProductChangeScheduled + +### Initialization Code + +#### Example + +```python +value = SubscriptionProductChangeScheduled( + previous_product_id=62, + new_product_id=52 +) +``` + ## SubscriptionStateChange ### Initialization Code @@ -109,7 +123,7 @@ value = ComponentAllocationChange( ```python value = MeteredUsage( 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 +141,8 @@ value = MeteredUsage( value = PrepaidUsage( 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..6be630a6 --- /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 + +```python +value = GetOneTimeTokenPaymentProfile( + 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 + +```python +value = GetOneTimeTokenBankAccountPaymentProfile( + 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..b4b3f2db --- /dev/null +++ b/doc/models/containers/list-subscriptions-input-product.md @@ -0,0 +1,34 @@ + +# List Subscriptions Input Product + +## Data Type + +`int | str` + +## Cases + +| Type | +| --- | +| `int` | +| `str` | + +## int + +### Initialization Code + +#### Example + +```python +value = 0 +``` + +## str + +### Initialization Code + +#### Example + +```python +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..f4f88aa5 --- /dev/null +++ b/doc/models/containers/metered-usage-new-unit-balance.md @@ -0,0 +1,34 @@ + +# Metered Usage New Unit Balance + +## Data Type + +`int | str` + +## Cases + +| Type | +| --- | +| `int` | +| `str` | + +## int + +### Initialization Code + +#### Example + +```python +value = 0 +``` + +## str + +### Initialization Code + +#### Example + +```python +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..b2563815 --- /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 + +`int | str` + +## Cases + +| Type | +| --- | +| `int` | +| `str` | + +## int + +### Initialization Code + +#### Example + +```python +value = 0 +``` + +## str + +### Initialization Code + +#### Example + +```python +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..f029f053 --- /dev/null +++ b/doc/models/containers/prepaid-usage-new-unit-balance.md @@ -0,0 +1,34 @@ + +# Prepaid Usage New Unit Balance + +## Data Type + +`int | str` + +## Cases + +| Type | +| --- | +| `int` | +| `str` | + +## int + +### Initialization Code + +#### Example + +```python +value = 0 +``` + +## str + +### Initialization Code + +#### Example + +```python +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..754af802 --- /dev/null +++ b/doc/models/containers/subscription-component-unit-balance.md @@ -0,0 +1,34 @@ + +# Subscription Component Unit Balance + +## Data Type + +`int | str` + +## Cases + +| Type | +| --- | +| `int` | +| `str` | + +## int + +### Initialization Code + +#### Example + +```python +value = 0 +``` + +## str + +### Initialization Code + +#### Example + +```python +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..7f7e5ee4 --- /dev/null +++ b/doc/models/containers/update-invoice-item-component-id.md @@ -0,0 +1,34 @@ + +# Update Invoice Item Component Id + +## Data Type + +`str | int` + +## Cases + +| Type | +| --- | +| `str` | +| `int` | + +## str + +### Initialization Code + +#### Example + +```python +value = 'String0' +``` + +## int + +### Initialization Code + +#### Example + +```python +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..6cecad54 --- /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 + +`str | int` + +## Cases + +| Type | +| --- | +| `str` | +| `int` | + +## str + +### Initialization Code + +#### Example + +```python +value = 'String0' +``` + +## int + +### Initialization Code + +#### Example + +```python +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..484f3178 --- /dev/null +++ b/doc/models/containers/update-invoice-item-product-id.md @@ -0,0 +1,34 @@ + +# Update Invoice Item Product Id + +## Data Type + +`str | int` + +## Cases + +| Type | +| --- | +| `str` | +| `int` | + +## str + +### Initialization Code + +#### Example + +```python +value = 'String0' +``` + +## int + +### Initialization Code + +#### Example + +```python +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..9a633011 --- /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 + +`str | int` + +## Cases + +| Type | +| --- | +| `str` | +| `int` | + +## str + +### Initialization Code + +#### Example + +```python +value = 'String0' +``` + +## int + +### Initialization Code + +#### Example + +```python +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..e8155d17 --- /dev/null +++ b/doc/models/containers/update-invoice-item-quantity.md @@ -0,0 +1,34 @@ + +# Update Invoice Item Quantity + +## Data Type + +`float | str` + +## Cases + +| Type | +| --- | +| `float` | +| `str` | + +## float + +### Initialization Code + +#### Example + +```python +value = 0 +``` + +## str + +### Initialization Code + +#### Example + +```python +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..ba2ec7ce --- /dev/null +++ b/doc/models/containers/update-invoice-item-unit-price.md @@ -0,0 +1,34 @@ + +# Update Invoice Item Unit Price + +## Data Type + +`float | str` + +## Cases + +| Type | +| --- | +| `float` | +| `str` | + +## float + +### Initialization Code + +#### Example + +```python +value = 0 +``` + +## str + +### Initialization Code + +#### Example + +```python +value = 'String0' +``` + diff --git a/doc/models/contract.md b/doc/models/contract.md index df1cb25b..a78ab57e 100644 --- a/doc/models/contract.md +++ b/doc/models/contract.md @@ -16,19 +16,22 @@ Contract linked to the scheduled renewal configuration. | `number` | `str` | 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 + +```python +from advancedbilling.models.contract import Contract +from advancedbilling.models.register import Register + +contract = Contract( + id=112, + maxio_id='maxio_id6', + number='number2', + register=Register( + 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 9fb550b4..6fac75f0 100644 --- a/doc/models/count-response.md +++ b/doc/models/count-response.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `count` | `int` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "count": 60 -} +```python +from advancedbilling.models.count_response import CountResponse + +count_response = CountResponse( + count=174 +) ``` diff --git a/doc/models/coupon-currency-request.md b/doc/models/coupon-currency-request.md index 839e5e90..4f29fbf6 100644 --- a/doc/models/coupon-currency-request.md +++ b/doc/models/coupon-currency-request.md @@ -11,16 +11,19 @@ | --- | --- | --- | --- | | `currency_prices` | [`List[UpdateCouponCurrency]`](../../doc/models/update-coupon-currency.md) | Required | - | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "currency": "currency8", - "price": 78 - } - ] -} +## Example + +```python +from advancedbilling.models.coupon_currency_request import CouponCurrencyRequest +from advancedbilling.models.update_coupon_currency import UpdateCouponCurrency + +coupon_currency_request = CouponCurrencyRequest( + currency_prices=[ + UpdateCouponCurrency( + currency='currency8', + price=78 + ) + ] +) ``` diff --git a/doc/models/coupon-currency-response.md b/doc/models/coupon-currency-response.md index d0820ec1..ce181b4a 100644 --- a/doc/models/coupon-currency-response.md +++ b/doc/models/coupon-currency-response.md @@ -11,30 +11,33 @@ | --- | --- | --- | --- | | `currency_prices` | [`List[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 + +```python +from advancedbilling.models.coupon_currency import CouponCurrency +from advancedbilling.models.coupon_currency_response import CouponCurrencyResponse + +coupon_currency_response = CouponCurrencyResponse( + currency_prices=[ + CouponCurrency( + id=50, + currency='currency8', + price=233.74, + coupon_id=224 + ), + CouponCurrency( + id=50, + currency='currency8', + price=233.74, + coupon_id=224 + ), + CouponCurrency( + 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 ab5ffc92..0fffe40a 100644 --- a/doc/models/coupon-currency.md +++ b/doc/models/coupon-currency.md @@ -14,14 +14,16 @@ | `price` | `float` | Optional | - | | `coupon_id` | `int` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 228, - "currency": "currency8", - "price": 169.96, - "coupon_id": 210 -} +## Example + +```python +from advancedbilling.models.coupon_currency import CouponCurrency + +coupon_currency = CouponCurrency( + 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 23b4c07e..d42c5c6d 100644 --- a/doc/models/coupon-payload.md +++ b/doc/models/coupon-payload.md @@ -10,10 +10,10 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `name` | `str` | Optional | Required when creating a new coupon. This name is not displayed to customers and is limited to 255 characters. | -| `code` | `str` | 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` | `str` | 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` | `str` | 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` | str \| float \| None | Optional | This is a container for one-of cases. | -| `amount_in_cents` | `int` | Optional | Required when creating a new flat amount coupon. Can't be used together with percentage. Flat USD discount | +| `amount_in_cents` | `int` | Optional | Required when creating a new flat amount coupon. Can't be used together with percentage. Flat USD discount. | | `allow_negative_balance` | `bool` | Optional | If set to true, discount is not limited (credits will carry forward to next billing). Can't be used together with restrictions. | | `recurring` | `bool` | 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,17 @@ | `apply_on_cancel_at_end_of_period` | `bool` | Optional | - | | `apply_on_subscription_expiration` | `bool` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "name": "name8", - "code": "code6", - "description": "description8", - "percentage": "String7", - "amount_in_cents": 110 -} +```python +from advancedbilling.models.coupon_payload import CouponPayload + +coupon_payload = CouponPayload( + 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 5caa4a6a..bfa97a00 100644 --- a/doc/models/coupon-request.md +++ b/doc/models/coupon-request.md @@ -10,26 +10,29 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `coupon` | [`CouponPayload`](../../doc/models/coupon-payload.md) | Optional | - | -| `restricted_products` | `Dict[str, bool]` | 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` | `Dict[str, bool]` | 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": { - "key0": true - }, - "restricted_components": { - "key0": true - } -} +| `restricted_products` | `Dict[str, bool]` | 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` | `Dict[str, bool]` | 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 + +```python +from advancedbilling.models.coupon_payload import CouponPayload +from advancedbilling.models.coupon_request import CouponRequest + +coupon_request = CouponRequest( + coupon=CouponPayload( + name='name4', + code='code2', + description='description6', + percentage='String3', + amount_in_cents=230 + ), + restricted_products={ + 'key0': True + }, + restricted_components={ + 'key0': True + } +) ``` diff --git a/doc/models/coupon-response.md b/doc/models/coupon-response.md index 7c5ad38a..d5a8dc03 100644 --- a/doc/models/coupon-response.md +++ b/doc/models/coupon-response.md @@ -11,17 +11,20 @@ | --- | --- | --- | --- | | `coupon` | [`Coupon`](../../doc/models/coupon.md) | Optional | - | -## Example (as JSON) - -```json -{ - "coupon": { - "id": 196, - "name": "name4", - "code": "code2", - "description": "description6", - "amount": 97.66 - } -} +## Example + +```python +from advancedbilling.models.coupon import Coupon +from advancedbilling.models.coupon_response import CouponResponse + +coupon_response = CouponResponse( + coupon=Coupon( + 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 7d57e7e1..faf530dd 100644 --- a/doc/models/coupon-restriction.md +++ b/doc/models/coupon-restriction.md @@ -15,15 +15,18 @@ | `name` | `str` | Optional | - | | `handle` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 180, - "item_type": "Component", - "item_id": 184, - "name": "name4", - "handle": "handle0" -} +## Example + +```python +from advancedbilling.models.coupon_restriction import CouponRestriction +from advancedbilling.models.restriction_type import RestrictionType + +coupon_restriction = CouponRestriction( + 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 8dd47273..7808ccfe 100644 --- a/doc/models/coupon-subcodes-response.md +++ b/doc/models/coupon-subcodes-response.md @@ -13,23 +13,23 @@ | `duplicate_codes` | `List[str]` | Optional | - | | `invalid_codes` | `List[str]` | Optional | - | -## Example (as JSON) - -```json -{ - "created_codes": [ - "created_codes1", - "created_codes2" - ], - "duplicate_codes": [ - "duplicate_codes8", - "duplicate_codes7" - ], - "invalid_codes": [ - "invalid_codes0", - "invalid_codes9", - "invalid_codes8" - ] -} +## Example + +```python +from advancedbilling.models.coupon_subcodes_response import CouponSubcodesResponse + +coupon_subcodes_response = CouponSubcodesResponse( + created_codes=[ + 'created_codes7', + 'created_codes8' + ], + duplicate_codes=[ + 'duplicate_codes0', + 'duplicate_codes1' + ], + invalid_codes=[ + 'invalid_codes4' + ] +) ``` diff --git a/doc/models/coupon-subcodes.md b/doc/models/coupon-subcodes.md index c654e0fd..7f9c8446 100644 --- a/doc/models/coupon-subcodes.md +++ b/doc/models/coupon-subcodes.md @@ -11,13 +11,17 @@ | --- | --- | --- | --- | | `codes` | `List[str]` | Optional | - | -## Example (as JSON) - -```json -{ - "codes": [ - "codes8" - ] -} +## Example + +```python +from advancedbilling.models.coupon_subcodes import CouponSubcodes + +coupon_subcodes = CouponSubcodes( + codes=[ + 'codes0', + 'codes1', + 'codes2' + ] +) ``` diff --git a/doc/models/coupon-usage.md b/doc/models/coupon-usage.md index 31c5aaf8..a1c219ae 100644 --- a/doc/models/coupon-usage.md +++ b/doc/models/coupon-usage.md @@ -14,18 +14,20 @@ | `signups` | `int` | Optional | Number of times the coupon has been applied | | `savings` | `int` | Optional | Dollar amount of customer savings as a result of the coupon. | | `savings_in_cents` | `int` | Optional | Dollar amount of customer savings as a result of the coupon. | -| `revenue` | `int` | Optional | Total revenue of the all subscriptions that have received a discount from this coupon. | -| `revenue_in_cents` | `int` | 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` | `int` | Optional | Total revenue of all subscriptions that have received a discount from this coupon. | +| `revenue_in_cents` | `int` | Optional | Total revenue of all subscriptions that have received a discount from this coupon. | + +## Example + +```python +from advancedbilling.models.coupon_usage import CouponUsage + +coupon_usage = CouponUsage( + 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 3e5caf06..55f7ca5a 100644 --- a/doc/models/coupon.md +++ b/doc/models/coupon.md @@ -41,15 +41,17 @@ | `coupon_restrictions` | [`List[CouponRestriction]`](../../doc/models/coupon-restriction.md) | Optional | - | | `currency_prices` | [`List[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 + +```python +from advancedbilling.models.coupon import Coupon + +coupon = Coupon( + 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..dc95d96e 100644 --- a/doc/models/create-allocation-request.md +++ b/doc/models/create-allocation-request.md @@ -11,18 +11,21 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.create_allocation import CreateAllocation +from advancedbilling.models.create_allocation_request import CreateAllocationRequest + +create_allocation_request = CreateAllocationRequest( + allocation=CreateAllocation( + 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 1007e1c8..78dbfd0f 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` | `str` | 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` | `str` | Optional | Decimal representation of `previous_quantity`. Only valid when decimal
allocations are enabled for the component. | @@ -25,16 +25,18 @@ | `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 + +```python +from advancedbilling.models.create_allocation import CreateAllocation + +create_allocation = CreateAllocation( + 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..2f8168a0 100644 --- a/doc/models/create-component-price-point-request.md +++ b/doc/models/create-component-price-point-request.md @@ -11,26 +11,32 @@ | --- | --- | --- | --- | | `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 - } - ], - "use_site_exchange_rate": true, - "handle": "handle6", - "tax_included": false, - "interval": 24, - "interval_unit": "day" - } -} +## Example + +```python +from advancedbilling.models.create_component_price_point import CreateComponentPricePoint +from advancedbilling.models.create_component_price_point_request import CreateComponentPricePointRequest +from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme + +create_component_price_point_request = CreateComponentPricePointRequest( + price_point=CreateComponentPricePoint( + name='name0', + pricing_scheme=PricingScheme.PER_UNIT, + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ) + ], + 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 8e281aa6..8a6e7fe8 100644 --- a/doc/models/create-component-price-point.md +++ b/doc/models/create-component-price-point.md @@ -15,27 +15,32 @@ | `prices` | [`List[Price]`](../../doc/models/price.md) | Required | - | | `use_site_exchange_rate` | `bool` | 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` | `bool` | Optional | Whether or not the price point includes tax. Setting not supported when creating price points in bulk. | -| `interval` | `int` | 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` | `int` | 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 - } - ], - "use_site_exchange_rate": true, - "handle": "handle6", - "tax_included": false, - "interval": 24, - "interval_unit": "day" -} +## Example + +```python +from advancedbilling.models.create_component_price_point import CreateComponentPricePoint +from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme + +create_component_price_point = CreateComponentPricePoint( + name='name4', + pricing_scheme=PricingScheme.STAIRSTEP, + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ) + ], + 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 6cdad09b..c8765a78 100644 --- a/doc/models/create-component-price-points-request.md +++ b/doc/models/create-component-price-points-request.md @@ -11,64 +11,70 @@ | --- | --- | --- | --- | | `price_points` | List[[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 List 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 - } - ], - "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 - } - ], - "use_site_exchange_rate": false, - "tax_included": false, - "interval": 24, - "interval_unit": "day" - } - ] -} +```python +from advancedbilling.models.create_component_price_point import CreateComponentPricePoint +from advancedbilling.models.create_component_price_points_request import CreateComponentPricePointsRequest +from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme + +create_component_price_points_request = CreateComponentPricePointsRequest( + price_points=[ + CreateComponentPricePoint( + name='name0', + pricing_scheme=PricingScheme.PER_UNIT, + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ), + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ), + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ) + ], + handle='handle6', + use_site_exchange_rate=False, + tax_included=False, + interval=24, + interval_unit=IntervalUnit.DAY + ), + CreateComponentPricePoint( + name='name0', + pricing_scheme=PricingScheme.PER_UNIT, + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ), + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ), + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ) + ], + 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 845483ba..3077c4e4 100644 --- a/doc/models/create-credit-note-event.md +++ b/doc/models/create-credit-note-event.md @@ -15,31 +15,38 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"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 + +```python +import dateutil.parser + +from advancedbilling.models.create_credit_note_event import CreateCreditNoteEvent +from advancedbilling.models.credit_note import CreditNote +from advancedbilling.models.invoice import Invoice +from advancedbilling.models.invoice_event_type import InvoiceEventType + +create_credit_note_event = CreateCreditNoteEvent( + id=166, + timestamp=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + invoice=Invoice( + id=166, + uid='uid6', + site_id=92, + customer_id=204, + subscription_id=20, + issue_date=dateutil.parser.parse('2024-01-01').date(), + due_date=dateutil.parser.parse('2024-01-01').date(), + paid_date=dateutil.parser.parse('2024-01-01').date(), + public_url_expires_on=dateutil.parser.parse('2024-01-21').date() + ), + event_type=InvoiceEventType.CREATE_CREDIT_NOTE, + event_data=CreditNote( + 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 6c39b444..e117de6a 100644 --- a/doc/models/create-currency-price.md +++ b/doc/models/create-currency-price.md @@ -13,13 +13,15 @@ | `price` | `float` | Optional | Price for the price level in this currency | | `price_id` | `int` | Optional | ID of the price that this corresponds with | -## Example (as JSON) - -```json -{ - "currency": "currency2", - "price": 10.4, - "price_id": 54 -} +## Example + +```python +from advancedbilling.models.create_currency_price import CreateCurrencyPrice + +create_currency_price = CreateCurrencyPrice( + 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 0d1eafe9..1bd3de16 100644 --- a/doc/models/create-currency-prices-request.md +++ b/doc/models/create-currency-prices-request.md @@ -11,17 +11,20 @@ | --- | --- | --- | --- | | `currency_prices` | [`List[CreateCurrencyPrice]`](../../doc/models/create-currency-price.md) | Required | - | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "currency": "currency8", - "price": 233.74, - "price_id": 116 - } - ] -} +## Example + +```python +from advancedbilling.models.create_currency_price import CreateCurrencyPrice +from advancedbilling.models.create_currency_prices_request import CreateCurrencyPricesRequest + +create_currency_prices_request = CreateCurrencyPricesRequest( + currency_prices=[ + CreateCurrencyPrice( + 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..8fd5aa90 100644 --- a/doc/models/create-customer-request.md +++ b/doc/models/create-customer-request.md @@ -11,20 +11,23 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.create_customer import CreateCustomer +from advancedbilling.models.create_customer_request import CreateCustomerRequest + +create_customer_request = CreateCustomerRequest( + customer=CreateCustomer( + 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 673e4675..aabaf6cc 100644 --- a/doc/models/create-customer.md +++ b/doc/models/create-customer.md @@ -25,22 +25,26 @@ | `locale` | `str` | Optional | Set a specific language on a customer record. | | `vat_number` | `str` | Optional | - | | `tax_exempt` | `bool` | Optional | - | +| `surcharging` | `bool` | 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` | `str` | Optional | - | | `parent_id` | `int` | Optional | The parent ID in Chargify if applicable. Parent is another Customer object. | | `salesforce_id` | `str` | 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` | `int` | 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 + +```python +from advancedbilling.models.create_customer import CreateCustomer + +create_customer = CreateCustomer( + 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 f7d242fe..a27b55b6 100644 --- a/doc/models/create-debit-note-event.md +++ b/doc/models/create-debit-note-event.md @@ -15,31 +15,38 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"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 + +```python +import dateutil.parser + +from advancedbilling.models.create_debit_note_event import CreateDebitNoteEvent +from advancedbilling.models.debit_note import DebitNote +from advancedbilling.models.invoice import Invoice +from advancedbilling.models.invoice_event_type import InvoiceEventType + +create_debit_note_event = CreateDebitNoteEvent( + id=246, + timestamp=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + invoice=Invoice( + id=166, + uid='uid6', + site_id=92, + customer_id=204, + subscription_id=20, + issue_date=dateutil.parser.parse('2024-01-01').date(), + due_date=dateutil.parser.parse('2024-01-01').date(), + paid_date=dateutil.parser.parse('2024-01-01').date(), + public_url_expires_on=dateutil.parser.parse('2024-01-21').date() + ), + event_type=InvoiceEventType.CREATE_DEBIT_NOTE, + event_data=DebitNote( + 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..d111a117 100644 --- a/doc/models/create-ebb-component.md +++ b/doc/models/create-ebb-component.md @@ -11,35 +11,42 @@ | --- | --- | --- | --- | | `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 - } - ], - "price_points": [ - { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" - } - ], - "event_based_billing_metric_id": 68 - } -} +## Example + +```python +from advancedbilling.models.component_price_point_item import ComponentPricePointItem +from advancedbilling.models.create_ebb_component import CreateEBBComponent +from advancedbilling.models.ebb_component import EBBComponent +from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme + +create_ebb_component = CreateEBBComponent( + event_based_component=EBBComponent( + name='name8', + unit_name='unit_name0', + pricing_scheme=PricingScheme.STAIRSTEP, + event_based_billing_metric_id=68, + description='description8', + handle='handle4', + taxable=False, + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ) + ], + price_points=[ + ComponentPricePointItem( + 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 a51028ac..8a30e082 100644 --- a/doc/models/create-invoice-address.md +++ b/doc/models/create-invoice-address.md @@ -21,15 +21,17 @@ Overrides the default address. | `zip` | `str` | Optional | - | | `country` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "first_name": "first_name4", - "last_name": "last_name2", - "phone": "phone6", - "address": "address0", - "address_2": "address_28" -} +## Example + +```python +from advancedbilling.models.create_invoice_address import CreateInvoiceAddress + +create_invoice_address = CreateInvoiceAddress( + 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 15b7b83e..e144cd89 100644 --- a/doc/models/create-invoice-coupon.md +++ b/doc/models/create-invoice-coupon.md @@ -17,15 +17,17 @@ | `product_family_id` | str \| int \| None | 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 + +```python +from advancedbilling.models.create_invoice_coupon import CreateInvoiceCoupon + +create_invoice_coupon = CreateInvoiceCoupon( + 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 9db6382a..e8a7eb8c 100644 --- a/doc/models/create-invoice-item.md +++ b/doc/models/create-invoice-item.md @@ -22,15 +22,17 @@ | `product_price_point_id` | str \| int \| None | Optional | This is a container for one-of cases. | | `description` | `str` | 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 + +```python +from advancedbilling.models.create_invoice_item import CreateInvoiceItem + +create_invoice_item = CreateInvoiceItem( + 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 e4822443..12ea353a 100644 --- a/doc/models/create-invoice-payment-application.md +++ b/doc/models/create-invoice-payment-application.md @@ -12,12 +12,14 @@ | `invoice_uid` | `str` | Required | Unique identifier for the invoice. It has the prefix "inv_" followed by alphanumeric characters. | | `amount` | `str` | Required | Dollar amount of the invoice payment (eg. "10.50" => $10.50). | -## Example (as JSON) +## Example -```json -{ - "invoice_uid": "invoice_uid4", - "amount": "amount6" -} +```python +from advancedbilling.models.create_invoice_payment_application import CreateInvoicePaymentApplication + +create_invoice_payment_application = CreateInvoicePaymentApplication( + 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 f380a95d..2ec9e136 100644 --- a/doc/models/create-invoice-payment-request.md +++ b/doc/models/create-invoice-payment-request.md @@ -12,18 +12,23 @@ | `payment` | [`CreateInvoicePayment`](../../doc/models/create-invoice-payment.md) | Required | - | | `mtype` | [`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 + +```python +from advancedbilling.models.create_invoice_payment import CreateInvoicePayment +from advancedbilling.models.create_invoice_payment_request import CreateInvoicePaymentRequest +from advancedbilling.models.invoice_payment_method_type import InvoicePaymentMethodType +from advancedbilling.models.invoice_payment_type import InvoicePaymentType + +create_invoice_payment_request = CreateInvoicePaymentRequest( + payment=CreateInvoicePayment( + amount='String9', + memo='memo0', + method=InvoicePaymentMethodType.ACH, + details='details6', + payment_profile_id=42 + ), + mtype=InvoicePaymentType.SERVICE_CREDIT +) ``` diff --git a/doc/models/create-invoice-payment.md b/doc/models/create-invoice-payment.md index 537b1e02..69aebe66 100644 --- a/doc/models/create-invoice-payment.md +++ b/doc/models/create-invoice-payment.md @@ -16,15 +16,18 @@ | `payment_profile_id` | `int` | 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 + +```python +from advancedbilling.models.create_invoice_payment import CreateInvoicePayment +from advancedbilling.models.invoice_payment_method_type import InvoicePaymentMethodType + +create_invoice_payment = CreateInvoicePayment( + 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..f69ad91e 100644 --- a/doc/models/create-invoice-request.md +++ b/doc/models/create-invoice-request.md @@ -11,40 +11,47 @@ | --- | --- | --- | --- | | `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" - } - ], - "net_terms": 144, - "payment_instructions": "payment_instructions6", - "memo": "memo0" - } -} +## Example + +```python +import dateutil.parser + +from advancedbilling.models.create_invoice import CreateInvoice +from advancedbilling.models.create_invoice_item import CreateInvoiceItem +from advancedbilling.models.create_invoice_request import CreateInvoiceRequest +from advancedbilling.models.create_invoice_status import CreateInvoiceStatus + +create_invoice_request = CreateInvoiceRequest( + invoice=CreateInvoice( + line_items=[ + CreateInvoiceItem( + title='title4', + quantity=56.68, + unit_price=39.9, + taxable=False, + tax_code='tax_code6' + ), + CreateInvoiceItem( + title='title4', + quantity=56.68, + unit_price=39.9, + taxable=False, + tax_code='tax_code6' + ), + CreateInvoiceItem( + title='title4', + quantity=56.68, + unit_price=39.9, + taxable=False, + tax_code='tax_code6' + ) + ], + issue_date=dateutil.parser.parse('2024-01-01').date(), + 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..c340c955 100644 --- a/doc/models/create-invoice-status.md +++ b/doc/models/create-invoice-status.md @@ -14,7 +14,9 @@ ## Example -``` -draft +```python +from advancedbilling.models.create_invoice_status import CreateInvoiceStatus + +create_invoice_status = CreateInvoiceStatus.DRAFT ``` diff --git a/doc/models/create-invoice.md b/doc/models/create-invoice.md index 4e5d0b35..2b96b6d4 100644 --- a/doc/models/create-invoice.md +++ b/doc/models/create-invoice.md @@ -14,30 +14,43 @@ | `net_terms` | `int` | 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` | `str` | Optional | - | | `memo` | `str` | 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` | [`List[CreateInvoiceCoupon]`](../../doc/models/create-invoice-coupon.md) | Optional | - | | `status` | [`CreateInvoiceStatus`](../../doc/models/create-invoice-status.md) | Optional | **Default**: `"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" - } - ], - "net_terms": 18, - "payment_instructions": "payment_instructions0", - "memo": "memo6" -} +## Example + +```python +import dateutil.parser + +from advancedbilling.models.create_invoice import CreateInvoice +from advancedbilling.models.create_invoice_item import CreateInvoiceItem +from advancedbilling.models.create_invoice_status import CreateInvoiceStatus + +create_invoice = CreateInvoice( + line_items=[ + CreateInvoiceItem( + title='title4', + quantity=56.68, + unit_price=39.9, + taxable=False, + tax_code='tax_code6' + ), + CreateInvoiceItem( + title='title4', + quantity=56.68, + unit_price=39.9, + taxable=False, + tax_code='tax_code6' + ) + ], + issue_date=dateutil.parser.parse('2024-01-01').date(), + 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 63f2899f..2488e7e4 100644 --- a/doc/models/create-metadata-request.md +++ b/doc/models/create-metadata-request.md @@ -11,16 +11,19 @@ | --- | --- | --- | --- | | `metadata` | [`List[CreateMetadata]`](../../doc/models/create-metadata.md) | Required | - | -## Example (as JSON) - -```json -{ - "metadata": [ - { - "name": "name6", - "value": "value8" - } - ] -} +## Example + +```python +from advancedbilling.models.create_metadata import CreateMetadata +from advancedbilling.models.create_metadata_request import CreateMetadataRequest + +create_metadata_request = CreateMetadataRequest( + metadata=[ + CreateMetadata( + name='name6', + value='value8' + ) + ] +) ``` diff --git a/doc/models/create-metadata.md b/doc/models/create-metadata.md index ce646645..31f9fb44 100644 --- a/doc/models/create-metadata.md +++ b/doc/models/create-metadata.md @@ -12,12 +12,14 @@ | `name` | `str` | Optional | - | | `value` | `str` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "name": "name4", - "value": "value6" -} +```python +from advancedbilling.models.create_metadata import CreateMetadata + +create_metadata = CreateMetadata( + name='name2', + value='value4' +) ``` diff --git a/doc/models/create-metafield.md b/doc/models/create-metafield.md index 0d4f7526..37a66e27 100644 --- a/doc/models/create-metafield.md +++ b/doc/models/create-metafield.md @@ -11,26 +11,31 @@ | --- | --- | --- | --- | | `name` | `str` | 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` | `List[str]` | 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 + +```python +from advancedbilling.models.create_metafield import CreateMetafield +from advancedbilling.models.include_option import IncludeOption +from advancedbilling.models.metafield_input import MetafieldInput +from advancedbilling.models.metafield_scope import MetafieldScope + +create_metafield = CreateMetafield( + name='my_field', + scope=MetafieldScope( + 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 82dfa342..48bfb241 100644 --- a/doc/models/create-metafields-request.md +++ b/doc/models/create-metafields-request.md @@ -11,25 +11,31 @@ | --- | --- | --- | --- | | `metafields` | [Create Metafield](../../doc/models/create-metafield.md) \| List[[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 + +```python +from advancedbilling.models.create_metafield import CreateMetafield +from advancedbilling.models.create_metafields_request import CreateMetafieldsRequest +from advancedbilling.models.include_option import IncludeOption +from advancedbilling.models.metafield_input import MetafieldInput +from advancedbilling.models.metafield_scope import MetafieldScope + +create_metafields_request = CreateMetafieldsRequest( + metafields=CreateMetafield( + name='my_field', + scope=MetafieldScope( + 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..e1f5739f 100644 --- a/doc/models/create-metered-component.md +++ b/doc/models/create-metered-component.md @@ -11,58 +11,65 @@ | --- | --- | --- | --- | | `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 - } - ], - "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" - } - ] - } -} +```python +from advancedbilling.models.component_price_point_item import ComponentPricePointItem +from advancedbilling.models.create_metered_component import CreateMeteredComponent +from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.metered_component import MeteredComponent +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme + +create_metered_component = CreateMeteredComponent( + metered_component=MeteredComponent( + name='name0', + unit_name='unit_name2', + pricing_scheme=PricingScheme.STAIRSTEP, + description='description0', + handle='handle6', + taxable=False, + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ), + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ), + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ) + ], + price_points=[ + ComponentPricePointItem( + name='name2', + handle='handle8', + pricing_scheme=PricingScheme.PER_UNIT, + interval=92, + interval_unit=IntervalUnit.DAY + ), + ComponentPricePointItem( + name='name2', + handle='handle8', + pricing_scheme=PricingScheme.PER_UNIT, + interval=92, + interval_unit=IntervalUnit.DAY + ), + ComponentPricePointItem( + 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..090defb1 100644 --- a/doc/models/create-multi-invoice-payment-request.md +++ b/doc/models/create-multi-invoice-payment-request.md @@ -11,23 +11,28 @@ | --- | --- | --- | --- | | `payment` | [`CreateMultiInvoicePayment`](../../doc/models/create-multi-invoice-payment.md) | Required | - | -## Example (as JSON) - -```json -{ - "payment": { - "amount": "String9", - "applications": [ - { - "invoice_uid": "invoice_uid8", - "amount": "amount0" - } - ], - "memo": "memo0", - "details": "details6", - "method": "ach", - "received_on": "received_on8" - } -} +## Example + +```python +from advancedbilling.models.create_invoice_payment_application import CreateInvoicePaymentApplication +from advancedbilling.models.create_multi_invoice_payment import CreateMultiInvoicePayment +from advancedbilling.models.create_multi_invoice_payment_request import CreateMultiInvoicePaymentRequest +from advancedbilling.models.invoice_payment_method_type import InvoicePaymentMethodType + +create_multi_invoice_payment_request = CreateMultiInvoicePaymentRequest( + payment=CreateMultiInvoicePayment( + amount='String9', + applications=[ + CreateInvoicePaymentApplication( + invoice_uid='invoice_uid8', + amount='amount0' + ) + ], + 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 e337e030..4e7b76d6 100644 --- a/doc/models/create-multi-invoice-payment.md +++ b/doc/models/create-multi-invoice-payment.md @@ -16,21 +16,25 @@ | `received_on` | `str` | Optional | Date reflecting when the payment was received from a customer. Must be in the past. | | `applications` | [`List[CreateInvoicePaymentApplication]`](../../doc/models/create-invoice-payment-application.md) | Required | - | -## Example (as JSON) - -```json -{ - "amount": "String7", - "applications": [ - { - "invoice_uid": "invoice_uid8", - "amount": "amount0" - } - ], - "memo": "memo8", - "details": "details4", - "method": "credit_card", - "received_on": "received_on6" -} +## Example + +```python +from advancedbilling.models.create_invoice_payment_application import CreateInvoicePaymentApplication +from advancedbilling.models.create_multi_invoice_payment import CreateMultiInvoicePayment +from advancedbilling.models.invoice_payment_method_type import InvoicePaymentMethodType + +create_multi_invoice_payment = CreateMultiInvoicePayment( + amount='String5', + applications=[ + CreateInvoicePaymentApplication( + invoice_uid='invoice_uid8', + amount='amount0' + ) + ], + 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 ee2098c5..b5ab1f75 100644 --- a/doc/models/create-offer-component.md +++ b/doc/models/create-offer-component.md @@ -13,13 +13,15 @@ | `price_point_id` | `int` | Optional | - | | `starting_quantity` | `int` | Optional | - | -## Example (as JSON) - -```json -{ - "component_id": 242, - "price_point_id": 10, - "starting_quantity": 50 -} +## Example + +```python +from advancedbilling.models.create_offer_component import CreateOfferComponent + +create_offer_component = CreateOfferComponent( + 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..f27dac0f 100644 --- a/doc/models/create-offer-request.md +++ b/doc/models/create-offer-request.md @@ -11,32 +11,36 @@ | --- | --- | --- | --- | | `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 - } - ], - "coupons": [ - "coupons6" - ] - } -} +## Example + +```python +from advancedbilling.models.create_offer import CreateOffer +from advancedbilling.models.create_offer_component import CreateOfferComponent +from advancedbilling.models.create_offer_request import CreateOfferRequest + +create_offer_request = CreateOfferRequest( + offer=CreateOffer( + name='name4', + handle='handle0', + product_id=30, + description='description6', + product_price_point_id=150, + components=[ + CreateOfferComponent( + component_id=108, + price_point_id=124, + starting_quantity=84 + ), + CreateOfferComponent( + component_id=108, + price_point_id=124, + starting_quantity=84 + ) + ], + coupons=[ + 'coupons6' + ] + ) +) ``` diff --git a/doc/models/create-offer.md b/doc/models/create-offer.md index d430c4a0..0a3b1919 100644 --- a/doc/models/create-offer.md +++ b/doc/models/create-offer.md @@ -17,30 +17,33 @@ | `components` | [`List[CreateOfferComponent]`](../../doc/models/create-offer-component.md) | Optional | - | | `coupons` | `List[str]` | 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 - } - ], - "coupons": [ - "coupons4" - ] -} +## Example + +```python +from advancedbilling.models.create_offer import CreateOffer +from advancedbilling.models.create_offer_component import CreateOfferComponent + +create_offer = CreateOffer( + name='name2', + handle='handle8', + product_id=8, + description='description2', + product_price_point_id=188, + components=[ + CreateOfferComponent( + component_id=108, + price_point_id=124, + starting_quantity=84 + ), + CreateOfferComponent( + component_id=108, + price_point_id=124, + starting_quantity=84 + ) + ], + coupons=[ + 'coupons8' + ] +) ``` diff --git a/doc/models/create-on-off-component.md b/doc/models/create-on-off-component.md index a87d8fc5..eae1b0c6 100644 --- a/doc/models/create-on-off-component.md +++ b/doc/models/create-on-off-component.md @@ -11,19 +11,23 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.create_on_off_component import CreateOnOffComponent +from advancedbilling.models.credit_type import CreditType +from advancedbilling.models.on_off_component import OnOffComponent + +create_on_off_component = CreateOnOffComponent( + on_off_component=OnOffComponent( + 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..8414007c 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,22 @@ 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 | - -## Example (as JSON) - -```json -{ - "endpoint": { - "url": "url2", - "webhook_subscriptions": [ - "subscription_prepayment_account_balance_changed" - ] - } -} +| `endpoint` | [`CreateOrUpdateEndpoint`](../../doc/models/create-or-update-endpoint.md) | Required | Used to Create or Update Endpoint. | + +## Example + +```python +from advancedbilling.models.create_or_update_endpoint import CreateOrUpdateEndpoint +from advancedbilling.models.create_or_update_endpoint_request import CreateOrUpdateEndpointRequest +from advancedbilling.models.webhook_subscription import WebhookSubscription + +create_or_update_endpoint_request = CreateOrUpdateEndpointRequest( + endpoint=CreateOrUpdateEndpoint( + 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 c6fe739b..4e76058c 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,17 @@ Used to Create or Update Endpoint | `url` | `str` | Required | - | | `webhook_subscriptions` | [`List[WebhookSubscription]`](../../doc/models/webhook-subscription.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "url": "url8", - "webhook_subscriptions": [ - "refund_success" - ] -} +```python +from advancedbilling.models.create_or_update_endpoint import CreateOrUpdateEndpoint +from advancedbilling.models.webhook_subscription import WebhookSubscription + +create_or_update_endpoint = CreateOrUpdateEndpoint( + 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..8875ee49 100644 --- a/doc/models/create-or-update-product-request.md +++ b/doc/models/create-or-update-product-request.md @@ -11,22 +11,26 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.create_or_update_product import CreateOrUpdateProduct +from advancedbilling.models.create_or_update_product_request import CreateOrUpdateProductRequest +from advancedbilling.models.interval_unit import IntervalUnit + +create_or_update_product_request = CreateOrUpdateProductRequest( + product=CreateOrUpdateProduct( + 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 157e6afa..799403b4 100644 --- a/doc/models/create-or-update-product.md +++ b/doc/models/create-or-update-product.md @@ -15,31 +15,35 @@ | `accounting_code` | `str` | Optional | E.g. Internal ID or SKU Number | | `require_credit_card` | `bool` | 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` | `int` | Required | The product price, in integer cents | -| `interval` | `int` | 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` | `int` | 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` | `int` | Optional | The product trial price, in integer cents | -| `trial_interval` | `int` | 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` | `int` | 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` | `int` | 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` | `int` | 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` | `bool` | Optional | - | | `tax_code` | `str` | 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` | `str` | 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 + +```python +from advancedbilling.models.create_or_update_product import CreateOrUpdateProduct +from advancedbilling.models.interval_unit import IntervalUnit + +create_or_update_product = CreateOrUpdateProduct( + 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 abdc2c8f..f6603b6f 100644 --- a/doc/models/create-or-update-segment-price.md +++ b/doc/models/create-or-update-segment-price.md @@ -13,13 +13,15 @@ | `ending_quantity` | `int` | Optional | - | | `unit_price` | str \| float | Required | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "starting_quantity": 78, - "ending_quantity": 52, - "unit_price": "String7" -} +## Example + +```python +from advancedbilling.models.create_or_update_segment_price import CreateOrUpdateSegmentPrice + +create_or_update_segment_price = CreateOrUpdateSegmentPrice( + 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..82b0538c 100644 --- a/doc/models/create-payment-profile-request.md +++ b/doc/models/create-payment-profile-request.md @@ -11,18 +11,22 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.create_payment_profile import CreatePaymentProfile +from advancedbilling.models.create_payment_profile_request import CreatePaymentProfileRequest +from advancedbilling.models.payment_type import PaymentType + +create_payment_profile_request = CreatePaymentProfileRequest( + payment_profile=CreatePaymentProfile( + 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 2201fc8c..c514c8d4 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` | int \| str \| None | Optional | This is a container for one-of cases. | | `expiration_year` | int \| str \| None | Optional | This is a container for one-of cases. | -| `billing_address` | `str` | 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` | `str` | Optional | Second line of the customer’s billing address i.e. Apt. 100 | -| `billing_city` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | Optional | Second line of the customer’s billing address e.g., Apt. 100 | +| `billing_city` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | Optional | The “token” provided by your vault storage for an already stored payment profile | | `customer_vault_token` | `str` | 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,27 @@ | `gateway_handle` | `str` | 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` | `str` | Optional | The 3- or 4-digit Card Verification Value. This value is merely passed through to the payment gateway. | | `bank_name` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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 + +```python +from advancedbilling.models.create_payment_profile import CreatePaymentProfile +from advancedbilling.models.payment_type import PaymentType + +create_payment_profile = CreatePaymentProfile( + 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 693d84c9..70619498 100644 --- a/doc/models/create-payment.md +++ b/doc/models/create-payment.md @@ -14,14 +14,17 @@ | `payment_details` | `str` | 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 + +```python +from advancedbilling.models.create_payment import CreatePayment +from advancedbilling.models.invoice_payment_method_type import InvoicePaymentMethodType + +create_payment = CreatePayment( + 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..2647cf89 100644 --- a/doc/models/create-prepaid-component.md +++ b/doc/models/create-prepaid-component.md @@ -11,36 +11,43 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.create_prepaid_component import CreatePrepaidComponent +from advancedbilling.models.credit_type import CreditType +from advancedbilling.models.overage_pricing import OveragePricing +from advancedbilling.models.prepaid_usage_component import PrepaidUsageComponent +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme + +create_prepaid_component = CreatePrepaidComponent( + prepaid_usage_component=PrepaidUsageComponent( + name='name2', + unit_name='unit_name4', + pricing_scheme=PricingScheme.PER_UNIT, + overage_pricing=OveragePricing( + pricing_scheme=PricingScheme.STAIRSTEP, + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ) + ] + ), + description='description2', + handle='handle8', + taxable=False, + prices=[ + Price( + 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 89bf68c7..7d8b4726 100644 --- a/doc/models/create-prepaid-usage-component-price-point.md +++ b/doc/models/create-prepaid-usage-component-price-point.md @@ -15,39 +15,44 @@ | `prices` | [`List[Price]`](../../doc/models/price.md) | Required | - | | `overage_pricing` | [`OveragePricing`](../../doc/models/overage-pricing.md) | Required | - | | `use_site_exchange_rate` | `bool` | 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` | `bool` | 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` | `bool` | 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 - } - ], - "overage_pricing": { - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - }, - "use_site_exchange_rate": true, - "handle": "handle6", - "rollover_prepaid_remainder": false, - "renew_prepaid_allocation": false, - "expiration_interval": 101.18 -} +| `rollover_prepaid_remainder` | `bool` | 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` | `bool` | 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 + +```python +from advancedbilling.models.create_prepaid_usage_component_price_point import CreatePrepaidUsageComponentPricePoint +from advancedbilling.models.overage_pricing import OveragePricing +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme + +create_prepaid_usage_component_price_point = CreatePrepaidUsageComponentPricePoint( + name='name6', + pricing_scheme=PricingScheme.PER_UNIT, + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ) + ], + overage_pricing=OveragePricing( + pricing_scheme=PricingScheme.STAIRSTEP, + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ) + ] + ), + 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..cd8bf125 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,11 @@ | `CREDIT_CARD_ON_FILE` | | `OTHER` | +## Example + +```python +from advancedbilling.models.create_prepayment_method import CreatePrepaymentMethod + +create_prepayment_method = CreatePrepaymentMethod.PAYPAL_ACCOUNT +``` + diff --git a/doc/models/create-prepayment-request.md b/doc/models/create-prepayment-request.md index 661cec6b..41e34175 100644 --- a/doc/models/create-prepayment-request.md +++ b/doc/models/create-prepayment-request.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.create_prepayment import CreatePrepayment +from advancedbilling.models.create_prepayment_method import CreatePrepaymentMethod +from advancedbilling.models.create_prepayment_request import CreatePrepaymentRequest + +create_prepayment_request = CreatePrepaymentRequest( + prepayment=CreatePrepayment( + 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..3822a4d7 100644 --- a/doc/models/create-prepayment-response.md +++ b/doc/models/create-prepayment-response.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | | `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 + +```python +import dateutil.parser + +from advancedbilling.models.create_prepayment_response import CreatePrepaymentResponse +from advancedbilling.models.created_prepayment import CreatedPrepayment + +create_prepayment_response = CreatePrepaymentResponse( + prepayment=CreatedPrepayment( + id=38, + subscription_id=148, + amount_in_cents=124, + memo='memo2', + created_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/create-prepayment.md b/doc/models/create-prepayment.md index 13b2aa59..a43b0896 100644 --- a/doc/models/create-prepayment.md +++ b/doc/models/create-prepayment.md @@ -12,18 +12,21 @@ | `amount` | `float` | Required | - | | `details` | `str` | Required | - | | `memo` | `str` | 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` | `int` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "amount": 23.92, - "details": "details6", - "memo": "memo0", - "method": "credit_card_on_file", - "payment_profile_id": 240 -} +```python +from advancedbilling.models.create_prepayment import CreatePrepayment +from advancedbilling.models.create_prepayment_method import CreatePrepaymentMethod + +create_prepayment = CreatePrepayment( + 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 9c061698..1588f6b8 100644 --- a/doc/models/create-product-currency-price.md +++ b/doc/models/create-product-currency-price.md @@ -13,13 +13,16 @@ | `price` | `int` | 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 + +```python +from advancedbilling.models.create_product_currency_price import CreateProductCurrencyPrice +from advancedbilling.models.currency_price_role import CurrencyPriceRole + +create_product_currency_price = CreateProductCurrencyPrice( + 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 9e1164d8..6f90f64b 100644 --- a/doc/models/create-product-currency-prices-request.md +++ b/doc/models/create-product-currency-prices-request.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | | `currency_prices` | [`List[CreateProductCurrencyPrice]`](../../doc/models/create-product-currency-price.md) | Required | - | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "currency": "currency8", - "price": 78, - "role": "initial" - } - ] -} +## Example + +```python +from advancedbilling.models.create_product_currency_price import CreateProductCurrencyPrice +from advancedbilling.models.create_product_currency_prices_request import CreateProductCurrencyPricesRequest +from advancedbilling.models.currency_price_role import CurrencyPriceRole + +create_product_currency_prices_request = CreateProductCurrencyPricesRequest( + currency_prices=[ + CreateProductCurrencyPrice( + 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..830415b8 100644 --- a/doc/models/create-product-family-request.md +++ b/doc/models/create-product-family-request.md @@ -11,15 +11,19 @@ | --- | --- | --- | --- | | `product_family` | [`CreateProductFamily`](../../doc/models/create-product-family.md) | Required | - | -## Example (as JSON) - -```json -{ - "product_family": { - "name": "name0", - "handle": "handle6", - "description": "description0" - } -} +## Example + +```python +from advancedbilling.models.create_product_family import CreateProductFamily +from advancedbilling.models.create_product_family_request import CreateProductFamilyRequest + +create_product_family_request = CreateProductFamilyRequest( + product_family=CreateProductFamily( + 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 599d8dcd..a6ef0c42 100644 --- a/doc/models/create-product-family.md +++ b/doc/models/create-product-family.md @@ -12,14 +12,18 @@ | `name` | `str` | Required | - | | `handle` | `str` | Optional | - | | `description` | `str` | Optional | - | +| `surcharging` | `bool` | 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" -} +```python +from advancedbilling.models.create_product_family import CreateProductFamily + +create_product_family = CreateProductFamily( + 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..095f5a39 100644 --- a/doc/models/create-product-price-point-request.md +++ b/doc/models/create-product-price-point-request.md @@ -11,22 +11,27 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.create_product_price_point import CreateProductPricePoint +from advancedbilling.models.create_product_price_point_request import CreateProductPricePointRequest +from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.trial_type import TrialType + +create_product_price_point_request = CreateProductPricePointRequest( + price_point=CreateProductPricePoint( + 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 564cef82..b6a8466d 100644 --- a/doc/models/create-product-price-point.md +++ b/doc/models/create-product-price-point.md @@ -12,32 +12,36 @@ | `name` | `str` | Required | The product price point name | | `handle` | `str` | Optional | The product price point API handle | | `price_in_cents` | `int` | Required | The product price point price, in integer cents | -| `interval` | `int` | 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` | `int` | 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` | `int` | Optional | The product price point trial price, in integer cents | -| `trial_interval` | `int` | 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` | `int` | 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` | `int` | Optional | The product price point initial charge, in integer cents | | `initial_charge_after_trial` | `bool` | Optional | - | -| `expiration_interval` | `int` | 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` | `int` | 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` | `bool` | 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 + +```python +from advancedbilling.models.create_product_price_point import CreateProductPricePoint +from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.trial_type import TrialType + +create_product_price_point = CreateProductPricePoint( + 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..9959e294 100644 --- a/doc/models/create-quantity-based-component.md +++ b/doc/models/create-quantity-based-component.md @@ -11,31 +11,37 @@ | --- | --- | --- | --- | | `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 - } - ], - "upgrade_charge": "prorated" - } -} +## Example + +```python +from advancedbilling.models.create_quantity_based_component import CreateQuantityBasedComponent +from advancedbilling.models.credit_type import CreditType +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme +from advancedbilling.models.quantity_based_component import QuantityBasedComponent + +create_quantity_based_component = CreateQuantityBasedComponent( + quantity_based_component=QuantityBasedComponent( + name='name0', + unit_name='unit_name2', + pricing_scheme=PricingScheme.STAIRSTEP, + description='description0', + handle='handle6', + taxable=False, + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ), + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ) + ], + upgrade_charge=CreditType.PRORATED + ) +) ``` diff --git a/doc/models/create-reason-code-request.md b/doc/models/create-reason-code-request.md index fcd21fd1..6c1ff3dc 100644 --- a/doc/models/create-reason-code-request.md +++ b/doc/models/create-reason-code-request.md @@ -11,15 +11,18 @@ | --- | --- | --- | --- | | `reason_code` | [`CreateReasonCode`](../../doc/models/create-reason-code.md) | Required | - | -## Example (as JSON) - -```json -{ - "reason_code": { - "code": "code4", - "description": "description6", - "position": 14 - } -} +## Example + +```python +from advancedbilling.models.create_reason_code import CreateReasonCode +from advancedbilling.models.create_reason_code_request import CreateReasonCodeRequest + +create_reason_code_request = CreateReasonCodeRequest( + reason_code=CreateReasonCode( + code='code4', + description='description6', + position=14 + ) +) ``` diff --git a/doc/models/create-reason-code.md b/doc/models/create-reason-code.md index c0b60295..90aa91e2 100644 --- a/doc/models/create-reason-code.md +++ b/doc/models/create-reason-code.md @@ -13,13 +13,15 @@ | `description` | `str` | Required | The friendly summary of what the code signifies | | `position` | `int` | Optional | The order that code appears in lists | -## Example (as JSON) - -```json -{ - "code": "code4", - "description": "description6", - "position": 86 -} +## Example + +```python +from advancedbilling.models.create_reason_code import CreateReasonCode + +create_reason_code = CreateReasonCode( + code='code6', + description='description8', + position=252 +) ``` diff --git a/doc/models/create-segment-request.md b/doc/models/create-segment-request.md index d41bef0e..61f774d3 100644 --- a/doc/models/create-segment-request.md +++ b/doc/models/create-segment-request.md @@ -11,34 +11,39 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.create_or_update_segment_price import CreateOrUpdateSegmentPrice +from advancedbilling.models.create_segment import CreateSegment +from advancedbilling.models.create_segment_request import CreateSegmentRequest +from advancedbilling.models.pricing_scheme import PricingScheme + +create_segment_request = CreateSegmentRequest( + segment=CreateSegment( + 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( + unit_price='String3', + starting_quantity=64, + ending_quantity=38 + ), + CreateOrUpdateSegmentPrice( + unit_price='String3', + starting_quantity=64, + ending_quantity=38 + ), + CreateOrUpdateSegmentPrice( + unit_price='String3', + starting_quantity=64, + ending_quantity=38 + ) + ] + ) +) ``` diff --git a/doc/models/create-segment.md b/doc/models/create-segment.md index 1755792b..e91283a5 100644 --- a/doc/models/create-segment.md +++ b/doc/models/create-segment.md @@ -16,32 +16,36 @@ | `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` | [`List[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 + +```python +from advancedbilling.models.create_or_update_segment_price import CreateOrUpdateSegmentPrice +from advancedbilling.models.create_segment import CreateSegment +from advancedbilling.models.pricing_scheme import PricingScheme + +create_segment = CreateSegment( + 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( + unit_price='String3', + starting_quantity=64, + ending_quantity=38 + ), + CreateOrUpdateSegmentPrice( + unit_price='String3', + starting_quantity=64, + ending_quantity=38 + ), + CreateOrUpdateSegmentPrice( + 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..3ce46571 100644 --- a/doc/models/create-signup-proforma-preview-include.md +++ b/doc/models/create-signup-proforma-preview-include.md @@ -13,7 +13,9 @@ ## Example -``` -next_proforma_invoice +```python +from advancedbilling.models.create_signup_proforma_preview_include import CreateSignupProformaPreviewInclude + +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 3ce2c013..f3cead52 100644 --- a/doc/models/create-subscription-component.md +++ b/doc/models/create-subscription-component.md @@ -11,21 +11,23 @@ | --- | --- | --- | --- | | `component_id` | int \| str \| None | Optional | This is a container for one-of cases. | | `enabled` | `bool` | Optional | Used for on/off components only. | -| `unit_balance` | `int` | Optional | Used for metered and events based components. | +| `unit_balance` | int \| str \| None | Optional | This is a container for one-of cases. | | `allocated_quantity` | int \| str \| None | Optional | This is a container for one-of cases. | | `quantity` | `int` | Optional | Deprecated. Use `allocated_quantity` instead. | | `price_point_id` | int \| str \| None | 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 -} +```python +from advancedbilling.models.create_subscription_component import CreateSubscriptionComponent + +create_subscription_component = CreateSubscriptionComponent( + 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..24271d30 100644 --- a/doc/models/create-subscription-group-request.md +++ b/doc/models/create-subscription-group-request.md @@ -11,17 +11,20 @@ | --- | --- | --- | --- | | `subscription_group` | [`CreateSubscriptionGroup`](../../doc/models/create-subscription-group.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscription_group": { - "subscription_id": 36, - "member_ids": [ - 164, - 165 - ] - } -} +## Example + +```python +from advancedbilling.models.create_subscription_group import CreateSubscriptionGroup +from advancedbilling.models.create_subscription_group_request import CreateSubscriptionGroupRequest + +create_subscription_group_request = CreateSubscriptionGroupRequest( + subscription_group=CreateSubscriptionGroup( + subscription_id=36, + member_ids=[ + 164, + 165 + ] + ) +) ``` diff --git a/doc/models/create-subscription-group.md b/doc/models/create-subscription-group.md index 8c741225..002b7010 100644 --- a/doc/models/create-subscription-group.md +++ b/doc/models/create-subscription-group.md @@ -12,14 +12,16 @@ | `subscription_id` | `int` | Required | - | | `member_ids` | `List[int]` | Optional | - | -## Example (as JSON) - -```json -{ - "subscription_id": 38, - "member_ids": [ - 162 - ] -} +## Example + +```python +from advancedbilling.models.create_subscription_group import CreateSubscriptionGroup + +create_subscription_group = CreateSubscriptionGroup( + subscription_id=130, + member_ids=[ + 230 + ] +) ``` diff --git a/doc/models/create-subscription-request.md b/doc/models/create-subscription-request.md index 3c5137ba..389a325a 100644 --- a/doc/models/create-subscription-request.md +++ b/doc/models/create-subscription-request.md @@ -11,33 +11,38 @@ | --- | --- | --- | --- | | `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" - }, - "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" - } - } -} +## Example + +```python +from advancedbilling.models.create_subscription import CreateSubscription +from advancedbilling.models.create_subscription_request import CreateSubscriptionRequest +from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.subscription_custom_price import SubscriptionCustomPrice + +create_subscription_request = CreateSubscriptionRequest( + subscription=CreateSubscription( + product_handle='product_handle6', + product_id=206, + product_price_point_handle='product_price_point_handle2', + product_price_point_id=130, + custom_price=SubscriptionCustomPrice( + 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)"' + ) +) ``` diff --git a/doc/models/create-subscription.md b/doc/models/create-subscription.md index 07d64a68..14af0847 100644 --- a/doc/models/create-subscription.md +++ b/doc/models/create-subscription.md @@ -20,19 +20,20 @@ | `receives_invoice_emails` | `str` | Optional | (Optional) Default: True - Whether or not this subscription is set to receive emails related to this subscription. | | `net_terms` | `str` | 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` | `int` | 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` | `int` | 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` | `bool` | 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` | `bool` | 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` | `int` | 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` | `int` | Optional | - | -| `payment_profile_id` | `int` | 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` | `int` | 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` | `str` | 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` | [`List[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` | `Dict[str, str]` | 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` | `str` | 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,35 @@ | `dunning_communication_delay_time_zone` | `str` | Optional | Time zone for the Dunning Communication Delay feature. | | `skip_billing_manifest_taxes` | `bool` | 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" - }, - "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" - } -} +```python +from advancedbilling.models.create_subscription import CreateSubscription +from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.subscription_custom_price import SubscriptionCustomPrice + +create_subscription = CreateSubscription( + product_handle='product_handle0', + product_id=60, + product_price_point_handle='product_price_point_handle6', + product_price_point_id=240, + custom_price=SubscriptionCustomPrice( + 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)"' +) ``` diff --git a/doc/models/create-usage-request.md b/doc/models/create-usage-request.md index 1a754cbc..c75faed3 100644 --- a/doc/models/create-usage-request.md +++ b/doc/models/create-usage-request.md @@ -11,37 +11,47 @@ | --- | --- | --- | --- | | `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 + +```python +import dateutil.parser + +from advancedbilling.models.billing_schedule import BillingSchedule +from advancedbilling.models.component_custom_price import ComponentCustomPrice +from advancedbilling.models.create_usage import CreateUsage +from advancedbilling.models.create_usage_request import CreateUsageRequest +from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme + +create_usage_request = CreateUsageRequest( + usage=CreateUsage( + quantity=162.34, + price_point_id='price_point_id0', + memo='memo2', + billing_schedule=BillingSchedule( + initial_billing_at=dateutil.parser.parse('2016-03-13').date() + ), + custom_price=ComponentCustomPrice( + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ), + Price( + 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 75ff03df..6a90e59e 100644 --- a/doc/models/create-usage.md +++ b/doc/models/create-usage.md @@ -15,35 +15,44 @@ | `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 + +```python +import dateutil.parser + +from advancedbilling.models.billing_schedule import BillingSchedule +from advancedbilling.models.component_custom_price import ComponentCustomPrice +from advancedbilling.models.create_usage import CreateUsage +from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme + +create_usage = CreateUsage( + quantity=244.02, + price_point_id='price_point_id8', + memo='memo0', + billing_schedule=BillingSchedule( + initial_billing_at=dateutil.parser.parse('2016-03-13').date() + ), + custom_price=ComponentCustomPrice( + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ), + Price( + 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 1ebdac9a..cdf16047 100644 --- a/doc/models/created-prepayment.md +++ b/doc/models/created-prepayment.md @@ -17,15 +17,19 @@ | `starting_balance_in_cents` | `int` | Optional | **Constraints**: `>= 0` | | `ending_balance_in_cents` | `int` | 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 + +```python +import dateutil.parser + +from advancedbilling.models.created_prepayment import CreatedPrepayment + +created_prepayment = CreatedPrepayment( + id=228, + subscription_id=82, + amount_in_cents=198, + memo='memo6', + created_at=dateutil.parser.parse('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 8eb2384c..bd6f808b 100644 --- a/doc/models/credit-account-balance-changed.md +++ b/doc/models/credit-account-balance-changed.md @@ -15,15 +15,19 @@ | `currency_code` | `str` | 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 + +```python +import dateutil.parser + +from advancedbilling.models.credit_account_balance_changed import CreditAccountBalanceChanged + +credit_account_balance_changed = CreditAccountBalanceChanged( + reason='reason8', + service_credit_account_balance_in_cents=64, + service_credit_balance_change_in_cents=190, + currency_code='currency_code8', + at_time=dateutil.parser.parse('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/credit-card-attributes.md b/doc/models/credit-card-attributes.md index 7d60c262..5daa15ba 100644 --- a/doc/models/credit-card-attributes.md +++ b/doc/models/credit-card-attributes.md @@ -13,13 +13,15 @@ | `expiration_month` | `str` | Optional | - | | `expiration_year` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "full_number": "full_number0", - "expiration_month": "expiration_month6", - "expiration_year": "expiration_year0" -} +## Example + +```python +from advancedbilling.models.credit_card_attributes import CreditCardAttributes + +credit_card_attributes = CreditCardAttributes( + 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 17fb7784..818c3cfe 100644 --- a/doc/models/credit-card-payment-profile.md +++ b/doc/models/credit-card-payment-profile.md @@ -12,10 +12,10 @@ | `id` | `int` | 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` | `str` | Optional | The first name of the card holder. | | `last_name` | `str` | Optional | The last name of the card holder. | -| `masked_card_number` | `str` | 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` | `str` | 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` | `int` | Optional | An integer representing the expiration month of the card(1 – 12). | -| `expiration_year` | `int` | Optional | An integer representing the 4-digit expiration year of the card(i.e. ‘2012’). | +| `expiration_year` | `int` | Optional | An integer representing the 4-digit expiration year of the card(e.g., ‘2012’). | | `customer_id` | `int` | 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` | `str` | Optional | The “token” provided by your vault storage for an already stored payment profile. | @@ -28,36 +28,41 @@ | `billing_address_2` | `str` | Optional | The current billing street address, second line, for the card. | | `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Required | **Default**: `"credit_card"` | | `disabled` | `bool` | Optional | - | -| `chargify_token` | `str` | 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` | `str` | 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` | `int` | Optional | - | | `gateway_handle` | `str` | 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 + +```python +from advancedbilling.models.card_type import CardType +from advancedbilling.models.credit_card_payment_profile import CreditCardPaymentProfile +from advancedbilling.models.credit_card_vault import CreditCardVault +from advancedbilling.models.payment_type import PaymentType + +credit_card_payment_profile = CreditCardPaymentProfile( + 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..03e6e753 100644 --- a/doc/models/credit-card-vault.md +++ b/doc/models/credit-card-vault.md @@ -45,3 +45,11 @@ The vault that stores the payment profile with the provided `vault_token`. Use ` | `UNIPAAS` | | `WIRECARD` | +## Example + +```python +from advancedbilling.models.credit_card_vault import CreditCardVault + +credit_card_vault = CreditCardVault.BRAINTREE1 +``` + diff --git a/doc/models/credit-note-application.md b/doc/models/credit-note-application.md index ea1e9311..828244f3 100644 --- a/doc/models/credit-note-application.md +++ b/doc/models/credit-note-application.md @@ -15,15 +15,19 @@ | `memo` | `str` | Optional | - | | `applied_amount` | `str` | 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 + +```python +import dateutil.parser + +from advancedbilling.models.credit_note_application import CreditNoteApplication + +credit_note_application = CreditNoteApplication( + uid='uid0', + transaction_time=dateutil.parser.parse('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 feb7c9ee..d647bde5 100644 --- a/doc/models/credit-note-line-item.md +++ b/doc/models/credit-note-line-item.md @@ -13,7 +13,7 @@ | `title` | `str` | Optional | A short descriptor for the credit given by this line. | | `description` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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,17 @@ | `custom_item` | `bool` | 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" -} +```python +from advancedbilling.models.credit_note_line_item import CreditNoteLineItem + +credit_note_line_item = CreditNoteLineItem( + 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..0d6736a4 100644 --- a/doc/models/credit-note-status.md +++ b/doc/models/credit-note-status.md @@ -14,3 +14,11 @@ Current status of the credit note. | `OPEN` | | `APPLIED` | +## Example + +```python +from advancedbilling.models.credit_note_status import CreditNoteStatus + +credit_note_status = CreditNoteStatus.OPEN +``` + diff --git a/doc/models/credit-note.md b/doc/models/credit-note.md index 898bf205..04da70d1 100644 --- a/doc/models/credit-note.md +++ b/doc/models/credit-note.md @@ -21,13 +21,13 @@ | `currency` | `str` | Optional | The ISO 4217 currency code (3 character string) representing the currency of the credit note amount fields. | | `memo` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | Optional | The credit note total, which is `subtotal_amount - discount_amount + tax_amount`.' | +| `discount_amount` | `str` | 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` | `str` | 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` | `str` | Optional | The credit note total, which is `subtotal_amount - discount_amount + tax_amount`. | | `applied_amount` | `str` | Optional | The amount of the credit note that has already been applied to invoices. | | `remaining_amount` | `str` | Optional | The amount of the credit note remaining to be applied to invoices, which is `total_amount - applied_amount`. | | `line_items` | [`List[CreditNoteLineItem]`](../../doc/models/credit-note-line-item.md) | Optional | Line items on the credit note. | @@ -35,17 +35,19 @@ | `taxes` | [`List[InvoiceTax]`](../../doc/models/invoice-tax.md) | Optional | - | | `applications` | [`List[CreditNoteApplication]`](../../doc/models/credit-note-application.md) | Optional | - | | `refunds` | [`List[InvoiceRefund]`](../../doc/models/invoice-refund.md) | Optional | - | -| `origin_invoices` | [`List[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` | [`List[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 + +```python +from advancedbilling.models.credit_note import CreditNote + +credit_note = CreditNote( + 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..66f062f1 100644 --- a/doc/models/credit-scheme-request.md +++ b/doc/models/credit-scheme-request.md @@ -11,11 +11,14 @@ | --- | --- | --- | --- | | `credit_scheme` | [`CreditScheme`](../../doc/models/credit-scheme.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "credit_scheme": "credit" -} +```python +from advancedbilling.models.credit_scheme import CreditScheme +from advancedbilling.models.credit_scheme_request import CreditSchemeRequest + +credit_scheme_request = CreditSchemeRequest( + credit_scheme=CreditScheme.REFUND +) ``` diff --git a/doc/models/credit-scheme.md b/doc/models/credit-scheme.md index fdf3956d..53fb5da0 100644 --- a/doc/models/credit-scheme.md +++ b/doc/models/credit-scheme.md @@ -13,3 +13,11 @@ | `CREDIT` | | `REFUND` | +## Example + +```python +from advancedbilling.models.credit_scheme import CreditScheme + +credit_scheme = CreditScheme.NONE +``` + diff --git a/doc/models/credit-type.md b/doc/models/credit-type.md index f7d2a090..5a640752 100644 --- a/doc/models/credit-type.md +++ b/doc/models/credit-type.md @@ -15,3 +15,11 @@ The type of credit to be created when upgrading/downgrading. Defaults to the com | `PRORATED` | | `NONE` | +## Example + +```python +from advancedbilling.models.credit_type import CreditType + +credit_type = CreditType.NONE +``` + diff --git a/doc/models/currency-overage-prices.md b/doc/models/currency-overage-prices.md index 4655d663..1d83c9cb 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` | `int` | Optional | - | | `mtype` | [`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` | `bool` | Optional | Note: Refer to type attribute instead | +| `default` | `bool` | Optional | Note: Refer to type attribute instead. | | `name` | `str` | 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` | `int` | Optional | - | @@ -25,7 +25,7 @@ Extends a component price point with currency overage prices. | `use_site_exchange_rate` | `bool` | 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` | `int` | 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` | `bool` | Optional | - | -| `interval` | `int` | 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` | `int` | 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` | [`List[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` | [`List[ComponentPrice]`](../../doc/models/component-price.md) | Optional | Applicable only to prepaid usage components. An array of overage price brackets. | @@ -36,15 +36,19 @@ 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` | [`List[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" -} +```python +from advancedbilling.models.currency_overage_prices import CurrencyOveragePrices +from advancedbilling.models.price_point_type import PricePointType +from advancedbilling.models.pricing_scheme import PricingScheme + +currency_overage_prices = CurrencyOveragePrices( + id=26, + mtype=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..bb1fde0a 100644 --- a/doc/models/currency-price-role.md +++ b/doc/models/currency-price-role.md @@ -15,3 +15,11 @@ Role for the price. | `TRIAL` | | `INITIAL` | +## Example + +```python +from advancedbilling.models.currency_price_role import CurrencyPriceRole + +currency_price_role = CurrencyPriceRole.TRIAL +``` + diff --git a/doc/models/currency-price.md b/doc/models/currency-price.md index 989c4c1a..73394876 100644 --- a/doc/models/currency-price.md +++ b/doc/models/currency-price.md @@ -18,15 +18,17 @@ | `product_price_point_id` | `int` | 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 + +```python +from advancedbilling.models.currency_price import CurrencyPrice + +currency_price = CurrencyPrice( + 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 f418dbe8..4f594ffa 100644 --- a/doc/models/currency-prices-response.md +++ b/doc/models/currency-prices-response.md @@ -11,19 +11,22 @@ | --- | --- | --- | --- | | `currency_prices` | [`List[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 + +```python +from advancedbilling.models.currency_price import CurrencyPrice +from advancedbilling.models.currency_prices_response import CurrencyPricesResponse + +currency_prices_response = CurrencyPricesResponse( + currency_prices=[ + CurrencyPrice( + 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..4147fba7 100644 --- a/doc/models/custom-field-owner.md +++ b/doc/models/custom-field-owner.md @@ -12,3 +12,11 @@ | `CUSTOMER` | | `SUBSCRIPTION` | +## Example + +```python +from advancedbilling.models.custom_field_owner import CustomFieldOwner + +custom_field_owner = CustomFieldOwner.CUSTOMER +``` + diff --git a/doc/models/custom-field-value-change.md b/doc/models/custom-field-value-change.md index 8ddcf626..ab2834e4 100644 --- a/doc/models/custom-field-value-change.md +++ b/doc/models/custom-field-value-change.md @@ -17,17 +17,19 @@ | `resource_type` | `str` | Required | - | | `resource_id` | `int` | 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 + +```python +from advancedbilling.models.custom_field_value_change import CustomFieldValueChange + +custom_field_value_change = CustomFieldValueChange( + 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 3f793681..270d5d6d 100644 --- a/doc/models/customer-attributes.md +++ b/doc/models/customer-attributes.md @@ -12,37 +12,40 @@ | `first_name` | `str` | Optional | The first name of the customer. Required when creating a customer via attributes. | | `last_name` | `str` | Optional | The last name of the customer. Required when creating a customer via attributes. | | `email` | `str` | Optional | The email address of the customer. Required when creating a customer via attributes. | -| `cc_emails` | `str` | Optional | A list of emails that should be cc’d on all customer communications. Optional. | -| `organization` | `str` | Optional | The organization/company of the customer. Optional. | -| `reference` | `str` | 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` | `str` | Optional | (Optional) The customer’s shipping street address (i.e. “123 Main St.”). | -| `address_2` | `str` | Optional | (Optional) Second line of the customer’s shipping address i.e. “Apt. 100” | -| `city` | `str` | Optional | (Optional) The customer’s shipping address city (i.e. “Boston”). | -| `state` | `str` | 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` | `str` | Optional | (Optional) The customer’s shipping address zip code (i.e. “12345”). | -| `country` | `str` | 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` | `str` | Optional | (Optional) A list of emails that should be cc’d on all customer communications. | +| `organization` | `str` | Optional | (Optional) The organization/company of the customer. | +| `reference` | `str` | 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` | `str` | Optional | (Optional) The customer’s shipping street address (e.g., “123 Main St.”). | +| `address_2` | `str` | Optional | (Optional) Second line of the customer’s shipping address e.g., “Apt. 100” | +| `city` | `str` | Optional | (Optional) The customer’s shipping address city (e.g., “Boston”). | +| `state` | `str` | 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` | `str` | Optional | (Optional) The customer’s shipping address zip code (e.g., “12345”). | +| `country` | `str` | 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` | `str` | Optional | (Optional) The phone number of the customer. | | `verified` | `bool` | Optional | - | | `tax_exempt` | `bool` | 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` | `str` | 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` | `bool` | 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` | `str` | 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` | `Dict[str, str]` | 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` | `int` | Optional | The parent ID in Chargify if applicable. Parent is another Customer object. | | `salesforce_id` | `str` | Optional | (Optional) The Salesforce ID of the customer. | | `default_auto_renewal_profile_id` | `int` | 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 + +```python +from advancedbilling.models.customer_attributes import CustomerAttributes + +customer_attributes = CustomerAttributes( + 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..df14d294 100644 --- a/doc/models/customer-change.md +++ b/doc/models/customer-change.md @@ -14,97 +14,106 @@ | `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 - } - ], - "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 - } - ] - } -} +```python +from advancedbilling.models.address_change import AddressChange +from advancedbilling.models.custom_field_owner import CustomFieldOwner +from advancedbilling.models.customer_change import CustomerChange +from advancedbilling.models.customer_custom_fields_change import CustomerCustomFieldsChange +from advancedbilling.models.customer_payer_change import CustomerPayerChange +from advancedbilling.models.invoice_address import InvoiceAddress +from advancedbilling.models.invoice_custom_field import InvoiceCustomField +from advancedbilling.models.invoice_payer_change import InvoicePayerChange + +customer_change = CustomerChange( + payer=CustomerPayerChange( + before=InvoicePayerChange( + first_name='first_name0', + last_name='last_name8', + organization='organization4', + email='email6' + ), + after=InvoicePayerChange( + first_name='first_name2', + last_name='last_name0', + organization='organization4', + email='email4' + ) + ), + shipping_address=AddressChange( + before=InvoiceAddress( + street='street0', + line_2='line24', + city='city0', + state='state6', + zip='zip4' + ), + after=InvoiceAddress( + street='street2', + line_2='line26', + city='city8', + state='state2', + zip='zip4' + ) + ), + billing_address=AddressChange( + before=InvoiceAddress( + street='street0', + line_2='line24', + city='city0', + state='state6', + zip='zip4' + ), + after=InvoiceAddress( + street='street2', + line_2='line26', + city='city8', + state='state2', + zip='zip4' + ) + ), + custom_fields=CustomerCustomFieldsChange( + before=[ + InvoiceCustomField( + owner_id=26, + owner_type=CustomFieldOwner.CUSTOMER, + name='name0', + value='value2', + metadatum_id=26 + ), + InvoiceCustomField( + owner_id=26, + owner_type=CustomFieldOwner.CUSTOMER, + name='name0', + value='value2', + metadatum_id=26 + ) + ], + after=[ + InvoiceCustomField( + owner_id=130, + owner_type=CustomFieldOwner.CUSTOMER, + name='name2', + value='value4', + metadatum_id=130 + ), + InvoiceCustomField( + owner_id=130, + owner_type=CustomFieldOwner.CUSTOMER, + name='name2', + value='value4', + metadatum_id=130 + ), + InvoiceCustomField( + 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..b79bf4f3 100644 --- a/doc/models/customer-changes-preview-response.md +++ b/doc/models/customer-changes-preview-response.md @@ -11,99 +11,109 @@ | --- | --- | --- | --- | | `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 - } - ], - "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 - } - ] - } - } -} +```python +from advancedbilling.models.address_change import AddressChange +from advancedbilling.models.custom_field_owner import CustomFieldOwner +from advancedbilling.models.customer_change import CustomerChange +from advancedbilling.models.customer_changes_preview_response import CustomerChangesPreviewResponse +from advancedbilling.models.customer_custom_fields_change import CustomerCustomFieldsChange +from advancedbilling.models.customer_payer_change import CustomerPayerChange +from advancedbilling.models.invoice_address import InvoiceAddress +from advancedbilling.models.invoice_custom_field import InvoiceCustomField +from advancedbilling.models.invoice_payer_change import InvoicePayerChange + +customer_changes_preview_response = CustomerChangesPreviewResponse( + changes=CustomerChange( + payer=CustomerPayerChange( + before=InvoicePayerChange( + first_name='first_name0', + last_name='last_name8', + organization='organization4', + email='email6' + ), + after=InvoicePayerChange( + first_name='first_name2', + last_name='last_name0', + organization='organization4', + email='email4' + ) + ), + shipping_address=AddressChange( + before=InvoiceAddress( + street='street0', + line_2='line24', + city='city0', + state='state6', + zip='zip4' + ), + after=InvoiceAddress( + street='street2', + line_2='line26', + city='city8', + state='state2', + zip='zip4' + ) + ), + billing_address=AddressChange( + before=InvoiceAddress( + street='street0', + line_2='line24', + city='city0', + state='state6', + zip='zip4' + ), + after=InvoiceAddress( + street='street2', + line_2='line26', + city='city8', + state='state2', + zip='zip4' + ) + ), + custom_fields=CustomerCustomFieldsChange( + before=[ + InvoiceCustomField( + owner_id=26, + owner_type=CustomFieldOwner.CUSTOMER, + name='name0', + value='value2', + metadatum_id=26 + ), + InvoiceCustomField( + owner_id=26, + owner_type=CustomFieldOwner.CUSTOMER, + name='name0', + value='value2', + metadatum_id=26 + ) + ], + after=[ + InvoiceCustomField( + owner_id=130, + owner_type=CustomFieldOwner.CUSTOMER, + name='name2', + value='value4', + metadatum_id=130 + ), + InvoiceCustomField( + owner_id=130, + owner_type=CustomFieldOwner.CUSTOMER, + name='name2', + value='value4', + metadatum_id=130 + ), + InvoiceCustomField( + 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 5f409c95..1faf85f6 100644 --- a/doc/models/customer-custom-fields-change.md +++ b/doc/models/customer-custom-fields-change.md @@ -12,28 +12,32 @@ | `before` | [`List[InvoiceCustomField]`](../../doc/models/invoice-custom-field.md) | Required | - | | `after` | [`List[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 - } - ], - "after": [ - { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 - } - ] -} +## Example + +```python +from advancedbilling.models.custom_field_owner import CustomFieldOwner +from advancedbilling.models.customer_custom_fields_change import CustomerCustomFieldsChange +from advancedbilling.models.invoice_custom_field import InvoiceCustomField + +customer_custom_fields_change = CustomerCustomFieldsChange( + before=[ + InvoiceCustomField( + owner_id=26, + owner_type=CustomFieldOwner.CUSTOMER, + name='name0', + value='value2', + metadatum_id=26 + ) + ], + after=[ + InvoiceCustomField( + 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 5bdc437b..b8bd1126 100644 --- a/doc/models/customer-error-response-exception.md +++ b/doc/models/customer-error-response-exception.md @@ -11,13 +11,14 @@ | --- | --- | --- | --- | | `errors` | [Customer Error](../../doc/models/customer-error.md) \| List[str] \| None | Optional | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "errors": { - "customer": "customer8" - } -} +## Example + +```python +try: + # make the API call +except CustomerErrorResponseException as e: + print(e) +except APIException as e: + print(e) ``` diff --git a/doc/models/customer-error.md b/doc/models/customer-error.md index 59835236..c61a814f 100644 --- a/doc/models/customer-error.md +++ b/doc/models/customer-error.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `customer` | `str` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "customer": "customer8" -} +```python +from advancedbilling.models.customer_error import CustomerError + +customer_error = CustomerError( + customer='customer8' +) ``` diff --git a/doc/models/customer-payer-change.md b/doc/models/customer-payer-change.md index e7d2ba8c..fdfb2a31 100644 --- a/doc/models/customer-payer-change.md +++ b/doc/models/customer-payer-change.md @@ -12,22 +12,25 @@ | `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 + +```python +from advancedbilling.models.customer_payer_change import CustomerPayerChange +from advancedbilling.models.invoice_payer_change import InvoicePayerChange + +customer_payer_change = CustomerPayerChange( + before=InvoicePayerChange( + first_name='first_name0', + last_name='last_name8', + organization='organization4', + email='email6' + ), + after=InvoicePayerChange( + 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..9b991833 100644 --- a/doc/models/customer-response.md +++ b/doc/models/customer-response.md @@ -11,17 +11,20 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.customer import Customer +from advancedbilling.models.customer_response import CustomerResponse + +customer_response = CustomerResponse( + customer=Customer( + 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 1a51ac89..a188cd22 100644 --- a/doc/models/customer.md +++ b/doc/models/customer.md @@ -12,18 +12,18 @@ | `first_name` | `str` | Optional | The first name of the customer | | `last_name` | `str` | Optional | The last name of the customer | | `email` | `str` | Optional | The email address of the customer | -| `cc_emails` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | Optional | The unique identifier used within your own application for this customer | | `id` | `int` | 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` | `str` | Optional | The customer’s shipping street address (i.e. “123 Main St.”) | -| `address_2` | `str` | Optional | Second line of the customer’s shipping address i.e. “Apt. 100” | -| `city` | `str` | Optional | The customer’s shipping address city (i.e. “Boston”) | -| `state` | `str` | Optional | The customer’s shipping address state (i.e. “MA”) | +| `address` | `str` | Optional | The customer’s shipping street address (e.g., “123 Main St.”) | +| `address_2` | `str` | Optional | Second line of the customer’s shipping address e.g., “Apt. 100” | +| `city` | `str` | Optional | The customer’s shipping address city (e.g., “Boston”) | +| `state` | `str` | Optional | The customer’s shipping address state (e.g., “MA”) | | `state_name` | `str` | Optional | The customer's full name of state | -| `zip` | `str` | Optional | The customer’s shipping address zip code (i.e. “12345”) | +| `zip` | `str` | Optional | The customer’s shipping address zip code (e.g., “12345”) | | `country` | `str` | Optional | The customer shipping address country | | `country_name` | `str` | Optional | The customer's full name of country | | `phone` | `str` | 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` | `bool` | Optional | The tax exempt status for the customer. Acceptable values are true or 1 for true and false or 0 for false. | +| `surcharging` | `bool` | Optional | Whether surcharging is enabled for the customer. Only included on sites where surcharging control is enabled. | | `vat_number` | `str` | 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` | `int` | Optional | The parent ID in Chargify if applicable. Parent is another Customer object. | | `locale` | `str` | Optional | The locale for the customer to identify language-region | @@ -40,16 +41,19 @@ | `tax_exempt_reason` | `str` | Optional | The Tax Exemption Reason Code for the customer | | `default_auto_renewal_profile_id` | `int` | Optional | The default auto-renewal profile ID for the customer | | `maxioid` | `str` | Optional | The Maxio-generated unique identifier for the customer. | +| `branding_theme_id` | `int` | 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 (as JSON) +## Example -```json -{ - "first_name": "first_name8", - "last_name": "last_name6", - "email": "email8", - "cc_emails": "cc_emails2", - "organization": "organization8" -} +```python +from advancedbilling.models.customer import Customer + +customer = Customer( + 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..aefc59d7 100644 --- a/doc/models/debit-note-role.md +++ b/doc/models/debit-note-role.md @@ -14,3 +14,11 @@ The role of the debit note. | `CHARGEBACK` | | `REFUND` | +## Example + +```python +from advancedbilling.models.debit_note_role import DebitNoteRole + +debit_note_role = DebitNoteRole.CHARGEBACK +``` + diff --git a/doc/models/debit-note-status.md b/doc/models/debit-note-status.md index 48eb3cb1..da151aec 100644 --- a/doc/models/debit-note-status.md +++ b/doc/models/debit-note-status.md @@ -16,3 +16,11 @@ Current status of the debit note. | `BANISHED` | | `PAID` | +## Example + +```python +from advancedbilling.models.debit_note_status import DebitNoteStatus + +debit_note_status = DebitNoteStatus.BANISHED +``` + diff --git a/doc/models/debit-note.md b/doc/models/debit-note.md index 498c3666..477b20d2 100644 --- a/doc/models/debit-note.md +++ b/doc/models/debit-note.md @@ -13,10 +13,10 @@ | `site_id` | `int` | Optional | ID of the site to which the debit note belongs. | | `customer_id` | `int` | Optional | ID of the customer to which the debit note belongs. | | `subscription_id` | `int` | Optional | ID of the subscription that generated the debit note. | -| `number` | `int` | Optional | A unique, identifier that appears on the debit note and in places it is referenced. | +| `number` | `int` | Optional | A unique identifier that appears on the debit note and in places it is referenced. | | `sequence_number` | `int` | Optional | A monotonically increasing number assigned to debit notes as they are created. | | `origin_credit_note_uid` | `str` | 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` | `str` | Optional | A unique, identifying string of the connected credit note. | +| `origin_credit_note_number` | `str` | 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` | `str` | 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` | [`List[CreditNoteLineItem]`](../../doc/models/credit-note-line-item.md) | Optional | Line items on the debit note. | @@ -33,15 +33,17 @@ | `taxes` | [`List[InvoiceTax]`](../../doc/models/invoice-tax.md) | Optional | - | | `refunds` | [`List[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 -} +```python +from advancedbilling.models.debit_note import DebitNote + +debit_note = DebitNote( + 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..5bf111c0 100644 --- a/doc/models/deduct-service-credit-request.md +++ b/doc/models/deduct-service-credit-request.md @@ -11,14 +11,17 @@ | --- | --- | --- | --- | | `deduction` | [`DeductServiceCredit`](../../doc/models/deduct-service-credit.md) | Required | - | -## Example (as JSON) - -```json -{ - "deduction": { - "amount": "String9", - "memo": "memo0" - } -} +## Example + +```python +from advancedbilling.models.deduct_service_credit import DeductServiceCredit +from advancedbilling.models.deduct_service_credit_request import DeductServiceCreditRequest + +deduct_service_credit_request = DeductServiceCreditRequest( + deduction=DeductServiceCredit( + amount='String9', + memo='memo0' + ) +) ``` diff --git a/doc/models/deduct-service-credit.md b/doc/models/deduct-service-credit.md index 3936b309..1a66840a 100644 --- a/doc/models/deduct-service-credit.md +++ b/doc/models/deduct-service-credit.md @@ -12,12 +12,14 @@ | `amount` | str \| float | Required | This is a container for one-of cases. | | `memo` | `str` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "amount": "String1", - "memo": "memo2" -} +```python +from advancedbilling.models.deduct_service_credit import DeductServiceCredit + +deduct_service_credit = DeductServiceCredit( + amount='String3', + memo='memo4' +) ``` diff --git a/doc/models/delayed-cancellation-response.md b/doc/models/delayed-cancellation-response.md index 1e2f8fa0..2b5a8e9f 100644 --- a/doc/models/delayed-cancellation-response.md +++ b/doc/models/delayed-cancellation-response.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `message` | `str` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "message": "message8" -} +```python +from advancedbilling.models.delayed_cancellation_response import DelayedCancellationResponse + +delayed_cancellation_response = DelayedCancellationResponse( + message='message0' +) ``` diff --git a/doc/models/delete-subscription-group-response.md b/doc/models/delete-subscription-group-response.md index b5d766bd..32ce9046 100644 --- a/doc/models/delete-subscription-group-response.md +++ b/doc/models/delete-subscription-group-response.md @@ -12,12 +12,14 @@ | `uid` | `str` | Optional | - | | `deleted` | `bool` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "uid": "uid4", - "deleted": false -} +```python +from advancedbilling.models.delete_subscription_group_response import DeleteSubscriptionGroupResponse + +delete_subscription_group_response = DeleteSubscriptionGroupResponse( + uid='uid8', + deleted=False +) ``` diff --git a/doc/models/deliver-proforma-invoice-request.md b/doc/models/deliver-proforma-invoice-request.md index a01e3dfa..ce540516 100644 --- a/doc/models/deliver-proforma-invoice-request.md +++ b/doc/models/deliver-proforma-invoice-request.md @@ -13,21 +13,24 @@ | `cc_recipient_emails` | `List[str]` | Optional | - | | `bcc_recipient_emails` | `List[str]` | Optional | - | -## Example (as JSON) - -```json -{ - "recipient_emails": [ - "recipient_emails9" - ], - "cc_recipient_emails": [ - "cc_recipient_emails8" - ], - "bcc_recipient_emails": [ - "bcc_recipient_emails2", - "bcc_recipient_emails3", - "bcc_recipient_emails4" - ] -} +## Example + +```python +from advancedbilling.models.deliver_proforma_invoice_request import DeliverProformaInvoiceRequest + +deliver_proforma_invoice_request = DeliverProformaInvoiceRequest( + recipient_emails=[ + 'recipient_emails9', + 'recipient_emails0' + ], + cc_recipient_emails=[ + 'cc_recipient_emails2', + 'cc_recipient_emails3', + 'cc_recipient_emails4' + ], + bcc_recipient_emails=[ + 'bcc_recipient_emails8' + ] +) ``` diff --git a/doc/models/direction.md b/doc/models/direction.md index ef6c29da..3c8ee075 100644 --- a/doc/models/direction.md +++ b/doc/models/direction.md @@ -12,3 +12,11 @@ | `ASC` | | `DESC` | +## Example + +```python +from advancedbilling.models.direction import Direction + +direction = Direction.ASC +``` + diff --git a/doc/models/discount-type.md b/doc/models/discount-type.md index 77357ece..66a75483 100644 --- a/doc/models/discount-type.md +++ b/doc/models/discount-type.md @@ -12,3 +12,11 @@ | `AMOUNT` | | `PERCENT` | +## Example + +```python +from advancedbilling.models.discount_type import DiscountType + +discount_type = DiscountType.AMOUNT +``` + diff --git a/doc/models/downgrade-credit-credit-type.md b/doc/models/downgrade-credit-credit-type.md index 50858a3b..5904acf4 100644 --- a/doc/models/downgrade-credit-credit-type.md +++ b/doc/models/downgrade-credit-credit-type.md @@ -21,3 +21,11 @@ The type of credit to be created when upgrading/downgrading. Defaults to the com | `PRORATED` | | `NONE` | +## Example + +```python +from advancedbilling.models.downgrade_credit_credit_type import DowngradeCreditCreditType + +downgrade_credit_credit_type = DowngradeCreditCreditType.NONE +``` + diff --git a/doc/models/dunner-data.md b/doc/models/dunner-data.md index 3f797eaa..a8eaaa8e 100644 --- a/doc/models/dunner-data.md +++ b/doc/models/dunner-data.md @@ -16,16 +16,20 @@ | `attempts` | `int` | 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 + +```python +import dateutil.parser + +from advancedbilling.models.dunner_data import DunnerData + +dunner_data = DunnerData( + state='state2', + subscription_id=216, + revenue_at_risk_in_cents=120, + created_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + attempts=20, + last_attempted_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/dunning-step-data.md b/doc/models/dunning-step-data.md index a945a81f..cbd3ace2 100644 --- a/doc/models/dunning-step-data.md +++ b/doc/models/dunning-step-data.md @@ -18,18 +18,20 @@ | `send_sms` | `bool` | Required | - | | `sms_body` | `str` | 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 + +```python +from advancedbilling.models.dunning_step_data import DunningStepData + +dunning_step_data = DunningStepData( + 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..f61f670e 100644 --- a/doc/models/dunning-step-reached.md +++ b/doc/models/dunning-step-reached.md @@ -13,38 +13,44 @@ | `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 + +```python +import dateutil.parser + +from advancedbilling.models.dunner_data import DunnerData +from advancedbilling.models.dunning_step_data import DunningStepData +from advancedbilling.models.dunning_step_reached import DunningStepReached + +dunning_step_reached = DunningStepReached( + dunner=DunnerData( + state='state8', + subscription_id=194, + revenue_at_risk_in_cents=98, + created_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + attempts=42, + last_attempted_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') + ), + current_step=DunningStepData( + 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( + 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 19273adc..86be7f4e 100644 --- a/doc/models/ebb-component.md +++ b/doc/models/ebb-component.md @@ -9,10 +9,10 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `name` | `str` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | -| `unit_name` | `str` | 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` | `str` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, i.e., "Minutes". | +| `unit_name` | `str` | 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` | `str` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | -| `handle` | `str` | 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` | `str` | 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` | `bool` | 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` | [`List[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,55 @@ | `tax_code` | `str` | 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` | `bool` | 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` | `int` | Required | The ID of an event based billing metric that will be attached to this component. | -| `interval` | `int` | 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` | `int` | 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` | `str` | 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" - } - ], - "event_based_billing_metric_id": 190 -} +## Example + +```python +from advancedbilling.models.component_price_point_item import ComponentPricePointItem +from advancedbilling.models.ebb_component import EBBComponent +from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme + +ebb_component = EBBComponent( + 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( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ), + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ) + ], + price_points=[ + ComponentPricePointItem( + name='name2', + handle='handle8', + pricing_scheme=PricingScheme.PER_UNIT, + interval=92, + interval_unit=IntervalUnit.DAY + ), + ComponentPricePointItem( + 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..931f5b7b 100644 --- a/doc/models/ebb-event.md +++ b/doc/models/ebb-event.md @@ -11,28 +11,19 @@ | --- | --- | --- | --- | | `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 + +```python +import dateutil.parser + +from advancedbilling.models.chargify_ebb import ChargifyEBB +from advancedbilling.models.ebb_event import EBBEvent + +ebb_event = EBBEvent( + chargify=ChargifyEBB( + timestamp=dateutil.parser.parse('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 5867962e..b3a04126 100644 --- a/doc/models/enable-webhooks-request.md +++ b/doc/models/enable-webhooks-request.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `webhooks_enabled` | `bool` | Required | - | -## Example (as JSON) +## Example -```json -{ - "webhooks_enabled": false -} +```python +from advancedbilling.models.enable_webhooks_request import EnableWebhooksRequest + +enable_webhooks_request = EnableWebhooksRequest( + webhooks_enabled=False +) ``` diff --git a/doc/models/enable-webhooks-response.md b/doc/models/enable-webhooks-response.md index 5214465b..f91e1c16 100644 --- a/doc/models/enable-webhooks-response.md +++ b/doc/models/enable-webhooks-response.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `webhooks_enabled` | `bool` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "webhooks_enabled": false -} +```python +from advancedbilling.models.enable_webhooks_response import EnableWebhooksResponse + +enable_webhooks_response = EnableWebhooksResponse( + webhooks_enabled=False +) ``` diff --git a/doc/models/endpoint-response.md b/doc/models/endpoint-response.md index 3bd269ac..29868b17 100644 --- a/doc/models/endpoint-response.md +++ b/doc/models/endpoint-response.md @@ -11,19 +11,22 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.endpoint import Endpoint +from advancedbilling.models.endpoint_response import EndpointResponse + +endpoint_response = EndpointResponse( + endpoint=Endpoint( + 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 f930f500..96c9b7d3 100644 --- a/doc/models/endpoint.md +++ b/doc/models/endpoint.md @@ -15,18 +15,19 @@ | `status` | `str` | Optional | - | | `webhook_subscriptions` | `List[str]` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 196, - "url": "url2", - "site_id": 122, - "status": "status0", - "webhook_subscriptions": [ - "webhook_subscriptions4", - "webhook_subscriptions3" - ] -} +## Example + +```python +from advancedbilling.models.endpoint import Endpoint + +endpoint = Endpoint( + 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 9cbf641f..76d58bda 100644 --- a/doc/models/error-array-map-response-exception.md +++ b/doc/models/error-array-map-response-exception.md @@ -11,16 +11,14 @@ | --- | --- | --- | --- | | `errors` | `Dict[str, Any]` | Optional | - | -## Example (as JSON) - -```json -{ - "errors": { - "key0": { - "key1": "val1", - "key2": "val2" - } - } -} +## Example + +```python +try: + # make the API call +except ErrorArrayMapResponseException as e: + print(e) +except APIException as e: + print(e) ``` diff --git a/doc/models/error-list-response-exception.md b/doc/models/error-list-response-exception.md index 08aaab01..73389f01 100644 --- a/doc/models/error-list-response-exception.md +++ b/doc/models/error-list-response-exception.md @@ -13,15 +13,14 @@ Error which contains list of messages. | --- | --- | --- | --- | | `errors` | `List[str]` | Required | - | -## Example (as JSON) - -```json -{ - "errors": [ - "errors5", - "errors6", - "errors7" - ] -} +## Example + +```python +try: + # make the API call +except ErrorListResponseException as e: + print(e) +except APIException as e: + print(e) ``` diff --git a/doc/models/error-string-map-response-exception.md b/doc/models/error-string-map-response-exception.md index 31319e0f..20b0a661 100644 --- a/doc/models/error-string-map-response-exception.md +++ b/doc/models/error-string-map-response-exception.md @@ -11,14 +11,14 @@ | --- | --- | --- | --- | | `errors` | `Dict[str, str]` | Optional | - | -## Example (as JSON) - -```json -{ - "errors": { - "key0": "errors3", - "key1": "errors4" - } -} +## Example + +```python +try: + # make the API call +except ErrorStringMapResponseException as e: + print(e) +except APIException as e: + print(e) ``` diff --git a/doc/models/errors.md b/doc/models/errors.md index b24a7e4c..eac3b366 100644 --- a/doc/models/errors.md +++ b/doc/models/errors.md @@ -12,18 +12,22 @@ | `per_page` | `List[str]` | Optional | - | | `price_point` | `List[str]` | Optional | - | -## Example (as JSON) - -```json -{ - "per_page": [ - "per_page7", - "per_page8" - ], - "price_point": [ - "price_point6", - "price_point7" - ] -} +## Example + +```python +from advancedbilling.models.errors import Errors + +errors = Errors( + per_page=[ + 'per_page1', + 'per_page2', + 'per_page3' + ], + 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..40cd70bf 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,14 @@ | --- | --- | --- | --- | | `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 + +```python +try: + # make the API call +except EventBasedBillingListSegmentsErrorsException as e: + print(e) +except APIException as e: + print(e) ``` diff --git a/doc/models/event-based-billing-segment-error.md b/doc/models/event-based-billing-segment-error.md index 9043818d..29a9d924 100644 --- a/doc/models/event-based-billing-segment-error.md +++ b/doc/models/event-based-billing-segment-error.md @@ -11,20 +11,18 @@ | --- | --- | --- | --- | | `segments` | `Dict[str, Any]` | 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 + +```python +import jsonpickle + +from advancedbilling.models.event_based_billing_segment_error import EventBasedBillingSegmentError + +event_based_billing_segment_error = EventBasedBillingSegmentError( + segments={ + 'key0': jsonpickle.decode('{"key1":"val1","key2":"val2"}'), + 'key1': jsonpickle.decode('{"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 33d8b10e..71e39bc5 100644 --- a/doc/models/event-based-billing-segment-errors-exception.md +++ b/doc/models/event-based-billing-segment-errors-exception.md @@ -11,24 +11,14 @@ | --- | --- | --- | --- | | `errors` | `Dict[str, Any]` | 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 + +```python +try: + # make the API call +except EventBasedBillingSegmentErrorsException as e: + print(e) +except APIException as e: + print(e) ``` diff --git a/doc/models/event-based-billing-segment-exception.md b/doc/models/event-based-billing-segment-exception.md index 76167500..916893ab 100644 --- a/doc/models/event-based-billing-segment-exception.md +++ b/doc/models/event-based-billing-segment-exception.md @@ -11,18 +11,14 @@ | --- | --- | --- | --- | | `errors` | [`EventBasedBillingSegmentError`](../../doc/models/event-based-billing-segment-error.md) | Required | - | -## Example (as JSON) - -```json -{ - "errors": { - "segments": { - "key0": { - "key1": "val1", - "key2": "val2" - } - } - } -} +## Example + +```python +try: + # make the API call +except EventBasedBillingSegmentException as e: + print(e) +except APIException as e: + print(e) ``` diff --git a/doc/models/event-key.md b/doc/models/event-key.md index a400739e..f2c51a10 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,11 @@ | `SUBSCRIPTION_TERM_RENEWAL_ACTIVATED` | | `SUBSCRIPTION_TERM_RENEWAL_REMOVED` | +## Example + +```python +from advancedbilling.models.event_key import EventKey + +event_key = EventKey.INVOICE_IN_COLLECTIONS_CANCELED +``` + diff --git a/doc/models/event-response.md b/doc/models/event-response.md index 1c4163af..d8ce2036 100644 --- a/doc/models/event-response.md +++ b/doc/models/event-response.md @@ -11,34 +11,29 @@ | --- | --- | --- | --- | | `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 + +```python +import dateutil.parser + +from advancedbilling.models.event import Event +from advancedbilling.models.event_key import EventKey +from advancedbilling.models.event_response import EventResponse +from advancedbilling.models.subscription_product_change import SubscriptionProductChange + +event_response = EventResponse( + event=Event( + id=242, + key=EventKey.SUBSCRIPTION_REMOVED_FROM_GROUP, + message='message0', + subscription_id=96, + customer_id=24, + created_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + event_specific_data=SubscriptionProductChange( + previous_product_id=126, + new_product_id=12 + ) + ) +) ``` diff --git a/doc/models/event.md b/doc/models/event.md index b7179a2b..bb49a68e 100644 --- a/doc/models/event.md +++ b/doc/models/event.md @@ -15,34 +15,28 @@ | `subscription_id` | `int` | Required | - | | `customer_id` | `int` | Required | - | | `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) \| None | 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 - } -} +| `event_specific_data` | [Subscription Product Change](../../doc/models/subscription-product-change.md) \| [Subscription Product Change Scheduled](../../doc/models/subscription-product-change-scheduled.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) \| None | Required | This is a container for one-of cases. | + +## Example + +```python +import dateutil.parser + +from advancedbilling.models.event import Event +from advancedbilling.models.event_key import EventKey +from advancedbilling.models.subscription_product_change import SubscriptionProductChange + +event = Event( + id=242, + key=EventKey.SUBSCRIPTION_REMOVED_FROM_GROUP, + message='message0', + subscription_id=96, + customer_id=24, + created_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + event_specific_data=SubscriptionProductChange( + previous_product_id=126, + new_product_id=12 + ) +) ``` diff --git a/doc/models/expiration-interval-unit.md b/doc/models/expiration-interval-unit.md index d6b75bef..31483d4c 100644 --- a/doc/models/expiration-interval-unit.md +++ b/doc/models/expiration-interval-unit.md @@ -13,3 +13,11 @@ | `MONTH` | | `NEVER` | +## Example + +```python +from advancedbilling.models.expiration_interval_unit import ExpirationIntervalUnit + +expiration_interval_unit = ExpirationIntervalUnit.NEVER +``` + diff --git a/doc/models/failed-payment-action.md b/doc/models/failed-payment-action.md index 4d48d023..9828655e 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,11 @@ Action taken when payment for an invoice fails: | `ROLLBACK_TO_PENDING` | | `INITIATE_DUNNING` | +## Example + +```python +from advancedbilling.models.failed_payment_action import FailedPaymentAction + +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 4c4b25f2..2cfb8b1b 100644 --- a/doc/models/failed-payment-event-data.md +++ b/doc/models/failed-payment-event-data.md @@ -17,15 +17,18 @@ Example schema for an `failed_payment` event | `payment_method` | [`InvoicePaymentMethodType`](../../doc/models/invoice-payment-method-type.md) | Required | - | | `transaction_id` | `int` | 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 + +```python +from advancedbilling.models.failed_payment_event_data import FailedPaymentEventData +from advancedbilling.models.invoice_payment_method_type import InvoicePaymentMethodType + +failed_payment_event_data = FailedPaymentEventData( + 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 ce039bb3..dc7f34f1 100644 --- a/doc/models/failed-payment-event.md +++ b/doc/models/failed-payment-event.md @@ -15,31 +15,39 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"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 + +```python +import dateutil.parser + +from advancedbilling.models.failed_payment_event import FailedPaymentEvent +from advancedbilling.models.failed_payment_event_data import FailedPaymentEventData +from advancedbilling.models.invoice import Invoice +from advancedbilling.models.invoice_event_type import InvoiceEventType +from advancedbilling.models.invoice_payment_method_type import InvoicePaymentMethodType + +failed_payment_event = FailedPaymentEvent( + id=140, + timestamp=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + invoice=Invoice( + id=166, + uid='uid6', + site_id=92, + customer_id=204, + subscription_id=20, + issue_date=dateutil.parser.parse('2024-01-01').date(), + due_date=dateutil.parser.parse('2024-01-01').date(), + paid_date=dateutil.parser.parse('2024-01-01').date(), + public_url_expires_on=dateutil.parser.parse('2024-01-21').date() + ), + event_type=InvoiceEventType.FAILED_PAYMENT, + event_data=FailedPaymentEventData( + 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..59c2dc7c 100644 --- a/doc/models/first-charge-type.md +++ b/doc/models/first-charge-type.md @@ -13,3 +13,11 @@ | `IMMEDIATE` | | `DELAYED` | +## Example + +```python +from advancedbilling.models.first_charge_type import FirstChargeType + +first_charge_type = FirstChargeType.IMMEDIATE +``` + diff --git a/doc/models/full-subscription-group-response.md b/doc/models/full-subscription-group-response.md index 0799d8d0..5c693d22 100644 --- a/doc/models/full-subscription-group-response.md +++ b/doc/models/full-subscription-group-response.md @@ -22,19 +22,21 @@ | `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 + +```python +from advancedbilling.models.full_subscription_group_response import FullSubscriptionGroupResponse + +full_subscription_group_response = FullSubscriptionGroupResponse( + 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..d53c30ff --- /dev/null +++ b/doc/models/get-one-time-token-bank-account-payment-profile.md @@ -0,0 +1,69 @@ + +# Get One Time Token Bank Account Payment Profile + +## Structure + +`GetOneTimeTokenBankAccountPaymentProfile` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `str` | Optional | - | +| `first_name` | `str` | Required | **Constraints**: *Minimum Length*: `1` | +| `last_name` | `str` | Required | **Constraints**: *Minimum Length*: `1` | +| `customer_id` | `str` | 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` | `str` | Required | **Constraints**: *Minimum Length*: `1` | +| `billing_address` | `str` | Required | **Constraints**: *Minimum Length*: `1` | +| `billing_address_2` | `str` | Optional | - | +| `billing_city` | `str` | Required | **Constraints**: *Minimum Length*: `1` | +| `billing_country` | `str` | Required | **Constraints**: *Minimum Length*: `1` | +| `billing_state` | `str` | Required | **Constraints**: *Minimum Length*: `1` | +| `billing_zip` | `str` | Required | **Constraints**: *Minimum Length*: `1` | +| `bank_name` | `str` | Required | **Constraints**: *Minimum Length*: `1` | +| `masked_bank_routing_number` | `str` | Required | **Constraints**: *Minimum Length*: `1` | +| `masked_bank_account_number` | `str` | 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` | `str` | Required | **Constraints**: *Minimum Length*: `1` | +| `disabled` | `bool` | Required | - | +| `site_gateway_setting_id` | `int` | Required | - | +| `customer_vault_token` | `str` | Optional | - | +| `gateway_handle` | `str` | Optional | - | +| `verified` | `bool` | Optional | - | + +## Example + +```python +from advancedbilling.models.bank_account_holder_type import BankAccountHolderType +from advancedbilling.models.bank_account_type import BankAccountType +from advancedbilling.models.bank_account_vault import BankAccountVault +from advancedbilling.models.get_one_time_token_bank_account_payment_profile import GetOneTimeTokenBankAccountPaymentProfile + +get_one_time_token_bank_account_payment_profile = GetOneTimeTokenBankAccountPaymentProfile( + 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 e329ebd2..b546e6df 100644 --- a/doc/models/get-one-time-token-payment-profile.md +++ b/doc/models/get-one-time-token-payment-profile.md @@ -31,31 +31,35 @@ | `customer_vault_token` | `str` | Optional | - | | `gateway_handle` | `str` | 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 + +```python +from advancedbilling.models.card_type import CardType +from advancedbilling.models.credit_card_vault import CreditCardVault +from advancedbilling.models.get_one_time_token_payment_profile import GetOneTimeTokenPaymentProfile + +get_one_time_token_payment_profile = GetOneTimeTokenPaymentProfile( + 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..45408542 100644 --- a/doc/models/get-one-time-token-request.md +++ b/doc/models/get-one-time-token-request.md @@ -9,35 +9,40 @@ | 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 + +```python +from advancedbilling.models.card_type import CardType +from advancedbilling.models.credit_card_vault import CreditCardVault +from advancedbilling.models.get_one_time_token_payment_profile import GetOneTimeTokenPaymentProfile +from advancedbilling.models.get_one_time_token_request import GetOneTimeTokenRequest + +get_one_time_token_request = GetOneTimeTokenRequest( + payment_profile=GetOneTimeTokenPaymentProfile( + 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 50d2562b..0716383b 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,15 @@ Optional attributes related to billing date and accrual. Note: Only applicable f | `align_date` | `bool` | 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` | `bool` | 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 -} +```python +from advancedbilling.models.group_billing import GroupBilling + +group_billing = GroupBilling( + accrue=False, + align_date=False, + prorate=False +) ``` diff --git a/doc/models/group-settings.md b/doc/models/group-settings.md index b547e219..de9455b0 100644 --- a/doc/models/group-settings.md +++ b/doc/models/group-settings.md @@ -10,21 +10,26 @@ | 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 + +```python +from advancedbilling.models.group_billing import GroupBilling +from advancedbilling.models.group_settings import GroupSettings +from advancedbilling.models.group_target import GroupTarget +from advancedbilling.models.group_target_type import GroupTargetType + +group_settings = GroupSettings( + target=GroupTarget( + mtype=GroupTargetType.PARENT, + id=236 + ), + billing=GroupBilling( + 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..b1a9d7e9 --- /dev/null +++ b/doc/models/group-status.md @@ -0,0 +1,22 @@ + +# Group Status + +## Enumeration + +`GroupStatus` + +## Fields + +| Name | +| --- | +| `UNGROUPED` | +| `GROUPED` | + +## Example + +```python +from advancedbilling.models.group_status import GroupStatus + +group_status = GroupStatus.UNGROUPED +``` + diff --git a/doc/models/group-target-type.md b/doc/models/group-target-type.md index dec1d51c..0f70349e 100644 --- a/doc/models/group-target-type.md +++ b/doc/models/group-target-type.md @@ -17,3 +17,11 @@ The type of object indicated by the id attribute. | `PARENT` | | `ELDEST` | +## Example + +```python +from advancedbilling.models.group_target_type import GroupTargetType + +group_target_type = GroupTargetType.ELDEST +``` + diff --git a/doc/models/group-target.md b/doc/models/group-target.md index c52ab814..db5fb82b 100644 --- a/doc/models/group-target.md +++ b/doc/models/group-target.md @@ -12,14 +12,17 @@ Attributes of the target customer who will be the responsible payer of the creat | Name | Type | Tags | Description | | --- | --- | --- | --- | | `mtype` | [`GroupTargetType`](../../doc/models/group-target-type.md) | Required | The type of object indicated by the id attribute. | -| `id` | `int` | 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` | `int` | 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 -} +```python +from advancedbilling.models.group_target import GroupTarget +from advancedbilling.models.group_target_type import GroupTargetType + +group_target = GroupTarget( + mtype=GroupTargetType.ENUM_SELF, + id=50 +) ``` diff --git a/doc/models/group-type.md b/doc/models/group-type.md index bc9c31b9..fe750f8e 100644 --- a/doc/models/group-type.md +++ b/doc/models/group-type.md @@ -12,3 +12,11 @@ | `SINGLE_CUSTOMER` | | `MULTIPLE_CUSTOMERS` | +## Example + +```python +from advancedbilling.models.group_type import GroupType + +group_type = GroupType.SINGLE_CUSTOMER +``` + diff --git a/doc/models/historic-usage.md b/doc/models/historic-usage.md index 5d3f5690..e74ac58f 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,17 @@ 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" -} +```python +import dateutil.parser + +from advancedbilling.models.historic_usage import HistoricUsage + +historic_usage = HistoricUsage( + total_usage_quantity=247.74, + billing_period_starts_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + billing_period_ends_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/include-not-null.md b/doc/models/include-not-null.md index 694ffcf9..7f0f5fd8 100644 --- a/doc/models/include-not-null.md +++ b/doc/models/include-not-null.md @@ -15,7 +15,9 @@ Passed as a parameter to list methods to return only non null values. ## Example -``` -not_null +```python +from advancedbilling.models.include_not_null import IncludeNotNull + +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..e1b887b6 100644 --- a/doc/models/include-null-or-not-null.md +++ b/doc/models/include-null-or-not-null.md @@ -16,7 +16,9 @@ Allows to filter by `not_null` or `null`. ## Example -``` -not_null +```python +from advancedbilling.models.include_null_or_not_null import IncludeNullOrNotNull + +include_null_or_not_null = IncludeNullOrNotNull.NOT_NULL ``` diff --git a/doc/models/include-option.md b/doc/models/include-option.md index 0ad125f0..b1d42c83 100644 --- a/doc/models/include-option.md +++ b/doc/models/include-option.md @@ -12,3 +12,11 @@ | `EXCLUDE` | | `INCLUDE` | +## Example + +```python +from advancedbilling.models.include_option import IncludeOption + +include_option = IncludeOption.EXCLUDE +``` + diff --git a/doc/models/interval-unit.md b/doc/models/interval-unit.md index 7e4cab3b..18e4cd18 100644 --- a/doc/models/interval-unit.md +++ b/doc/models/interval-unit.md @@ -12,3 +12,11 @@ | `DAY` | | `MONTH` | +## Example + +```python +from advancedbilling.models.interval_unit import IntervalUnit + +interval_unit = IntervalUnit.DAY +``` + diff --git a/doc/models/invoice-address.md b/doc/models/invoice-address.md index ef314f01..1c1ba471 100644 --- a/doc/models/invoice-address.md +++ b/doc/models/invoice-address.md @@ -16,15 +16,17 @@ | `zip` | `str` | Optional | - | | `country` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" -} +## Example + +```python +from advancedbilling.models.invoice_address import InvoiceAddress + +invoice_address = InvoiceAddress( + street='street8', + line_2='line22', + city='city8', + state='state4', + zip='zip2' +) ``` diff --git a/doc/models/invoice-avatax-details.md b/doc/models/invoice-avatax-details.md index 2324f74f..2266583f 100644 --- a/doc/models/invoice-avatax-details.md +++ b/doc/models/invoice-avatax-details.md @@ -15,15 +15,19 @@ | `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 + +```python +import dateutil.parser + +from advancedbilling.models.invoice_avatax_details import InvoiceAvataxDetails + +invoice_avatax_details = InvoiceAvataxDetails( + id=18, + status='status2', + document_code='document_code0', + commit_date=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + modify_date=dateutil.parser.parse('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/invoice-balance-item.md b/doc/models/invoice-balance-item.md index 483087f6..fe7c456e 100644 --- a/doc/models/invoice-balance-item.md +++ b/doc/models/invoice-balance-item.md @@ -13,13 +13,15 @@ | `number` | `str` | Optional | - | | `outstanding_amount` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "number": "number6", - "outstanding_amount": "outstanding_amount6" -} +## Example + +```python +from advancedbilling.models.invoice_balance_item import InvoiceBalanceItem + +invoice_balance_item = InvoiceBalanceItem( + 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..a963e964 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,11 @@ See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/ | `CHILD` | | `PARENT` | +## Example + +```python +from advancedbilling.models.invoice_consolidation_level import InvoiceConsolidationLevel + +invoice_consolidation_level = InvoiceConsolidationLevel.NONE +``` + diff --git a/doc/models/invoice-credit.md b/doc/models/invoice-credit.md index e081734f..08c79973 100644 --- a/doc/models/invoice-credit.md +++ b/doc/models/invoice-credit.md @@ -17,15 +17,19 @@ | `original_amount` | `str` | Optional | - | | `applied_amount` | `str` | 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 + +```python +import dateutil.parser + +from advancedbilling.models.invoice_credit import InvoiceCredit + +invoice_credit = InvoiceCredit( + uid='uid8', + credit_note_number='credit_note_number8', + credit_note_uid='credit_note_uid2', + transaction_time=dateutil.parser.parse('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 1f3cf7ec..1f1db57a 100644 --- a/doc/models/invoice-custom-field.md +++ b/doc/models/invoice-custom-field.md @@ -15,15 +15,18 @@ | `value` | `str` | Optional | **Constraints**: *Minimum Length*: `1` | | `metadatum_id` | `int` | Optional | - | -## Example (as JSON) - -```json -{ - "owner_id": 142, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 142 -} +## Example + +```python +from advancedbilling.models.custom_field_owner import CustomFieldOwner +from advancedbilling.models.invoice_custom_field import InvoiceCustomField + +invoice_custom_field = InvoiceCustomField( + 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 1d98568c..37fd10b9 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,17 @@ Information about the customer who is owner or recipient the invoiced subscripti | `vat_number` | `str` | Optional | - | | `reference` | `str` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "chargify_id": 236, - "first_name": "first_name0", - "last_name": "last_name8", - "organization": "organization4", - "email": "email6" -} +```python +from advancedbilling.models.invoice_customer import InvoiceCustomer + +invoice_customer = InvoiceCustomer( + 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..54dd4dc2 100644 --- a/doc/models/invoice-date-field.md +++ b/doc/models/invoice-date-field.md @@ -17,7 +17,9 @@ ## Example -``` -issue_date +```python +from advancedbilling.models.invoice_date_field import InvoiceDateField + +invoice_date_field = InvoiceDateField.DUE_DATE ``` diff --git a/doc/models/invoice-debit.md b/doc/models/invoice-debit.md index 32613922..3c6d10a7 100644 --- a/doc/models/invoice-debit.md +++ b/doc/models/invoice-debit.md @@ -18,15 +18,20 @@ | `original_amount` | `str` | Optional | - | | `applied_amount` | `str` | 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 + +```python +import dateutil.parser + +from advancedbilling.models.debit_note_role import DebitNoteRole +from advancedbilling.models.invoice_debit import InvoiceDebit + +invoice_debit = InvoiceDebit( + uid='uid2', + debit_note_number='debit_note_number2', + debit_note_uid='debit_note_uid2', + role=DebitNoteRole.CHARGEBACK, + transaction_time=dateutil.parser.parse('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/invoice-discount-breakout.md b/doc/models/invoice-discount-breakout.md index 256e4a22..d241ecee 100644 --- a/doc/models/invoice-discount-breakout.md +++ b/doc/models/invoice-discount-breakout.md @@ -13,13 +13,15 @@ | `eligible_amount` | `str` | Optional | - | | `discount_amount` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "eligible_amount": "eligible_amount0", - "discount_amount": "discount_amount8" -} +## Example + +```python +from advancedbilling.models.invoice_discount_breakout import InvoiceDiscountBreakout + +invoice_discount_breakout = InvoiceDiscountBreakout( + 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..0a791c30 100644 --- a/doc/models/invoice-discount-source-type.md +++ b/doc/models/invoice-discount-source-type.md @@ -13,3 +13,11 @@ | `REFERRAL` | | `ENUM_AD_HOC_COUPON` | +## Example + +```python +from advancedbilling.models.invoice_discount_source_type import InvoiceDiscountSourceType + +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..b37b13ca 100644 --- a/doc/models/invoice-discount-type.md +++ b/doc/models/invoice-discount-type.md @@ -13,3 +13,11 @@ | `FLAT_AMOUNT` | | `ROLLOVER` | +## Example + +```python +from advancedbilling.models.invoice_discount_type import InvoiceDiscountType + +invoice_discount_type = InvoiceDiscountType.ROLLOVER +``` + diff --git a/doc/models/invoice-discount.md b/doc/models/invoice-discount.md index e0026ad8..be790a99 100644 --- a/doc/models/invoice-discount.md +++ b/doc/models/invoice-discount.md @@ -22,15 +22,18 @@ | `transaction_id` | `int` | Optional | - | | `line_item_breakouts` | [`List[InvoiceDiscountBreakout]`](../../doc/models/invoice-discount-breakout.md) | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid0", - "title": "title4", - "description": "description0", - "code": "code8", - "source_type": "Coupon" -} +## Example + +```python +from advancedbilling.models.invoice_discount import InvoiceDiscount +from advancedbilling.models.invoice_discount_source_type import InvoiceDiscountSourceType + +invoice_discount = InvoiceDiscount( + 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 44d8c93f..41a391ce 100644 --- a/doc/models/invoice-display-settings.md +++ b/doc/models/invoice-display-settings.md @@ -12,12 +12,14 @@ | `hide_zero_subtotal_lines` | `bool` | Optional | - | | `include_discounts_on_lines` | `bool` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "hide_zero_subtotal_lines": false, - "include_discounts_on_lines": false -} +```python +from advancedbilling.models.invoice_display_settings import InvoiceDisplaySettings + +invoice_display_settings = InvoiceDisplaySettings( + 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..76626bbc 100644 --- a/doc/models/invoice-event-payment-method.md +++ b/doc/models/invoice-event-payment-method.md @@ -15,3 +15,11 @@ | `EXTERNAL` | | `PAYPAL_ACCOUNT` | +## Example + +```python +from advancedbilling.models.invoice_event_payment_method import InvoiceEventPaymentMethod + +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..f4636287 100644 --- a/doc/models/invoice-event-type.md +++ b/doc/models/invoice-event-type.md @@ -27,3 +27,11 @@ Invoice Event Type | `FAILED_PAYMENT` | | `CHANGE_CHARGEBACK_STATUS` | +## Example + +```python +from advancedbilling.models.invoice_event_type import InvoiceEventType + +invoice_event_type = InvoiceEventType.REMOVE_PAYMENT +``` + diff --git a/doc/models/invoice-issued.md b/doc/models/invoice-issued.md index a8eb11a3..08366f5b 100644 --- a/doc/models/invoice-issued.md +++ b/doc/models/invoice-issued.md @@ -25,33 +25,38 @@ | `consolidation_level` | `str` | Required | - | | `line_items` | [`List[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 + +```python +import dateutil.parser + +from advancedbilling.models.invoice_issued import InvoiceIssued +from advancedbilling.models.invoice_line_item_event_data import InvoiceLineItemEventData + +invoice_issued = InvoiceIssued( + uid='uid0', + number='number8', + role='role4', + due_date=dateutil.parser.parse('2016-03-13').date(), + 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( + 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 b507bb70..4e1b0217 100644 --- a/doc/models/invoice-line-item-component-cost-data.md +++ b/doc/models/invoice-line-item-component-cost-data.md @@ -11,33 +11,22 @@ | --- | --- | --- | --- | | `rates` | [`List[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 + +```python +from advancedbilling.models.component_cost_data import ComponentCostData +from advancedbilling.models.invoice_line_item_component_cost_data import InvoiceLineItemComponentCostData + +invoice_line_item_component_cost_data = InvoiceLineItemComponentCostData( + rates=[ + ComponentCostData( + 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 30c91f2e..291e6c9e 100644 --- a/doc/models/invoice-line-item-event-data.md +++ b/doc/models/invoice-line-item-event-data.md @@ -30,15 +30,17 @@ | `billing_schedule_item_id` | `int` | Optional | - | | `custom_item` | `bool` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid4", - "title": "title0", - "description": "description6", - "quantity": 40, - "quantity_delta": 114 -} +## Example + +```python +from advancedbilling.models.invoice_line_item_event_data import InvoiceLineItemEventData + +invoice_line_item_event_data = InvoiceLineItemEventData( + 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 f570e349..102039fb 100644 --- a/doc/models/invoice-line-item-pricing-detail.md +++ b/doc/models/invoice-line-item-pricing-detail.md @@ -12,12 +12,14 @@ | `label` | `str` | Optional | - | | `amount` | `str` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "label": "label0", - "amount": "amount2" -} +```python +from advancedbilling.models.invoice_line_item_pricing_detail import InvoiceLineItemPricingDetail + +invoice_line_item_pricing_detail = InvoiceLineItemPricingDetail( + label='label0', + amount='amount2' +) ``` diff --git a/doc/models/invoice-line-item.md b/doc/models/invoice-line-item.md index db1e8eea..7bc34bbb 100644 --- a/doc/models/invoice-line-item.md +++ b/doc/models/invoice-line-item.md @@ -9,19 +9,19 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `uid` | `str` | Optional | Unique identifier for the line item. Useful when cross-referencing the line against individual discounts in the `discounts` or `taxes` lists. | +| `uid` | `str` | Optional | Unique identifier for the line item. Useful when cross-referencing the line against individual discounts in the `discounts` or `taxes` lists. | | `title` | `str` | Optional | A short descriptor for the charge or item represented by this line. | -| `description` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `bool` | 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` | `str` | 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` | `str` | 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` | `bool` | 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` | `int` | Optional | - | | `product_id` | `int` | 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` | `int` | Optional | The version of the product subscribed when the charge was made. | @@ -35,15 +35,17 @@ | `kind` | `str` | 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" -} +```python +from advancedbilling.models.invoice_line_item import InvoiceLineItem + +invoice_line_item = InvoiceLineItem( + 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 c2021e9c..08eac979 100644 --- a/doc/models/invoice-payer-change.md +++ b/doc/models/invoice-payer-change.md @@ -14,14 +14,16 @@ | `organization` | `str` | Optional | - | | `email` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "first_name": "first_name2", - "last_name": "last_name0", - "organization": "organization4", - "email": "email4" -} +## Example + +```python +from advancedbilling.models.invoice_payer_change import InvoicePayerChange + +invoice_payer_change = InvoicePayerChange( + 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 4ce6f239..ccb59867 100644 --- a/doc/models/invoice-payer.md +++ b/doc/models/invoice-payer.md @@ -16,15 +16,17 @@ | `email` | `str` | Optional | - | | `vat_number` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "chargify_id": 46, - "first_name": "first_name4", - "last_name": "last_name2", - "organization": "organization8", - "email": "email2" -} +## Example + +```python +from advancedbilling.models.invoice_payer import InvoicePayer + +invoice_payer = InvoicePayer( + 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 ac33c42d..7e1d312e 100644 --- a/doc/models/invoice-payment-application.md +++ b/doc/models/invoice-payment-application.md @@ -13,13 +13,15 @@ | `application_uid` | `str` | Optional | Unique identifier for the payment. It has the prefix "pmt_" followed by alphanumeric characters. | | `applied_amount` | `str` | Optional | Dollar amount of the paid invoice. | -## Example (as JSON) - -```json -{ - "invoice_uid": "invoice_uid2", - "application_uid": "application_uid4", - "applied_amount": "applied_amount6" -} +## Example + +```python +from advancedbilling.models.invoice_payment_application import InvoicePaymentApplication + +invoice_payment_application = InvoicePaymentApplication( + 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..56b61f96 100644 --- a/doc/models/invoice-payment-method-type.md +++ b/doc/models/invoice-payment-method-type.md @@ -18,3 +18,11 @@ The type of payment method used. Defaults to other. | `ACH` | | `OTHER` | +## Example + +```python +from advancedbilling.models.invoice_payment_method_type import InvoicePaymentMethodType + +invoice_payment_method_type = InvoicePaymentMethodType.CREDIT_CARD +``` + diff --git a/doc/models/invoice-payment-method.md b/doc/models/invoice-payment-method.md index 36bbb524..e002e70b 100644 --- a/doc/models/invoice-payment-method.md +++ b/doc/models/invoice-payment-method.md @@ -18,15 +18,17 @@ | `last_four` | `str` | Optional | - | | `masked_card_number` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "details": "details8", - "kind": "kind6", - "memo": "memo2", - "type": "type8", - "card_brand": "card_brand8" -} +## Example + +```python +from advancedbilling.models.invoice_payment_method import InvoicePaymentMethod + +invoice_payment_method = InvoicePaymentMethod( + details='details2', + kind='kind0', + memo='memo6', + mtype='type2', + card_brand='card_brand4' +) ``` diff --git a/doc/models/invoice-payment-type.md b/doc/models/invoice-payment-type.md index 8283fc2f..7d1cf00d 100644 --- a/doc/models/invoice-payment-type.md +++ b/doc/models/invoice-payment-type.md @@ -16,3 +16,11 @@ The type of payment to be applied to an Invoice. Defaults to external. | `SERVICE_CREDIT` | | `PAYMENT` | +## Example + +```python +from advancedbilling.models.invoice_payment_type import InvoicePaymentType + +invoice_payment_type = InvoicePaymentType.EXTERNAL +``` + diff --git a/doc/models/invoice-payment.md b/doc/models/invoice-payment.md index 414155c1..bb31cbe9 100644 --- a/doc/models/invoice-payment.md +++ b/doc/models/invoice-payment.md @@ -22,21 +22,26 @@ | `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` | `str` | 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 + +```python +import dateutil.parser + +from advancedbilling.models.invoice_payment import InvoicePayment +from advancedbilling.models.invoice_payment_method import InvoicePaymentMethod + +invoice_payment = InvoicePayment( + transaction_time=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + memo='memo4', + original_amount='original_amount4', + applied_amount='applied_amount8', + payment_method=InvoicePaymentMethod( + details='details0', + kind='kind8', + memo='memo4', + mtype='type0', + card_brand='card_brand6' + ) +) ``` diff --git a/doc/models/invoice-pre-payment.md b/doc/models/invoice-pre-payment.md index 16a07b0c..6344955d 100644 --- a/doc/models/invoice-pre-payment.md +++ b/doc/models/invoice-pre-payment.md @@ -13,13 +13,15 @@ | `amount_in_cents` | `int` | Optional | The amount in cents of the prepayment that was created as a result of this payment. | | `ending_balance_in_cents` | `int` | 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 + +```python +from advancedbilling.models.invoice_pre_payment import InvoicePrePayment + +invoice_pre_payment = InvoicePrePayment( + 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 2e2d0f0a..3913a6f1 100644 --- a/doc/models/invoice-previous-balance.md +++ b/doc/models/invoice-previous-balance.md @@ -12,18 +12,33 @@ | `captured_at` | `datetime` | Optional | - | | `invoices` | [`List[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 + +```python +import dateutil.parser + +from advancedbilling.models.invoice_balance_item import InvoiceBalanceItem +from advancedbilling.models.invoice_previous_balance import InvoicePreviousBalance + +invoice_previous_balance = InvoicePreviousBalance( + captured_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + invoices=[ + InvoiceBalanceItem( + uid='uid6', + number='number6', + outstanding_amount='outstanding_amount8' + ), + InvoiceBalanceItem( + uid='uid6', + number='number6', + outstanding_amount='outstanding_amount8' + ), + InvoiceBalanceItem( + uid='uid6', + number='number6', + outstanding_amount='outstanding_amount8' + ) + ] +) ``` diff --git a/doc/models/invoice-refund.md b/doc/models/invoice-refund.md index 2935bf12..a5efc13e 100644 --- a/doc/models/invoice-refund.md +++ b/doc/models/invoice-refund.md @@ -19,15 +19,17 @@ | `gateway_handle` | `str` | Optional | - | | `ach_late_reject` | `bool` | Optional | - | -## Example (as JSON) - -```json -{ - "transaction_id": 172, - "payment_id": 42, - "memo": "memo6", - "original_amount": "original_amount6", - "applied_amount": "applied_amount6" -} +## Example + +```python +from advancedbilling.models.invoice_refund import InvoiceRefund + +invoice_refund = InvoiceRefund( + 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..1b661c8c 100644 --- a/doc/models/invoice-response.md +++ b/doc/models/invoice-response.md @@ -11,21 +11,26 @@ | --- | --- | --- | --- | | `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 + +```python +import dateutil.parser + +from advancedbilling.models.invoice import Invoice +from advancedbilling.models.invoice_response import InvoiceResponse + +invoice_response = InvoiceResponse( + invoice=Invoice( + id=166, + uid='uid6', + site_id=92, + customer_id=204, + subscription_id=20, + issue_date=dateutil.parser.parse('2024-01-01').date(), + due_date=dateutil.parser.parse('2024-01-01').date(), + paid_date=dateutil.parser.parse('2024-01-01').date(), + public_url_expires_on=dateutil.parser.parse('2024-01-21').date() + ) +) ``` diff --git a/doc/models/invoice-role.md b/doc/models/invoice-role.md index 2f75a786..9d08f0f9 100644 --- a/doc/models/invoice-role.md +++ b/doc/models/invoice-role.md @@ -20,3 +20,11 @@ | `BACKPORT` | | `BACKPORTBALANCERECONCILIATION` | +## Example + +```python +from advancedbilling.models.invoice_role import InvoiceRole + +invoice_role = InvoiceRole.RENEWAL +``` + diff --git a/doc/models/invoice-seller.md b/doc/models/invoice-seller.md index 543b0c60..dd06f623 100644 --- a/doc/models/invoice-seller.md +++ b/doc/models/invoice-seller.md @@ -16,20 +16,23 @@ Information about the seller (merchant) listed on the masthead of the invoice. | `phone` | `str` | Optional | - | | `logo_url` | `str` | 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 + +```python +from advancedbilling.models.invoice_address import InvoiceAddress +from advancedbilling.models.invoice_seller import InvoiceSeller + +invoice_seller = InvoiceSeller( + name='name2', + address=InvoiceAddress( + street='street6', + line_2='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..f107978f 100644 --- a/doc/models/invoice-sort-field.md +++ b/doc/models/invoice-sort-field.md @@ -20,7 +20,9 @@ ## Example -``` -total_amount +```python +from advancedbilling.models.invoice_sort_field import InvoiceSortField + +invoice_sort_field = InvoiceSortField.DUE_AMOUNT ``` diff --git a/doc/models/invoice-status.md b/doc/models/invoice-status.md index 87ba0765..855e5ef4 100644 --- a/doc/models/invoice-status.md +++ b/doc/models/invoice-status.md @@ -19,3 +19,11 @@ The current status of the invoice. See [Invoice Statuses](https://maxio.zendesk. | `CANCELED` | | `PROCESSING` | +## Example + +```python +from advancedbilling.models.invoice_status import InvoiceStatus + +invoice_status = InvoiceStatus.PROCESSING +``` + diff --git a/doc/models/invoice-tax-breakout.md b/doc/models/invoice-tax-breakout.md index 2b030cbc..c7834e08 100644 --- a/doc/models/invoice-tax-breakout.md +++ b/doc/models/invoice-tax-breakout.md @@ -14,14 +14,16 @@ | `tax_amount` | `str` | Optional | - | | `tax_exempt_amount` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid2", - "taxable_amount": "taxable_amount6", - "tax_amount": "tax_amount6", - "tax_exempt_amount": "tax_exempt_amount2" -} +## Example + +```python +from advancedbilling.models.invoice_tax_breakout import InvoiceTaxBreakout + +invoice_tax_breakout = InvoiceTaxBreakout( + 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 14413efe..699b5ec6 100644 --- a/doc/models/invoice-tax-component-breakout.md +++ b/doc/models/invoice-tax-component-breakout.md @@ -24,15 +24,17 @@ | `state_assigned_no` | `str` | Optional | - | | `tax_sub_type` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "tax_rule_id": 226, - "percentage": "percentage0", - "country_code": "country_code8", - "subdivision_code": "subdivision_code6", - "tax_amount": "tax_amount4" -} +## Example + +```python +from advancedbilling.models.invoice_tax_component_breakout import InvoiceTaxComponentBreakout + +invoice_tax_component_breakout = InvoiceTaxComponentBreakout( + 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 06b1baaa..0fbe7135 100644 --- a/doc/models/invoice-tax.md +++ b/doc/models/invoice-tax.md @@ -24,15 +24,18 @@ | `mtype` | `str` | Optional | - | | `tax_exempt_amount` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "title": "title6", - "description": "description2", - "source_type": "Tax", - "source_id": 164 -} +## Example + +```python +from advancedbilling.models.invoice_tax import InvoiceTax +from advancedbilling.models.proforma_invoice_tax_source_type import ProformaInvoiceTaxSourceType + +invoice_tax = InvoiceTax( + 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 a2740033..5c142d1f 100644 --- a/doc/models/invoice.md +++ b/doc/models/invoice.md @@ -15,11 +15,11 @@ | `customer_id` | `int` | Optional | ID of the customer to which the invoice belongs. | | `subscription_id` | `int` | Optional | ID of the subscription that generated the invoice. | | `number` | `str` | 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` | `int` | 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` | `int` | 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` | `str` | 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` | `str` | 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` | `str` | Optional | For invoices with `consolidation_level` of `child`, this specifies the UID of the parent (consolidated) invoice. | | `subscription_group_id` | `int` | Optional | - | | `parent_invoice_number` | `int` | Optional | For invoices with `consolidation_level` of `child`, this specifies the number of the parent (consolidated) invoice. | @@ -36,17 +36,17 @@ | `product_name` | `str` | Optional | The name of the product subscribed when the invoice was generated. | | `product_family_name` | `str` | 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` | `List[str]` | Optional | **Constraints**: *Maximum Items*: `5` | | `net_terms` | `int` | Optional | - | -| `memo` | `str` | Optional | The memo printed on invoices of any collection type. This message is in control of the merchant. | +| `memo` | `str` | 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` | `str` | Optional | Subtotal of the invoice, which is the sum of all line items before discounts or taxes. | | `discount_amount` | `str` | Optional | Total discount applied to the invoice. | | `tax_amount` | `str` | Optional | Total tax on the invoice. | -| `total_amount` | `str` | Optional | The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' | +| `total_amount` | `str` | Optional | The invoice total, which is `subtotal_amount - discount_amount + tax_amount`. | | `credit_amount` | `str` | Optional | The amount of credit (from credit notes) applied to this invoice.

Credits offset the amount due from the customer. | | `debit_amount` | `str` | Optional | - | | `refund_amount` | `str` | Optional | - | @@ -65,20 +65,25 @@ | `public_url` | `str` | 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` | `int` | 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 -} +```python +import dateutil.parser + +from advancedbilling.models.invoice import Invoice + +invoice = Invoice( + id=166, + uid='uid6', + site_id=92, + customer_id=204, + subscription_id=20, + issue_date=dateutil.parser.parse('2024-01-01').date(), + due_date=dateutil.parser.parse('2024-01-01').date(), + paid_date=dateutil.parser.parse('2024-01-01').date(), + public_url_expires_on=dateutil.parser.parse('2024-01-21').date() +) ``` diff --git a/doc/models/issue-advance-invoice-request.md b/doc/models/issue-advance-invoice-request.md index 640e03e9..384ce618 100644 --- a/doc/models/issue-advance-invoice-request.md +++ b/doc/models/issue-advance-invoice-request.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `force` | `bool` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "force": false -} +```python +from advancedbilling.models.issue_advance_invoice_request import IssueAdvanceInvoiceRequest + +issue_advance_invoice_request = IssueAdvanceInvoiceRequest( + force=False +) ``` diff --git a/doc/models/issue-invoice-event-data.md b/doc/models/issue-invoice-event-data.md index 02e12f7c..eedbb7f4 100644 --- a/doc/models/issue-invoice-event-data.md +++ b/doc/models/issue-invoice-event-data.md @@ -11,21 +11,25 @@ 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` | `str` | Required | Amount due on the invoice, which is `total_amount - credit_amount - paid_amount`. | | `total_amount` | `str` | 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" -} +```python +from advancedbilling.models.invoice_consolidation_level import InvoiceConsolidationLevel +from advancedbilling.models.invoice_status import InvoiceStatus +from advancedbilling.models.issue_invoice_event_data import IssueInvoiceEventData + +issue_invoice_event_data = IssueInvoiceEventData( + 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 4c5a000a..bb014cf1 100644 --- a/doc/models/issue-invoice-event.md +++ b/doc/models/issue-invoice-event.md @@ -15,31 +15,40 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"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 + +```python +import dateutil.parser + +from advancedbilling.models.invoice import Invoice +from advancedbilling.models.invoice_consolidation_level import InvoiceConsolidationLevel +from advancedbilling.models.invoice_event_type import InvoiceEventType +from advancedbilling.models.invoice_status import InvoiceStatus +from advancedbilling.models.issue_invoice_event import IssueInvoiceEvent +from advancedbilling.models.issue_invoice_event_data import IssueInvoiceEventData + +issue_invoice_event = IssueInvoiceEvent( + id=238, + timestamp=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + invoice=Invoice( + id=166, + uid='uid6', + site_id=92, + customer_id=204, + subscription_id=20, + issue_date=dateutil.parser.parse('2024-01-01').date(), + due_date=dateutil.parser.parse('2024-01-01').date(), + paid_date=dateutil.parser.parse('2024-01-01').date(), + public_url_expires_on=dateutil.parser.parse('2024-01-21').date() + ), + event_type=InvoiceEventType.ISSUE_INVOICE, + event_data=IssueInvoiceEventData( + 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 d88c9927..6a367153 100644 --- a/doc/models/issue-invoice-request.md +++ b/doc/models/issue-invoice-request.md @@ -9,13 +9,16 @@ | 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**: `"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**: `"leave_open_invoice"` | -## Example (as JSON) +## Example -```json -{ - "on_failed_payment": "leave_open_invoice" -} +```python +from advancedbilling.models.failed_payment_action import FailedPaymentAction +from advancedbilling.models.issue_invoice_request import IssueInvoiceRequest + +issue_invoice_request = IssueInvoiceRequest( + 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..66c4e507 100644 --- a/doc/models/issue-service-credit-request.md +++ b/doc/models/issue-service-credit-request.md @@ -11,14 +11,17 @@ | --- | --- | --- | --- | | `service_credit` | [`IssueServiceCredit`](../../doc/models/issue-service-credit.md) | Required | - | -## Example (as JSON) - -```json -{ - "service_credit": { - "amount": 31.42, - "memo": "memo0" - } -} +## Example + +```python +from advancedbilling.models.issue_service_credit import IssueServiceCredit +from advancedbilling.models.issue_service_credit_request import IssueServiceCreditRequest + +issue_service_credit_request = IssueServiceCreditRequest( + service_credit=IssueServiceCredit( + amount=31.42, + memo='memo0' + ) +) ``` diff --git a/doc/models/issue-service-credit.md b/doc/models/issue-service-credit.md index 7a2ac985..bf7520cd 100644 --- a/doc/models/issue-service-credit.md +++ b/doc/models/issue-service-credit.md @@ -12,12 +12,14 @@ | `amount` | float \| str | Required | This is a container for one-of cases. | | `memo` | `str` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "amount": 5.82, - "memo": "memo4" -} +```python +from advancedbilling.models.issue_service_credit import IssueServiceCredit + +issue_service_credit = IssueServiceCredit( + amount=216.68, + memo='memo6' +) ``` diff --git a/doc/models/item-category.md b/doc/models/item-category.md index 8a73b8c3..63038969 100644 --- a/doc/models/item-category.md +++ b/doc/models/item-category.md @@ -19,7 +19,9 @@ One of the following: Business Software, Consumer Software, Digital Services, Ph ## Example -``` -Business Software +```python +from advancedbilling.models.item_category import ItemCategory + +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 96a215b8..7e115967 100644 --- a/doc/models/item-price-point-changed.md +++ b/doc/models/item-price-point-changed.md @@ -16,24 +16,27 @@ | `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 + +```python +from advancedbilling.models.item_price_point_changed import ItemPricePointChanged +from advancedbilling.models.item_price_point_data import ItemPricePointData + +item_price_point_changed = ItemPricePointChanged( + item_id=66, + item_type='item_type2', + item_handle='item_handle0', + item_name='item_name4', + previous_price_point=ItemPricePointData( + id=216, + handle='handle6', + name='name0' + ), + current_price_point=ItemPricePointData( + 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 eec08e9d..3c7ed817 100644 --- a/doc/models/item-price-point-data.md +++ b/doc/models/item-price-point-data.md @@ -13,13 +13,15 @@ | `handle` | `str` | Optional | - | | `name` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 192, - "handle": "handle6", - "name": "name0" -} +## Example + +```python +from advancedbilling.models.item_price_point_data import ItemPricePointData + +item_price_point_data = ItemPricePointData( + id=180, + handle='handle2', + name='name6' +) ``` diff --git a/doc/models/line-item-kind.md b/doc/models/line-item-kind.md index 380d29ea..692ee069 100644 --- a/doc/models/line-item-kind.md +++ b/doc/models/line-item-kind.md @@ -22,3 +22,11 @@ A handle for the line item kind | `COUPON` | | `TAX` | +## Example + +```python +from advancedbilling.models.line_item_kind import LineItemKind + +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..16525c54 100644 --- a/doc/models/line-item-transaction-type.md +++ b/doc/models/line-item-transaction-type.md @@ -19,3 +19,11 @@ A handle for the line item transaction type | `INFO_TRANSACTION` | | `PAYMENT_AUTHORIZATION` | +## Example + +```python +from advancedbilling.models.line_item_transaction_type import LineItemTransactionType + +line_item_transaction_type = LineItemTransactionType.REFUND +``` + diff --git a/doc/models/list-components-filter.md b/doc/models/list-components-filter.md index d205da1a..aacafc22 100644 --- a/doc/models/list-components-filter.md +++ b/doc/models/list-components-filter.md @@ -12,16 +12,18 @@ | `ids` | `List[int]` | 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` | `bool` | 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) - -```json -{ - "ids": [ - 1, - 2, - 3 - ], - "use_site_exchange_rate": false -} +## Example + +```python +from advancedbilling.models.list_components_filter import ListComponentsFilter + +list_components_filter = ListComponentsFilter( + ids=[ + 1, + 2, + 3 + ], + 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..800c5f00 100644 --- a/doc/models/list-components-price-points-include.md +++ b/doc/models/list-components-price-points-include.md @@ -13,7 +13,9 @@ ## Example -``` -currency_prices +```python +from advancedbilling.models.list_components_price_points_include import ListComponentsPricePointsInclude + +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 455b1cac..5b6b7b40 100644 --- a/doc/models/list-components-price-points-response.md +++ b/doc/models/list-components-price-points-response.md @@ -11,19 +11,24 @@ | --- | --- | --- | --- | | `price_points` | [`List[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 + +```python +from advancedbilling.models.component_price_point import ComponentPricePoint +from advancedbilling.models.list_components_price_points_response import ListComponentsPricePointsResponse +from advancedbilling.models.price_point_type import PricePointType +from advancedbilling.models.pricing_scheme import PricingScheme + +list_components_price_points_response = ListComponentsPricePointsResponse( + price_points=[ + ComponentPricePoint( + id=40, + mtype=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 9a2e6301..5a689586 100644 --- a/doc/models/list-coupons-filter.md +++ b/doc/models/list-coupons-filter.md @@ -19,24 +19,29 @@ | `use_site_exchange_rate` | `bool` | 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` | `bool` | 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": [ - 1, - 2, - 3 - ], - "codes": [ - "free", - "free_trial" - ], - "date_field": "updated_at" -} +## Example + +```python +import dateutil.parser + +from advancedbilling.models.basic_date_field import BasicDateField +from advancedbilling.models.list_coupons_filter import ListCouponsFilter + +list_coupons_filter = ListCouponsFilter( + date_field=BasicDateField.UPDATED_AT, + start_date=dateutil.parser.parse('2011-12-17').date(), + end_date=dateutil.parser.parse('2011-12-15').date(), + start_datetime=dateutil.parser.parse('2011-12-19T09:15:30+00:00'), + end_datetime=dateutil.parser.parse('2019-06-07T17:20:06Z'), + ids=[ + 1, + 2, + 3 + ], + codes=[ + 'free', + 'free_trial' + ] +) ``` diff --git a/doc/models/list-credit-notes-response.md b/doc/models/list-credit-notes-response.md index f251c0e0..3faa24ef 100644 --- a/doc/models/list-credit-notes-response.md +++ b/doc/models/list-credit-notes-response.md @@ -11,19 +11,22 @@ | --- | --- | --- | --- | | `credit_notes` | [`List[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 + +```python +from advancedbilling.models.credit_note import CreditNote +from advancedbilling.models.list_credit_notes_response import ListCreditNotesResponse + +list_credit_notes_response = ListCreditNotesResponse( + credit_notes=[ + CreditNote( + 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..938a60d7 100644 --- a/doc/models/list-events-date-field.md +++ b/doc/models/list-events-date-field.md @@ -13,7 +13,9 @@ ## Example -``` -created_at +```python +from advancedbilling.models.list_events_date_field import ListEventsDateField + +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 e87a0c5c..751a8dc6 100644 --- a/doc/models/list-invoice-events-response.md +++ b/doc/models/list-invoice-events-response.md @@ -14,52 +14,61 @@ | `per_page` | `int` | Optional | - | | `total_pages` | `int` | 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" - } - ] - } - } - ], - "page": 184, - "per_page": 96, - "total_pages": 194 -} +```python +import dateutil.parser + +from advancedbilling.models.applied_credit_note_data import AppliedCreditNoteData +from advancedbilling.models.apply_credit_note_event import ApplyCreditNoteEvent +from advancedbilling.models.apply_credit_note_event_data import ApplyCreditNoteEventData +from advancedbilling.models.invoice import Invoice +from advancedbilling.models.invoice_event_type import InvoiceEventType +from advancedbilling.models.list_invoice_events_response import ListInvoiceEventsResponse + +list_invoice_events_response = ListInvoiceEventsResponse( + events=[ + ApplyCreditNoteEvent( + id=214, + timestamp=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + invoice=Invoice( + id=166, + uid='uid6', + site_id=92, + customer_id=204, + subscription_id=20 + ), + event_type=InvoiceEventType.APPLY_CREDIT_NOTE, + event_data=ApplyCreditNoteEventData( + uid='uid6', + credit_note_number='credit_note_number0', + credit_note_uid='credit_note_uid0', + original_amount='original_amount0', + applied_amount='applied_amount2', + transaction_time=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + memo='memo0', + role='role0', + consolidated_invoice=False, + applied_credit_notes=[ + AppliedCreditNoteData( + uid='uid4', + number='number8' + ), + AppliedCreditNoteData( + uid='uid4', + number='number8' + ), + AppliedCreditNoteData( + uid='uid4', + number='number8' + ) + ] + ) + ) + ], + 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 17f90abe..d0f4c8ed 100644 --- a/doc/models/list-invoices-response.md +++ b/doc/models/list-invoices-response.md @@ -11,23 +11,28 @@ | --- | --- | --- | --- | | `invoices` | [`List[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 + +```python +import dateutil.parser + +from advancedbilling.models.invoice import Invoice +from advancedbilling.models.list_invoices_response import ListInvoicesResponse + +list_invoices_response = ListInvoicesResponse( + invoices=[ + Invoice( + id=196, + uid='uid6', + site_id=122, + customer_id=234, + subscription_id=50, + issue_date=dateutil.parser.parse('2024-01-01').date(), + due_date=dateutil.parser.parse('2024-01-01').date(), + paid_date=dateutil.parser.parse('2024-01-01').date(), + public_url_expires_on=dateutil.parser.parse('2024-01-21').date() + ) + ] +) ``` diff --git a/doc/models/list-metafields-response.md b/doc/models/list-metafields-response.md index fca5bc37..2c76138e 100644 --- a/doc/models/list-metafields-response.md +++ b/doc/models/list-metafields-response.md @@ -15,29 +15,61 @@ | `per_page` | `int` | Optional | - | | `metafields` | [`List[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 + +```python +from advancedbilling.models.include_option import IncludeOption +from advancedbilling.models.list_metafields_response import ListMetafieldsResponse +from advancedbilling.models.metafield import Metafield +from advancedbilling.models.metafield_input import MetafieldInput +from advancedbilling.models.metafield_scope import MetafieldScope + +list_metafields_response = ListMetafieldsResponse( + total_count=70, + current_page=46, + total_pages=58, + per_page=232, + metafields=[ + Metafield( + id=22, + name='name2', + scope=MetafieldScope( + 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( + id=22, + name='name2', + scope=MetafieldScope( + 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( + id=22, + name='name2', + scope=MetafieldScope( + 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 0137b000..e3da1ca9 100644 --- a/doc/models/list-mrr-filter.md +++ b/doc/models/list-mrr-filter.md @@ -11,15 +11,17 @@ | --- | --- | --- | --- | | `subscription_ids` | `List[int]` | Optional | Submit ids in order to limit results. Use in query: `filter[subscription_ids]=1,2,3`.

**Constraints**: *Minimum Items*: `1` | -## Example (as JSON) - -```json -{ - "subscription_ids": [ - 1, - 2, - 3 - ] -} +## Example + +```python +from advancedbilling.models.list_mrr_filter import ListMrrFilter + +list_mrr_filter = ListMrrFilter( + subscription_ids=[ + 1, + 2, + 3 + ] +) ``` diff --git a/doc/models/list-mrr-response-result.md b/doc/models/list-mrr-response-result.md index 06735a4c..a6ca565e 100644 --- a/doc/models/list-mrr-response-result.md +++ b/doc/models/list-mrr-response-result.md @@ -17,15 +17,17 @@ | `currency_symbol` | `str` | Optional | - | | `movements` | [`List[Movement]`](../../doc/models/movement.md) | Optional | - | -## Example (as JSON) - -```json -{ - "page": 150, - "per_page": 238, - "total_pages": 16, - "total_entries": 112, - "currency": "currency8" -} +## Example + +```python +from advancedbilling.models.list_mrr_response_result import ListMRRResponseResult + +list_mrr_response_result = ListMRRResponseResult( + 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..4c0790ba 100644 --- a/doc/models/list-mrr-response.md +++ b/doc/models/list-mrr-response.md @@ -11,17 +11,20 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.list_mrr_response import ListMRRResponse +from advancedbilling.models.list_mrr_response_result import ListMRRResponseResult + +list_mrr_response = ListMRRResponse( + mrr=ListMRRResponseResult( + 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 e8afcc0f..b49b3399 100644 --- a/doc/models/list-offers-response.md +++ b/doc/models/list-offers-response.md @@ -11,33 +11,29 @@ | --- | --- | --- | --- | | `offers` | [`List[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 + +```python +from advancedbilling.models.list_offers_response import ListOffersResponse +from advancedbilling.models.offer import Offer + +list_offers_response = ListOffersResponse( + offers=[ + Offer( + id=12, + site_id=194, + product_family_id=16, + product_id=210, + product_price_point_id=134 + ), + Offer( + 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..eba7c0c3 100644 --- a/doc/models/list-prepayment-date-field.md +++ b/doc/models/list-prepayment-date-field.md @@ -14,7 +14,9 @@ ## Example -``` -created_at +```python +from advancedbilling.models.list_prepayment_date_field import ListPrepaymentDateField + +list_prepayment_date_field = ListPrepaymentDateField.CREATED_AT ``` diff --git a/doc/models/list-prepayments-filter.md b/doc/models/list-prepayments-filter.md index 1b4244bf..91224f91 100644 --- a/doc/models/list-prepayments-filter.md +++ b/doc/models/list-prepayments-filter.md @@ -13,13 +13,18 @@ | `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 + +```python +import dateutil.parser + +from advancedbilling.models.list_prepayment_date_field import ListPrepaymentDateField +from advancedbilling.models.list_prepayments_filter import ListPrepaymentsFilter + +list_prepayments_filter = ListPrepaymentsFilter( + date_field=ListPrepaymentDateField.CREATED_AT, + start_date=dateutil.parser.parse('2024-01-01').date(), + end_date=dateutil.parser.parse('2024-01-31').date() +) ``` diff --git a/doc/models/list-price-points-filter.md b/doc/models/list-price-points-filter.md index 3533e83e..cd3f795e 100644 --- a/doc/models/list-price-points-filter.md +++ b/doc/models/list-price-points-filter.md @@ -18,25 +18,31 @@ | `ids` | `List[int]` | 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" - ], - "ids": [ - 1, - 2, - 3 - ], - "date_field": "updated_at" -} +## Example + +```python +import dateutil.parser + +from advancedbilling.models.basic_date_field import BasicDateField +from advancedbilling.models.list_price_points_filter import ListPricePointsFilter +from advancedbilling.models.price_point_type import PricePointType + +list_price_points_filter = ListPricePointsFilter( + date_field=BasicDateField.UPDATED_AT, + start_date=dateutil.parser.parse('2011-12-17').date(), + end_date=dateutil.parser.parse('2011-12-15').date(), + start_datetime=dateutil.parser.parse('2011-12-19T09:15:30+00:00'), + end_datetime=dateutil.parser.parse('2019-06-07T17:20:06Z'), + mtype=[ + PricePointType.CATALOG, + PricePointType.DEFAULT, + PricePointType.CUSTOM + ], + ids=[ + 1, + 2, + 3 + ] +) ``` diff --git a/doc/models/list-product-price-points-response.md b/doc/models/list-product-price-points-response.md index 07a19f4c..0798aa6e 100644 --- a/doc/models/list-product-price-points-response.md +++ b/doc/models/list-product-price-points-response.md @@ -11,19 +11,22 @@ | --- | --- | --- | --- | | `price_points` | [`List[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 + +```python +from advancedbilling.models.list_product_price_points_response import ListProductPricePointsResponse +from advancedbilling.models.product_price_point import ProductPricePoint + +list_product_price_points_response = ListProductPricePointsResponse( + price_points=[ + ProductPricePoint( + 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 bc2272cd..bdaf3bf5 100644 --- a/doc/models/list-products-filter.md +++ b/doc/models/list-products-filter.md @@ -13,19 +13,20 @@ | `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` | `bool` | 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) - -```json -{ - "ids": [ - 1, - 2, - 3 - ], - "prepaid_product_price_point": { - "product_price_point_id": "product_price_point_id2" - }, - "use_site_exchange_rate": false -} +## Example + +```python +from advancedbilling.models.list_products_filter import ListProductsFilter +from advancedbilling.models.prepaid_product_price_point_filter import PrepaidProductPricePointFilter + +list_products_filter = ListProductsFilter( + ids=[ + 1, + 2, + 3 + ], + prepaid_product_price_point=PrepaidProductPricePointFilter(), + use_site_exchange_rate=False +) ``` diff --git a/doc/models/list-products-include.md b/doc/models/list-products-include.md index f2847330..7bcd41c4 100644 --- a/doc/models/list-products-include.md +++ b/doc/models/list-products-include.md @@ -13,7 +13,9 @@ ## Example -``` -prepaid_product_price_point +```python +from advancedbilling.models.list_products_include import ListProductsInclude + +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..26245c01 100644 --- a/doc/models/list-products-price-points-include.md +++ b/doc/models/list-products-price-points-include.md @@ -13,7 +13,9 @@ ## Example -``` -currency_prices +```python +from advancedbilling.models.list_products_price_points_include import ListProductsPricePointsInclude + +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 7a9b02e1..9b8c36ad 100644 --- a/doc/models/list-proforma-invoices-meta.md +++ b/doc/models/list-proforma-invoices-meta.md @@ -14,14 +14,16 @@ | `total_pages` | `int` | Optional | - | | `status_code` | `int` | Optional | - | -## Example (as JSON) - -```json -{ - "total_count": 226, - "current_page": 202, - "total_pages": 214, - "status_code": 244 -} +## Example + +```python +from advancedbilling.models.list_proforma_invoices_meta import ListProformaInvoicesMeta + +list_proforma_invoices_meta = ListProformaInvoicesMeta( + 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 b793596b..e0d114c5 100644 --- a/doc/models/list-proforma-invoices-response.md +++ b/doc/models/list-proforma-invoices-response.md @@ -12,39 +12,43 @@ | `proforma_invoices` | [`List[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 - } - ], - "meta": { - "total_count": 150, - "current_page": 126, - "total_pages": 138, - "status_code": 168 - } -} +## Example + +```python +from advancedbilling.models.list_proforma_invoices_meta import ListProformaInvoicesMeta +from advancedbilling.models.list_proforma_invoices_response import ListProformaInvoicesResponse +from advancedbilling.models.proforma_invoice import ProformaInvoice + +list_proforma_invoices_response = ListProformaInvoicesResponse( + proforma_invoices=[ + ProformaInvoice( + uid='uid0', + site_id=140, + customer_id=252, + subscription_id=68, + number=56 + ), + ProformaInvoice( + uid='uid0', + site_id=140, + customer_id=252, + subscription_id=68, + number=56 + ), + ProformaInvoice( + uid='uid0', + site_id=140, + customer_id=252, + subscription_id=68, + number=56 + ) + ], + meta=ListProformaInvoicesMeta( + 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 fac3b04d..8beeec4a 100644 --- a/doc/models/list-public-keys-meta.md +++ b/doc/models/list-public-keys-meta.md @@ -14,14 +14,16 @@ | `total_pages` | `int` | Optional | - | | `per_page` | `int` | Optional | - | -## Example (as JSON) - -```json -{ - "total_count": 22, - "current_page": 254, - "total_pages": 10, - "per_page": 24 -} +## Example + +```python +from advancedbilling.models.list_public_keys_meta import ListPublicKeysMeta + +list_public_keys_meta = ListPublicKeysMeta( + 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 791d34c2..e009a46f 100644 --- a/doc/models/list-public-keys-response.md +++ b/doc/models/list-public-keys-response.md @@ -12,28 +12,34 @@ | `chargify_js_keys` | [`List[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" - } - ], - "meta": { - "total_count": 150, - "current_page": 126, - "total_pages": 138, - "per_page": 152 - } -} +## Example + +```python +import dateutil.parser + +from advancedbilling.models.list_public_keys_meta import ListPublicKeysMeta +from advancedbilling.models.list_public_keys_response import ListPublicKeysResponse +from advancedbilling.models.public_key import PublicKey + +list_public_keys_response = ListPublicKeysResponse( + chargify_js_keys=[ + PublicKey( + public_key='public_key8', + requires_security_token=False, + created_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') + ), + PublicKey( + public_key='public_key8', + requires_security_token=False, + created_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') + ) + ], + meta=ListPublicKeysMeta( + 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 f5e0a239..ecf61e87 100644 --- a/doc/models/list-sale-rep-item.md +++ b/doc/models/list-sale-rep-item.md @@ -15,31 +15,34 @@ | `mrr_data` | [`Dict[str, SaleRepItemMrr]`](../../doc/models/sale-rep-item-mrr.md) | Optional | - | | `test_mode` | `bool` | Optional | - | -## Example (as JSON) - -```json -{ - "mrr_data": { - "november_2019": { - "mrr": "$0.00", - "usage": "$0.00", - "recurring": "$0.00" +## Example + +```python +from advancedbilling.models.list_sale_rep_item import ListSaleRepItem +from advancedbilling.models.sale_rep_item_mrr import SaleRepItemMrr + +list_sale_rep_item = ListSaleRepItem( + id=124, + full_name='full_name8', + subscriptions_count=56, + mrr_data={ + 'november_2019': SaleRepItemMrr( + mrr='$0.00', + usage='$0.00', + recurring='$0.00' + ), + 'december_2019': SaleRepItemMrr( + mrr='$0.00', + usage='$0.00', + recurring='$0.00' + ), + 'january_2020': SaleRepItemMrr( + mrr='$400.00', + usage='$0.00', + recurring='$400.00' + ) }, - "december_2019": { - "mrr": "$0.00", - "usage": "$0.00", - "recurring": "$0.00" - }, - "january_2020": { - "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 7626cfd9..e60d0f43 100644 --- a/doc/models/list-segments-filter.md +++ b/doc/models/list-segments-filter.md @@ -14,14 +14,16 @@ | `segment_property_3_value` | `str` | 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` | `str` | 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 + +```python +from advancedbilling.models.list_segments_filter import ListSegmentsFilter + +list_segments_filter = ListSegmentsFilter( + 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 8a52adfb..1bc72d0a 100644 --- a/doc/models/list-segments-response.md +++ b/doc/models/list-segments-response.md @@ -11,19 +11,23 @@ | --- | --- | --- | --- | | `segments` | [`List[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 + +```python +from advancedbilling.models.list_segments_response import ListSegmentsResponse +from advancedbilling.models.pricing_scheme import PricingScheme +from advancedbilling.models.segment import Segment + +list_segments_response = ListSegmentsResponse( + segments=[ + Segment( + 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 b39e8887..e5e9fe95 100644 --- a/doc/models/list-service-credits-response.md +++ b/doc/models/list-service-credits-response.md @@ -11,26 +11,23 @@ | --- | --- | --- | --- | | `service_credits` | [`List[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 + +```python +from advancedbilling.models.list_service_credits_response import ListServiceCreditsResponse +from advancedbilling.models.service_credit_1 import ServiceCredit1 +from advancedbilling.models.service_credit_type import ServiceCreditType + +list_service_credits_response = ListServiceCreditsResponse( + service_credits=[ + ServiceCredit1( + 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 109c7c4a..4c07a296 100644 --- a/doc/models/list-subscription-components-filter.md +++ b/doc/models/list-subscription-components-filter.md @@ -12,15 +12,17 @@ | `currencies` | `List[str]` | 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` | `bool` | 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) - -```json -{ - "currencies": [ - "EUR", - "USD" - ], - "use_site_exchange_rate": false -} +## Example + +```python +from advancedbilling.models.list_subscription_components_filter import ListSubscriptionComponentsFilter + +list_subscription_components_filter = ListSubscriptionComponentsFilter( + currencies=[ + 'EUR', + 'USD' + ], + 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 53b97a73..f4224bf6 100644 --- a/doc/models/list-subscription-components-for-site-filter.md +++ b/doc/models/list-subscription-components-for-site-filter.md @@ -13,26 +13,33 @@ | `use_site_exchange_rate` | `bool` | 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) - -```json -{ - "currencies": [ - "EUR", - "USD" - ], - "use_site_exchange_rate": false, - "subscription": { - "states": [ - "active", - "canceled", - "expired" +## Example + +```python +import dateutil.parser + +from advancedbilling.models.list_subscription_components_for_site_filter import ListSubscriptionComponentsForSiteFilter +from advancedbilling.models.subscription_filter import SubscriptionFilter +from advancedbilling.models.subscription_list_date_field import SubscriptionListDateField +from advancedbilling.models.subscription_state_filter import SubscriptionStateFilter + +list_subscription_components_for_site_filter = ListSubscriptionComponentsForSiteFilter( + currencies=[ + 'EUR', + 'USD' ], - "date_field": "updated_at", - "start_date": "2016-03-13", - "end_date": "2016-03-13", - "start_datetime": "2016-03-13T12:52:32.123Z" - } -} + use_site_exchange_rate=False, + subscription=SubscriptionFilter( + states=[ + SubscriptionStateFilter.TRIALING, + SubscriptionStateFilter.UNPAID, + SubscriptionStateFilter.ACTIVE + ], + date_field=SubscriptionListDateField.UPDATED_AT, + start_date=dateutil.parser.parse('2016-03-13').date(), + end_date=dateutil.parser.parse('2016-03-13').date(), + start_datetime=dateutil.parser.parse('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..3e58d01d 100644 --- a/doc/models/list-subscription-components-include.md +++ b/doc/models/list-subscription-components-include.md @@ -14,7 +14,9 @@ ## Example -``` -subscription +```python +from advancedbilling.models.list_subscription_components_include import ListSubscriptionComponentsInclude + +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 ba7fe22a..42b4f134 100644 --- a/doc/models/list-subscription-components-response.md +++ b/doc/models/list-subscription-components-response.md @@ -11,19 +11,23 @@ | --- | --- | --- | --- | | `subscriptions_components` | [`List[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 + +```python +from advancedbilling.models.component_kind import ComponentKind +from advancedbilling.models.list_subscription_components_response import ListSubscriptionComponentsResponse +from advancedbilling.models.subscription_component import SubscriptionComponent + +list_subscription_components_response = ListSubscriptionComponentsResponse( + subscriptions_components=[ + SubscriptionComponent( + 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..e28d4b9a 100644 --- a/doc/models/list-subscription-components-sort.md +++ b/doc/models/list-subscription-components-sort.md @@ -14,7 +14,9 @@ ## Example -``` -updated_at +```python +from advancedbilling.models.list_subscription_components_sort import ListSubscriptionComponentsSort + +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 54% rename from doc/models/list-subcription-group-prepayment-item.md rename to doc/models/list-subscription-group-prepayment-item.md index a29ab45c..7208b373 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,17 @@ | `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" -} +```python +from advancedbilling.models.list_subscription_group_prepayment_item import ListSubscriptionGroupPrepaymentItem + +list_subscription_group_prepayment_item = ListSubscriptionGroupPrepaymentItem( + 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 23371d16..430cd344 100644 --- a/doc/models/list-subscription-group-prepayment-response.md +++ b/doc/models/list-subscription-group-prepayment-response.md @@ -11,21 +11,25 @@ | --- | --- | --- | --- | | `prepayments` | [`List[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 + +```python +from advancedbilling.models.list_subscription_group_prepayment import ListSubscriptionGroupPrepayment +from advancedbilling.models.list_subscription_group_prepayment_item import ListSubscriptionGroupPrepaymentItem +from advancedbilling.models.list_subscription_group_prepayment_response import ListSubscriptionGroupPrepaymentResponse + +list_subscription_group_prepayment_response = ListSubscriptionGroupPrepaymentResponse( + prepayments=[ + ListSubscriptionGroupPrepayment( + prepayment=ListSubscriptionGroupPrepaymentItem( + 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..5928eea1 100644 --- a/doc/models/list-subscription-group-prepayment.md +++ b/doc/models/list-subscription-group-prepayment.md @@ -9,19 +9,22 @@ | 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 + +```python +from advancedbilling.models.list_subscription_group_prepayment import ListSubscriptionGroupPrepayment +from advancedbilling.models.list_subscription_group_prepayment_item import ListSubscriptionGroupPrepaymentItem + +list_subscription_group_prepayment = ListSubscriptionGroupPrepayment( + prepayment=ListSubscriptionGroupPrepaymentItem( + 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 5efcca4d..4cf7d5e7 100644 --- a/doc/models/list-subscription-groups-item.md +++ b/doc/models/list-subscription-groups-item.md @@ -21,17 +21,21 @@ | `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 + +```python +from advancedbilling.models.list_subscription_groups_item import ListSubscriptionGroupsItem + +list_subscription_groups_item = ListSubscriptionGroupsItem( + 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 883ddfcd..744bbbba 100644 --- a/doc/models/list-subscription-groups-meta.md +++ b/doc/models/list-subscription-groups-meta.md @@ -12,12 +12,14 @@ | `current_page` | `int` | Optional | - | | `total_count` | `int` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "current_page": 14, - "total_count": 38 -} +```python +from advancedbilling.models.list_subscription_groups_meta import ListSubscriptionGroupsMeta + +list_subscription_groups_meta = ListSubscriptionGroupsMeta( + 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 5553dcbb..31ad37d8 100644 --- a/doc/models/list-subscription-groups-response.md +++ b/doc/models/list-subscription-groups-response.md @@ -12,43 +12,38 @@ | `subscription_groups` | [`List[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": [ - 40 - ] - }, - { - "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 - } -} +## Example + +```python +from advancedbilling.models.list_subscription_groups_item import ListSubscriptionGroupsItem +from advancedbilling.models.list_subscription_groups_meta import ListSubscriptionGroupsMeta +from advancedbilling.models.list_subscription_groups_response import ListSubscriptionGroupsResponse + +list_subscription_groups_response = ListSubscriptionGroupsResponse( + subscription_groups=[ + ListSubscriptionGroupsItem( + uid='uid2', + scheme=166, + customer_id=186, + payment_profile_id=162, + subscription_ids=[ + 40 + ] + ), + ListSubscriptionGroupsItem( + uid='uid2', + scheme=166, + customer_id=186, + payment_profile_id=162, + subscription_ids=[ + 40 + ] + ) + ], + meta=ListSubscriptionGroupsMeta( + current_page=126, + total_count=150 + ) +) ``` diff --git a/doc/models/metadata.md b/doc/models/metadata.md index 4b263aea..858db700 100644 --- a/doc/models/metadata.md +++ b/doc/models/metadata.md @@ -16,15 +16,19 @@ | `deleted_at` | `datetime` | Optional | - | | `metafield_id` | `int` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 12, - "value": "value0", - "resource_id": 96, - "name": "name8", - "deleted_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```python +import dateutil.parser + +from advancedbilling.models.metadata import Metadata + +metadata = Metadata( + id=50, + value='value8', + resource_id=134, + name='name6', + deleted_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/metafield-input.md b/doc/models/metafield-input.md index 75443bd3..c1b0427d 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,11 @@ Indicates the type of metafield. A text metafield allows any string value. Dropd | `RADIO` | | `DROPDOWN` | +## Example + +```python +from advancedbilling.models.metafield_input import MetafieldInput + +metafield_input = MetafieldInput.RADIO +``` + diff --git a/doc/models/metafield-scope.md b/doc/models/metafield-scope.md index 7ddc6dac..8bdd6dbd 100644 --- a/doc/models/metafield-scope.md +++ b/doc/models/metafield-scope.md @@ -19,15 +19,18 @@ 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` | `List[str]` | Optional | - | -## Example (as JSON) - -```json -{ - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0" -} +## Example + +```python +from advancedbilling.models.include_option import IncludeOption +from advancedbilling.models.metafield_scope import MetafieldScope + +metafield_scope = MetafieldScope( + 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 419d80f5..9ebab104 100644 --- a/doc/models/metafield.md +++ b/doc/models/metafield.md @@ -13,24 +13,29 @@ | `name` | `str` | 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` | `int` | 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` | str \| List[str] \| None | 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 + +```python +from advancedbilling.models.include_option import IncludeOption +from advancedbilling.models.metafield import Metafield +from advancedbilling.models.metafield_input import MetafieldInput +from advancedbilling.models.metafield_scope import MetafieldScope + +metafield = Metafield( + id=242, + name='name4', + scope=MetafieldScope( + 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 9fb7b725..fe7800f2 100644 --- a/doc/models/metered-component.md +++ b/doc/models/metered-component.md @@ -9,10 +9,10 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `name` | `str` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | -| `unit_name` | `str` | 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` | `str` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "Minutes". | +| `unit_name` | `str` | 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` | `str` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | -| `handle` | `str` | 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` | `str` | 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` | `bool` | 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` | [`List[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,66 @@ | `display_on_hosted_page` | `bool` | Optional | - | | `allow_fractional_quantities` | `bool` | Optional | - | | `public_signup_page_ids` | `List[int]` | Optional | - | -| `interval` | `int` | 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` | `int` | 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` | `str` | 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 - } - ], - "price_points": [ - { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" - } - ] -} +## Example + +```python +from advancedbilling.models.component_price_point_item import ComponentPricePointItem +from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.metered_component import MeteredComponent +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme + +metered_component = MeteredComponent( + name='name0', + unit_name='unit_name2', + pricing_scheme=PricingScheme.STAIRSTEP, + description='description0', + handle='handle6', + taxable=False, + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ), + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ), + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ) + ], + price_points=[ + ComponentPricePointItem( + name='name2', + handle='handle8', + pricing_scheme=PricingScheme.PER_UNIT, + interval=92, + interval_unit=IntervalUnit.DAY + ), + ComponentPricePointItem( + name='name2', + handle='handle8', + pricing_scheme=PricingScheme.PER_UNIT, + interval=92, + interval_unit=IntervalUnit.DAY + ), + ComponentPricePointItem( + 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 8f444e0b..79055fa0 100644 --- a/doc/models/metered-usage.md +++ b/doc/models/metered-usage.md @@ -10,22 +10,24 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `previous_unit_balance` | `str` | Required | **Constraints**: *Minimum Length*: `1` | -| `new_unit_balance` | `int` | Required | - | +| `new_unit_balance` | int \| str | Required | This is a container for one-of cases. | | `usage_quantity` | `int` | Required | - | | `component_id` | `int` | Required | - | | `component_handle` | `str` | Required | - | | `memo` | `str` | 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 + +```python +from advancedbilling.models.metered_usage import MeteredUsage + +metered_usage = MeteredUsage( + 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 a1d39901..5b25d018 100644 --- a/doc/models/movement-line-item.md +++ b/doc/models/movement-line-item.md @@ -19,15 +19,17 @@ | `prev_quantity` | `int` | Optional | - | | `recurring` | `bool` | 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 + +```python +from advancedbilling.models.movement_line_item import MovementLineItem + +movement_line_item = MovementLineItem( + 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 c6f5daa0..4d230d63 100644 --- a/doc/models/movement.md +++ b/doc/models/movement.md @@ -19,15 +19,19 @@ | `subscription_id` | `int` | Optional | - | | `subscriber_name` | `str` | 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 + +```python +import dateutil.parser + +from advancedbilling.models.movement import Movement + +movement = Movement( + timestamp=dateutil.parser.parse('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 b10d7ef2..44b3a3a4 100644 --- a/doc/models/mrr-movement.md +++ b/doc/models/mrr-movement.md @@ -14,14 +14,16 @@ | `subscriber_delta` | `int` | Optional | - | | `lead_delta` | `int` | Optional | - | -## Example (as JSON) - -```json -{ - "amount": 210, - "category": "category0", - "subscriber_delta": 170, - "lead_delta": 198 -} +## Example + +```python +from advancedbilling.models.mrr_movement import MRRMovement + +mrr_movement = MRRMovement( + 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..41079b4a 100644 --- a/doc/models/mrr-response.md +++ b/doc/models/mrr-response.md @@ -11,22 +11,26 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.breakouts import Breakouts +from advancedbilling.models.mrr import MRR +from advancedbilling.models.mrr_response import MRRResponse + +mrr_response = MRRResponse( + mrr=MRR( + amount_in_cents=198, + amount_formatted='amount_formatted6', + currency='currency4', + currency_symbol='currency_symbol2', + breakouts=Breakouts( + 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 8294207c..b34ab5d3 100644 --- a/doc/models/mrr.md +++ b/doc/models/mrr.md @@ -16,20 +16,23 @@ | `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 + +```python +from advancedbilling.models.breakouts import Breakouts +from advancedbilling.models.mrr import MRR + +mrr = MRR( + amount_in_cents=198, + amount_formatted='amount_formatted6', + currency='currency4', + currency_symbol='currency_symbol2', + breakouts=Breakouts( + 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..429cba79 100644 --- a/doc/models/multi-invoice-payment-response.md +++ b/doc/models/multi-invoice-payment-response.md @@ -11,32 +11,36 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.invoice_payment_application import InvoicePaymentApplication +from advancedbilling.models.multi_invoice_payment import MultiInvoicePayment +from advancedbilling.models.multi_invoice_payment_response import MultiInvoicePaymentResponse + +multi_invoice_payment_response = MultiInvoicePaymentResponse( + payment=MultiInvoicePayment( + transaction_id=224, + total_amount='total_amount2', + currency_code='currency_code2', + applications=[ + InvoicePaymentApplication( + invoice_uid='invoice_uid8', + application_uid='application_uid8', + applied_amount='applied_amount0' + ), + InvoicePaymentApplication( + invoice_uid='invoice_uid8', + application_uid='application_uid8', + applied_amount='applied_amount0' + ), + InvoicePaymentApplication( + 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 f896634f..2c09f1de 100644 --- a/doc/models/multi-invoice-payment.md +++ b/doc/models/multi-invoice-payment.md @@ -14,20 +14,23 @@ | `currency_code` | `str` | Optional | The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. | | `applications` | [`List[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 + +```python +from advancedbilling.models.invoice_payment_application import InvoicePaymentApplication +from advancedbilling.models.multi_invoice_payment import MultiInvoicePayment + +multi_invoice_payment = MultiInvoicePayment( + transaction_id=238, + total_amount='total_amount0', + currency_code='currency_code0', + applications=[ + InvoicePaymentApplication( + 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 7780dd9a..b1ab537b 100644 --- a/doc/models/nested-subscription-group.md +++ b/doc/models/nested-subscription-group.md @@ -14,14 +14,16 @@ | `primary_subscription_id` | `int` | Optional | The subscription ID of the primary within the group. Applicable to scheme 1. | | `primary` | `bool` | 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 + +```python +from advancedbilling.models.nested_subscription_group import NestedSubscriptionGroup + +nested_subscription_group = NestedSubscriptionGroup( + 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 fdf928f0..aca09212 100644 --- a/doc/models/net-terms.md +++ b/doc/models/net-terms.md @@ -15,15 +15,17 @@ | `net_terms_on_remittance_signups_enabled` | `bool` | Optional | **Default**: `False` | | `custom_net_terms_enabled` | `bool` | 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 + +```python +from advancedbilling.models.net_terms import NetTerms + +net_terms = NetTerms( + 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 627a0264..28c9414b 100644 --- a/doc/models/offer-discount.md +++ b/doc/models/offer-discount.md @@ -13,13 +13,15 @@ | `coupon_id` | `int` | Optional | - | | `coupon_name` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "coupon_code": "coupon_code8", - "coupon_id": 86, - "coupon_name": "coupon_name4" -} +## Example + +```python +from advancedbilling.models.offer_discount import OfferDiscount + +offer_discount = OfferDiscount( + 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 1e4e9a8c..a83b24c1 100644 --- a/doc/models/offer-item.md +++ b/doc/models/offer-item.md @@ -17,18 +17,20 @@ | `component_name` | `str` | Optional | - | | `price_point_name` | `str` | Optional | - | | `currency_prices` | [`List[CurrencyPrice]`](../../doc/models/currency-price.md) | Optional | - | -| `interval` | `int` | 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` | `int` | 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" -} +```python +from advancedbilling.models.offer_item import OfferItem + +offer_item = OfferItem( + 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..ec61d2e2 100644 --- a/doc/models/offer-response.md +++ b/doc/models/offer-response.md @@ -11,17 +11,20 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.offer import Offer +from advancedbilling.models.offer_response import OfferResponse + +offer_response = OfferResponse( + offer=Offer( + 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 74ef034e..9e4446fc 100644 --- a/doc/models/offer-signup-page.md +++ b/doc/models/offer-signup-page.md @@ -16,15 +16,17 @@ | `return_params` | `str` | Optional | - | | `url` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 50, - "nickname": "nickname8", - "enabled": false, - "return_url": "return_url2", - "return_params": "return_params0" -} +## Example + +```python +from advancedbilling.models.offer_signup_page import OfferSignupPage + +offer_signup_page = OfferSignupPage( + 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 38a2676a..9cabc510 100644 --- a/doc/models/offer.md +++ b/doc/models/offer.md @@ -29,15 +29,17 @@ | `product_price_in_cents` | `int` | Optional | - | | `offer_signup_pages` | [`List[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 + +```python +from advancedbilling.models.offer import Offer + +offer = Offer( + 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 3562bd7d..c3aed798 100644 --- a/doc/models/ok-response.md +++ b/doc/models/ok-response.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `ok` | `str` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "ok": "ok4" -} +```python +from advancedbilling.models.ok_response import OkResponse + +ok_response = OkResponse( + ok='ok8' +) ``` diff --git a/doc/models/on-off-component.md b/doc/models/on-off-component.md index 1679d23d..7f940091 100644 --- a/doc/models/on-off-component.md +++ b/doc/models/on-off-component.md @@ -9,9 +9,9 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `name` | `str` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | +| `name` | `str` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "Minutes". | | `description` | `str` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | -| `handle` | `str` | 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` | `str` | 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` | `bool` | 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,24 @@ | `display_on_hosted_page` | `bool` | Optional | - | | `allow_fractional_quantities` | `bool` | Optional | - | | `public_signup_page_ids` | `List[int]` | Optional | - | -| `interval` | `int` | 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` | `int` | 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` | `str` | 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 + +```python +from advancedbilling.models.credit_type import CreditType +from advancedbilling.models.on_off_component import OnOffComponent + +on_off_component = OnOffComponent( + 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 721e7cf4..8d93da34 100644 --- a/doc/models/organization-address.md +++ b/doc/models/organization-address.md @@ -18,15 +18,17 @@ | `name` | `str` | Optional | - | | `phone` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "street": "street4", - "line2": "line28", - "city": "city4", - "state": "state0", - "zip": "zip2" -} +## Example + +```python +from advancedbilling.models.organization_address import OrganizationAddress + +organization_address = OrganizationAddress( + street='street6', + line_2='line20', + city='city6', + state='state2', + zip='zip0' +) ``` diff --git a/doc/models/origin-invoice.md b/doc/models/origin-invoice.md index 1f94e778..20d6d799 100644 --- a/doc/models/origin-invoice.md +++ b/doc/models/origin-invoice.md @@ -12,12 +12,14 @@ | `uid` | `str` | Optional | The UID of the invoice serving as an origin invoice. | | `number` | `str` | Optional | The number of the invoice serving as an origin invoice. | -## Example (as JSON) +## Example -```json -{ - "uid": "uid0", - "number": "number8" -} +```python +from advancedbilling.models.origin_invoice import OriginInvoice + +origin_invoice = OriginInvoice( + uid='uid8', + number='number4' +) ``` diff --git a/doc/models/overage-pricing.md b/doc/models/overage-pricing.md index 98e898b9..8bf6950f 100644 --- a/doc/models/overage-pricing.md +++ b/doc/models/overage-pricing.md @@ -12,28 +12,22 @@ | `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` | [`List[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 + +```python +from advancedbilling.models.overage_pricing import OveragePricing +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme + +overage_pricing = OveragePricing( + pricing_scheme=PricingScheme.STAIRSTEP, + prices=[ + Price( + 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..fe5c2e20 100644 --- a/doc/models/override-subscription-request.md +++ b/doc/models/override-subscription-request.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | | `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 + +```python +import dateutil.parser + +from advancedbilling.models.override_subscription import OverrideSubscription +from advancedbilling.models.override_subscription_request import OverrideSubscriptionRequest + +override_subscription_request = OverrideSubscriptionRequest( + subscription=OverrideSubscription( + activated_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + canceled_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + cancellation_message='cancellation_message2', + expires_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + current_period_starts_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/override-subscription.md b/doc/models/override-subscription.md index 604171fa..50e03515 100644 --- a/doc/models/override-subscription.md +++ b/doc/models/override-subscription.md @@ -15,15 +15,19 @@ | `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 + +```python +import dateutil.parser + +from advancedbilling.models.override_subscription import OverrideSubscription + +override_subscription = OverrideSubscription( + activated_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + canceled_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + cancellation_message='cancellation_message2', + expires_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + current_period_starts_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/paginated-metadata.md b/doc/models/paginated-metadata.md index 611aa458..21df4abf 100644 --- a/doc/models/paginated-metadata.md +++ b/doc/models/paginated-metadata.md @@ -15,30 +15,42 @@ | `per_page` | `int` | Optional | - | | `metadata` | [`List[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 + +```python +import dateutil.parser + +from advancedbilling.models.metadata import Metadata +from advancedbilling.models.paginated_metadata import PaginatedMetadata + +paginated_metadata = PaginatedMetadata( + total_count=144, + current_page=120, + total_pages=132, + per_page=158, + metadata=[ + Metadata( + id=50, + value='value8', + resource_id=134, + name='name6', + deleted_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') + ), + Metadata( + id=50, + value='value8', + resource_id=134, + name='name6', + deleted_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') + ), + Metadata( + id=50, + value='value8', + resource_id=134, + name='name6', + deleted_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') + ) + ] +) ``` diff --git a/doc/models/paid-invoice.md b/doc/models/paid-invoice.md index d475bca4..69065934 100644 --- a/doc/models/paid-invoice.md +++ b/doc/models/paid-invoice.md @@ -14,14 +14,17 @@ | `due_amount` | `str` | Optional | The remaining due amount on the invoice | | `paid_amount` | `str` | 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 + +```python +from advancedbilling.models.invoice_status import InvoiceStatus +from advancedbilling.models.paid_invoice import PaidInvoice + +paid_invoice = PaidInvoice( + 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..10aaeb2b 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,18 @@ 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" - } -} +```python +import dateutil.parser + +from advancedbilling.models.auto_resume import AutoResume +from advancedbilling.models.pause_request import PauseRequest + +pause_request = PauseRequest( + hold=AutoResume( + automatically_resume_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/pay-pal-vault.md b/doc/models/pay-pal-vault.md index 00445c6c..557a86b7 100644 --- a/doc/models/pay-pal-vault.md +++ b/doc/models/pay-pal-vault.md @@ -16,3 +16,11 @@ The vault that stores the payment profile with the provided vault_token. | `MODUSLINK` | | `PAYPAL_COMPLETE` | +## Example + +```python +from advancedbilling.models.pay_pal_vault import PayPalVault + +pay_pal_vault = PayPalVault.MODUSLINK +``` + diff --git a/doc/models/payer-attributes.md b/doc/models/payer-attributes.md index 465fe3c7..af611e75 100644 --- a/doc/models/payer-attributes.md +++ b/doc/models/payer-attributes.md @@ -28,19 +28,21 @@ | `tax_exempt_reason` | `str` | Optional | - | | `metafields` | `Dict[str, str]` | 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 + +```python +from advancedbilling.models.payer_attributes import PayerAttributes + +payer_attributes = PayerAttributes( + 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 59641ebe..4c728ebe 100644 --- a/doc/models/payer-error.md +++ b/doc/models/payer-error.md @@ -13,22 +13,25 @@ | `first_name` | `List[str]` | Optional | - | | `email` | `List[str]` | Optional | - | -## Example (as JSON) - -```json -{ - "last_name": [ - "last_name1", - "last_name2", - "last_name3" - ], - "first_name": [ - "first_name4", - "first_name5" - ], - "email": [ - "email4" - ] -} +## Example + +```python +from advancedbilling.models.payer_error import PayerError + +payer_error = PayerError( + last_name=[ + 'last_name9' + ], + first_name=[ + 'first_name2', + 'first_name3', + 'first_name4' + ], + email=[ + 'email4', + 'email3', + 'email2' + ] +) ``` diff --git a/doc/models/payment-collection-method-changed.md b/doc/models/payment-collection-method-changed.md index ccfcdc7d..9456399b 100644 --- a/doc/models/payment-collection-method-changed.md +++ b/doc/models/payment-collection-method-changed.md @@ -12,12 +12,14 @@ | `previous_value` | `str` | Required | - | | `current_value` | `str` | Required | - | -## Example (as JSON) +## Example -```json -{ - "previous_value": "previous_value4", - "current_value": "current_value2" -} +```python +from advancedbilling.models.payment_collection_method_changed import PaymentCollectionMethodChanged + +payment_collection_method_changed = PaymentCollectionMethodChanged( + 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 24f7f298..860c51c7 100644 --- a/doc/models/payment-for-allocation.md +++ b/doc/models/payment-for-allocation.md @@ -16,14 +16,16 @@ Information for captured payment, if applicable | `success` | `bool` | Optional | - | | `memo` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 72, - "amount_in_cents": 158, - "success": false, - "memo": "memo6" -} +## Example + +```python +from advancedbilling.models.payment_for_allocation import PaymentForAllocation + +payment_for_allocation = PaymentForAllocation( + 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 36edc23a..91e74025 100644 --- a/doc/models/payment-method-apple-pay.md +++ b/doc/models/payment-method-apple-pay.md @@ -11,11 +11,14 @@ | --- | --- | --- | --- | | `mtype` | [`InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "type": "apple_pay" -} +```python +from advancedbilling.models.invoice_event_payment_method import InvoiceEventPaymentMethod +from advancedbilling.models.payment_method_apple_pay import PaymentMethodApplePay + +payment_method_apple_pay = PaymentMethodApplePay( + mtype=InvoiceEventPaymentMethod.APPLE_PAY +) ``` diff --git a/doc/models/payment-method-bank-account.md b/doc/models/payment-method-bank-account.md index 796fabac..5a86edd4 100644 --- a/doc/models/payment-method-bank-account.md +++ b/doc/models/payment-method-bank-account.md @@ -13,13 +13,16 @@ | `masked_routing_number` | `str` | Required | - | | `mtype` | [`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 + +```python +from advancedbilling.models.invoice_event_payment_method import InvoiceEventPaymentMethod +from advancedbilling.models.payment_method_bank_account import PaymentMethodBankAccount + +payment_method_bank_account = PaymentMethodBankAccount( + masked_account_number='masked_account_number6', + masked_routing_number='masked_routing_number6', + mtype=InvoiceEventPaymentMethod.BANK_ACCOUNT +) ``` diff --git a/doc/models/payment-method-credit-card.md b/doc/models/payment-method-credit-card.md index eddc8982..15be3d0c 100644 --- a/doc/models/payment-method-credit-card.md +++ b/doc/models/payment-method-credit-card.md @@ -15,15 +15,18 @@ | `masked_card_number` | `str` | Required | - | | `mtype` | [`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 + +```python +from advancedbilling.models.invoice_event_payment_method import InvoiceEventPaymentMethod +from advancedbilling.models.payment_method_credit_card import PaymentMethodCreditCard + +payment_method_credit_card = PaymentMethodCreditCard( + card_brand='card_brand2', + masked_card_number='masked_card_number2', + mtype=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 fc2ec0f8..4f2cf150 100644 --- a/doc/models/payment-method-external.md +++ b/doc/models/payment-method-external.md @@ -14,14 +14,17 @@ | `memo` | `str` | Required | - | | `mtype` | [`InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | -## Example (as JSON) - -```json -{ - "details": "details4", - "kind": "kind2", - "memo": "memo8", - "type": "external" -} +## Example + +```python +from advancedbilling.models.invoice_event_payment_method import InvoiceEventPaymentMethod +from advancedbilling.models.payment_method_external import PaymentMethodExternal + +payment_method_external = PaymentMethodExternal( + details='details8', + kind='kind6', + memo='memo2', + mtype=InvoiceEventPaymentMethod.EXTERNAL +) ``` diff --git a/doc/models/payment-method-paypal.md b/doc/models/payment-method-paypal.md index 955a742e..3e06c45e 100644 --- a/doc/models/payment-method-paypal.md +++ b/doc/models/payment-method-paypal.md @@ -12,12 +12,15 @@ | `email` | `str` | Required | - | | `mtype` | [`InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "email": "email2", - "type": "paypal_account" -} +```python +from advancedbilling.models.invoice_event_payment_method import InvoiceEventPaymentMethod +from advancedbilling.models.payment_method_paypal import PaymentMethodPaypal + +payment_method_paypal = PaymentMethodPaypal( + email='email6', + mtype=InvoiceEventPaymentMethod.PAYPAL_ACCOUNT +) ``` diff --git a/doc/models/payment-profile-attributes.md b/doc/models/payment-profile-attributes.md index 3d15812b..bbf4205a 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` | `str` | 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` | `str` | 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` | `int` | Optional | - | | `payment_type` | [`PaymentType`](../../doc/models/payment-type.md) | Optional | - | | `first_name` | `str` | Optional | (Optional) First name on card or bank account. If omitted, the first_name from customer attributes will be used. | | `last_name` | `str` | Optional | (Optional) Last name on card or bank account. If omitted, the last_name from customer attributes will be used. | | `masked_card_number` | `str` | Optional | - | -| `full_number` | `str` | 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` | `str` | 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` | int \| str \| None | Optional | This is a container for one-of cases. | | `expiration_year` | int \| str \| None | Optional | This is a container for one-of cases. | -| `billing_address` | `str` | 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` | `str` | Optional | (Optional) Second line of the customer’s billing address i.e. Apt. 100 | -| `billing_city` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | Optional | (Optional) Second line of the customer’s billing address, e.g., Apt. 100 | +| `billing_city` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | Optional | (Optional, used only for Subscription Import) The “token” provided by your vault storage for an already stored payment profile | | `customer_vault_token` | `str` | 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,20 @@ alias to credit_card_attributes | `payment_method_nonce` | `str` | Optional | (Required for Square unless importing with vault_token and customer_vault_token) The nonce generated by the Square Javascript library (SqPaymentForm) | | `gateway_handle` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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 + +```python +from advancedbilling.models.payment_profile_attributes import PaymentProfileAttributes +from advancedbilling.models.payment_type import PaymentType + +payment_profile_attributes = PaymentProfileAttributes( + 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 079f293c..463d9997 100644 --- a/doc/models/payment-profile-params.md +++ b/doc/models/payment-profile-params.md @@ -15,13 +15,15 @@ PCI-safe cardholder fields only. Full card numbers, CVV, and billing address are | `last_name` | `str` | Optional | - | | `card_type` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "first_name": "first_name2", - "last_name": "last_name0", - "card_type": "card_type8" -} +## Example + +```python +from advancedbilling.models.payment_profile_params import PaymentProfileParams + +payment_profile_params = PaymentProfileParams( + 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..8fa4632b 100644 --- a/doc/models/payment-profile-response.md +++ b/doc/models/payment-profile-response.md @@ -11,18 +11,23 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.apple_pay_payment_profile import ApplePayPaymentProfile +from advancedbilling.models.apple_pay_vault import ApplePayVault +from advancedbilling.models.payment_profile_response import PaymentProfileResponse +from advancedbilling.models.payment_type import PaymentType + +payment_profile_response = PaymentProfileResponse( + payment_profile=ApplePayPaymentProfile( + 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 32224ba0..e83ec793 100644 --- a/doc/models/payment-related-events.md +++ b/doc/models/payment-related-events.md @@ -12,12 +12,14 @@ | `product_id` | `int` | Required | - | | `account_transaction_id` | `int` | Required | - | -## Example (as JSON) +## Example -```json -{ - "product_id": 42, - "account_transaction_id": 58 -} +```python +from advancedbilling.models.payment_related_events import PaymentRelatedEvents + +payment_related_events = PaymentRelatedEvents( + product_id=208, + account_transaction_id=52 +) ``` diff --git a/doc/models/payment-type.md b/doc/models/payment-type.md index 44b7cba6..d54cdc41 100644 --- a/doc/models/payment-type.md +++ b/doc/models/payment-type.md @@ -14,3 +14,11 @@ | `PAYPAL_ACCOUNT` | | `APPLE_PAY` | +## Example + +```python +from advancedbilling.models.payment_type import PaymentType + +payment_type = PaymentType.CREDIT_CARD +``` + diff --git a/doc/models/paypal-payment-profile.md b/doc/models/paypal-payment-profile.md index 50563b62..f8133583 100644 --- a/doc/models/paypal-payment-profile.md +++ b/doc/models/paypal-payment-profile.md @@ -29,16 +29,20 @@ | `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 + +```python +from advancedbilling.models.pay_pal_vault import PayPalVault +from advancedbilling.models.payment_type import PaymentType +from advancedbilling.models.paypal_payment_profile import PaypalPaymentProfile + +paypal_payment_profile = PaypalPaymentProfile( + 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 74223aff..6bb5ebda 100644 --- a/doc/models/pending-cancellation-change.md +++ b/doc/models/pending-cancellation-change.md @@ -12,12 +12,16 @@ | `cancellation_state` | `str` | Required | - | | `cancels_at` | `datetime` | Required | - | -## Example (as JSON) +## Example -```json -{ - "cancellation_state": "cancellation_state8", - "cancels_at": "2016-03-13T12:52:32.123Z" -} +```python +import dateutil.parser + +from advancedbilling.models.pending_cancellation_change import PendingCancellationChange + +pending_cancellation_change = PendingCancellationChange( + cancellation_state='cancellation_state2', + cancels_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/portal-management-link.md b/doc/models/portal-management-link.md index b3905d1a..b6757fa9 100644 --- a/doc/models/portal-management-link.md +++ b/doc/models/portal-management-link.md @@ -16,15 +16,19 @@ | `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 + +```python +import dateutil.parser + +from advancedbilling.models.portal_management_link import PortalManagementLink + +portal_management_link = PortalManagementLink( + url='url0', + fetch_count=46, + created_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + new_link_available_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + expires_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/prepaid-configuration-response.md b/doc/models/prepaid-configuration-response.md index 708062bf..4fb89e83 100644 --- a/doc/models/prepaid-configuration-response.md +++ b/doc/models/prepaid-configuration-response.md @@ -11,17 +11,20 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.prepaid_configuration import PrepaidConfiguration +from advancedbilling.models.prepaid_configuration_response import PrepaidConfigurationResponse + +prepaid_configuration_response = PrepaidConfigurationResponse( + prepaid_configuration=PrepaidConfiguration( + 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 f74657e5..9f820110 100644 --- a/doc/models/prepaid-configuration.md +++ b/doc/models/prepaid-configuration.md @@ -15,15 +15,17 @@ | `auto_replenish` | `bool` | Optional | - | | `replenish_threshold_amount_in_cents` | `int` | 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 + +```python +from advancedbilling.models.prepaid_configuration import PrepaidConfiguration + +prepaid_configuration = PrepaidConfiguration( + 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 03badb63..15f560fe 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` | `str` | 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" -} +```python +from advancedbilling.models.prepaid_product_price_point_filter import PrepaidProductPricePointFilter + +prepaid_product_price_point_filter = PrepaidProductPricePointFilter() ``` diff --git a/doc/models/prepaid-subscription-balance-changed.md b/doc/models/prepaid-subscription-balance-changed.md index 923a2c03..7e999e0b 100644 --- a/doc/models/prepaid-subscription-balance-changed.md +++ b/doc/models/prepaid-subscription-balance-changed.md @@ -14,14 +14,16 @@ | `prepayment_account_balance_in_cents` | `int` | Required | - | | `current_usage_amount_in_cents` | `int` | 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 + +```python +from advancedbilling.models.prepaid_subscription_balance_changed import PrepaidSubscriptionBalanceChanged + +prepaid_subscription_balance_changed = PrepaidSubscriptionBalanceChanged( + 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 fc6ae5b0..b5651497 100644 --- a/doc/models/prepaid-usage-allocation-detail.md +++ b/doc/models/prepaid-usage-allocation-detail.md @@ -13,13 +13,15 @@ | `charge_id` | `int` | Optional | - | | `usage_quantity` | `int` | Optional | - | -## Example (as JSON) - -```json -{ - "allocation_id": 72, - "charge_id": 30, - "usage_quantity": 212 -} +## Example + +```python +from advancedbilling.models.prepaid_usage_allocation_detail import PrepaidUsageAllocationDetail + +prepaid_usage_allocation_detail = PrepaidUsageAllocationDetail( + 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 f7113642..c4273a23 100644 --- a/doc/models/prepaid-usage-component.md +++ b/doc/models/prepaid-usage-component.md @@ -9,10 +9,10 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `name` | `str` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | -| `unit_name` | `str` | 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` | `str` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "Minutes". | +| `unit_name` | `str` | 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` | `str` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | -| `handle` | `str` | 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` | `str` | 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` | `bool` | 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` | [`List[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,49 @@ | `tax_code` | `str` | 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` | `bool` | 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` | `bool` | Optional | Boolean which controls whether or not remaining units should be rolled over to the next period | -| `renew_prepaid_allocation` | `bool` | Optional | Boolean which controls whether or not the allocated quantity should be renewed at the beginning of each period | +| `rollover_prepaid_remainder` | `bool` | Optional | Boolean which controls whether or not remaining units should be rolled over to the next period. | +| `renew_prepaid_allocation` | `bool` | 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` | `bool` | Optional | - | | `allow_fractional_quantities` | `bool` | Optional | - | | `public_signup_page_ids` | `List[int]` | Optional | - | +| `unspsc_code` | `str` | 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 - } - ] - } -} +```python +from advancedbilling.models.credit_type import CreditType +from advancedbilling.models.overage_pricing import OveragePricing +from advancedbilling.models.prepaid_usage_component import PrepaidUsageComponent +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme + +prepaid_usage_component = PrepaidUsageComponent( + name='name2', + unit_name='unit_name4', + pricing_scheme=PricingScheme.PER_UNIT, + overage_pricing=OveragePricing( + pricing_scheme=PricingScheme.STAIRSTEP, + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ) + ] + ), + description='description2', + handle='handle8', + taxable=False, + prices=[ + Price( + 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 d794e551..76fd9fe3 100644 --- a/doc/models/prepaid-usage.md +++ b/doc/models/prepaid-usage.md @@ -11,8 +11,8 @@ | --- | --- | --- | --- | | `previous_unit_balance` | `str` | Required | **Constraints**: *Minimum Length*: `1` | | `previous_overage_unit_balance` | `str` | Required | **Constraints**: *Minimum Length*: `1` | -| `new_unit_balance` | `int` | Required | - | -| `new_overage_unit_balance` | `int` | Required | - | +| `new_unit_balance` | int \| str | Required | This is a container for one-of cases. | +| `new_overage_unit_balance` | int \| str | Required | This is a container for one-of cases. | | `usage_quantity` | `int` | Required | - | | `overage_usage_quantity` | `int` | Required | - | | `component_id` | `int` | Required | - | @@ -20,26 +20,29 @@ | `memo` | `str` | Required | - | | `allocation_details` | [`List[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 + +```python +from advancedbilling.models.prepaid_usage import PrepaidUsage +from advancedbilling.models.prepaid_usage_allocation_detail import PrepaidUsageAllocationDetail + +prepaid_usage = PrepaidUsage( + 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( + 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 4343e35e..ef1758fd 100644 --- a/doc/models/prepayment-account-balance-changed.md +++ b/doc/models/prepayment-account-balance-changed.md @@ -14,14 +14,16 @@ | `prepayment_balance_change_in_cents` | `int` | Required | - | | `currency_code` | `str` | Required | - | -## Example (as JSON) - -```json -{ - "reason": "reason4", - "prepayment_account_balance_in_cents": 182, - "prepayment_balance_change_in_cents": 206, - "currency_code": "currency_code4" -} +## Example + +```python +from advancedbilling.models.prepayment_account_balance_changed import PrepaymentAccountBalanceChanged + +prepayment_account_balance_changed = PrepaymentAccountBalanceChanged( + 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..89ea9983 100644 --- a/doc/models/prepayment-method.md +++ b/doc/models/prepayment-method.md @@ -17,3 +17,11 @@ | `CREDIT_CARD` | | `OTHER` | +## Example + +```python +from advancedbilling.models.prepayment_method import PrepaymentMethod + +prepayment_method = PrepaymentMethod.CASH +``` + diff --git a/doc/models/prepayment-response.md b/doc/models/prepayment-response.md index f0b045af..1c24cdde 100644 --- a/doc/models/prepayment-response.md +++ b/doc/models/prepayment-response.md @@ -11,22 +11,28 @@ | --- | --- | --- | --- | | `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 + +```python +import dateutil.parser + +from advancedbilling.models.prepayment import Prepayment +from advancedbilling.models.prepayment_method import PrepaymentMethod +from advancedbilling.models.prepayment_response import PrepaymentResponse + +prepayment_response = PrepaymentResponse( + prepayment=Prepayment( + id=38, + subscription_id=148, + amount_in_cents=124, + remaining_amount_in_cents=182, + external=False, + memo='memo2', + created_at=dateutil.parser.parse('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 dabe5d3d..effed3b6 100644 --- a/doc/models/prepayment.md +++ b/doc/models/prepayment.md @@ -20,20 +20,25 @@ | `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 + +```python +import dateutil.parser + +from advancedbilling.models.prepayment import Prepayment +from advancedbilling.models.prepayment_method import PrepaymentMethod + +prepayment = Prepayment( + id=38, + subscription_id=148, + amount_in_cents=124, + remaining_amount_in_cents=182, + external=False, + memo='memo2', + created_at=dateutil.parser.parse('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 f4c18af0..d520c3be 100644 --- a/doc/models/prepayments-response.md +++ b/doc/models/prepayments-response.md @@ -11,36 +11,54 @@ | --- | --- | --- | --- | | `prepayments` | [`List[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 + +```python +import dateutil.parser + +from advancedbilling.models.prepayment import Prepayment +from advancedbilling.models.prepayment_method import PrepaymentMethod +from advancedbilling.models.prepayments_response import PrepaymentsResponse + +prepayments_response = PrepaymentsResponse( + prepayments=[ + Prepayment( + id=76, + subscription_id=186, + amount_in_cents=94, + remaining_amount_in_cents=220, + external=False, + memo='memo0', + created_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + refunded_amount_in_cents=170, + details='details6', + payment_type=PrepaymentMethod.CASH + ), + Prepayment( + id=76, + subscription_id=186, + amount_in_cents=94, + remaining_amount_in_cents=220, + external=False, + memo='memo0', + created_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + refunded_amount_in_cents=170, + details='details6', + payment_type=PrepaymentMethod.CASH + ), + Prepayment( + id=76, + subscription_id=186, + amount_in_cents=94, + remaining_amount_in_cents=220, + external=False, + memo='memo0', + created_at=dateutil.parser.parse('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 cb7beb9f..0d676f63 100644 --- a/doc/models/preview-allocations-request.md +++ b/doc/models/preview-allocations-request.md @@ -14,23 +14,29 @@ | `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" - } - ], - "effective_proration_date": "2023-12-01", - "upgrade_charge": "none", - "downgrade_credit": "prorated" -} +## Example + +```python +import dateutil.parser + +from advancedbilling.models.create_allocation import CreateAllocation +from advancedbilling.models.credit_type import CreditType +from advancedbilling.models.preview_allocations_request import PreviewAllocationsRequest + +preview_allocations_request = PreviewAllocationsRequest( + allocations=[ + CreateAllocation( + 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=dateutil.parser.parse('2023-12-01').date(), + 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..0a7e70c2 100644 --- a/doc/models/price-point-type.md +++ b/doc/models/price-point-type.md @@ -19,3 +19,11 @@ Price point type. We expose the following types: | `DEFAULT` | | `CUSTOM` | +## Example + +```python +from advancedbilling.models.price_point_type import PricePointType + +price_point_type = PricePointType.CUSTOM +``` + diff --git a/doc/models/price.md b/doc/models/price.md index 8e7f8202..2a3eeceb 100644 --- a/doc/models/price.md +++ b/doc/models/price.md @@ -13,13 +13,15 @@ | `ending_quantity` | int \| str \| None | Optional | This is a container for one-of cases. | | `unit_price` | float \| str | Required | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "starting_quantity": 40, - "ending_quantity": 14, - "unit_price": 125.12 -} +## Example + +```python +from advancedbilling.models.price import Price + +price = Price( + 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..9a73b5a5 100644 --- a/doc/models/pricing-scheme.md +++ b/doc/models/pricing-scheme.md @@ -16,3 +16,11 @@ The identifier for the pricing scheme. See [Product Components](https://help.cha | `PER_UNIT` | | `TIERED` | +## Example + +```python +from advancedbilling.models.pricing_scheme import PricingScheme + +pricing_scheme = PricingScheme.PER_UNIT +``` + diff --git a/doc/models/product-family-response.md b/doc/models/product-family-response.md index e90f0430..751bec10 100644 --- a/doc/models/product-family-response.md +++ b/doc/models/product-family-response.md @@ -11,17 +11,20 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.product_family import ProductFamily +from advancedbilling.models.product_family_response import ProductFamilyResponse + +product_family_response = ProductFamilyResponse( + product_family=ProductFamily( + 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 11ddd169..4e53d431 100644 --- a/doc/models/product-family.md +++ b/doc/models/product-family.md @@ -14,19 +14,22 @@ | `handle` | `str` | Optional | - | | `accounting_code` | `str` | Optional | - | | `description` | `str` | Optional | - | +| `surcharging` | `bool` | 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" -} +```python +from advancedbilling.models.product_family import ProductFamily + +product_family = ProductFamily( + 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..a6aec901 100644 --- a/doc/models/product-price-point-error-response-exception.md +++ b/doc/models/product-price-point-error-response-exception.md @@ -11,31 +11,14 @@ | --- | --- | --- | --- | | `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 + +```python +try: + # make the API call +except ProductPricePointErrorResponseException as e: + print(e) +except APIException as e: + print(e) ``` diff --git a/doc/models/product-price-point-errors.md b/doc/models/product-price-point-errors.md index a0080cb5..fc680409 100644 --- a/doc/models/product-price-point-errors.md +++ b/doc/models/product-price-point-errors.md @@ -16,29 +16,31 @@ | `price` | `List[str]` | Optional | - | | `price_in_cents` | `List[str]` | 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." - ], - "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 + +```python +from advancedbilling.models.product_price_point_errors import ProductPricePointErrors + +product_price_point_errors = ProductPricePointErrors( + 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.' + ] +) ``` diff --git a/doc/models/product-price-point-response.md b/doc/models/product-price-point-response.md index 33f69f3e..7271cdb2 100644 --- a/doc/models/product-price-point-response.md +++ b/doc/models/product-price-point-response.md @@ -11,17 +11,20 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.product_price_point import ProductPricePoint +from advancedbilling.models.product_price_point_response import ProductPricePointResponse + +product_price_point_response = ProductPricePointResponse( + price_point=ProductPricePoint( + 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 560e6265..29e4d0b1 100644 --- a/doc/models/product-price-point.md +++ b/doc/models/product-price-point.md @@ -13,16 +13,16 @@ | `name` | `str` | Optional | The product price point name | | `handle` | `str` | Optional | The product price point API handle | | `price_in_cents` | `int` | Optional | The product price point price, in integer cents | -| `interval` | `int` | 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` | `int` | 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` | `int` | Optional | The product price point trial price, in integer cents | -| `trial_interval` | `int` | 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` | `int` | 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` | `bool` | Optional | reserved for future use | | `initial_charge_in_cents` | `int` | Optional | The product price point initial charge, in integer cents | | `initial_charge_after_trial` | `bool` | Optional | - | -| `expiration_interval` | `int` | 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` | `int` | 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` | `int` | Optional | The product id this price point belongs to | | `archived_at` | `datetime` | Optional | Timestamp indicating when this price point was archived | @@ -34,15 +34,17 @@ | `subscription_id` | `int` | Optional | The subscription id this price point belongs to | | `currency_prices` | [`List[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 -} +```python +from advancedbilling.models.product_price_point import ProductPricePoint + +product_price_point = ProductPricePoint( + 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..5740f379 100644 --- a/doc/models/product-response.md +++ b/doc/models/product-response.md @@ -11,17 +11,20 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.product import Product +from advancedbilling.models.product_response import ProductResponse + +product_response = ProductResponse( + product=Product( + 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 abe3152b..41f75aa4 100644 --- a/doc/models/product.md +++ b/doc/models/product.md @@ -13,18 +13,18 @@ | `name` | `str` | Optional | The product name | | `handle` | `str` | Optional | The product API handle | | `description` | `str` | Optional | The product description | -| `accounting_code` | `str` | Optional | E.g. Internal ID or SKU Number | +| `accounting_code` | `str` | Optional | E.g., Internal ID or SKU Number | | `request_credit_card` | `bool` | 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` | `int` | 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` | `int` | 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` | `int` | Optional | The product price, in integer cents | -| `interval` | `int` | 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` | `int` | 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` | `int` | Optional | The up front charge you have specified. | | `trial_price_in_cents` | `int` | Optional | The price of the trial period for a subscription to this product, in integer cents. | -| `trial_interval` | `int` | 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` | `int` | 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` | `bool` | 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` | `str` | Optional | The url to which a customer will be returned after a successful account update | | `initial_charge_after_trial` | `bool` | Optional | - | | `version_number` | `int` | Optional | The version of the product | -| `update_return_params` | `str` | 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` | `str` | 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` | [`List[PublicSignupPage]`](../../doc/models/public-signup-page.md) | Optional | - | | `product_price_point_name` | `str` | Optional | - | @@ -46,16 +46,19 @@ | `item_category` | `str` | Optional | One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other | | `product_price_point_id` | `int` | Optional | - | | `product_price_point_handle` | `str` | Optional | - | +| `unspsc_code` | `str` | 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 (as JSON) +## Example -```json -{ - "id": 180, - "name": "name4", - "handle": "handle0", - "description": "description4", - "accounting_code": "accounting_code0" -} +```python +from advancedbilling.models.product import Product + +product = Product( + 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..2c417f5d 100644 --- a/doc/models/proforma-bad-request-error-response-exception.md +++ b/doc/models/proforma-bad-request-error-response-exception.md @@ -11,18 +11,14 @@ | --- | --- | --- | --- | | `errors` | [`ProformaError`](../../doc/models/proforma-error.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": { - "subscription": { - "base": [ - "base3", - "base4" - ] - } - } -} +## Example + +```python +try: + # make the API call +except ProformaBadRequestErrorResponseException as e: + print(e) +except APIException as e: + print(e) ``` diff --git a/doc/models/proforma-error.md b/doc/models/proforma-error.md index f9e1ef3e..48d7a49d 100644 --- a/doc/models/proforma-error.md +++ b/doc/models/proforma-error.md @@ -11,16 +11,19 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.base_string_error import BaseStringError +from advancedbilling.models.proforma_error import ProformaError + +proforma_error = ProformaError( + subscription=BaseStringError( + base=[ + 'base3', + 'base4' + ] + ) +) ``` diff --git a/doc/models/proforma-invoice-credit.md b/doc/models/proforma-invoice-credit.md index 8666986e..2aa7e66b 100644 --- a/doc/models/proforma-invoice-credit.md +++ b/doc/models/proforma-invoice-credit.md @@ -14,14 +14,16 @@ | `original_amount` | `str` | Optional | **Constraints**: *Minimum Length*: `1` | | `applied_amount` | `str` | Optional | **Constraints**: *Minimum Length*: `1` | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "memo": "memo2", - "original_amount": "original_amount2", - "applied_amount": "applied_amount0" -} +## Example + +```python +from advancedbilling.models.proforma_invoice_credit import ProformaInvoiceCredit + +proforma_invoice_credit = ProformaInvoiceCredit( + 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..99d58396 100644 --- a/doc/models/proforma-invoice-discount-source-type.md +++ b/doc/models/proforma-invoice-discount-source-type.md @@ -12,3 +12,11 @@ | `COUPON` | | `REFERRAL` | +## Example + +```python +from advancedbilling.models.proforma_invoice_discount_source_type import ProformaInvoiceDiscountSourceType + +proforma_invoice_discount_source_type = ProformaInvoiceDiscountSourceType.COUPON +``` + diff --git a/doc/models/proforma-invoice-discount.md b/doc/models/proforma-invoice-discount.md index 1ae1cd26..7e52d362 100644 --- a/doc/models/proforma-invoice-discount.md +++ b/doc/models/proforma-invoice-discount.md @@ -18,15 +18,19 @@ | `discount_amount` | `str` | Optional | **Constraints**: *Minimum Length*: `1` | | `line_item_breakouts` | [`List[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 + +```python +from advancedbilling.models.invoice_discount_type import InvoiceDiscountType +from advancedbilling.models.proforma_invoice_discount import ProformaInvoiceDiscount +from advancedbilling.models.proforma_invoice_discount_source_type import ProformaInvoiceDiscountSourceType + +proforma_invoice_discount = ProformaInvoiceDiscount( + 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 0bf55254..b6f26c47 100644 --- a/doc/models/proforma-invoice-issued.md +++ b/doc/models/proforma-invoice-issued.md @@ -21,29 +21,34 @@ | `product_name` | `str` | Required | - | | `line_items` | [`List[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 + +```python +import dateutil.parser + +from advancedbilling.models.invoice_line_item_event_data import InvoiceLineItemEventData +from advancedbilling.models.proforma_invoice_issued import ProformaInvoiceIssued + +proforma_invoice_issued = ProformaInvoiceIssued( + uid='uid8', + number='number4', + role='role8', + delivery_date=dateutil.parser.parse('2016-03-13').date(), + created_at=dateutil.parser.parse('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( + 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 1d328706..859d8fa0 100644 --- a/doc/models/proforma-invoice-payment.md +++ b/doc/models/proforma-invoice-payment.md @@ -14,14 +14,16 @@ | `applied_amount` | `str` | Optional | **Constraints**: *Minimum Length*: `1` | | `prepayment` | `bool` | Optional | - | -## Example (as JSON) - -```json -{ - "memo": "memo4", - "original_amount": "original_amount4", - "applied_amount": "applied_amount8", - "prepayment": false -} +## Example + +```python +from advancedbilling.models.proforma_invoice_payment import ProformaInvoicePayment + +proforma_invoice_payment = ProformaInvoicePayment( + 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..d17e7c42 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,11 @@ | `PROFORMA_ADHOC` | | `PROFORMA_AUTOMATIC` | +## Example + +```python +from advancedbilling.models.proforma_invoice_role import ProformaInvoiceRole + +proforma_invoice_role = ProformaInvoiceRole.PROFORMA_ADHOC +``` + diff --git a/doc/models/proforma-invoice-status.md b/doc/models/proforma-invoice-status.md index 73e3ddef..33520bc2 100644 --- a/doc/models/proforma-invoice-status.md +++ b/doc/models/proforma-invoice-status.md @@ -13,3 +13,11 @@ | `VOIDED` | | `ARCHIVED` | +## Example + +```python +from advancedbilling.models.proforma_invoice_status import ProformaInvoiceStatus + +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..ffab2034 100644 --- a/doc/models/proforma-invoice-tax-source-type.md +++ b/doc/models/proforma-invoice-tax-source-type.md @@ -12,3 +12,11 @@ | `TAX` | | `AVALARA` | +## Example + +```python +from advancedbilling.models.proforma_invoice_tax_source_type import ProformaInvoiceTaxSourceType + +proforma_invoice_tax_source_type = ProformaInvoiceTaxSourceType.TAX +``` + diff --git a/doc/models/proforma-invoice-tax.md b/doc/models/proforma-invoice-tax.md index 5be4ec68..cd1d289c 100644 --- a/doc/models/proforma-invoice-tax.md +++ b/doc/models/proforma-invoice-tax.md @@ -17,15 +17,18 @@ | `tax_amount` | `str` | Optional | **Constraints**: *Minimum Length*: `1` | | `line_item_breakouts` | [`List[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 + +```python +from advancedbilling.models.proforma_invoice_tax import ProformaInvoiceTax +from advancedbilling.models.proforma_invoice_tax_source_type import ProformaInvoiceTaxSourceType + +proforma_invoice_tax = ProformaInvoiceTax( + 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 70554a40..b322c7de 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` | `str` | Optional | - | | `currency` | `str` | 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` | `str` | Optional | - | | `product_family_name` | `str` | 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` | `str` | Optional | - | | `billing_address` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | - | | `shipping_address` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Optional | - | @@ -47,15 +47,17 @@ | `public_url` | `str` | 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 -} +```python +from advancedbilling.models.proforma_invoice import ProformaInvoice + +proforma_invoice = ProformaInvoice( + 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 aabac010..99882824 100644 --- a/doc/models/proration.md +++ b/doc/models/proration.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `preserve_period` | `bool` | Optional | The alternative to sending preserve_period as a direct attribute to migration | -## Example (as JSON) +## Example -```json -{ - "preserve_period": false -} +```python +from advancedbilling.models.proration import Proration + +proration = Proration( + preserve_period=False +) ``` diff --git a/doc/models/public-key.md b/doc/models/public-key.md index d61c3b80..9ce412ba 100644 --- a/doc/models/public-key.md +++ b/doc/models/public-key.md @@ -13,13 +13,17 @@ | `requires_security_token` | `bool` | 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 + +```python +import dateutil.parser + +from advancedbilling.models.public_key import PublicKey + +public_key = PublicKey( + public_key='public_key0', + requires_security_token=False, + created_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/public-signup-page.md b/doc/models/public-signup-page.md index 37fcf721..eda73198 100644 --- a/doc/models/public-signup-page.md +++ b/doc/models/public-signup-page.md @@ -10,18 +10,20 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `id` | `int` | Optional | The id of the signup page (public_signup_pages only) | -| `return_url` | `str` | Optional | The url to which a customer will be returned after a successful signup (public_signup_pages only) | +| `return_url` | `str` | Optional | The url to which a customer will be returned after a successful signup (public_signup_pages only). | | `return_params` | `str` | Optional | The params to be appended to the return_url (public_signup_pages only) | -| `url` | `str` | Optional | The url where the signup page can be viewed (public_signup_pages only) | +| `url` | `str` | 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" -} +```python +from advancedbilling.models.public_signup_page import PublicSignupPage + +public_signup_page = PublicSignupPage( + 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..9a9faa19 --- /dev/null +++ b/doc/models/q-scope.md @@ -0,0 +1,27 @@ + +# Q Scope + +## Enumeration + +`QScope` + +## Fields + +| Name | +| --- | +| `FULL_NAME` | +| `FIRST_NAME` | +| `LAST_NAME` | +| `ORGANIZATION` | +| `CUSTOMER_REFERENCE` | +| `SUBSCRIPTION_REFERENCE` | +| `LAST_FOUR` | + +## Example + +```python +from advancedbilling.models.q_scope import QScope + +q_scope = QScope.SUBSCRIPTION_REFERENCE +``` + diff --git a/doc/models/quantity-based-component.md b/doc/models/quantity-based-component.md index 3fee3ace..4dad3ca6 100644 --- a/doc/models/quantity-based-component.md +++ b/doc/models/quantity-based-component.md @@ -9,10 +9,10 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `name` | `str` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". | -| `unit_name` | `str` | 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` | `str` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "Minutes". | +| `unit_name` | `str` | 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` | `str` | Optional | A description for the component that will be displayed to the user on the hosted signup page. | -| `handle` | `str` | 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` | `str` | 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` | `bool` | 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` | [`List[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,38 @@ | `display_on_hosted_page` | `bool` | Optional | - | | `allow_fractional_quantities` | `bool` | Optional | - | | `public_signup_page_ids` | `List[int]` | Optional | - | -| `interval` | `int` | 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` | `int` | 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 - } - ], - "upgrade_charge": "full" -} +| `unspsc_code` | `str` | 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 + +```python +from advancedbilling.models.credit_type import CreditType +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme +from advancedbilling.models.quantity_based_component import QuantityBasedComponent + +quantity_based_component = QuantityBasedComponent( + name='name0', + unit_name='unit_name2', + pricing_scheme=PricingScheme.STAIRSTEP, + description='description0', + handle='handle6', + taxable=False, + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ), + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ) + ], + upgrade_charge=CreditType.PRORATED +) ``` diff --git a/doc/models/reactivate-subscription-group-request.md b/doc/models/reactivate-subscription-group-request.md index 3ef407e3..dead2993 100644 --- a/doc/models/reactivate-subscription-group-request.md +++ b/doc/models/reactivate-subscription-group-request.md @@ -12,12 +12,14 @@ | `resume` | `bool` | Optional | - | | `resume_members` | `bool` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "resume": false, - "resume_members": false -} +```python +from advancedbilling.models.reactivate_subscription_group_request import ReactivateSubscriptionGroupRequest + +reactivate_subscription_group_request = ReactivateSubscriptionGroupRequest( + resume=False, + resume_members=False +) ``` diff --git a/doc/models/reactivate-subscription-group-response.md b/doc/models/reactivate-subscription-group-response.md index 17f8541c..deb31470 100644 --- a/doc/models/reactivate-subscription-group-response.md +++ b/doc/models/reactivate-subscription-group-response.md @@ -19,18 +19,21 @@ | `state` | `str` | Optional | - | | `cancel_at_end_of_period` | `bool` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid4", - "scheme": 66, - "customer_id": 86, - "payment_profile_id": 250, - "subscription_ids": [ - 196, - 197 - ] -} +## Example + +```python +from advancedbilling.models.reactivate_subscription_group_response import ReactivateSubscriptionGroupResponse + +reactivate_subscription_group_response = ReactivateSubscriptionGroupResponse( + 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 247b3a1d..74c7decf 100644 --- a/doc/models/reactivate-subscription-request.md +++ b/doc/models/reactivate-subscription-request.md @@ -9,24 +9,28 @@ | 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` | `bool` | 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` | `bool` | Optional | If `true` is passed, the existing subscription balance will NOT be cleared/reset before adding the additional reactivation charges. | | `coupon_code` | `str` | Optional | The coupon code to be applied during reactivation. | | `use_credits_and_prepayments` | `bool` | 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` | bool \| [Resume Options](../../doc/models/resume-options.md) \| None | 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 + +```python +from advancedbilling.models.reactivate_subscription_request import ReactivateSubscriptionRequest +from advancedbilling.models.reactivation_billing import ReactivationBilling +from advancedbilling.models.reactivation_charge import ReactivationCharge + +reactivate_subscription_request = ReactivateSubscriptionRequest( + calendar_billing=ReactivationBilling( + 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 f56885c5..76d77c9e 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,16 @@ 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**: `"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**: `"prorated"` | -## Example (as JSON) +## Example -```json -{ - "reactivation_charge": "prorated" -} +```python +from advancedbilling.models.reactivation_billing import ReactivationBilling +from advancedbilling.models.reactivation_charge import ReactivationCharge + +reactivation_billing = ReactivationBilling( + reactivation_charge=ReactivationCharge.PRORATED +) ``` diff --git a/doc/models/reactivation-charge.md b/doc/models/reactivation-charge.md index dbe0bc6e..87d57a13 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,11 @@ You may choose how to handle the reactivation charge for that subscription: 1) ` | `IMMEDIATE` | | `DELAYED` | +## Example + +```python +from advancedbilling.models.reactivation_charge import ReactivationCharge + +reactivation_charge = ReactivationCharge.IMMEDIATE +``` + diff --git a/doc/models/reason-code-response.md b/doc/models/reason-code-response.md index defe592d..57cb94ba 100644 --- a/doc/models/reason-code-response.md +++ b/doc/models/reason-code-response.md @@ -11,17 +11,20 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.reason_code import ReasonCode +from advancedbilling.models.reason_code_response import ReasonCodeResponse + +reason_code_response = ReasonCodeResponse( + reason_code=ReasonCode( + 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 05ebdc4b..7f849d55 100644 --- a/doc/models/reason-code.md +++ b/doc/models/reason-code.md @@ -17,15 +17,17 @@ | `created_at` | `datetime` | Optional | - | | `updated_at` | `datetime` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 164, - "site_id": 90, - "code": "code0", - "description": "description2", - "position": 194 -} +## Example + +```python +from advancedbilling.models.reason_code import ReasonCode + +reason_code = ReasonCode( + 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..ceefd06d 100644 --- a/doc/models/record-payment-request.md +++ b/doc/models/record-payment-request.md @@ -11,16 +11,20 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.create_payment import CreatePayment +from advancedbilling.models.invoice_payment_method_type import InvoicePaymentMethodType +from advancedbilling.models.record_payment_request import RecordPaymentRequest + +record_payment_request = RecordPaymentRequest( + payment=CreatePayment( + 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 a23ddda3..6026d420 100644 --- a/doc/models/record-payment-response.md +++ b/doc/models/record-payment-response.md @@ -12,35 +12,28 @@ | `paid_invoices` | [`List[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" - } - ], - "prepayment": { - "subscription_id": 148, - "amount_in_cents": 124, - "ending_balance_in_cents": 164 - } -} +## Example + +```python +from advancedbilling.models.invoice_pre_payment import InvoicePrePayment +from advancedbilling.models.invoice_status import InvoiceStatus +from advancedbilling.models.paid_invoice import PaidInvoice +from advancedbilling.models.record_payment_response import RecordPaymentResponse + +record_payment_response = RecordPaymentResponse( + paid_invoices=[ + PaidInvoice( + invoice_id='invoice_id8', + status=InvoiceStatus.DRAFT, + due_amount='due_amount0', + paid_amount='paid_amount0' + ) + ], + prepayment=InvoicePrePayment( + 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..fd388389 100644 --- a/doc/models/recurring-scheme.md +++ b/doc/models/recurring-scheme.md @@ -13,3 +13,11 @@ | `RECUR_INDEFINITELY` | | `RECUR_WITH_DURATION` | +## Example + +```python +from advancedbilling.models.recurring_scheme import RecurringScheme + +recurring_scheme = RecurringScheme.RECUR_WITH_DURATION +``` + diff --git a/doc/models/referral-code.md b/doc/models/referral-code.md index 173c6f89..f2a71d63 100644 --- a/doc/models/referral-code.md +++ b/doc/models/referral-code.md @@ -14,14 +14,16 @@ | `subscription_id` | `int` | Optional | - | | `code` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 42, - "site_id": 224, - "subscription_id": 152, - "code": "code6" -} +## Example + +```python +from advancedbilling.models.referral_code import ReferralCode + +referral_code = ReferralCode( + 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..601c0a68 100644 --- a/doc/models/referral-validation-response.md +++ b/doc/models/referral-validation-response.md @@ -11,16 +11,19 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.referral_code import ReferralCode +from advancedbilling.models.referral_validation_response import ReferralValidationResponse + +referral_validation_response = ReferralValidationResponse( + referral_code=ReferralCode( + 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 8429bf37..a5511c52 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,22 @@ Refund consolidated invoice | `apply_credit` | `bool` | Optional | If set to true, creates credit and applies it to an invoice. Defaults to `false`. | | `amount` | `str` | 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) - -```json -{ - "memo": "memo0", - "payment_id": 46, - "segment_uids": [ - "String0", - "String1" - ], - "external": false, - "apply_credit": false, - "amount": "amount8" -} +## Example + +```python +from advancedbilling.models.refund_consolidated_invoice import RefundConsolidatedInvoice + +refund_consolidated_invoice = RefundConsolidatedInvoice( + memo='memo2', + payment_id=66, + segment_uids=[ + 'String2', + 'String3', + 'String4' + ], + 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 db4fd3bf..a1b60fae 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` | `bool` | 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` | `str` | Optional | The refund memo. | | `original_amount` | `str` | Optional | The full, original amount of the refund. | @@ -21,25 +21,31 @@ Example schema for an `refund_invoice` event | `refund_id` | `int` | 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 + +```python +import dateutil.parser + +from advancedbilling.models.credit_note import CreditNote +from advancedbilling.models.invoice_consolidation_level import InvoiceConsolidationLevel +from advancedbilling.models.refund_invoice_event_data import RefundInvoiceEventData + +refund_invoice_event_data = RefundInvoiceEventData( + apply_credit=False, + credit_note_attributes=CreditNote( + 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=dateutil.parser.parse('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 32dfbc19..daceaed6 100644 --- a/doc/models/refund-invoice-event.md +++ b/doc/models/refund-invoice-event.md @@ -15,41 +15,50 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"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 + +```python +import dateutil.parser + +from advancedbilling.models.credit_note import CreditNote +from advancedbilling.models.invoice import Invoice +from advancedbilling.models.invoice_consolidation_level import InvoiceConsolidationLevel +from advancedbilling.models.invoice_event_type import InvoiceEventType +from advancedbilling.models.refund_invoice_event import RefundInvoiceEvent +from advancedbilling.models.refund_invoice_event_data import RefundInvoiceEventData + +refund_invoice_event = RefundInvoiceEvent( + id=142, + timestamp=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + invoice=Invoice( + id=166, + uid='uid6', + site_id=92, + customer_id=204, + subscription_id=20, + issue_date=dateutil.parser.parse('2024-01-01').date(), + due_date=dateutil.parser.parse('2024-01-01').date(), + paid_date=dateutil.parser.parse('2024-01-01').date(), + public_url_expires_on=dateutil.parser.parse('2024-01-21').date() + ), + event_type=InvoiceEventType.REFUND_INVOICE, + event_data=RefundInvoiceEventData( + apply_credit=False, + credit_note_attributes=CreditNote( + 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=dateutil.parser.parse('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..dd52176a 100644 --- a/doc/models/refund-invoice-request.md +++ b/doc/models/refund-invoice-request.md @@ -11,18 +11,21 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.refund_invoice import RefundInvoice +from advancedbilling.models.refund_invoice_request import RefundInvoiceRequest + +refund_invoice_request = RefundInvoiceRequest( + refund=RefundInvoice( + 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 da133e30..73bb4913 100644 --- a/doc/models/refund-invoice.md +++ b/doc/models/refund-invoice.md @@ -16,18 +16,20 @@ Refund an invoice or a segment of a consolidated invoice. | `payment_id` | `int` | Required | The ID of the payment to be refunded | | `external` | `bool` | Optional | Flag that marks refund as external (no money is returned to the customer). Defaults to `false`. | | `apply_credit` | `bool` | Optional | If set to true, creates credit and applies it to an invoice. Defaults to `false`. | -| `void_invoice` | `bool` | 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` | `bool` | 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 + +```python +from advancedbilling.models.refund_invoice import RefundInvoice + +refund_invoice = RefundInvoice( + 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..e748b609 100644 --- a/doc/models/refund-prepayment-base-errors-response-exception.md +++ b/doc/models/refund-prepayment-base-errors-response-exception.md @@ -13,20 +13,14 @@ 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 + +```python +try: + # make the API call +except RefundPrepaymentBaseErrorsResponseException as e: + print(e) +except APIException as e: + print(e) ``` diff --git a/doc/models/refund-prepayment-base-refund-error.md b/doc/models/refund-prepayment-base-refund-error.md index cd1d7290..88ff2ecd 100644 --- a/doc/models/refund-prepayment-base-refund-error.md +++ b/doc/models/refund-prepayment-base-refund-error.md @@ -11,18 +11,20 @@ | --- | --- | --- | --- | | `refund` | [`BaseRefundError`](../../doc/models/base-refund-error.md) | Optional | - | -## Example (as JSON) - -```json -{ - "refund": { - "base": [ - { - "key1": "val1", - "key2": "val2" - } - ] - } -} +## Example + +```python +import jsonpickle + +from advancedbilling.models.base_refund_error import BaseRefundError +from advancedbilling.models.refund_prepayment_base_refund_error import RefundPrepaymentBaseRefundError + +refund_prepayment_base_refund_error = RefundPrepaymentBaseRefundError( + refund=BaseRefundError( + base=[ + jsonpickle.decode('{"key1":"val1","key2":"val2"}') + ] + ) +) ``` diff --git a/doc/models/refund-prepayment-request.md b/doc/models/refund-prepayment-request.md index 2d4ac5a8..e231e49f 100644 --- a/doc/models/refund-prepayment-request.md +++ b/doc/models/refund-prepayment-request.md @@ -11,16 +11,19 @@ | --- | --- | --- | --- | | `refund` | [`RefundPrepayment`](../../doc/models/refund-prepayment.md) | Required | - | -## Example (as JSON) - -```json -{ - "refund": { - "amount_in_cents": 132, - "amount": "String1", - "memo": "memo2", - "external": false - } -} +## Example + +```python +from advancedbilling.models.refund_prepayment import RefundPrepayment +from advancedbilling.models.refund_prepayment_request import RefundPrepaymentRequest + +refund_prepayment_request = RefundPrepaymentRequest( + refund=RefundPrepayment( + 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 08d76c5a..b8846a24 100644 --- a/doc/models/refund-prepayment.md +++ b/doc/models/refund-prepayment.md @@ -14,14 +14,16 @@ | `memo` | `str` | Required | **Constraints**: *Minimum Length*: `1` | | `external` | `bool` | 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 + +```python +from advancedbilling.models.refund_prepayment import RefundPrepayment + +refund_prepayment = RefundPrepayment( + 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 25a658b9..0b6d331f 100644 --- a/doc/models/refund-success.md +++ b/doc/models/refund-success.md @@ -13,13 +13,15 @@ | `gateway_transaction_id` | `int` | Required | - | | `product_id` | `int` | Required | - | -## Example (as JSON) - -```json -{ - "refund_id": 12, - "gateway_transaction_id": 182, - "product_id": 168 -} +## Example + +```python +from advancedbilling.models.refund_success import RefundSuccess + +refund_success = RefundSuccess( + refund_id=194, + gateway_transaction_id=0, + product_id=162 +) ``` diff --git a/doc/models/register.md b/doc/models/register.md index 0b165c99..78199610 100644 --- a/doc/models/register.md +++ b/doc/models/register.md @@ -12,16 +12,18 @@ | `id` | `int` | Optional | - | | `maxio_id` | `str` | Optional | - | | `name` | `str` | Optional | - | -| `currency_code` | `str` | Optional | The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. | +| `currency_code` | `str` | 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" -} +```python +from advancedbilling.models.register import Register + +register = Register( + 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 9e64ceb1..54e1bc8e 100644 --- a/doc/models/remove-payment-event-data.md +++ b/doc/models/remove-payment-event-data.md @@ -19,19 +19,25 @@ 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` | `bool` | 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 + +```python +import dateutil.parser + +from advancedbilling.models.invoice_event_payment_method import InvoiceEventPaymentMethod +from advancedbilling.models.payment_method_apple_pay import PaymentMethodApplePay +from advancedbilling.models.remove_payment_event_data import RemovePaymentEventData + +remove_payment_event_data = RemovePaymentEventData( + transaction_id=50, + memo='memo0', + applied_amount='applied_amount2', + transaction_time=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + payment_method=PaymentMethodApplePay( + mtype=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 5d162f57..dfe769dd 100644 --- a/doc/models/remove-payment-event.md +++ b/doc/models/remove-payment-event.md @@ -15,35 +15,44 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"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 + +```python +import dateutil.parser + +from advancedbilling.models.invoice import Invoice +from advancedbilling.models.invoice_event_payment_method import InvoiceEventPaymentMethod +from advancedbilling.models.invoice_event_type import InvoiceEventType +from advancedbilling.models.payment_method_apple_pay import PaymentMethodApplePay +from advancedbilling.models.remove_payment_event import RemovePaymentEvent +from advancedbilling.models.remove_payment_event_data import RemovePaymentEventData + +remove_payment_event = RemovePaymentEvent( + id=4, + timestamp=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + invoice=Invoice( + id=166, + uid='uid6', + site_id=92, + customer_id=204, + subscription_id=20, + issue_date=dateutil.parser.parse('2024-01-01').date(), + due_date=dateutil.parser.parse('2024-01-01').date(), + paid_date=dateutil.parser.parse('2024-01-01').date(), + public_url_expires_on=dateutil.parser.parse('2024-01-21').date() + ), + event_type=InvoiceEventType.REMOVE_PAYMENT, + event_data=RemovePaymentEventData( + transaction_id=78, + memo='memo0', + applied_amount='applied_amount2', + transaction_time=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + payment_method=PaymentMethodApplePay( + mtype=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 71c9caf0..5b07d50a 100644 --- a/doc/models/renewal-preview-component.md +++ b/doc/models/renewal-preview-component.md @@ -13,13 +13,15 @@ | `quantity` | `int` | 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` | str \| int \| None | Optional | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "component_id": "String7", - "quantity": 174, - "price_point_id": "String1" -} +## Example + +```python +from advancedbilling.models.renewal_preview_component import RenewalPreviewComponent + +renewal_preview_component = RenewalPreviewComponent( + 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 c8469a7e..4094bae8 100644 --- a/doc/models/renewal-preview-line-item.md +++ b/doc/models/renewal-preview-line-item.md @@ -24,15 +24,19 @@ | `period_range_start` | `str` | Optional | - | | `period_range_end` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "transaction_type": "charge", - "kind": "prepaid_usage_component", - "amount_in_cents": 154, - "memo": "memo0", - "discount_amount_in_cents": 214 -} +## Example + +```python +from advancedbilling.models.line_item_kind import LineItemKind +from advancedbilling.models.line_item_transaction_type import LineItemTransactionType +from advancedbilling.models.renewal_preview_line_item import RenewalPreviewLineItem + +renewal_preview_line_item = RenewalPreviewLineItem( + 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 e9899681..8fa42c05 100644 --- a/doc/models/renewal-preview-request.md +++ b/doc/models/renewal-preview-request.md @@ -9,29 +9,27 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `components` | [`List[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` | [`List[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 + +```python +from advancedbilling.models.renewal_preview_component import RenewalPreviewComponent +from advancedbilling.models.renewal_preview_request import RenewalPreviewRequest + +renewal_preview_request = RenewalPreviewRequest( + components=[ + RenewalPreviewComponent( + component_id='String5', + quantity=210, + price_point_id='String3' + ), + RenewalPreviewComponent( + 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..88f827d3 100644 --- a/doc/models/renewal-preview-response.md +++ b/doc/models/renewal-preview-response.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | | `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 + +```python +import dateutil.parser + +from advancedbilling.models.renewal_preview import RenewalPreview +from advancedbilling.models.renewal_preview_response import RenewalPreviewResponse + +renewal_preview_response = RenewalPreviewResponse( + renewal_preview=RenewalPreview( + next_assessment_at=dateutil.parser.parse('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 73d54a04..6a37938c 100644 --- a/doc/models/renewal-preview.md +++ b/doc/models/renewal-preview.md @@ -19,15 +19,19 @@ | `uncalculated_taxes` | `bool` | 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` | [`List[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 + +```python +import dateutil.parser + +from advancedbilling.models.renewal_preview import RenewalPreview + +renewal_preview = RenewalPreview( + next_assessment_at=dateutil.parser.parse('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 c13fcfb6..b45adf04 100644 --- a/doc/models/replay-webhooks-request.md +++ b/doc/models/replay-webhooks-request.md @@ -11,13 +11,17 @@ | --- | --- | --- | --- | | `ids` | `List[int]` | Required | - | -## Example (as JSON) - -```json -{ - "ids": [ - 15 - ] -} +## Example + +```python +from advancedbilling.models.replay_webhooks_request import ReplayWebhooksRequest + +replay_webhooks_request = ReplayWebhooksRequest( + ids=[ + 233, + 234, + 235 + ] +) ``` diff --git a/doc/models/replay-webhooks-response.md b/doc/models/replay-webhooks-response.md index 2f6bfa50..da98741e 100644 --- a/doc/models/replay-webhooks-response.md +++ b/doc/models/replay-webhooks-response.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `status` | `str` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "status": "status4" -} +```python +from advancedbilling.models.replay_webhooks_response import ReplayWebhooksResponse + +replay_webhooks_response = ReplayWebhooksResponse( + status='status0' +) ``` diff --git a/doc/models/resent-invitation.md b/doc/models/resent-invitation.md index 86b07ecf..004359fe 100644 --- a/doc/models/resent-invitation.md +++ b/doc/models/resent-invitation.md @@ -16,16 +16,20 @@ | `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 + +```python +import dateutil.parser + +from advancedbilling.models.resent_invitation import ResentInvitation + +resent_invitation = ResentInvitation( + 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=dateutil.parser.parse('2024-01-01T04:30:00+00:00'), + last_invite_accepted_at=dateutil.parser.parse('2024-01-01T04:35:00+00:00') +) ``` diff --git a/doc/models/resource-type.md b/doc/models/resource-type.md index 1490b923..238a0ae9 100644 --- a/doc/models/resource-type.md +++ b/doc/models/resource-type.md @@ -12,3 +12,11 @@ | `SUBSCRIPTIONS` | | `CUSTOMERS` | +## Example + +```python +from advancedbilling.models.resource_type import ResourceType + +resource_type = ResourceType.SUBSCRIPTIONS +``` + diff --git a/doc/models/restriction-type.md b/doc/models/restriction-type.md index 816172f6..db3576a0 100644 --- a/doc/models/restriction-type.md +++ b/doc/models/restriction-type.md @@ -12,3 +12,11 @@ | `COMPONENT` | | `PRODUCT` | +## Example + +```python +from advancedbilling.models.restriction_type import RestrictionType + +restriction_type = RestrictionType.COMPONENT +``` + diff --git a/doc/models/resume-options.md b/doc/models/resume-options.md index 1bc16a54..514e4524 100644 --- a/doc/models/resume-options.md +++ b/doc/models/resume-options.md @@ -12,12 +12,14 @@ | `require_resume` | `bool` | 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` | `bool` | 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 -} +```python +from advancedbilling.models.resume_options import ResumeOptions + +resume_options = ResumeOptions( + require_resume=False, + forgive_balance=False +) ``` diff --git a/doc/models/resumption-charge.md b/doc/models/resumption-charge.md index 799f3d35..6394c39f 100644 --- a/doc/models/resumption-charge.md +++ b/doc/models/resumption-charge.md @@ -15,3 +15,11 @@ | `IMMEDIATE` | | `DELAYED` | +## Example + +```python +from advancedbilling.models.resumption_charge import ResumptionCharge + +resumption_charge = ResumptionCharge.PRORATED +``` + diff --git a/doc/models/revoked-invitation.md b/doc/models/revoked-invitation.md index a36b266d..46af0e9c 100644 --- a/doc/models/revoked-invitation.md +++ b/doc/models/revoked-invitation.md @@ -13,13 +13,15 @@ | `last_accepted_at` | `str` | Optional | - | | `uninvited_count` | `int` | Optional | - | -## Example (as JSON) - -```json -{ - "last_sent_at": "last_sent_at2", - "last_accepted_at": "last_accepted_at2", - "uninvited_count": 226 -} +## Example + +```python +from advancedbilling.models.revoked_invitation import RevokedInvitation + +revoked_invitation = RevokedInvitation( + 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 dba82663..f78308e9 100644 --- a/doc/models/sale-rep-item-mrr.md +++ b/doc/models/sale-rep-item-mrr.md @@ -13,13 +13,15 @@ | `usage` | `str` | Optional | - | | `recurring` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "mrr": "mrr2", - "usage": "usage0", - "recurring": "recurring4" -} +## Example + +```python +from advancedbilling.models.sale_rep_item_mrr import SaleRepItemMrr + +sale_rep_item_mrr = SaleRepItemMrr( + mrr='mrr8', + usage='usage4', + recurring='recurring0' +) ``` diff --git a/doc/models/sale-rep-settings.md b/doc/models/sale-rep-settings.md index 4bc8b3f7..297f6292 100644 --- a/doc/models/sale-rep-settings.md +++ b/doc/models/sale-rep-settings.md @@ -17,15 +17,17 @@ | `sales_rep_id` | `int` | Optional | - | | `sales_rep_name` | `str` | 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 + +```python +from advancedbilling.models.sale_rep_settings import SaleRepSettings + +sale_rep_settings = SaleRepSettings( + 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 63a93efc..e5716429 100644 --- a/doc/models/sale-rep-subscription.md +++ b/doc/models/sale-rep-subscription.md @@ -20,15 +20,17 @@ | `last_payment` | `str` | Optional | - | | `churn_date` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 18, - "site_name": "site_name2", - "subscription_url": "subscription_url6", - "customer_name": "customer_name2", - "created_at": "created_at8" -} +## Example + +```python +from advancedbilling.models.sale_rep_subscription import SaleRepSubscription + +sale_rep_subscription = SaleRepSubscription( + 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 bad5d8aa..0ccfa533 100644 --- a/doc/models/sale-rep.md +++ b/doc/models/sale-rep.md @@ -15,30 +15,33 @@ | `test_mode` | `bool` | Optional | - | | `subscriptions` | [`List[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 + +```python +from advancedbilling.models.sale_rep import SaleRep +from advancedbilling.models.sale_rep_subscription import SaleRepSubscription + +sale_rep = SaleRep( + id=214, + full_name='full_name0', + subscriptions_count=34, + test_mode=False, + subscriptions=[ + SaleRepSubscription( + id=202, + site_name='site_name8', + subscription_url='subscription_url2', + customer_name='customer_name8', + created_at='created_at4' + ), + SaleRepSubscription( + 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 d629aa3e..bd634bab 100644 --- a/doc/models/scheduled-renewal-component-custom-price.md +++ b/doc/models/scheduled-renewal-component-custom-price.md @@ -12,22 +12,26 @@ Custom pricing for a component within a scheduled renewal. | Name | Type | Tags | Description | | --- | --- | --- | --- | | `tax_included` | `bool` | 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` | [`List[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 - } - ], - "tax_included": false -} +## Example + +```python +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme +from advancedbilling.models.scheduled_renewal_component_custom_price import ScheduledRenewalComponentCustomPrice + +scheduled_renewal_component_custom_price = ScheduledRenewalComponentCustomPrice( + pricing_scheme=PricingScheme.PER_UNIT, + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ) + ], + 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..cfeb40e9 100644 --- a/doc/models/scheduled-renewal-configuration-item-request.md +++ b/doc/models/scheduled-renewal-configuration-item-request.md @@ -11,32 +11,37 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme +from advancedbilling.models.scheduled_renewal_component_custom_price import ScheduledRenewalComponentCustomPrice +from advancedbilling.models.scheduled_renewal_configuration_item_request import ScheduledRenewalConfigurationItemRequest +from advancedbilling.models.scheduled_renewal_item_request_body_component import ScheduledRenewalItemRequestBodyComponent + +scheduled_renewal_configuration_item_request = ScheduledRenewalConfigurationItemRequest( + renewal_configuration_item=ScheduledRenewalItemRequestBodyComponent( + item_id=108, + price_point_id=122, + quantity=212, + custom_price=ScheduledRenewalComponentCustomPrice( + pricing_scheme=PricingScheme.STAIRSTEP, + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ), + Price( + 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..73f79292 100644 --- a/doc/models/scheduled-renewal-configuration-item-response.md +++ b/doc/models/scheduled-renewal-configuration-item-response.md @@ -11,17 +11,20 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.scheduled_renewal_configuration_item import ScheduledRenewalConfigurationItem +from advancedbilling.models.scheduled_renewal_configuration_item_response import ScheduledRenewalConfigurationItemResponse + +scheduled_renewal_configuration_item_response = ScheduledRenewalConfigurationItemResponse( + scheduled_renewal_configuration_item=ScheduledRenewalConfigurationItem( + 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 15391d9f..cafa0847 100644 --- a/doc/models/scheduled-renewal-configuration-item.md +++ b/doc/models/scheduled-renewal-configuration-item.md @@ -21,15 +21,17 @@ | `decimal_quantity` | `str` | 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 + +```python +from advancedbilling.models.scheduled_renewal_configuration_item import ScheduledRenewalConfigurationItem + +scheduled_renewal_configuration_item = ScheduledRenewalConfigurationItem( + 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 fc5f0dbd..ba8e4ae7 100644 --- a/doc/models/scheduled-renewal-configuration-request-body.md +++ b/doc/models/scheduled-renewal-configuration-request-body.md @@ -15,15 +15,19 @@ | `contract_id` | `int` | Optional | (Optional) Existing contract to associate with the scheduled renewal. Contracts must be enabled for your site. | | `create_new_contract` | `bool` | 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 + +```python +import dateutil.parser + +from advancedbilling.models.scheduled_renewal_configuration_request_body import ScheduledRenewalConfigurationRequestBody + +scheduled_renewal_configuration_request_body = ScheduledRenewalConfigurationRequestBody( + starts_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + ends_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + lock_in_at=dateutil.parser.parse('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..e4c52923 100644 --- a/doc/models/scheduled-renewal-configuration-request.md +++ b/doc/models/scheduled-renewal-configuration-request.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | | `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 + +```python +import dateutil.parser + +from advancedbilling.models.scheduled_renewal_configuration_request import ScheduledRenewalConfigurationRequest +from advancedbilling.models.scheduled_renewal_configuration_request_body import ScheduledRenewalConfigurationRequestBody + +scheduled_renewal_configuration_request = ScheduledRenewalConfigurationRequest( + renewal_configuration=ScheduledRenewalConfigurationRequestBody( + starts_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + ends_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + lock_in_at=dateutil.parser.parse('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..4da45c4f 100644 --- a/doc/models/scheduled-renewal-configuration-response.md +++ b/doc/models/scheduled-renewal-configuration-response.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | | `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 + +```python +import dateutil.parser + +from advancedbilling.models.scheduled_renewal_configuration import ScheduledRenewalConfiguration +from advancedbilling.models.scheduled_renewal_configuration_response import ScheduledRenewalConfigurationResponse + +scheduled_renewal_configuration_response = ScheduledRenewalConfigurationResponse( + scheduled_renewal_configuration=ScheduledRenewalConfiguration( + id=134, + site_id=60, + subscription_id=244, + starts_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + ends_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/scheduled-renewal-configuration.md b/doc/models/scheduled-renewal-configuration.md index df1bac2b..096ce28d 100644 --- a/doc/models/scheduled-renewal-configuration.md +++ b/doc/models/scheduled-renewal-configuration.md @@ -20,15 +20,19 @@ | `scheduled_renewal_configuration_items` | [`List[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 + +```python +import dateutil.parser + +from advancedbilling.models.scheduled_renewal_configuration import ScheduledRenewalConfiguration + +scheduled_renewal_configuration = ScheduledRenewalConfiguration( + id=134, + site_id=60, + subscription_id=244, + starts_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + ends_at=dateutil.parser.parse('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 2f494fe5..ad12e550 100644 --- a/doc/models/scheduled-renewal-configurations-response.md +++ b/doc/models/scheduled-renewal-configurations-response.md @@ -11,33 +11,31 @@ | --- | --- | --- | --- | | `scheduled_renewal_configurations` | [`List[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 + +```python +import dateutil.parser + +from advancedbilling.models.scheduled_renewal_configuration import ScheduledRenewalConfiguration +from advancedbilling.models.scheduled_renewal_configurations_response import ScheduledRenewalConfigurationsResponse + +scheduled_renewal_configurations_response = ScheduledRenewalConfigurationsResponse( + scheduled_renewal_configurations=[ + ScheduledRenewalConfiguration( + id=122, + site_id=48, + subscription_id=232, + starts_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + ends_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') + ), + ScheduledRenewalConfiguration( + id=122, + site_id=48, + subscription_id=232, + starts_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + ends_at=dateutil.parser.parse('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 d6c97f80..1fa716e1 100644 --- a/doc/models/scheduled-renewal-item-request-body-component.md +++ b/doc/models/scheduled-renewal-item-request-body-component.md @@ -12,33 +12,37 @@ | `item_type` | `str` | Required, Constant | Item type to add. Either Product or Component.

**Value**: `"Component"` | | `item_id` | `int` | Required | Product or component identifier. | | `price_point_id` | `int` | Optional | Price point identifier. | -| `quantity` | `int` | Optional | Optional quantity for the item. | +| `quantity` | `int` | 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 + +```python +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme +from advancedbilling.models.scheduled_renewal_component_custom_price import ScheduledRenewalComponentCustomPrice +from advancedbilling.models.scheduled_renewal_item_request_body_component import ScheduledRenewalItemRequestBodyComponent + +scheduled_renewal_item_request_body_component = ScheduledRenewalItemRequestBodyComponent( + item_id=228, + price_point_id=214, + quantity=36, + custom_price=ScheduledRenewalComponentCustomPrice( + pricing_scheme=PricingScheme.STAIRSTEP, + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ), + Price( + 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 d644f2c5..fd888d5c 100644 --- a/doc/models/scheduled-renewal-item-request-body-product.md +++ b/doc/models/scheduled-renewal-item-request-body-product.md @@ -12,27 +12,30 @@ | `item_type` | `str` | Required, Constant | Item type to add. Either Product or Component.

**Value**: `"Product"` | | `item_id` | `int` | Required | Product or component identifier. | | `price_point_id` | `int` | Optional | Price point identifier. | -| `quantity` | `int` | Optional | Optional quantity for the item. | +| `quantity` | `int` | 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 + +```python +from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.scheduled_renewal_item_request_body_product import ScheduledRenewalItemRequestBodyProduct +from advancedbilling.models.scheduled_renewal_product_price_point import ScheduledRenewalProductPricePoint + +scheduled_renewal_item_request_body_product = ScheduledRenewalItemRequestBodyProduct( + item_id=18, + price_point_id=4, + quantity=82, + custom_price=ScheduledRenewalProductPricePoint( + 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 7c2c804f..086bc288 100644 --- a/doc/models/scheduled-renewal-lock-in-request.md +++ b/doc/models/scheduled-renewal-lock-in-request.md @@ -11,11 +11,15 @@ | --- | --- | --- | --- | | `lock_in_at` | `date` | Required | Date to lock in the renewal. | -## Example (as JSON) +## Example -```json -{ - "lock_in_at": "2016-03-13" -} +```python +import dateutil.parser + +from advancedbilling.models.scheduled_renewal_lock_in_request import ScheduledRenewalLockInRequest + +scheduled_renewal_lock_in_request = ScheduledRenewalLockInRequest( + lock_in_at=dateutil.parser.parse('2016-03-13').date() +) ``` diff --git a/doc/models/scheduled-renewal-product-price-point.md b/doc/models/scheduled-renewal-product-price-point.md index 2c266437..f835dcc4 100644 --- a/doc/models/scheduled-renewal-product-price-point.md +++ b/doc/models/scheduled-renewal-product-price-point.md @@ -18,21 +18,24 @@ 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` | `bool` | Optional | (Optional) | | `initial_charge_in_cents` | `int` | Optional | The product price point initial charge, in integer cents. | -| `expiration_interval` | `int` | 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` | `int` | 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 + +```python +from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.scheduled_renewal_product_price_point import ScheduledRenewalProductPricePoint + +scheduled_renewal_product_price_point = ScheduledRenewalProductPricePoint( + 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..2b8bb87a 100644 --- a/doc/models/scheduled-renewal-update-request.md +++ b/doc/models/scheduled-renewal-update-request.md @@ -11,32 +11,37 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme +from advancedbilling.models.scheduled_renewal_component_custom_price import ScheduledRenewalComponentCustomPrice +from advancedbilling.models.scheduled_renewal_item_request_body_component import ScheduledRenewalItemRequestBodyComponent +from advancedbilling.models.scheduled_renewal_update_request import ScheduledRenewalUpdateRequest + +scheduled_renewal_update_request = ScheduledRenewalUpdateRequest( + renewal_configuration_item=ScheduledRenewalItemRequestBodyComponent( + item_id=108, + price_point_id=122, + quantity=212, + custom_price=ScheduledRenewalComponentCustomPrice( + pricing_scheme=PricingScheme.STAIRSTEP, + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ), + Price( + 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 2f53f71c..ac7a00f6 100644 --- a/doc/models/segment-price.md +++ b/doc/models/segment-price.md @@ -18,15 +18,17 @@ | `formatted_unit_price` | `str` | Optional | - | | `segment_id` | `int` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 220, - "component_id": 74, - "starting_quantity": 118, - "ending_quantity": 92, - "unit_price": "unit_price0" -} +## Example + +```python +from advancedbilling.models.segment_price import SegmentPrice + +segment_price = SegmentPrice( + 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..22198a1b 100644 --- a/doc/models/segment-response.md +++ b/doc/models/segment-response.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.pricing_scheme import PricingScheme +from advancedbilling.models.segment import Segment +from advancedbilling.models.segment_response import SegmentResponse + +segment_response = SegmentResponse( + segment=Segment( + 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 8038ead3..1de7524c 100644 --- a/doc/models/segment.md +++ b/doc/models/segment.md @@ -22,15 +22,18 @@ | `updated_at` | `datetime` | Optional | - | | `prices` | [`List[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 + +```python +from advancedbilling.models.pricing_scheme import PricingScheme +from advancedbilling.models.segment import Segment + +segment = Segment( + 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 2f7d1371..758a8c5f 100644 --- a/doc/models/send-email.md +++ b/doc/models/send-email.md @@ -12,12 +12,14 @@ | `can_execute` | `bool` | Required | - | | `url` | `str` | Required | - | -## Example (as JSON) +## Example -```json -{ - "can_execute": false, - "url": "url2" -} +```python +from advancedbilling.models.send_email import SendEmail + +send_email = SendEmail( + can_execute=False, + url='url0' +) ``` diff --git a/doc/models/send-invoice-request.md b/doc/models/send-invoice-request.md index a0659fe3..ed7d7882 100644 --- a/doc/models/send-invoice-request.md +++ b/doc/models/send-invoice-request.md @@ -14,25 +14,31 @@ | `bcc_recipient_emails` | `List[str]` | Optional | **Constraints**: *Maximum Items*: `5` | | `attachment_urls` | `List[str]` | 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" - ], - "cc_recipient_emails": [ - "cc_recipient_emails6", - "cc_recipient_emails5" - ], - "bcc_recipient_emails": [ - "bcc_recipient_emails6" - ], - "attachment_urls": [ - "attachment_urls0", - "attachment_urls1" - ] -} +## Example + +```python +from advancedbilling.models.send_invoice_request import SendInvoiceRequest + +send_invoice_request = SendInvoiceRequest( + recipient_emails=[ + 'recipient_emails9', + 'recipient_emails0', + 'recipient_emails1' + ], + cc_recipient_emails=[ + 'cc_recipient_emails2', + 'cc_recipient_emails3' + ], + bcc_recipient_emails=[ + 'bcc_recipient_emails2', + 'bcc_recipient_emails1', + 'bcc_recipient_emails0' + ], + 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 060dce09..26558d22 100644 --- a/doc/models/service-credit-1.md +++ b/doc/models/service-credit-1.md @@ -14,19 +14,22 @@ | `ending_balance_in_cents` | `int` | Optional | The new balance for the credit account | | `entry_type` | [`ServiceCreditType`](../../doc/models/service-credit-type.md) | Optional | The type of entry | | `memo` | `str` | Optional | The memo attached to the entry | -| `invoice_uid` | `str` | Optional | The invoice uid associated with the entry. Only present for debit entries | +| `invoice_uid` | `str` | Optional | The invoice uid associated with the entry. Only present for debit entries. | | `remaining_balance_in_cents` | `int` | 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" -} +```python +from advancedbilling.models.service_credit_1 import ServiceCredit1 +from advancedbilling.models.service_credit_type import ServiceCreditType + +service_credit_1 = ServiceCredit1( + id=40, + amount_in_cents=126, + ending_balance_in_cents=166, + entry_type=ServiceCreditType.CREDIT, + memo='memo2' +) ``` diff --git a/doc/models/service-credit-response.md b/doc/models/service-credit-response.md index 3df9020f..8295039e 100644 --- a/doc/models/service-credit-response.md +++ b/doc/models/service-credit-response.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.service_credit import ServiceCredit +from advancedbilling.models.service_credit_response import ServiceCreditResponse +from advancedbilling.models.service_credit_type import ServiceCreditType + +service_credit_response = ServiceCreditResponse( + service_credit=ServiceCredit( + 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..b85f0deb 100644 --- a/doc/models/service-credit-type.md +++ b/doc/models/service-credit-type.md @@ -14,3 +14,11 @@ The type of entry | `CREDIT` | | `DEBIT` | +## Example + +```python +from advancedbilling.models.service_credit_type import ServiceCreditType + +service_credit_type = ServiceCreditType.CREDIT +``` + diff --git a/doc/models/service-credit.md b/doc/models/service-credit.md index d1241d38..237f319c 100644 --- a/doc/models/service-credit.md +++ b/doc/models/service-credit.md @@ -15,15 +15,18 @@ | `entry_type` | [`ServiceCreditType`](../../doc/models/service-credit-type.md) | Optional | The type of entry | | `memo` | `str` | 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 + +```python +from advancedbilling.models.service_credit import ServiceCredit +from advancedbilling.models.service_credit_type import ServiceCreditType + +service_credit = ServiceCredit( + 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..772b59a0 100644 --- a/doc/models/signup-proforma-preview-response.md +++ b/doc/models/signup-proforma-preview-response.md @@ -11,26 +11,30 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.proforma_invoice import ProformaInvoice +from advancedbilling.models.signup_proforma_preview import SignupProformaPreview +from advancedbilling.models.signup_proforma_preview_response import SignupProformaPreviewResponse + +signup_proforma_preview_response = SignupProformaPreviewResponse( + proforma_invoice_preview=SignupProformaPreview( + current_proforma_invoice=ProformaInvoice( + uid='uid6', + site_id=72, + customer_id=184, + subscription_id=0, + number=132 + ), + next_proforma_invoice=ProformaInvoice( + 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..39694bd0 100644 --- a/doc/models/signup-proforma-preview.md +++ b/doc/models/signup-proforma-preview.md @@ -12,24 +12,27 @@ | `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 + +```python +from advancedbilling.models.proforma_invoice import ProformaInvoice +from advancedbilling.models.signup_proforma_preview import SignupProformaPreview + +signup_proforma_preview = SignupProformaPreview( + current_proforma_invoice=ProformaInvoice( + uid='uid6', + site_id=72, + customer_id=184, + subscription_id=0, + number=132 + ), + next_proforma_invoice=ProformaInvoice( + 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 9b38d823..18b9d970 100644 --- a/doc/models/single-error-response-exception.md +++ b/doc/models/single-error-response-exception.md @@ -11,11 +11,14 @@ | --- | --- | --- | --- | | `error` | `str` | Required | - | -## Example (as JSON) - -```json -{ - "error": "error2" -} +## Example + +```python +try: + # make the API call +except SingleErrorResponseException as e: + print(e) +except APIException as e: + print(e) ``` diff --git a/doc/models/single-string-error-response-exception.md b/doc/models/single-string-error-response-exception.md index 788277a8..23853ab4 100644 --- a/doc/models/single-string-error-response-exception.md +++ b/doc/models/single-string-error-response-exception.md @@ -11,11 +11,14 @@ | --- | --- | --- | --- | | `errors` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "errors": "errors4" -} +## Example + +```python +try: + # make the API call +except SingleStringErrorResponseException as e: + print(e) +except APIException as e: + print(e) ``` diff --git a/doc/models/site-response.md b/doc/models/site-response.md index 26c6eb66..9d10ddf5 100644 --- a/doc/models/site-response.md +++ b/doc/models/site-response.md @@ -11,17 +11,20 @@ | --- | --- | --- | --- | | `site` | [`Site`](../../doc/models/site.md) | Required | - | -## Example (as JSON) - -```json -{ - "site": { - "id": 64, - "name": "name4", - "subdomain": "subdomain0", - "currency": "currency4", - "seller_id": 228 - } -} +## Example + +```python +from advancedbilling.models.site import Site +from advancedbilling.models.site_response import SiteResponse + +site_response = SiteResponse( + site=Site( + 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 2923abc2..3f5559ed 100644 --- a/doc/models/site-statistics.md +++ b/doc/models/site-statistics.md @@ -21,15 +21,17 @@ | `total_unpaid_subscriptions` | `int` | Optional | - | | `total_dunning_subscriptions` | `int` | 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 + +```python +from advancedbilling.models.site_statistics import SiteStatistics + +site_statistics = SiteStatistics( + 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 fdbad040..63fdda2e 100644 --- a/doc/models/site-summary.md +++ b/doc/models/site-summary.md @@ -15,21 +15,24 @@ | `site_currency` | `str` | 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 + +```python +from advancedbilling.models.site_statistics import SiteStatistics +from advancedbilling.models.site_summary import SiteSummary + +site_summary = SiteSummary( + seller_name='seller_name8', + site_name='site_name4', + site_id=170, + site_currency='site_currency2', + stats=SiteStatistics( + 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 9cd696fc..f46284e3 100644 --- a/doc/models/site.md +++ b/doc/models/site.md @@ -30,15 +30,17 @@ | `portal_enabled` | `bool` | Optional | Whether the Billing Portal is enabled for this site. | | `test` | `bool` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 34, - "name": "name0", - "subdomain": "subdomain4", - "currency": "currency0", - "seller_id": 198 -} +## Example + +```python +from advancedbilling.models.site import Site + +site = Site( + 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..e190e020 100644 --- a/doc/models/sorting-direction.md +++ b/doc/models/sorting-direction.md @@ -14,3 +14,11 @@ Used for sorting results. | `ASC` | | `DESC` | +## Example + +```python +from advancedbilling.models.sorting_direction import SortingDirection + +sorting_direction = SortingDirection.ASC +``` + diff --git a/doc/models/status.md b/doc/models/status.md index 3531d2ce..695b9f99 100644 --- a/doc/models/status.md +++ b/doc/models/status.md @@ -16,3 +16,11 @@ | `ACTIVE` | | `FULFILLED` | +## Example + +```python +from advancedbilling.models.status import Status + +status = Status.PENDING +``` + diff --git a/doc/models/subscription-add-coupon-error-exception.md b/doc/models/subscription-add-coupon-error-exception.md index 29a5871a..4210ce9b 100644 --- a/doc/models/subscription-add-coupon-error-exception.md +++ b/doc/models/subscription-add-coupon-error-exception.md @@ -14,25 +14,14 @@ | `coupon_codes` | `List[str]` | Optional | - | | `subscription` | `List[str]` | Optional | - | -## Example (as JSON) - -```json -{ - "codes": [ - "codes6", - "codes7", - "codes8" - ], - "coupon_code": [ - "coupon_code8", - "coupon_code7" - ], - "coupon_codes": [ - "coupon_codes2" - ], - "subscription": [ - "subscription8" - ] -} +## Example + +```python +try: + # make the API call +except SubscriptionAddCouponErrorException as e: + print(e) +except APIException as e: + print(e) ``` diff --git a/doc/models/subscription-component-allocation-error-exception.md b/doc/models/subscription-component-allocation-error-exception.md index e0000bfd..4d273a6e 100644 --- a/doc/models/subscription-component-allocation-error-exception.md +++ b/doc/models/subscription-component-allocation-error-exception.md @@ -11,16 +11,14 @@ | --- | --- | --- | --- | | `errors` | [`List[SubscriptionComponentAllocationErrorItem]`](../../doc/models/subscription-component-allocation-error-item.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": [ - { - "kind": "kind8", - "message": "message0" - } - ] -} +## Example + +```python +try: + # make the API call +except SubscriptionComponentAllocationErrorException as e: + print(e) +except APIException as e: + print(e) ``` diff --git a/doc/models/subscription-component-allocation-error-item.md b/doc/models/subscription-component-allocation-error-item.md index 505fda2c..177fe896 100644 --- a/doc/models/subscription-component-allocation-error-item.md +++ b/doc/models/subscription-component-allocation-error-item.md @@ -12,12 +12,14 @@ | `kind` | `str` | Optional | - | | `message` | `str` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "kind": "kind0", - "message": "message8" -} +```python +from advancedbilling.models.subscription_component_allocation_error_item import SubscriptionComponentAllocationErrorItem + +subscription_component_allocation_error_item = SubscriptionComponentAllocationErrorItem( + kind='kind0', + message='message2' +) ``` diff --git a/doc/models/subscription-component-response.md b/doc/models/subscription-component-response.md index 984a88f1..6090d100 100644 --- a/doc/models/subscription-component-response.md +++ b/doc/models/subscription-component-response.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.component_kind import ComponentKind +from advancedbilling.models.subscription_component import SubscriptionComponent +from advancedbilling.models.subscription_component_response import SubscriptionComponentResponse + +subscription_component_response = SubscriptionComponentResponse( + component=SubscriptionComponent( + 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 389421e1..3710b5ca 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,17 @@ 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" -} +```python +import dateutil.parser + +from advancedbilling.models.subscription_component_subscription import SubscriptionComponentSubscription +from advancedbilling.models.subscription_state import SubscriptionState + +subscription_component_subscription = SubscriptionComponentSubscription( + state=SubscriptionState.PAUSED, + updated_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/subscription-component.md b/doc/models/subscription-component.md index c6f56e85..ea75bfe3 100644 --- a/doc/models/subscription-component.md +++ b/doc/models/subscription-component.md @@ -13,8 +13,8 @@ | `name` | `str` | Optional | - | | `kind` | [`ComponentKind`](../../doc/models/component-kind.md) | Optional | A handle for the component type | | `unit_name` | `str` | Optional | - | -| `enabled` | `bool` | Optional | (for on/off components) indicates if the component is enabled for the subscription | -| `unit_balance` | `int` | Optional | - | +| `enabled` | `bool` | Optional | (for on/off components) indicates if the component is enabled for the subscription. | +| `unit_balance` | int \| str \| None | Optional | This is a container for one-of cases. | | `currency` | `str` | Optional | - | | `allocated_quantity` | int \| str \| None | Optional | This is a container for one-of cases. | | `pricing_scheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Optional | - | @@ -36,21 +36,24 @@ | `use_site_exchange_rate` | `bool` | Optional | - | | `description` | `str` | Optional | - | | `allow_fractional_quantities` | `bool` | 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` | [`List[HistoricUsage]`](../../doc/models/historic-usage.md) | Optional | - | | `display_on_hosted_page` | `bool` | Optional | - | -| `interval` | `int` | 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` | `int` | 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 -} +```python +from advancedbilling.models.component_kind import ComponentKind +from advancedbilling.models.subscription_component import SubscriptionComponent + +subscription_component = SubscriptionComponent( + 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 5655f26a..2b722f47 100644 --- a/doc/models/subscription-custom-price.md +++ b/doc/models/subscription-custom-price.md @@ -19,25 +19,28 @@ | `trial_price_in_cents` | str \| int \| None | Optional | This is a container for one-of cases. | | `trial_interval` | str \| int \| None | 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` | str \| int \| None | Optional | This is a container for one-of cases. | | `initial_charge_after_trial` | `bool` | Optional | (Optional) | | `expiration_interval` | str \| int \| None | Optional | This is a container for one-of cases. | | `expiration_interval_unit` | [`ExpirationIntervalUnit`](../../doc/models/expiration-interval-unit.md) | Optional | (Optional) | | `tax_included` | `bool` | 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 + +```python +from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.subscription_custom_price import SubscriptionCustomPrice + +subscription_custom_price = SubscriptionCustomPrice( + 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..9791482a 100644 --- a/doc/models/subscription-date-field.md +++ b/doc/models/subscription-date-field.md @@ -19,3 +19,11 @@ | `TRIAL_ENDED_AT` | | `UPDATED_AT` | +## Example + +```python +from advancedbilling.models.subscription_date_field import SubscriptionDateField + +subscription_date_field = SubscriptionDateField.CURRENT_PERIOD_STARTS_AT +``` + diff --git a/doc/models/subscription-filter.md b/doc/models/subscription-filter.md index a9993149..b3263da8 100644 --- a/doc/models/subscription-filter.md +++ b/doc/models/subscription-filter.md @@ -18,19 +18,25 @@ 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) - -```json -{ - "states": [ - "active", - "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" -} +## Example + +```python +import dateutil.parser + +from advancedbilling.models.subscription_filter import SubscriptionFilter +from advancedbilling.models.subscription_list_date_field import SubscriptionListDateField +from advancedbilling.models.subscription_state_filter import SubscriptionStateFilter + +subscription_filter = SubscriptionFilter( + states=[ + SubscriptionStateFilter.ACTIVE, + SubscriptionStateFilter.CANCELED + ], + date_field=SubscriptionListDateField.UPDATED_AT, + start_date=dateutil.parser.parse('2024-01-17').date(), + end_date=dateutil.parser.parse('2024-01-31').date(), + start_datetime=dateutil.parser.parse('2024-01-17T09:15:30+00:00'), + end_datetime=dateutil.parser.parse('2024-01-17T17:20:06Z') +) ``` diff --git a/doc/models/subscription-group-balances.md b/doc/models/subscription-group-balances.md index b267f235..0e58f941 100644 --- a/doc/models/subscription-group-balances.md +++ b/doc/models/subscription-group-balances.md @@ -14,30 +14,33 @@ | `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 + +```python +from advancedbilling.models.account_balance import AccountBalance +from advancedbilling.models.subscription_group_balances import SubscriptionGroupBalances + +subscription_group_balances = SubscriptionGroupBalances( + prepayments=AccountBalance( + balance_in_cents=192, + automatic_balance_in_cents=178, + remittance_balance_in_cents=146 + ), + service_credits=AccountBalance( + balance_in_cents=84, + automatic_balance_in_cents=70, + remittance_balance_in_cents=38 + ), + open_invoices=AccountBalance( + balance_in_cents=40, + automatic_balance_in_cents=202, + remittance_balance_in_cents=170 + ), + pending_discounts=AccountBalance( + 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 ba3c13ab..3b642865 100644 --- a/doc/models/subscription-group-bank-account.md +++ b/doc/models/subscription-group-bank-account.md @@ -11,9 +11,9 @@ | --- | --- | --- | --- | | `bank_name` | `str` | Optional | (Required when creating a subscription with ACH or GoCardless) The name of the bank where the customer’s account resides | | `bank_account_number` | `str` | 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` | `str` | 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` | `str` | Optional | (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided | -| `bank_branch_code` | `str` | Optional | (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided | +| `bank_routing_number` | `str` | 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` | `str` | Optional | (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided. | +| `bank_branch_code` | `str` | 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,17 @@ | `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` | `str` | 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" -} +```python +from advancedbilling.models.subscription_group_bank_account import SubscriptionGroupBankAccount + +subscription_group_bank_account = SubscriptionGroupBankAccount( + 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 90bdedde..5ce360d2 100644 --- a/doc/models/subscription-group-component-custom-price.md +++ b/doc/models/subscription-group-component-custom-price.md @@ -15,34 +15,59 @@ Used in place of `price_point_id` to define a custom price point unique to the s | `prices` | [`List[Price]`](../../doc/models/price.md) | Optional | - | | `overage_pricing` | [`List[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 - } - ], - "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 - } - ] - } - ] -} +## Example + +```python +from advancedbilling.models.component_custom_price import ComponentCustomPrice +from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme +from advancedbilling.models.subscription_group_component_custom_price import SubscriptionGroupComponentCustomPrice + +subscription_group_component_custom_price = SubscriptionGroupComponentCustomPrice( + pricing_scheme=PricingScheme.STAIRSTEP, + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ), + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ) + ], + overage_pricing=[ + ComponentCustomPrice( + prices=[ + Price( + 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( + prices=[ + Price( + 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 c691c448..191a3b1b 100644 --- a/doc/models/subscription-group-create-error-response-exception.md +++ b/doc/models/subscription-group-create-error-response-exception.md @@ -11,15 +11,14 @@ | --- | --- | --- | --- | | `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) \| str | Required | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "errors": { - "members": [ - "members6" - ] - } -} +## Example + +```python +try: + # make the API call +except SubscriptionGroupCreateErrorResponseException as e: + print(e) +except APIException as e: + print(e) ``` diff --git a/doc/models/subscription-group-credit-card.md b/doc/models/subscription-group-credit-card.md index f86e4a20..3b495f31 100644 --- a/doc/models/subscription-group-credit-card.md +++ b/doc/models/subscription-group-credit-card.md @@ -30,16 +30,19 @@ | `cvv` | `str` | Optional | - | | `payment_type` | `str` | 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 + +```python +from advancedbilling.models.credit_card_vault import CreditCardVault +from advancedbilling.models.subscription_group_credit_card import SubscriptionGroupCreditCard + +subscription_group_credit_card = SubscriptionGroupCreditCard( + 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 f43a5a28..661c5fd6 100644 --- a/doc/models/subscription-group-customer.md +++ b/doc/models/subscription-group-customer.md @@ -15,15 +15,17 @@ | `email` | `str` | Optional | - | | `reference` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "first_name": "first_name4", - "last_name": "last_name2", - "organization": "organization2", - "email": "email2", - "reference": "reference0" -} +## Example + +```python +from advancedbilling.models.subscription_group_customer import SubscriptionGroupCustomer + +subscription_group_customer = SubscriptionGroupCustomer( + 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..19230da1 100644 --- a/doc/models/subscription-group-include.md +++ b/doc/models/subscription-group-include.md @@ -11,3 +11,11 @@ | --- | | `CURRENT_BILLING_AMOUNT_IN_CENTS` | +## Example + +```python +from advancedbilling.models.subscription_group_include import SubscriptionGroupInclude + +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 70cf329e..f31e8b23 100644 --- a/doc/models/subscription-group-item.md +++ b/doc/models/subscription-group-item.md @@ -20,15 +20,17 @@ | `total_revenue_in_cents` | `int` | Optional | - | | `balance_in_cents` | `int` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 16, - "reference": "reference8", - "product_id": 214, - "product_handle": "product_handle4", - "product_price_point_id": 138 -} +## Example + +```python +from advancedbilling.models.subscription_group_item import SubscriptionGroupItem + +subscription_group_item = SubscriptionGroupItem( + 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 40769573..6bf3d441 100644 --- a/doc/models/subscription-group-members-array-error.md +++ b/doc/models/subscription-group-members-array-error.md @@ -11,13 +11,15 @@ | --- | --- | --- | --- | | `members` | `List[str]` | Required | - | -## Example (as JSON) - -```json -{ - "members": [ - "members6" - ] -} +## Example + +```python +from advancedbilling.models.subscription_group_members_array_error import SubscriptionGroupMembersArrayError + +subscription_group_members_array_error = SubscriptionGroupMembersArrayError( + members=[ + 'members2' + ] +) ``` diff --git a/doc/models/subscription-group-payment-profile.md b/doc/models/subscription-group-payment-profile.md index 4dbafe98..990afd92 100644 --- a/doc/models/subscription-group-payment-profile.md +++ b/doc/models/subscription-group-payment-profile.md @@ -14,14 +14,16 @@ | `last_name` | `str` | Optional | - | | `masked_card_number` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 22, - "first_name": "first_name4", - "last_name": "last_name2", - "masked_card_number": "masked_card_number2" -} +## Example + +```python +from advancedbilling.models.subscription_group_payment_profile import SubscriptionGroupPaymentProfile + +subscription_group_payment_profile = SubscriptionGroupPaymentProfile( + 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..c1c1539a 100644 --- a/doc/models/subscription-group-prepayment-method.md +++ b/doc/models/subscription-group-prepayment-method.md @@ -16,3 +16,11 @@ | `PAYPAL_ACCOUNT` | | `OTHER` | +## Example + +```python +from advancedbilling.models.subscription_group_prepayment_method import SubscriptionGroupPrepaymentMethod + +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..812511f1 100644 --- a/doc/models/subscription-group-prepayment-request.md +++ b/doc/models/subscription-group-prepayment-request.md @@ -11,16 +11,20 @@ | --- | --- | --- | --- | | `prepayment` | [`SubscriptionGroupPrepayment`](../../doc/models/subscription-group-prepayment.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepayment": { - "amount": 136, - "details": "details8", - "memo": "memo2", - "method": "paypal_account" - } -} +## Example + +```python +from advancedbilling.models.subscription_group_prepayment import SubscriptionGroupPrepayment +from advancedbilling.models.subscription_group_prepayment_method import SubscriptionGroupPrepaymentMethod +from advancedbilling.models.subscription_group_prepayment_request import SubscriptionGroupPrepaymentRequest + +subscription_group_prepayment_request = SubscriptionGroupPrepaymentRequest( + prepayment=SubscriptionGroupPrepayment( + 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 0fe1cbe5..cea40c19 100644 --- a/doc/models/subscription-group-prepayment-response.md +++ b/doc/models/subscription-group-prepayment-response.md @@ -15,15 +15,18 @@ | `entry_type` | [`ServiceCreditType`](../../doc/models/service-credit-type.md) | Optional | The type of entry | | `memo` | `str` | 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 + +```python +from advancedbilling.models.service_credit_type import ServiceCreditType +from advancedbilling.models.subscription_group_prepayment_response import SubscriptionGroupPrepaymentResponse + +subscription_group_prepayment_response = SubscriptionGroupPrepaymentResponse( + 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 b9849c33..c3ff51ee 100644 --- a/doc/models/subscription-group-prepayment.md +++ b/doc/models/subscription-group-prepayment.md @@ -14,14 +14,17 @@ | `memo` | `str` | 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 + +```python +from advancedbilling.models.subscription_group_prepayment import SubscriptionGroupPrepayment +from advancedbilling.models.subscription_group_prepayment_method import SubscriptionGroupPrepaymentMethod + +subscription_group_prepayment = SubscriptionGroupPrepayment( + 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..8854abca 100644 --- a/doc/models/subscription-group-response.md +++ b/doc/models/subscription-group-response.md @@ -11,25 +11,30 @@ | --- | --- | --- | --- | | `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": [ - 74, - 75 - ] - } -} +## Example + +```python +from advancedbilling.models.collection_method import CollectionMethod +from advancedbilling.models.subscription_group import SubscriptionGroup +from advancedbilling.models.subscription_group_payment_profile import SubscriptionGroupPaymentProfile +from advancedbilling.models.subscription_group_response import SubscriptionGroupResponse + +subscription_group_response = SubscriptionGroupResponse( + subscription_group=SubscriptionGroup( + uid='uid8', + customer_id=220, + payment_profile=SubscriptionGroupPaymentProfile( + 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 2ae41906..47f145b6 100644 --- a/doc/models/subscription-group-signup-component.md +++ b/doc/models/subscription-group-signup-component.md @@ -15,73 +15,80 @@ | `price_point_id` | str \| int \| None | 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 - } - ], - "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 - } +```python +from advancedbilling.models.component_custom_price import ComponentCustomPrice +from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme +from advancedbilling.models.subscription_group_component_custom_price import SubscriptionGroupComponentCustomPrice +from advancedbilling.models.subscription_group_signup_component import SubscriptionGroupSignupComponent + +subscription_group_signup_component = SubscriptionGroupSignupComponent( + component_id='String9', + allocated_quantity='String3', + unit_balance='String7', + price_point_id='String9', + custom_price=SubscriptionGroupComponentCustomPrice( + pricing_scheme=PricingScheme.STAIRSTEP, + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ), + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ) + ], + overage_pricing=[ + ComponentCustomPrice( + prices=[ + Price( + 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( + prices=[ + Price( + 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( + prices=[ + Price( + 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..69755d0f 100644 --- a/doc/models/subscription-group-signup-error-response-exception.md +++ b/doc/models/subscription-group-signup-error-response-exception.md @@ -11,60 +11,14 @@ | --- | --- | --- | --- | | `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 + +```python +try: + # make the API call +except SubscriptionGroupSignupErrorResponseException as e: + print(e) +except APIException as e: + print(e) ``` diff --git a/doc/models/subscription-group-signup-error.md b/doc/models/subscription-group-signup-error.md index 349fd1df..9aad901d 100644 --- a/doc/models/subscription-group-signup-error.md +++ b/doc/models/subscription-group-signup-error.md @@ -16,67 +16,71 @@ | `payment_profile_id` | `str` | Optional | - | | `payer_id` | `str` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "subscriptions": { - "key0": { - "product": [ - "product9" - ], - "product_price_point_id": [ - "product_price_point_id7" - ], - "payment_profile": [ - "payment_profile2" - ], - "payment_profile.chargify_token": [ - "payment_profile.chargify_token6" - ], - "base": [ - "base5", - "base6" - ] +```python +from advancedbilling.models.payer_error import PayerError +from advancedbilling.models.subscription_group_signup_error import SubscriptionGroupSignupError +from advancedbilling.models.subscription_group_subscription_error import SubscriptionGroupSubscriptionError + +subscription_group_signup_error = SubscriptionGroupSignupError( + subscriptions={ + 'key0': SubscriptionGroupSubscriptionError( + product=[ + 'product9' + ], + product_price_point_id=[ + 'product_price_point_id7' + ], + payment_profile=[ + 'payment_profile2' + ], + payment_profile_chargify_token=[ + 'payment_profile.chargify_token6' + ], + base=[ + 'base5', + 'base6' + ] + ), + 'key1': SubscriptionGroupSubscriptionError( + product=[ + 'product9' + ], + product_price_point_id=[ + 'product_price_point_id7' + ], + payment_profile=[ + 'payment_profile2' + ], + payment_profile_chargify_token=[ + 'payment_profile.chargify_token6' + ], + base=[ + 'base5', + 'base6' + ] + ) }, - "key1": { - "product": [ - "product9" - ], - "product_price_point_id": [ - "product_price_point_id7" - ], - "payment_profile": [ - "payment_profile2" - ], - "payment_profile.chargify_token": [ - "payment_profile.chargify_token6" - ], - "base": [ - "base5", - "base6" - ] - } - }, - "payer_reference": "payer_reference0", - "payer": { - "last_name": [ - "last_name5", - "last_name6" - ], - "first_name": [ - "first_name8" + payer_reference='payer_reference6', + payer=PayerError( + last_name=[ + 'last_name5', + 'last_name6' + ], + first_name=[ + 'first_name8' + ], + email=[ + 'email0', + 'email9' + ] + ), + subscription_group=[ + 'subscription_group7', + 'subscription_group8' ], - "email": [ - "email0", - "email9" - ] - }, - "subscription_group": [ - "subscription_group1", - "subscription_group2" - ], - "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..0151b473 100644 --- a/doc/models/subscription-group-signup-event-data.md +++ b/doc/models/subscription-group-signup-event-data.md @@ -12,30 +12,35 @@ | `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 + +```python +from advancedbilling.models.customer import Customer +from advancedbilling.models.payer_attributes import PayerAttributes +from advancedbilling.models.subscription_group_signup_event_data import SubscriptionGroupSignupEventData +from advancedbilling.models.subscription_group_signup_failure_data import SubscriptionGroupSignupFailureData + +subscription_group_signup_event_data = SubscriptionGroupSignupEventData( + subscription_group=SubscriptionGroupSignupFailureData( + payer_id=150, + payer_reference='payer_reference6', + payment_profile_id=128, + payment_collection_method='payment_collection_method8', + payer_attributes=PayerAttributes( + first_name='first_name2', + last_name='last_name0', + email='email4', + cc_emails='cc_emails2', + organization='organization6' + ) + ), + customer=Customer( + 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 31424b16..04e9420c 100644 --- a/doc/models/subscription-group-signup-failure-data.md +++ b/doc/models/subscription-group-signup-failure-data.md @@ -18,21 +18,24 @@ | `bank_account_attributes` | [`SubscriptionGroupBankAccount`](../../doc/models/subscription-group-bank-account.md) | Optional | - | | `subscriptions` | [`List[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 + +```python +from advancedbilling.models.payer_attributes import PayerAttributes +from advancedbilling.models.subscription_group_signup_failure_data import SubscriptionGroupSignupFailureData + +subscription_group_signup_failure_data = SubscriptionGroupSignupFailureData( + payer_id=218, + payer_reference='payer_reference2', + payment_profile_id=196, + payment_collection_method='payment_collection_method0', + payer_attributes=PayerAttributes( + 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 f1d30ca1..fd9eb7e6 100644 --- a/doc/models/subscription-group-signup-item.md +++ b/doc/models/subscription-group-signup-item.md @@ -13,29 +13,31 @@ | `product_id` | `int` | 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` | `int` | Optional | The ID of the particular price point on the product. | | `product_price_point_handle` | `str` | Optional | The user-friendly API handle of a product's particular price point. | -| `offer_id` | `int` | 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` | `str` | Optional | The reference value (provided by your app) for the subscription itelf. | +| `offer_id` | `int` | 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` | `str` | Optional | The reference value (provided by your app) for the subscription itself. | | `primary` | `bool` | Optional | One of the subscriptions must be marked as primary in the group. | | `currency` | `str` | 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` | `List[str]` | Optional | An array for all the coupons attached to the subscription. | | `components` | [`List[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` | `Dict[str, str]` | 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 + +```python +from advancedbilling.models.subscription_group_signup_item import SubscriptionGroupSignupItem + +subscription_group_signup_item = SubscriptionGroupSignupItem( + 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..86ca6f03 100644 --- a/doc/models/subscription-group-signup-request.md +++ b/doc/models/subscription-group-signup-request.md @@ -11,36 +11,42 @@ | --- | --- | --- | --- | | `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 - } - ], - "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" - } - } -} +## Example + +```python +from advancedbilling.models.collection_method import CollectionMethod +from advancedbilling.models.payer_attributes import PayerAttributes +from advancedbilling.models.subscription_group_signup import SubscriptionGroupSignup +from advancedbilling.models.subscription_group_signup_item import SubscriptionGroupSignupItem +from advancedbilling.models.subscription_group_signup_request import SubscriptionGroupSignupRequest + +subscription_group_signup_request = SubscriptionGroupSignupRequest( + subscription_group=SubscriptionGroupSignup( + subscriptions=[ + SubscriptionGroupSignupItem( + 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=CollectionMethod.PREPAID, + payer_attributes=PayerAttributes( + 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 9ffc2538..4e7fbfd6 100644 --- a/doc/models/subscription-group-signup-response.md +++ b/doc/models/subscription-group-signup-response.md @@ -21,19 +21,21 @@ | `subscriptions` | [`List[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 + +```python +from advancedbilling.models.subscription_group_signup_response import SubscriptionGroupSignupResponse + +subscription_group_signup_response = SubscriptionGroupSignupResponse( + 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 ae58394a..26caab39 100644 --- a/doc/models/subscription-group-signup.md +++ b/doc/models/subscription-group-signup.md @@ -18,34 +18,39 @@ | `bank_account_attributes` | [`SubscriptionGroupBankAccount`](../../doc/models/subscription-group-bank-account.md) | Optional | - | | `subscriptions` | [`List[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 - } - ], - "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" - } -} +## Example + +```python +from advancedbilling.models.collection_method import CollectionMethod +from advancedbilling.models.payer_attributes import PayerAttributes +from advancedbilling.models.subscription_group_signup import SubscriptionGroupSignup +from advancedbilling.models.subscription_group_signup_item import SubscriptionGroupSignupItem + +subscription_group_signup = SubscriptionGroupSignup( + subscriptions=[ + SubscriptionGroupSignupItem( + 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=232, + payer_id=254, + payer_reference='payer_reference2', + payment_collection_method=CollectionMethod.PREPAID, + payer_attributes=PayerAttributes( + 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 2d720477..c97124e0 100644 --- a/doc/models/subscription-group-single-error.md +++ b/doc/models/subscription-group-single-error.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `subscription_group` | `str` | Required | - | -## Example (as JSON) +## Example -```json -{ - "subscription_group": "subscription_group2" -} +```python +from advancedbilling.models.subscription_group_single_error import SubscriptionGroupSingleError + +subscription_group_single_error = SubscriptionGroupSingleError( + subscription_group='subscription_group4' +) ``` diff --git a/doc/models/subscription-group-subscription-error.md b/doc/models/subscription-group-subscription-error.md index aa357b53..7a14421d 100644 --- a/doc/models/subscription-group-subscription-error.md +++ b/doc/models/subscription-group-subscription-error.md @@ -20,31 +20,28 @@ Object which contains subscription errors. | `payment_profile_expiration_year` | `List[str]` | Optional | - | | `payment_profile_full_number` | `List[str]` | Optional | - | -## Example (as JSON) - -```json -{ - "product": [ - "product7", - "product6" - ], - "product_price_point_id": [ - "product_price_point_id9", - "product_price_point_id0" - ], - "payment_profile": [ - "payment_profile4", - "payment_profile5" - ], - "payment_profile.chargify_token": [ - "payment_profile.chargify_token8", - "payment_profile.chargify_token9" - ], - "base": [ - "base7", - "base8", - "base9" - ] -} +## Example + +```python +from advancedbilling.models.subscription_group_subscription_error import SubscriptionGroupSubscriptionError + +subscription_group_subscription_error = SubscriptionGroupSubscriptionError( + product=[ + 'product1' + ], + product_price_point_id=[ + 'product_price_point_id7' + ], + payment_profile=[ + 'payment_profile2' + ], + payment_profile_chargify_token=[ + 'payment_profile.chargify_token6' + ], + 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..5faaf8b9 100644 --- a/doc/models/subscription-group-update-error-response-exception.md +++ b/doc/models/subscription-group-update-error-response-exception.md @@ -11,16 +11,14 @@ | --- | --- | --- | --- | | `errors` | [`SubscriptionGroupUpdateError`](../../doc/models/subscription-group-update-error.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": { - "members": [ - "members2", - "members1" - ] - } -} +## Example + +```python +try: + # make the API call +except SubscriptionGroupUpdateErrorResponseException as e: + print(e) +except APIException as e: + print(e) ``` diff --git a/doc/models/subscription-group-update-error.md b/doc/models/subscription-group-update-error.md index 7d6fbd3c..e02186c0 100644 --- a/doc/models/subscription-group-update-error.md +++ b/doc/models/subscription-group-update-error.md @@ -11,15 +11,17 @@ | --- | --- | --- | --- | | `members` | `List[str]` | Optional | - | -## Example (as JSON) - -```json -{ - "members": [ - "members4", - "members5", - "members6" - ] -} +## Example + +```python +from advancedbilling.models.subscription_group_update_error import SubscriptionGroupUpdateError + +subscription_group_update_error = SubscriptionGroupUpdateError( + members=[ + 'members6', + 'members5', + 'members4' + ] +) ``` diff --git a/doc/models/subscription-group.md b/doc/models/subscription-group.md index 5cb5c28f..79ab9641 100644 --- a/doc/models/subscription-group.md +++ b/doc/models/subscription-group.md @@ -16,24 +16,27 @@ | `subscription_ids` | `List[int]` | 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 + +```python +from advancedbilling.models.collection_method import CollectionMethod +from advancedbilling.models.subscription_group import SubscriptionGroup +from advancedbilling.models.subscription_group_payment_profile import SubscriptionGroupPaymentProfile + +subscription_group = SubscriptionGroup( + uid='uid8', + customer_id=220, + payment_profile=SubscriptionGroupPaymentProfile( + 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..1292ef87 100644 --- a/doc/models/subscription-groups-list-include.md +++ b/doc/models/subscription-groups-list-include.md @@ -11,3 +11,11 @@ | --- | | `ACCOUNT_BALANCES` | +## Example + +```python +from advancedbilling.models.subscription_groups_list_include import SubscriptionGroupsListInclude + +subscription_groups_list_include = SubscriptionGroupsListInclude.ACCOUNT_BALANCES +``` + diff --git a/doc/models/subscription-include.md b/doc/models/subscription-include.md index 639f7da2..a29f5974 100644 --- a/doc/models/subscription-include.md +++ b/doc/models/subscription-include.md @@ -12,3 +12,11 @@ | `COUPONS` | | `SELF_SERVICE_PAGE_TOKEN` | +## Example + +```python +from advancedbilling.models.subscription_include import SubscriptionInclude + +subscription_include = SubscriptionInclude.COUPONS +``` + diff --git a/doc/models/subscription-included-coupon.md b/doc/models/subscription-included-coupon.md index c2d0f5e2..9c17b868 100644 --- a/doc/models/subscription-included-coupon.md +++ b/doc/models/subscription-included-coupon.md @@ -17,17 +17,19 @@ | `amount_in_cents` | `int` | Optional | **Constraints**: `>= 0` | | `percentage` | `str` | 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 + +```python +from advancedbilling.models.subscription_included_coupon import SubscriptionIncludedCoupon + +subscription_included_coupon = SubscriptionIncludedCoupon( + 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..8cd10e7f 100644 --- a/doc/models/subscription-list-date-field.md +++ b/doc/models/subscription-list-date-field.md @@ -13,7 +13,9 @@ ## Example -``` -updated_at +```python +from advancedbilling.models.subscription_list_date_field import SubscriptionListDateField + +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..ba2da5c9 100644 --- a/doc/models/subscription-list-include.md +++ b/doc/models/subscription-list-include.md @@ -10,4 +10,16 @@ | Name | | --- | | `SELF_SERVICE_PAGE_TOKEN` | +| `CURRENT_ACCOUNT_BALANCE_IN_CENTS` | +| `CURRENT_BILLING_AMOUNT` | +| `THREE_DS_ACTION_LINK` | +| `COUPONS` | + +## Example + +```python +from advancedbilling.models.subscription_list_include import SubscriptionListInclude + +subscription_list_include = SubscriptionListInclude.THREE_DS_ACTION_LINK +``` diff --git a/doc/models/subscription-migration-preview-options.md b/doc/models/subscription-migration-preview-options.md index d16fb2e5..e00f7e0b 100644 --- a/doc/models/subscription-migration-preview-options.md +++ b/doc/models/subscription-migration-preview-options.md @@ -20,16 +20,18 @@ | `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 + +```python +from advancedbilling.models.subscription_migration_preview_options import SubscriptionMigrationPreviewOptions + +subscription_migration_preview_options = SubscriptionMigrationPreviewOptions( + 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..beafbea9 100644 --- a/doc/models/subscription-migration-preview-request.md +++ b/doc/models/subscription-migration-preview-request.md @@ -11,18 +11,21 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.subscription_migration_preview_options import SubscriptionMigrationPreviewOptions +from advancedbilling.models.subscription_migration_preview_request import SubscriptionMigrationPreviewRequest + +subscription_migration_preview_request = SubscriptionMigrationPreviewRequest( + migration=SubscriptionMigrationPreviewOptions( + 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..7db90f77 100644 --- a/doc/models/subscription-migration-preview-response.md +++ b/doc/models/subscription-migration-preview-response.md @@ -11,16 +11,19 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.subscription_migration_preview import SubscriptionMigrationPreview +from advancedbilling.models.subscription_migration_preview_response import SubscriptionMigrationPreviewResponse + +subscription_migration_preview_response = SubscriptionMigrationPreviewResponse( + migration=SubscriptionMigrationPreview( + 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 20bfb681..50333be1 100644 --- a/doc/models/subscription-migration-preview.md +++ b/doc/models/subscription-migration-preview.md @@ -14,14 +14,16 @@ | `payment_due_in_cents` | `int` | Optional | The amount of the payment due in the case of an upgrade. | | `credit_applied_in_cents` | `int` | 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 + +```python +from advancedbilling.models.subscription_migration_preview import SubscriptionMigrationPreview + +subscription_migration_preview = SubscriptionMigrationPreview( + 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 6c8ce5a4..e7859c02 100644 --- a/doc/models/subscription-mrr-breakout.md +++ b/doc/models/subscription-mrr-breakout.md @@ -12,12 +12,14 @@ | `plan_amount_in_cents` | `int` | Required | - | | `usage_amount_in_cents` | `int` | Required | - | -## Example (as JSON) +## Example -```json -{ - "plan_amount_in_cents": 208, - "usage_amount_in_cents": 60 -} +```python +from advancedbilling.models.subscription_mrr_breakout import SubscriptionMRRBreakout + +subscription_mrr_breakout = SubscriptionMRRBreakout( + 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 b022369a..65e5e41e 100644 --- a/doc/models/subscription-mrr-response.md +++ b/doc/models/subscription-mrr-response.md @@ -11,20 +11,24 @@ | --- | --- | --- | --- | | `subscriptions_mrr` | [`List[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 + +```python +from advancedbilling.models.subscription_mrr import SubscriptionMRR +from advancedbilling.models.subscription_mrr_breakout import SubscriptionMRRBreakout +from advancedbilling.models.subscription_mrr_response import SubscriptionMRRResponse + +subscription_mrr_response = SubscriptionMRRResponse( + subscriptions_mrr=[ + SubscriptionMRR( + subscription_id=0, + mrr_amount_in_cents=0, + breakouts=SubscriptionMRRBreakout( + 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 5c77dccd..9cb853f1 100644 --- a/doc/models/subscription-mrr.md +++ b/doc/models/subscription-mrr.md @@ -13,16 +13,19 @@ | `mrr_amount_in_cents` | `int` | 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 + +```python +from advancedbilling.models.subscription_mrr import SubscriptionMRR +from advancedbilling.models.subscription_mrr_breakout import SubscriptionMRRBreakout + +subscription_mrr = SubscriptionMRR( + subscription_id=186, + mrr_amount_in_cents=204, + breakouts=SubscriptionMRRBreakout( + 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..c4b8ba92 100644 --- a/doc/models/subscription-note-response.md +++ b/doc/models/subscription-note-response.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | | `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 + +```python +import dateutil.parser + +from advancedbilling.models.subscription_note import SubscriptionNote +from advancedbilling.models.subscription_note_response import SubscriptionNoteResponse + +subscription_note_response = SubscriptionNoteResponse( + note=SubscriptionNote( + id=28, + body='body0', + subscription_id=138, + created_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + updated_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/subscription-note.md b/doc/models/subscription-note.md index 9c4655a5..91b0b0cd 100644 --- a/doc/models/subscription-note.md +++ b/doc/models/subscription-note.md @@ -16,15 +16,19 @@ | `updated_at` | `datetime` | Optional | - | | `sticky` | `bool` | 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 + +```python +import dateutil.parser + +from advancedbilling.models.subscription_note import SubscriptionNote + +subscription_note = SubscriptionNote( + id=114, + body='body0', + subscription_id=224, + created_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + updated_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/subscription-preview-response.md b/doc/models/subscription-preview-response.md index cb4ea150..b1a8fde6 100644 --- a/doc/models/subscription-preview-response.md +++ b/doc/models/subscription-preview-response.md @@ -11,56 +11,63 @@ | --- | --- | --- | --- | | `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 - } - ], - "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": 62, - "total_discount_in_cents": 208, - "total_tax_in_cents": 42, - "subtotal_in_cents": 174 - } - } -} +```python +from advancedbilling.models.billing_manifest import BillingManifest +from advancedbilling.models.billing_manifest_item import BillingManifestItem +from advancedbilling.models.billing_manifest_line_item_kind import BillingManifestLineItemKind +from advancedbilling.models.line_item_transaction_type import LineItemTransactionType +from advancedbilling.models.subscription_preview import SubscriptionPreview +from advancedbilling.models.subscription_preview_response import SubscriptionPreviewResponse + +subscription_preview_response = SubscriptionPreviewResponse( + subscription_preview=SubscriptionPreview( + current_billing_manifest=BillingManifest( + line_items=[ + BillingManifestItem( + 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=BillingManifest( + line_items=[ + BillingManifestItem( + transaction_type=LineItemTransactionType.CREDIT, + kind=BillingManifestLineItemKind.COMPONENT, + amount_in_cents=24, + memo='memo2', + discount_amount_in_cents=172 + ), + BillingManifestItem( + transaction_type=LineItemTransactionType.CREDIT, + kind=BillingManifestLineItemKind.COMPONENT, + amount_in_cents=24, + memo='memo2', + discount_amount_in_cents=172 + ), + BillingManifestItem( + 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 + ) + ) +) ``` diff --git a/doc/models/subscription-preview.md b/doc/models/subscription-preview.md index 0ceb3da4..088e4aab 100644 --- a/doc/models/subscription-preview.md +++ b/doc/models/subscription-preview.md @@ -12,54 +12,60 @@ | `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 - } - ], - "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": 62, - "total_discount_in_cents": 208, - "total_tax_in_cents": 42, - "subtotal_in_cents": 174 - } -} +```python +from advancedbilling.models.billing_manifest import BillingManifest +from advancedbilling.models.billing_manifest_item import BillingManifestItem +from advancedbilling.models.billing_manifest_line_item_kind import BillingManifestLineItemKind +from advancedbilling.models.line_item_transaction_type import LineItemTransactionType +from advancedbilling.models.subscription_preview import SubscriptionPreview + +subscription_preview = SubscriptionPreview( + current_billing_manifest=BillingManifest( + line_items=[ + BillingManifestItem( + 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=BillingManifest( + line_items=[ + BillingManifestItem( + transaction_type=LineItemTransactionType.CREDIT, + kind=BillingManifestLineItemKind.COMPONENT, + amount_in_cents=24, + memo='memo2', + discount_amount_in_cents=172 + ), + BillingManifestItem( + transaction_type=LineItemTransactionType.CREDIT, + kind=BillingManifestLineItemKind.COMPONENT, + amount_in_cents=24, + memo='memo2', + discount_amount_in_cents=172 + ), + BillingManifestItem( + 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 + ) +) ``` diff --git a/doc/models/subscription-product-change-scheduled.md b/doc/models/subscription-product-change-scheduled.md new file mode 100644 index 00000000..32746959 --- /dev/null +++ b/doc/models/subscription-product-change-scheduled.md @@ -0,0 +1,33 @@ + +# Subscription Product Change Scheduled + +## Structure + +`SubscriptionProductChangeScheduled` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `previous_product_id` | `int` | Required | - | +| `new_product_id` | `int` | Required | - | +| `previous_product_price_point_id` | `int` | Optional | - | +| `new_product_price_point_id` | `int` | Optional | - | +| `effective_at` | `datetime` | Optional | When the scheduled product change takes effect (the subscription's next renewal). | + +## Example + +```python +import dateutil.parser + +from advancedbilling.models.subscription_product_change_scheduled import SubscriptionProductChangeScheduled + +subscription_product_change_scheduled = SubscriptionProductChangeScheduled( + previous_product_id=50, + new_product_id=64, + previous_product_price_point_id=174, + new_product_price_point_id=168, + effective_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') +) +``` + diff --git a/doc/models/subscription-product-change.md b/doc/models/subscription-product-change.md index 9e94f832..6d8dd3e2 100644 --- a/doc/models/subscription-product-change.md +++ b/doc/models/subscription-product-change.md @@ -12,12 +12,14 @@ | `previous_product_id` | `int` | Required | - | | `new_product_id` | `int` | Required | - | -## Example (as JSON) +## Example -```json -{ - "previous_product_id": 126, - "new_product_id": 12 -} +```python +from advancedbilling.models.subscription_product_change import SubscriptionProductChange + +subscription_product_change = SubscriptionProductChange( + previous_product_id=250, + new_product_id=120 +) ``` diff --git a/doc/models/subscription-product-migration-request.md b/doc/models/subscription-product-migration-request.md index 5b269939..34ea68cb 100644 --- a/doc/models/subscription-product-migration-request.md +++ b/doc/models/subscription-product-migration-request.md @@ -11,18 +11,21 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.subscription_product_migration import SubscriptionProductMigration +from advancedbilling.models.subscription_product_migration_request import SubscriptionProductMigrationRequest + +subscription_product_migration_request = SubscriptionProductMigrationRequest( + migration=SubscriptionProductMigration( + 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 57f664dd..b4d07e04 100644 --- a/doc/models/subscription-product-migration.md +++ b/doc/models/subscription-product-migration.md @@ -19,16 +19,18 @@ | `product_price_point_handle` | `str` | 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 + +```python +from advancedbilling.models.subscription_product_migration import SubscriptionProductMigration + +subscription_product_migration = SubscriptionProductMigration( + 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..bae79f97 100644 --- a/doc/models/subscription-purge-type.md +++ b/doc/models/subscription-purge-type.md @@ -12,3 +12,11 @@ | `CUSTOMER` | | `PAYMENT_PROFILE` | +## Example + +```python +from advancedbilling.models.subscription_purge_type import SubscriptionPurgeType + +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 403e42b5..b43b9811 100644 --- a/doc/models/subscription-remove-coupon-errors-exception.md +++ b/doc/models/subscription-remove-coupon-errors-exception.md @@ -11,13 +11,14 @@ | --- | --- | --- | --- | | `subscription` | `List[str]` | Required | - | -## Example (as JSON) - -```json -{ - "subscription": [ - "subscription0" - ] -} +## Example + +```python +try: + # make the API call +except SubscriptionRemoveCouponErrorsException as e: + print(e) +except APIException as e: + print(e) ``` diff --git a/doc/models/subscription-response-error-exception.md b/doc/models/subscription-response-error-exception.md index 7431e8a4..345bb54e 100644 --- a/doc/models/subscription-response-error-exception.md +++ b/doc/models/subscription-response-error-exception.md @@ -11,17 +11,14 @@ | --- | --- | --- | --- | | `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 + +```python +try: + # make the API call +except SubscriptionResponseErrorException as e: + print(e) +except APIException as e: + print(e) ``` diff --git a/doc/models/subscription-response.md b/doc/models/subscription-response.md index 90a394a6..67d5a990 100644 --- a/doc/models/subscription-response.md +++ b/doc/models/subscription-response.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.subscription import Subscription +from advancedbilling.models.subscription_response import SubscriptionResponse +from advancedbilling.models.subscription_state import SubscriptionState + +subscription_response = SubscriptionResponse( + subscription=Subscription( + 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..6567b08b 100644 --- a/doc/models/subscription-sort.md +++ b/doc/models/subscription-sort.md @@ -20,3 +20,11 @@ | `OPEN_BALANCE` | | `EXPIRES_AT` | +## Example + +```python +from advancedbilling.models.subscription_sort import SubscriptionSort + +subscription_sort = SubscriptionSort.OPEN_BALANCE +``` + diff --git a/doc/models/subscription-state-change.md b/doc/models/subscription-state-change.md index 64087eb1..324b72ce 100644 --- a/doc/models/subscription-state-change.md +++ b/doc/models/subscription-state-change.md @@ -12,12 +12,14 @@ | `previous_subscription_state` | `str` | Required | **Constraints**: *Minimum Length*: `1` | | `new_subscription_state` | `str` | Required | **Constraints**: *Minimum Length*: `1` | -## Example (as JSON) +## Example -```json -{ - "previous_subscription_state": "previous_subscription_state2", - "new_subscription_state": "new_subscription_state6" -} +```python +from advancedbilling.models.subscription_state_change import SubscriptionStateChange + +subscription_state_change = SubscriptionStateChange( + 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..87a64126 100644 --- a/doc/models/subscription-state-filter.md +++ b/doc/models/subscription-state-filter.md @@ -15,12 +15,25 @@ 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 + +```python +from advancedbilling.models.subscription_state_filter import SubscriptionStateFilter + +subscription_state_filter = SubscriptionStateFilter.SUSPENDED +``` + diff --git a/doc/models/subscription-state.md b/doc/models/subscription-state.md index 6e893623..02faefe1 100644 --- a/doc/models/subscription-state.md +++ b/doc/models/subscription-state.md @@ -48,3 +48,11 @@ See [Subscription States](https://maxio.zendesk.com/hc/en-us/articles/2425211902 | `ON_HOLD` | | `AWAITING_SIGNUP` | +## Example + +```python +from advancedbilling.models.subscription_state import SubscriptionState + +subscription_state = SubscriptionState.ACTIVE +``` + diff --git a/doc/models/subscription.md b/doc/models/subscription.md index b46f6edf..e86fd08e 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` | `int` | Optional | Gives the current outstanding subscription balance in the number of cents. | | `total_revenue_in_cents` | `int` | Optional | Gives the total revenue from the subscription in the number of cents. | -| `product_price_in_cents` | `int` | 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` | `int` | 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` | `int` | 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` | `bool` | 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` | `int` | Optional | The ID of the transaction that generated the revenue | -| `signup_revenue` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `int` | Optional | (deprecated) How many times the subscription's single coupon has been used. This field has no replacement for multiple coupons. | | `coupon_uses_allowed` | `int` | Optional | (deprecated) How many times the subscription's single coupon may be used. This field has no replacement for multiple coupons. | -| `reason_code` | `str` | Optional | The churn reason code associated to a cancelled subscription. | +| `reason_code` | `str` | 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` | `List[str]` | Optional | An array for all the coupons attached to the subscription. | | `offer_id` | `int` | Optional | The ID of the offer associated with the subscription. | @@ -57,10 +57,10 @@ | `next_product_price_point_id` | `int` | 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` | `int` | Optional | On Relationship Invoicing, the number of days before a renewal invoice is due. | | `stored_credential_transaction_id` | `int` | 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` | `str` | Optional | The reference value (provided by your app) for the subscription istelf. | +| `reference` | `str` | 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` | `bool` | Optional | Boolean representing whether the subscription is prepaid and currently in dunning. Only returned for Relationship Invoicing sites with the feature enabled | -| `coupons` | [`List[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` | `bool` | Optional | Boolean representing whether the subscription is prepaid and currently in dunning. Only returned for Relationship Invoicing sites with the feature enabled. | +| `coupons` | [`List[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` | `bool` | 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` | `str` | Optional | Time zone for the Dunning Communication Delay feature. | | `receives_invoice_emails` | `bool` | Optional | - | @@ -72,38 +72,45 @@ | `prepaid_configuration` | [`PrepaidConfiguration`](../../doc/models/prepaid-configuration.md) | Optional | - | | `self_service_page_token` | `str` | 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 -} +```python +from advancedbilling.models.card_type import CardType +from advancedbilling.models.credit_card_payment_profile import CreditCardPaymentProfile +from advancedbilling.models.credit_card_vault import CreditCardVault +from advancedbilling.models.payment_type import PaymentType +from advancedbilling.models.subscription import Subscription +from advancedbilling.models.subscription_state import SubscriptionState + +subscription = Subscription( + id=8, + state=SubscriptionState.PAUSED, + balance_in_cents=124, + total_revenue_in_cents=48, + product_price_in_cents=238, + credit_card=CreditCardPaymentProfile( + 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..06e366bf 100644 --- a/doc/models/subscriptions-mrr-error-response-exception.md +++ b/doc/models/subscriptions-mrr-error-response-exception.md @@ -11,15 +11,14 @@ | --- | --- | --- | --- | | `errors` | [`AttributeError`](../../doc/models/attribute-error.md) | Required | - | -## Example (as JSON) - -```json -{ - "errors": { - "attribute": [ - "supplied value is invalid, expected ISO 8601 format" - ] - } -} +## Example + +```python +try: + # make the API call +except SubscriptionsMrrErrorResponseException as e: + print(e) +except APIException as e: + print(e) ``` diff --git a/doc/models/tax-configuration-kind.md b/doc/models/tax-configuration-kind.md index ef95cf08..12f61906 100644 --- a/doc/models/tax-configuration-kind.md +++ b/doc/models/tax-configuration-kind.md @@ -14,3 +14,11 @@ | `ENUM_LINKED_AVALARA` | | `ENUM_DIGITAL_RIVER` | +## Example + +```python +from advancedbilling.models.tax_configuration_kind import TaxConfigurationKind + +tax_configuration_kind = TaxConfigurationKind.CUSTOM +``` + diff --git a/doc/models/tax-configuration.md b/doc/models/tax-configuration.md index 0321d5cc..d96e3032 100644 --- a/doc/models/tax-configuration.md +++ b/doc/models/tax-configuration.md @@ -13,13 +13,17 @@ | `destination_address` | [`TaxDestinationAddress`](../../doc/models/tax-destination-address.md) | Optional | - | | `fully_configured` | `bool` | 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 + +```python +from advancedbilling.models.tax_configuration import TaxConfiguration +from advancedbilling.models.tax_configuration_kind import TaxConfigurationKind +from advancedbilling.models.tax_destination_address import TaxDestinationAddress + +tax_configuration = TaxConfiguration( + 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..dff8ca46 100644 --- a/doc/models/tax-destination-address.md +++ b/doc/models/tax-destination-address.md @@ -14,3 +14,11 @@ | `SHIPPING_ONLY` | | `BILLING_ONLY` | +## Example + +```python +from advancedbilling.models.tax_destination_address import TaxDestinationAddress + +tax_destination_address = TaxDestinationAddress.SHIPPING_ONLY +``` + diff --git a/doc/models/tokenized-payment-profile.md b/doc/models/tokenized-payment-profile.md index 16a2ade5..a6551122 100644 --- a/doc/models/tokenized-payment-profile.md +++ b/doc/models/tokenized-payment-profile.md @@ -14,14 +14,16 @@ | `gateway_handle` | `str` | Optional | - | | `customer_vault_token` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 72, - "vault_token": "vault_token2", - "gateway_handle": "gateway_handle8", - "customer_vault_token": "customer_vault_token8" -} +## Example + +```python +from advancedbilling.models.tokenized_payment_profile import TokenizedPaymentProfile + +tokenized_payment_profile = TokenizedPaymentProfile( + 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..9c5cfe0f 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,14 @@ | --- | --- | --- | --- | | `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 + +```python +try: + # make the API call +except TooManyManagementLinkRequestsErrorException as e: + print(e) +except APIException as e: + print(e) ``` diff --git a/doc/models/too-many-management-link-requests.md b/doc/models/too-many-management-link-requests.md index 6501f783..9960737c 100644 --- a/doc/models/too-many-management-link-requests.md +++ b/doc/models/too-many-management-link-requests.md @@ -12,12 +12,16 @@ | `error` | `str` | Required | - | | `new_link_available_at` | `datetime` | Required | - | -## Example (as JSON) +## Example -```json -{ - "error": "error2", - "new_link_available_at": "2016-03-13T12:52:32.123Z" -} +```python +import dateutil.parser + +from advancedbilling.models.too_many_management_link_requests import TooManyManagementLinkRequests + +too_many_management_link_requests = TooManyManagementLinkRequests( + error='error4', + new_link_available_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/trial-type.md b/doc/models/trial-type.md index 1298d99b..e6276f7e 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,11 @@ Indicates how a trial is handled when the trail period ends and there is no cred | `NO_OBLIGATION` | | `PAYMENT_EXPECTED` | +## Example + +```python +from advancedbilling.models.trial_type import TrialType + +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..634e3d0d 100644 --- a/doc/models/update-allocation-expiration-date.md +++ b/doc/models/update-allocation-expiration-date.md @@ -11,13 +11,18 @@ | --- | --- | --- | --- | | `allocation` | [`AllocationExpirationDate`](../../doc/models/allocation-expiration-date.md) | Optional | - | -## Example (as JSON) - -```json -{ - "allocation": { - "expires_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```python +import dateutil.parser + +from advancedbilling.models.allocation_expiration_date import AllocationExpirationDate +from advancedbilling.models.update_allocation_expiration_date import UpdateAllocationExpirationDate + +update_allocation_expiration_date = UpdateAllocationExpirationDate( + allocation=AllocationExpirationDate( + expires_at=dateutil.parser.parse('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..33a47a4b 100644 --- a/doc/models/update-component-price-point-request.md +++ b/doc/models/update-component-price-point-request.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.pricing_scheme import PricingScheme +from advancedbilling.models.update_component_price_point import UpdateComponentPricePoint +from advancedbilling.models.update_component_price_point_request import UpdateComponentPricePointRequest + +update_component_price_point_request = UpdateComponentPricePointRequest( + price_point=UpdateComponentPricePoint( + 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 16e55b20..6e3f91a2 100644 --- a/doc/models/update-component-price-point.md +++ b/doc/models/update-component-price-point.md @@ -14,19 +14,22 @@ | `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` | `bool` | 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` | `bool` | Optional | Whether or not the price point includes tax | -| `interval` | `int` | 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` | `int` | 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` | [`List[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 -} +```python +from advancedbilling.models.pricing_scheme import PricingScheme +from advancedbilling.models.update_component_price_point import UpdateComponentPricePoint + +update_component_price_point = UpdateComponentPricePoint( + 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..f9d11efd 100644 --- a/doc/models/update-component-request.md +++ b/doc/models/update-component-request.md @@ -11,18 +11,22 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.item_category import ItemCategory +from advancedbilling.models.update_component import UpdateComponent +from advancedbilling.models.update_component_request import UpdateComponentRequest + +update_component_request = UpdateComponentRequest( + component=UpdateComponent( + 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 5e5feb57..504aec44 100644 --- a/doc/models/update-component.md +++ b/doc/models/update-component.md @@ -10,7 +10,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `handle` | `str` | Optional | - | -| `name` | `str` | Optional | The name of the Component, suitable for display on statements. i.e. Text Messages. | +| `name` | `str` | Optional | The name of the Component, suitable for display on statements. e.g., Text Messages. | | `description` | `str` | Optional | The description of the component. | | `accounting_code` | `str` | Optional | - | | `taxable` | `bool` | Optional | Boolean flag describing whether a component is taxable or not. | @@ -18,17 +18,21 @@ | `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` | `bool` | 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` | `str` | 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 + +```python +from advancedbilling.models.item_category import ItemCategory +from advancedbilling.models.update_component import UpdateComponent + +update_component = UpdateComponent( + 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 a6965647..fd89cc5a 100644 --- a/doc/models/update-coupon-currency.md +++ b/doc/models/update-coupon-currency.md @@ -12,12 +12,14 @@ | `currency` | `str` | Required | ISO code for the site defined currency. | | `price` | `int` | Required | Price for the given currency. | -## Example (as JSON) +## Example -```json -{ - "currency": "currency4", - "price": 146 -} +```python +from advancedbilling.models.update_coupon_currency import UpdateCouponCurrency + +update_coupon_currency = UpdateCouponCurrency( + currency='currency6', + price=14 +) ``` diff --git a/doc/models/update-currency-price.md b/doc/models/update-currency-price.md index 9f0c45fe..3ab1ead7 100644 --- a/doc/models/update-currency-price.md +++ b/doc/models/update-currency-price.md @@ -12,12 +12,14 @@ | `id` | `int` | 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 -} +```python +from advancedbilling.models.update_currency_price import UpdateCurrencyPrice + +update_currency_price = UpdateCurrencyPrice( + id=186, + price=72.26 +) ``` diff --git a/doc/models/update-currency-prices-request.md b/doc/models/update-currency-prices-request.md index d6680540..e47fd73a 100644 --- a/doc/models/update-currency-prices-request.md +++ b/doc/models/update-currency-prices-request.md @@ -11,16 +11,19 @@ | --- | --- | --- | --- | | `currency_prices` | [`List[UpdateCurrencyPrice]`](../../doc/models/update-currency-price.md) | Required | - | -## Example (as JSON) - -```json -{ - "currency_prices": [ - { - "id": 50, - "price": 233.74 - } - ] -} +## Example + +```python +from advancedbilling.models.update_currency_price import UpdateCurrencyPrice +from advancedbilling.models.update_currency_prices_request import UpdateCurrencyPricesRequest + +update_currency_prices_request = UpdateCurrencyPricesRequest( + currency_prices=[ + UpdateCurrencyPrice( + id=50, + price=233.74 + ) + ] +) ``` diff --git a/doc/models/update-customer-request.md b/doc/models/update-customer-request.md index 1fa229e0..757cfbe0 100644 --- a/doc/models/update-customer-request.md +++ b/doc/models/update-customer-request.md @@ -11,17 +11,20 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.update_customer import UpdateCustomer +from advancedbilling.models.update_customer_request import UpdateCustomerRequest + +update_customer_request = UpdateCustomerRequest( + customer=UpdateCustomer( + 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 f8008795..c9e431c6 100644 --- a/doc/models/update-customer.md +++ b/doc/models/update-customer.md @@ -25,20 +25,24 @@ | `locale` | `str` | Optional | Set a specific language on a customer record. | | `vat_number` | `str` | Optional | - | | `tax_exempt` | `bool` | Optional | - | +| `surcharging` | `bool` | Optional | Whether surcharging is enabled for the customer. Only applied on sites where surcharging control is enabled. | | `tax_exempt_reason` | `str` | Optional | - | | `parent_id` | `int` | Optional | - | -| `verified` | `bool` | Optional | Is the customer verified to use ACH as a payment method. Available only on Authorize.Net gateway | +| `verified` | `bool` | Optional | Is the customer verified to use ACH as a payment method. Available only on the Authorize.Net gateway. | | `salesforce_id` | `str` | Optional | The Salesforce ID of the customer | +| `branding_theme_id` | `int` | 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 (as JSON) +## Example -```json -{ - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails8", - "organization": "organization6" -} +```python +from advancedbilling.models.update_customer import UpdateCustomer + +update_customer = UpdateCustomer( + 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..77bd7d27 --- /dev/null +++ b/doc/models/update-invoice-item.md @@ -0,0 +1,42 @@ + +# 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` | `str` | Optional | - | +| `quantity` | float \| str \| None | Optional | This is a container for one-of cases. | +| `unit_price` | float \| str \| None | Optional | This is a container for one-of cases. | +| `taxable` | `bool` | 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` | `str` | 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` | `str` | Optional | YYYY-MM-DD | +| `period_range_end` | `str` | Optional | YYYY-MM-DD | +| `product_id` | str \| int \| None | Optional | This is a container for one-of cases. | +| `component_id` | str \| int \| None | Optional | This is a container for one-of cases. | +| `price_point_id` | str \| int \| None | Optional | This is a container for one-of cases. | +| `product_price_point_id` | str \| int \| None | Optional | This is a container for one-of cases. | +| `description` | `str` | Optional | **Constraints**: *Maximum Length*: `255` | +| `uid` | `str` | 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` | `bool` | 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 + +```python +from advancedbilling.models.update_invoice_item import UpdateInvoiceItem + +update_invoice_item = UpdateInvoiceItem( + 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..6722ea64 --- /dev/null +++ b/doc/models/update-invoice-request.md @@ -0,0 +1,57 @@ + +# 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 + +```python +import dateutil.parser + +from advancedbilling.models.update_invoice import UpdateInvoice +from advancedbilling.models.update_invoice_item import UpdateInvoiceItem +from advancedbilling.models.update_invoice_request import UpdateInvoiceRequest + +update_invoice_request = UpdateInvoiceRequest( + invoice=UpdateInvoice( + line_items=[ + UpdateInvoiceItem( + title='title4', + quantity=56.68, + unit_price=39.9, + taxable=False, + tax_code='tax_code6' + ), + UpdateInvoiceItem( + title='title4', + quantity=56.68, + unit_price=39.9, + taxable=False, + tax_code='tax_code6' + ), + UpdateInvoiceItem( + title='title4', + quantity=56.68, + unit_price=39.9, + taxable=False, + tax_code='tax_code6' + ) + ], + issue_date=dateutil.parser.parse('2024-01-01').date(), + 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..ac3f360a --- /dev/null +++ b/doc/models/update-invoice.md @@ -0,0 +1,55 @@ + +# 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` | [`List[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` | `int` | 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` | `str` | Optional | Custom payment instructions displayed on the invoice. | +| `memo` | `str` | 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` | [`List[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 + +```python +import dateutil.parser + +from advancedbilling.models.update_invoice import UpdateInvoice +from advancedbilling.models.update_invoice_item import UpdateInvoiceItem + +update_invoice = UpdateInvoice( + line_items=[ + UpdateInvoiceItem( + title='title4', + quantity=56.68, + unit_price=39.9, + taxable=False, + tax_code='tax_code6' + ), + UpdateInvoiceItem( + title='title4', + quantity=56.68, + unit_price=39.9, + taxable=False, + tax_code='tax_code6' + ) + ], + issue_date=dateutil.parser.parse('2024-01-01').date(), + 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..cd161fa7 100644 --- a/doc/models/update-metadata-request.md +++ b/doc/models/update-metadata-request.md @@ -11,15 +11,18 @@ | --- | --- | --- | --- | | `metadata` | [`UpdateMetadata`](../../doc/models/update-metadata.md) | Optional | - | -## Example (as JSON) - -```json -{ - "metadata": { - "current_name": "current_name0", - "name": "name6", - "value": "value8" - } -} +## Example + +```python +from advancedbilling.models.update_metadata import UpdateMetadata +from advancedbilling.models.update_metadata_request import UpdateMetadataRequest + +update_metadata_request = UpdateMetadataRequest( + metadata=UpdateMetadata( + current_name='current_name0', + name='name6', + value='value8' + ) +) ``` diff --git a/doc/models/update-metadata.md b/doc/models/update-metadata.md index da9e0b5c..98f70abf 100644 --- a/doc/models/update-metadata.md +++ b/doc/models/update-metadata.md @@ -13,13 +13,15 @@ | `name` | `str` | Optional | - | | `value` | `str` | Optional | - | -## Example (as JSON) - -```json -{ - "current_name": "current_name4", - "name": "name0", - "value": "value2" -} +## Example + +```python +from advancedbilling.models.update_metadata import UpdateMetadata + +update_metadata = UpdateMetadata( + current_name='current_name4', + name='name0', + value='value2' +) ``` diff --git a/doc/models/update-metafield.md b/doc/models/update-metafield.md index 3b9fb6d9..8defab73 100644 --- a/doc/models/update-metafield.md +++ b/doc/models/update-metafield.md @@ -12,26 +12,32 @@ | `current_name` | `str` | Optional | - | | `name` | `str` | 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` | `List[str]` | 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 + +```python +from advancedbilling.models.include_option import IncludeOption +from advancedbilling.models.metafield_input import MetafieldInput +from advancedbilling.models.metafield_scope import MetafieldScope +from advancedbilling.models.update_metafield import UpdateMetafield + +update_metafield = UpdateMetafield( + current_name='current_name0', + name='name6', + scope=MetafieldScope( + 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 93865b43..df3c41aa 100644 --- a/doc/models/update-metafields-request.md +++ b/doc/models/update-metafields-request.md @@ -11,25 +11,31 @@ | --- | --- | --- | --- | | `metafields` | [Update Metafield](../../doc/models/update-metafield.md) \| List[[Update Metafield](../../doc/models/update-metafield.md)] \| None | 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 + +```python +from advancedbilling.models.include_option import IncludeOption +from advancedbilling.models.metafield_input import MetafieldInput +from advancedbilling.models.metafield_scope import MetafieldScope +from advancedbilling.models.update_metafield import UpdateMetafield +from advancedbilling.models.update_metafields_request import UpdateMetafieldsRequest + +update_metafields_request = UpdateMetafieldsRequest( + metafields=UpdateMetafield( + current_name='current_name0', + name='name6', + scope=MetafieldScope( + 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..37a1bca7 100644 --- a/doc/models/update-payment-profile-request.md +++ b/doc/models/update-payment-profile-request.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.card_type import CardType +from advancedbilling.models.update_payment_profile import UpdatePaymentProfile +from advancedbilling.models.update_payment_profile_request import UpdatePaymentProfileRequest + +update_payment_profile_request = UpdatePaymentProfileRequest( + payment_profile=UpdatePaymentProfile( + 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 d9760e94..0587c801 100644 --- a/doc/models/update-payment-profile.md +++ b/doc/models/update-payment-profile.md @@ -13,25 +13,28 @@ | `last_name` | `str` | Optional | The last name of the card holder. | | `full_number` | `str` | Optional | The full credit card number | | `card_type` | [`CardType`](../../doc/models/card-type.md) | Optional | The type of card used. | -| `expiration_month` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | 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` | `str` | Optional | Second line of the customer’s billing address, e.g., Apt. 100 | + +## Example + +```python +from advancedbilling.models.card_type import CardType +from advancedbilling.models.update_payment_profile import UpdatePaymentProfile + +update_payment_profile = UpdatePaymentProfile( + 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 b44f0e70..d13671d0 100644 --- a/doc/models/update-price.md +++ b/doc/models/update-price.md @@ -15,15 +15,17 @@ | `destroy` | `bool` | Optional | - | | `starting_quantity` | int \| str \| None | 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 + +```python +from advancedbilling.models.update_price import UpdatePrice + +update_price = UpdatePrice( + 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..d0748cb3 100644 --- a/doc/models/update-product-price-point-request.md +++ b/doc/models/update-product-price-point-request.md @@ -11,14 +11,17 @@ | --- | --- | --- | --- | | `price_point` | [`UpdateProductPricePoint`](../../doc/models/update-product-price-point.md) | Required | - | -## Example (as JSON) - -```json -{ - "price_point": { - "handle": "handle6", - "price_in_cents": 196 - } -} +## Example + +```python +from advancedbilling.models.update_product_price_point import UpdateProductPricePoint +from advancedbilling.models.update_product_price_point_request import UpdateProductPricePointRequest + +update_product_price_point_request = UpdateProductPricePointRequest( + price_point=UpdateProductPricePoint( + 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 2bf3d4cd..9fcaa9ab 100644 --- a/doc/models/update-product-price-point.md +++ b/doc/models/update-product-price-point.md @@ -12,12 +12,14 @@ | `handle` | `str` | Optional | - | | `price_in_cents` | `int` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "handle": "handle6", - "price_in_cents": 220 -} +```python +from advancedbilling.models.update_product_price_point import UpdateProductPricePoint + +update_product_price_point = UpdateProductPricePoint( + 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..28eda967 100644 --- a/doc/models/update-reason-code-request.md +++ b/doc/models/update-reason-code-request.md @@ -11,15 +11,18 @@ | --- | --- | --- | --- | | `reason_code` | [`UpdateReasonCode`](../../doc/models/update-reason-code.md) | Required | - | -## Example (as JSON) - -```json -{ - "reason_code": { - "code": "code4", - "description": "description6", - "position": 14 - } -} +## Example + +```python +from advancedbilling.models.update_reason_code import UpdateReasonCode +from advancedbilling.models.update_reason_code_request import UpdateReasonCodeRequest + +update_reason_code_request = UpdateReasonCodeRequest( + reason_code=UpdateReasonCode( + code='code4', + description='description6', + position=14 + ) +) ``` diff --git a/doc/models/update-reason-code.md b/doc/models/update-reason-code.md index 2cfe08af..34391f39 100644 --- a/doc/models/update-reason-code.md +++ b/doc/models/update-reason-code.md @@ -13,13 +13,15 @@ | `description` | `str` | Optional | The friendly summary of what the code signifies | | `position` | `int` | Optional | The order that code appears in lists | -## Example (as JSON) - -```json -{ - "code": "code0", - "description": "description8", - "position": 118 -} +## Example + +```python +from advancedbilling.models.update_reason_code import UpdateReasonCode + +update_reason_code = UpdateReasonCode( + code='code2', + description='description4', + position=12 +) ``` diff --git a/doc/models/update-segment-request.md b/doc/models/update-segment-request.md index c84e55d1..3ca207b9 100644 --- a/doc/models/update-segment-request.md +++ b/doc/models/update-segment-request.md @@ -11,30 +11,35 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.create_or_update_segment_price import CreateOrUpdateSegmentPrice +from advancedbilling.models.pricing_scheme import PricingScheme +from advancedbilling.models.update_segment import UpdateSegment +from advancedbilling.models.update_segment_request import UpdateSegmentRequest + +update_segment_request = UpdateSegmentRequest( + segment=UpdateSegment( + pricing_scheme=PricingScheme.STAIRSTEP, + prices=[ + CreateOrUpdateSegmentPrice( + unit_price='String3', + starting_quantity=64, + ending_quantity=38 + ), + CreateOrUpdateSegmentPrice( + unit_price='String3', + starting_quantity=64, + ending_quantity=38 + ), + CreateOrUpdateSegmentPrice( + unit_price='String3', + starting_quantity=64, + ending_quantity=38 + ) + ] + ) +) ``` diff --git a/doc/models/update-segment.md b/doc/models/update-segment.md index 59b0bcdb..460b9abe 100644 --- a/doc/models/update-segment.md +++ b/doc/models/update-segment.md @@ -12,18 +12,27 @@ | `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` | [`List[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 + +```python +from advancedbilling.models.create_or_update_segment_price import CreateOrUpdateSegmentPrice +from advancedbilling.models.pricing_scheme import PricingScheme +from advancedbilling.models.update_segment import UpdateSegment + +update_segment = UpdateSegment( + pricing_scheme=PricingScheme.STAIRSTEP, + prices=[ + CreateOrUpdateSegmentPrice( + unit_price='String3', + starting_quantity=64, + ending_quantity=38 + ), + CreateOrUpdateSegmentPrice( + 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 a6d57d84..ad6a09f6 100644 --- a/doc/models/update-subscription-component.md +++ b/doc/models/update-subscription-component.md @@ -12,30 +12,36 @@ | `component_id` | `int` | 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 + +```python +from advancedbilling.models.component_custom_price import ComponentCustomPrice +from advancedbilling.models.interval_unit import IntervalUnit +from advancedbilling.models.price import Price +from advancedbilling.models.pricing_scheme import PricingScheme +from advancedbilling.models.update_subscription_component import UpdateSubscriptionComponent + +update_subscription_component = UpdateSubscriptionComponent( + component_id=76, + custom_price=ComponentCustomPrice( + prices=[ + Price( + starting_quantity=242, + unit_price=23.26, + ending_quantity=40 + ), + Price( + 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..f86dc262 100644 --- a/doc/models/update-subscription-group-request.md +++ b/doc/models/update-subscription-group-request.md @@ -11,16 +11,19 @@ | --- | --- | --- | --- | | `subscription_group` | [`UpdateSubscriptionGroup`](../../doc/models/update-subscription-group.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscription_group": { - "member_ids": [ - 164, - 165 - ] - } -} +## Example + +```python +from advancedbilling.models.update_subscription_group import UpdateSubscriptionGroup +from advancedbilling.models.update_subscription_group_request import UpdateSubscriptionGroupRequest + +update_subscription_group_request = UpdateSubscriptionGroupRequest( + subscription_group=UpdateSubscriptionGroup( + member_ids=[ + 164, + 165 + ] + ) +) ``` diff --git a/doc/models/update-subscription-group.md b/doc/models/update-subscription-group.md index c3012fa9..1ea38920 100644 --- a/doc/models/update-subscription-group.md +++ b/doc/models/update-subscription-group.md @@ -11,15 +11,16 @@ | --- | --- | --- | --- | | `member_ids` | `List[int]` | Optional | - | -## Example (as JSON) - -```json -{ - "member_ids": [ - 52, - 53, - 54 - ] -} +## Example + +```python +from advancedbilling.models.update_subscription_group import UpdateSubscriptionGroup + +update_subscription_group = UpdateSubscriptionGroup( + member_ids=[ + 54, + 55 + ] +) ``` diff --git a/doc/models/update-subscription-note-request.md b/doc/models/update-subscription-note-request.md index 05d27d6e..7af2263f 100644 --- a/doc/models/update-subscription-note-request.md +++ b/doc/models/update-subscription-note-request.md @@ -13,14 +13,17 @@ 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 + +```python +from advancedbilling.models.update_subscription_note import UpdateSubscriptionNote +from advancedbilling.models.update_subscription_note_request import UpdateSubscriptionNoteRequest + +update_subscription_note_request = UpdateSubscriptionNoteRequest( + note=UpdateSubscriptionNote( + body='body0', + sticky=False + ) +) ``` diff --git a/doc/models/update-subscription-note.md b/doc/models/update-subscription-note.md index d7cb33aa..45d1fd05 100644 --- a/doc/models/update-subscription-note.md +++ b/doc/models/update-subscription-note.md @@ -14,12 +14,14 @@ Updatable fields for Subscription Note | `body` | `str` | Required | - | | `sticky` | `bool` | Required | - | -## Example (as JSON) +## Example -```json -{ - "body": "body8", - "sticky": false -} +```python +from advancedbilling.models.update_subscription_note import UpdateSubscriptionNote + +update_subscription_note = UpdateSubscriptionNote( + body='body8', + sticky=False +) ``` diff --git a/doc/models/update-subscription-request.md b/doc/models/update-subscription-request.md index ede8dd80..7968a760 100644 --- a/doc/models/update-subscription-request.md +++ b/doc/models/update-subscription-request.md @@ -11,23 +11,27 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.credit_card_attributes import CreditCardAttributes +from advancedbilling.models.update_subscription import UpdateSubscription +from advancedbilling.models.update_subscription_request import UpdateSubscriptionRequest + +update_subscription_request = UpdateSubscriptionRequest( + subscription=UpdateSubscription( + credit_card_attributes=CreditCardAttributes( + 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 4e38033f..84441690 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` | `str` | Optional | Set to the handle of a different product to change the subscription's product | -| `product_id` | `int` | Optional | Set to the id of a different product to change the subscription's product | +| `product_handle` | `str` | Optional | Set to the handle of a different product to change the subscription's product. | +| `product_id` | `int` | Optional | Set to the id of a different product to change the subscription's product. | | `product_change_delayed` | `bool` | Optional | - | | `next_product_id` | `str` | Optional | Set to an empty string to cancel a delayed product change. | | `next_product_price_point_id` | `str` | Optional | - | | `snap_day` | str \| int \| None | 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` | `bool` | 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` | `int` | 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` | `str` | Optional | - | | `receives_invoice_emails` | `bool` | Optional | - | @@ -32,21 +33,24 @@ | `product_price_point_id` | `int` | Optional | Set to change the current product's price point. | | `product_price_point_handle` | `str` | 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 + +```python +from advancedbilling.models.credit_card_attributes import CreditCardAttributes +from advancedbilling.models.update_subscription import UpdateSubscription + +update_subscription = UpdateSubscription( + credit_card_attributes=CreditCardAttributes( + 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..356dd4f2 100644 --- a/doc/models/upgrade-charge-credit-type.md +++ b/doc/models/upgrade-charge-credit-type.md @@ -21,3 +21,11 @@ The type of credit to be created when upgrading/downgrading. Defaults to the com | `PRORATED` | | `NONE` | +## Example + +```python +from advancedbilling.models.upgrade_charge_credit_type import UpgradeChargeCreditType + +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..9d6b216d 100644 --- a/doc/models/upsert-prepaid-configuration-request.md +++ b/doc/models/upsert-prepaid-configuration-request.md @@ -11,16 +11,19 @@ | --- | --- | --- | --- | | `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 + +```python +from advancedbilling.models.upsert_prepaid_configuration import UpsertPrepaidConfiguration +from advancedbilling.models.upsert_prepaid_configuration_request import UpsertPrepaidConfigurationRequest + +upsert_prepaid_configuration_request = UpsertPrepaidConfigurationRequest( + prepaid_configuration=UpsertPrepaidConfiguration( + 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 0acbf78e..ab4c30b5 100644 --- a/doc/models/upsert-prepaid-configuration.md +++ b/doc/models/upsert-prepaid-configuration.md @@ -14,14 +14,16 @@ | `auto_replenish` | `bool` | Optional | - | | `replenish_threshold_amount_in_cents` | `int` | 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 + +```python +from advancedbilling.models.upsert_prepaid_configuration import UpsertPrepaidConfiguration + +upsert_prepaid_configuration = UpsertPrepaidConfiguration( + 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..f04da0d6 100644 --- a/doc/models/usage-response.md +++ b/doc/models/usage-response.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | | `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 + +```python +import dateutil.parser + +from advancedbilling.models.usage import Usage +from advancedbilling.models.usage_response import UsageResponse + +usage_response = UsageResponse( + usage=Usage( + id=150, + memo='memo2', + created_at=dateutil.parser.parse('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 36e87684..205e3023 100644 --- a/doc/models/usage.md +++ b/doc/models/usage.md @@ -19,15 +19,19 @@ | `component_handle` | `str` | Optional | - | | `subscription_id` | `int` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 252, - "memo": "memo8", - "created_at": "2016-03-13T12:52:32.123Z", - "price_point_id": 126, - "quantity": 130 -} +## Example + +```python +import dateutil.parser + +from advancedbilling.models.usage import Usage + +usage = Usage( + id=150, + memo='memo2', + created_at=dateutil.parser.parse('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 ef994b5c..d5a2148f 100644 --- a/doc/models/void-invoice-event-data.md +++ b/doc/models/void-invoice-event-data.md @@ -18,22 +18,27 @@ Example schema for an `void_invoice` event | `is_advance_invoice` | `bool` | Required | If true, the invoice is an advance invoice. | | `reason` | `str` | 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 + +```python +import dateutil.parser + +from advancedbilling.models.credit_note import CreditNote +from advancedbilling.models.void_invoice_event_data import VoidInvoiceEventData + +void_invoice_event_data = VoidInvoiceEventData( + credit_note_attributes=CreditNote( + uid='uid2', + site_id=72, + customer_id=184, + subscription_id=0, + number='number0' + ), + memo='memo6', + applied_amount='applied_amount6', + transaction_time=dateutil.parser.parse('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 6b9dd513..903b95a6 100644 --- a/doc/models/void-invoice-event.md +++ b/doc/models/void-invoice-event.md @@ -15,38 +15,46 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"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 + +```python +import dateutil.parser + +from advancedbilling.models.credit_note import CreditNote +from advancedbilling.models.invoice import Invoice +from advancedbilling.models.invoice_event_type import InvoiceEventType +from advancedbilling.models.void_invoice_event import VoidInvoiceEvent +from advancedbilling.models.void_invoice_event_data import VoidInvoiceEventData + +void_invoice_event = VoidInvoiceEvent( + id=220, + timestamp=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + invoice=Invoice( + id=166, + uid='uid6', + site_id=92, + customer_id=204, + subscription_id=20, + issue_date=dateutil.parser.parse('2024-01-01').date(), + due_date=dateutil.parser.parse('2024-01-01').date(), + paid_date=dateutil.parser.parse('2024-01-01').date(), + public_url_expires_on=dateutil.parser.parse('2024-01-21').date() + ), + event_type=InvoiceEventType.VOID_INVOICE, + event_data=VoidInvoiceEventData( + credit_note_attributes=CreditNote( + uid='uid2', + site_id=72, + customer_id=184, + subscription_id=0, + number='number0' + ), + memo='memo0', + applied_amount='applied_amount2', + transaction_time=dateutil.parser.parse('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..68e1fa85 100644 --- a/doc/models/void-invoice-request.md +++ b/doc/models/void-invoice-request.md @@ -11,13 +11,16 @@ | --- | --- | --- | --- | | `void` | [`VoidInvoice`](../../doc/models/void-invoice.md) | Required | - | -## Example (as JSON) - -```json -{ - "void": { - "reason": "reason6" - } -} +## Example + +```python +from advancedbilling.models.void_invoice import VoidInvoice +from advancedbilling.models.void_invoice_request import VoidInvoiceRequest + +void_invoice_request = VoidInvoiceRequest( + void=VoidInvoice( + reason='reason6' + ) +) ``` diff --git a/doc/models/void-invoice.md b/doc/models/void-invoice.md index c5bfef1e..f7ee34e3 100644 --- a/doc/models/void-invoice.md +++ b/doc/models/void-invoice.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `reason` | `str` | Required | **Constraints**: *Minimum Length*: `1` | -## Example (as JSON) +## Example -```json -{ - "reason": "reason2" -} +```python +from advancedbilling.models.void_invoice import VoidInvoice + +void_invoice = VoidInvoice( + reason='reason6' +) ``` diff --git a/doc/models/void-remainder-event-data.md b/doc/models/void-remainder-event-data.md index 5e05b52c..a2864bba 100644 --- a/doc/models/void-remainder-event-data.md +++ b/doc/models/void-remainder-event-data.md @@ -16,20 +16,25 @@ Example schema for an `void_remainder` event | `applied_amount` | `str` | 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 + +```python +import dateutil.parser + +from advancedbilling.models.credit_note import CreditNote +from advancedbilling.models.void_remainder_event_data import VoidRemainderEventData + +void_remainder_event_data = VoidRemainderEventData( + credit_note_attributes=CreditNote( + uid='uid2', + site_id=72, + customer_id=184, + subscription_id=0, + number='number0' + ), + memo='memo0', + applied_amount='applied_amount2', + transaction_time=dateutil.parser.parse('2016-03-13T12:52:32.123Z') +) ``` diff --git a/doc/models/void-remainder-event.md b/doc/models/void-remainder-event.md index 746f3464..3989eeed 100644 --- a/doc/models/void-remainder-event.md +++ b/doc/models/void-remainder-event.md @@ -15,36 +15,44 @@ | `event_type` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `"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 + +```python +import dateutil.parser + +from advancedbilling.models.credit_note import CreditNote +from advancedbilling.models.invoice import Invoice +from advancedbilling.models.invoice_event_type import InvoiceEventType +from advancedbilling.models.void_remainder_event import VoidRemainderEvent +from advancedbilling.models.void_remainder_event_data import VoidRemainderEventData + +void_remainder_event = VoidRemainderEvent( + id=204, + timestamp=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + invoice=Invoice( + id=166, + uid='uid6', + site_id=92, + customer_id=204, + subscription_id=20, + issue_date=dateutil.parser.parse('2024-01-01').date(), + due_date=dateutil.parser.parse('2024-01-01').date(), + paid_date=dateutil.parser.parse('2024-01-01').date(), + public_url_expires_on=dateutil.parser.parse('2024-01-21').date() + ), + event_type=InvoiceEventType.VOID_REMAINDER, + event_data=VoidRemainderEventData( + credit_note_attributes=CreditNote( + uid='uid2', + site_id=72, + customer_id=184, + subscription_id=0, + number='number0' + ), + memo='memo0', + applied_amount='applied_amount2', + transaction_time=dateutil.parser.parse('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/webhook-order.md b/doc/models/webhook-order.md index 528b979f..64abe429 100644 --- a/doc/models/webhook-order.md +++ b/doc/models/webhook-order.md @@ -12,3 +12,11 @@ | `NEWEST_FIRST` | | `OLDEST_FIRST` | +## Example + +```python +from advancedbilling.models.webhook_order import WebhookOrder + +webhook_order = WebhookOrder.NEWEST_FIRST +``` + diff --git a/doc/models/webhook-response.md b/doc/models/webhook-response.md index 86aa8c6c..00156c7c 100644 --- a/doc/models/webhook-response.md +++ b/doc/models/webhook-response.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | | `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 + +```python +import dateutil.parser + +from advancedbilling.models.webhook import Webhook +from advancedbilling.models.webhook_response import WebhookResponse + +webhook_response = WebhookResponse( + webhook=Webhook( + event='event2', + id=18, + created_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + last_error='last_error4', + last_error_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') + ) +) ``` diff --git a/doc/models/webhook-status.md b/doc/models/webhook-status.md index 9202a9bf..723d0a86 100644 --- a/doc/models/webhook-status.md +++ b/doc/models/webhook-status.md @@ -14,3 +14,11 @@ | `PENDING` | | `PAUSED` | +## Example + +```python +from advancedbilling.models.webhook_status import WebhookStatus + +webhook_status = WebhookStatus.PENDING +``` + diff --git a/doc/models/webhook-subscription.md b/doc/models/webhook-subscription.md index 85990e59..047b17a0 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,11 @@ | `SUBSCRIPTION_PREPAYMENT_ACCOUNT_BALANCE_CHANGED` | | `SUBSCRIPTION_SERVICE_CREDIT_ACCOUNT_BALANCE_CHANGED` | +## Example + +```python +from advancedbilling.models.webhook_subscription import WebhookSubscription + +webhook_subscription = WebhookSubscription.CHJS_TOKENIZATION_SUCCESS +``` + diff --git a/doc/models/webhook.md b/doc/models/webhook.md index 0834b31b..a2b89bc6 100644 --- a/doc/models/webhook.md +++ b/doc/models/webhook.md @@ -10,27 +10,31 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `event` | `str` | Optional | A string describing which event type produced the given webhook | -| `id` | `int` | 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` | `int` | 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` | `str` | 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` | `str` | Optional | The url that the endpoint was last sent to. | -| `successful` | `bool` | 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` | `bool` | 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` | `str` | Optional | The data sent within the webhook post | | `signature` | `str` | Optional | The calculated webhook signature | | `signature_hmac_sha_256` | `str` | 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" -} +```python +import dateutil.parser + +from advancedbilling.models.webhook import Webhook + +webhook = Webhook( + event='event2', + id=18, + created_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), + last_error='last_error4', + last_error_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') +) ``` diff --git a/pyproject.toml b/pyproject.toml index e649b2b8..35b073a4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "maxio-advanced-billing-sdk" 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." -version = "9.1.0" +version = "10.0.0" readme = "README.md" keywords = ["Maxio", "Advaced Billing", "Payments", "Subscription"] dependencies = ["apimatic-core~=0.2.0, >= 0.2.24", "apimatic-core-interfaces~=0.1.0, >= 0.1.8", "apimatic-requests-client-adapter~=0.1.0, >= 0.1.10", "python-dotenv>=0.21, <2.0", "deprecation~=2.1"] From a2cefd026820902840558d16926cade0f75409c2 Mon Sep 17 00:00:00 2001 From: lucassus Date: Wed, 12 Aug 2026 16:04:30 +0000 Subject: [PATCH 2/4] Automated commit message --- .../models/bank_account_payment_profile.py | 26 +++++++++++++++++++ doc/models/bank-account-payment-profile.md | 1 + 2 files changed, 27 insertions(+) diff --git a/advancedbilling/models/bank_account_payment_profile.py b/advancedbilling/models/bank_account_payment_profile.py index c5e716e2..cf562f4a 100644 --- a/advancedbilling/models/bank_account_payment_profile.py +++ b/advancedbilling/models/bank_account_payment_profile.py @@ -41,6 +41,9 @@ class BankAccountPaymentProfile(object): masked_bank_routing_number (str): 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 (str): 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): Defaults to checking bank_account_holder_type (BankAccountHolderType): Defaults to personal payment_type (PaymentType): The model property of type PaymentType. @@ -75,6 +78,7 @@ class BankAccountPaymentProfile(object): "billing_address_2": "billing_address_2", "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", "verified": "verified", @@ -100,6 +104,7 @@ class BankAccountPaymentProfile(object): "billing_address_2", "bank_name", "masked_bank_routing_number", + "masked_bank_account_number", "bank_account_type", "bank_account_holder_type", "verified", @@ -118,6 +123,7 @@ class BankAccountPaymentProfile(object): "customer_vault_token", "billing_address_2", "masked_bank_routing_number", + "masked_bank_account_number", "site_gateway_setting_id", "gateway_handle", ] @@ -140,6 +146,7 @@ def __init__( billing_address_2=APIHelper.SKIP, bank_name=APIHelper.SKIP, masked_bank_routing_number=APIHelper.SKIP, + masked_bank_account_number=APIHelper.SKIP, bank_account_type=APIHelper.SKIP, bank_account_holder_type=APIHelper.SKIP, verified=False, @@ -180,6 +187,8 @@ def __init__( self.bank_name = bank_name if masked_bank_routing_number is not APIHelper.SKIP: self.masked_bank_routing_number = masked_bank_routing_number + if masked_bank_account_number is not APIHelper.SKIP: + self.masked_bank_account_number = masked_bank_account_number if bank_account_type is not APIHelper.SKIP: self.bank_account_type = bank_account_type if bank_account_holder_type is not APIHelper.SKIP: @@ -288,6 +297,10 @@ def from_dictionary(cls, dictionary.get("masked_bank_routing_number")\ if "masked_bank_routing_number" in dictionary.keys()\ else APIHelper.SKIP + masked_bank_account_number =\ + dictionary.get("masked_bank_account_number")\ + if "masked_bank_account_number" in dictionary.keys()\ + else APIHelper.SKIP bank_account_type =\ dictionary.get("bank_account_type")\ if dictionary.get("bank_account_type")\ @@ -336,6 +349,7 @@ def from_dictionary(cls, billing_address_2, bank_name, masked_bank_routing_number, + masked_bank_account_number, bank_account_type, bank_account_holder_type, verified, @@ -449,6 +463,11 @@ def __repr__(self): if hasattr(self, "masked_bank_routing_number") else None ) + _masked_bank_account_number=( + self.masked_bank_account_number + if hasattr(self, "masked_bank_account_number") + else None + ) _bank_account_type=( self.bank_account_type if hasattr(self, "bank_account_type") @@ -503,6 +522,7 @@ def __repr__(self): f"billing_address_2={_billing_address_2!r}, " f"bank_name={_bank_name!r}, " f"masked_bank_routing_number={_masked_bank_routing_number!r}, " + f"masked_bank_account_number={_masked_bank_account_number!r}, " f"bank_account_type={_bank_account_type!r}, " f"bank_account_holder_type={_bank_account_holder_type!r}, " f"payment_type={_payment_type!r}, " @@ -592,6 +612,11 @@ def __str__(self): if hasattr(self, "masked_bank_routing_number") else None ) + _masked_bank_account_number=( + self.masked_bank_account_number + if hasattr(self, "masked_bank_account_number") + else None + ) _bank_account_type=( self.bank_account_type if hasattr(self, "bank_account_type") @@ -646,6 +671,7 @@ def __str__(self): f"billing_address_2={_billing_address_2!s}, " f"bank_name={_bank_name!s}, " f"masked_bank_routing_number={_masked_bank_routing_number!s}, " + f"masked_bank_account_number={_masked_bank_account_number!s}, " f"bank_account_type={_bank_account_type!s}, " f"bank_account_holder_type={_bank_account_holder_type!s}, " f"payment_type={_payment_type!s}, " diff --git a/doc/models/bank-account-payment-profile.md b/doc/models/bank-account-payment-profile.md index 18b3f428..96888a3d 100644 --- a/doc/models/bank-account-payment-profile.md +++ b/doc/models/bank-account-payment-profile.md @@ -24,6 +24,7 @@ | `billing_address_2` | `str` | Optional | The current billing street address, second line, for the bank account | | `bank_name` | `str` | Optional | The bank where the account resides | | `masked_bank_routing_number` | `str` | 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` | `str` | 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**: `"bank_account"` | From e35d40410b185a4328b2f29df5d25bce539cc110 Mon Sep 17 00:00:00 2001 From: lucassus Date: Wed, 12 Aug 2026 19:04:08 +0000 Subject: [PATCH 3/4] Automated commit message --- .../controllers/advance_invoice_controller.py | 35 +-- .../controllers/api_exports_controller.py | 7 +- .../controllers/billing_portal_controller.py | 46 ++-- .../controllers/components_controller.py | 24 +- .../controllers/coupons_controller.py | 73 ++---- .../controllers/customers_controller.py | 44 ++-- ...vents_based_billing_segments_controller.py | 6 +- .../controllers/events_controller.py | 66 +++-- .../controllers/invoices_controller.py | 29 +-- .../controllers/offers_controller.py | 10 +- .../payment_profiles_controller.py | 23 +- .../product_families_controller.py | 4 +- .../controllers/products_controller.py | 8 +- .../proforma_invoices_controller.py | 9 +- .../controllers/reason_codes_controller.py | 11 +- .../controllers/referral_codes_controller.py | 11 +- .../controllers/sites_controller.py | 22 +- .../subscription_components_controller.py | 37 ++- .../subscription_groups_controller.py | 2 +- .../subscription_notes_controller.py | 11 +- .../subscription_products_controller.py | 23 +- .../subscription_status_controller.py | 30 +-- .../controllers/subscriptions_controller.py | 78 +++--- advancedbilling/models/__init__.py | 1 - advancedbilling/models/event.py | 8 +- .../models/subscription_product_change.py | 90 +++++++ .../subscription_product_change_scheduled.py | 235 ------------------ .../utilities/union_type_lookup.py | 4 - doc/controllers/advance-invoice.md | 16 +- doc/controllers/api-exports.md | 6 +- doc/controllers/billing-portal.md | 24 +- doc/controllers/components.md | 14 +- doc/controllers/coupons.md | 45 ++-- doc/controllers/customers.md | 19 +- .../events-based-billing-segments.md | 4 +- doc/controllers/events.md | 58 ++--- doc/controllers/invoices.md | 23 +- doc/controllers/offers.md | 6 +- doc/controllers/payment-profiles.md | 8 +- doc/controllers/product-families.md | 2 +- doc/controllers/products.md | 6 +- doc/controllers/proforma-invoices.md | 2 +- doc/controllers/reason-codes.md | 12 +- doc/controllers/referral-codes.md | 8 +- doc/controllers/sites.md | 17 +- doc/controllers/subscription-components.md | 20 +- doc/controllers/subscription-groups.md | 14 +- doc/controllers/subscription-notes.md | 6 +- doc/controllers/subscription-products.md | 8 +- doc/controllers/subscription-status.md | 14 +- doc/controllers/subscriptions.md | 32 ++- .../containers/event-event-specific-data.md | 16 +- doc/models/event-response.md | 5 +- doc/models/event.md | 7 +- .../subscription-product-change-scheduled.md | 33 --- doc/models/subscription-product-change.md | 12 +- 56 files changed, 529 insertions(+), 855 deletions(-) delete mode 100644 advancedbilling/models/subscription_product_change_scheduled.py delete mode 100644 doc/models/subscription-product-change-scheduled.md diff --git a/advancedbilling/controllers/advance_invoice_controller.py b/advancedbilling/controllers/advance_invoice_controller.py index 463ebfc8..1cc88a09 100644 --- a/advancedbilling/controllers/advance_invoice_controller.py +++ b/advancedbilling/controllers/advance_invoice_controller.py @@ -42,20 +42,21 @@ def issue_advance_invoice(self, """Perform a POST request to /subscriptions/{subscription_id}/advance_invoice/issue.json. - Issues 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 + 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-Invo + ice-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. - 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. + 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. Args: subscription_id (int): The Chargify id of the subscription. @@ -148,10 +149,10 @@ def void_advance_invoice(self, 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). Args: subscription_id (int): The Chargify id of the subscription. diff --git a/advancedbilling/controllers/api_exports_controller.py b/advancedbilling/controllers/api_exports_controller.py index 19196bc4..e1336463 100644 --- a/advancedbilling/controllers/api_exports_controller.py +++ b/advancedbilling/controllers/api_exports_controller.py @@ -245,8 +245,8 @@ def list_exported_subscriptions(self, def export_proforma_invoices(self): """Perform a POST request to /api_exports/proforma_invoices.json. - 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. Returns: BatchJobResponse: Response from the API. Created @@ -346,7 +346,8 @@ def read_proforma_invoices_export(self, """Perform a GET request to /api_exports/proforma_invoices/{batch_id}.json. - 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. Args: batch_id (str): Id of a Batch Job. diff --git a/advancedbilling/controllers/billing_portal_controller.py b/advancedbilling/controllers/billing_portal_controller.py index 1fc299eb..e5a0696a 100644 --- a/advancedbilling/controllers/billing_portal_controller.py +++ b/advancedbilling/controllers/billing_portal_controller.py @@ -58,30 +58,24 @@ def enable_billing_portal_for_customer(self, 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-Port - al-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-Billing-P + ortal-Overview). Args: customer_id (int): The Chargify id of the customer @@ -130,15 +124,15 @@ def read_billing_portal_link(self, /portal/customers/{customer_id}/management_link.json. 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 + 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 + requests before `new_link_available_at`, you are blocked from further Management URL requests (with a response code `429`). Args: diff --git a/advancedbilling/controllers/components_controller.py b/advancedbilling/controllers/components_controller.py index 40e30289..93663229 100644 --- a/advancedbilling/controllers/components_controller.py +++ b/advancedbilling/controllers/components_controller.py @@ -129,7 +129,7 @@ def create_quantity_based_component(self, 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 socks in @@ -141,6 +141,9 @@ def create_quantity_based_component(self, 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-Component + s-Overview). #### Hybrid Pricing A `volume`, `tiered`, or `stairstep` component can combine its primary pricing with a secondary pricing model (the `overage_pricing` parameter) so @@ -274,15 +277,14 @@ def create_prepaid_usage_component(self, 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-Components-O - verview). + 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-Component + s-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`. + `tax_code`; sending a blank value results in a validation error. Args: product_family_id (str): Either the product family's id or its handle @@ -345,13 +347,13 @@ def create_event_based_component(self, period for each subscription. 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-O - verview). + For more information, see [Components + Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Component + s-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`. + `tax_code`; sending a blank value results in a validation error. Args: product_family_id (str): Either the product family's id or its handle diff --git a/advancedbilling/controllers/coupons_controller.py b/advancedbilling/controllers/coupons_controller.py index c9fea293..1d9eb5b8 100644 --- a/advancedbilling/controllers/coupons_controller.py +++ b/advancedbilling/controllers/coupons_controller.py @@ -194,13 +194,11 @@ def find_coupon(self, currency_prices=None): """Perform a GET request to /coupons/find.json. - 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. + 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`. Args: product_family_id (int, optional): The Advanced Billing id of the product @@ -249,13 +247,13 @@ def read_coupon(self, """Perform a GET request to /product_families/{product_family_id}/coupons/{coupon_id}.json. - 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. - 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. Args: product_family_id (int): The Advanced Billing id of the product family to @@ -532,26 +530,17 @@ def validate_coupon(self, """Perform a GET request to /coupons/validate.json. 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 + 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. + 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= @@ -656,7 +645,6 @@ def create_coupon_subcodes(self, """Perform a POST request to /coupons/{coupon_id}/codes.json. 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: @@ -666,25 +654,12 @@ def create_coupon_subcodes(self, + 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-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. + only letters and numbers, and do not have any spaces. Lowercase 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 + to %2B @@ -694,6 +669,12 @@ def create_coupon_subcodes(self, 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-Coup + ons-and-Subscriptions). Args: coupon_id (int): The Advanced Billing id of the coupon diff --git a/advancedbilling/controllers/customers_controller.py b/advancedbilling/controllers/customers_controller.py index 014b6f81..898447e7 100644 --- a/advancedbilling/controllers/customers_controller.py +++ b/advancedbilling/controllers/customers_controller.py @@ -46,39 +46,35 @@ def create_customer(self, """Perform a POST request to /customers.json. 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 + 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. - 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-Det - ails). + Alternatively, you can choose to leave `reference` blank, and store the + system-assigned unique ID for the customer, which is in the `id` attribute. + For more information, see [Customer + Details](https://maxio.zendesk.com/hc/en-us/articles/24252190590093-Customer-D + etails). ## 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 + 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-Customer-Lo - cale) + cale). Args: body (CreateCustomerRequest, optional): The request body parameter. diff --git a/advancedbilling/controllers/events_based_billing_segments_controller.py b/advancedbilling/controllers/events_based_billing_segments_controller.py index 369c1332..c5b10e35 100644 --- a/advancedbilling/controllers/events_based_billing_segments_controller.py +++ b/advancedbilling/controllers/events_based_billing_segments_controller.py @@ -206,9 +206,9 @@ def update_segment(self, """Perform a PUT request to /components/{component_id}/price_points/{price_point_id}/segments/{id}.json. - 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 ID + 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. Args: diff --git a/advancedbilling/controllers/events_controller.py b/advancedbilling/controllers/events_controller.py index 578d9ff0..fc01cda1 100644 --- a/advancedbilling/controllers/events_controller.py +++ b/advancedbilling/controllers/events_controller.py @@ -43,30 +43,15 @@ def list_events(self, """Perform a GET request to /events.json. 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". - See the [Site + 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-Acti - vity) article in the product documentation for details on how to record view - Events / Site Activty in the Advanced Billing UI. - 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” - ## 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. + vity). + 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` @@ -78,8 +63,8 @@ def list_events(self, + `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. @@ -122,6 +107,18 @@ def list_events(self, } } ``` + ## 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” Args: options (dict, optional): Key-value pairs for any of the parameters to @@ -237,8 +234,16 @@ def list_subscription_events(self, 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. + 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]($m/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. @@ -250,13 +255,6 @@ def list_subscription_events(self, - “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” - ## Event Specific Data - Different event types may include additional data in `event_specific_data` - property. - 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]($m/Event). Args: options (dict, optional): Key-value pairs for any of the parameters to diff --git a/advancedbilling/controllers/invoices_controller.py b/advancedbilling/controllers/invoices_controller.py index 8090f839..3d8fbe2a 100644 --- a/advancedbilling/controllers/invoices_controller.py +++ b/advancedbilling/controllers/invoices_controller.py @@ -468,8 +468,9 @@ def record_payment_for_invoice(self, """Perform a POST request to /invoices/{uid}/payments.json. 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. Args: uid (str): The unique identifier for the invoice, this does not refer to @@ -519,28 +520,8 @@ def record_payment_for_multiple_invoices(self, """Perform a POST request to /invoices/payments.json. 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" - } - ] - } - } - ``` + To apply a payment to multiple invoices, at minimum, specify the `amount` and + `applications` (i.e., `invoice_uid` and `amount`) details. Note that the invoice payment amounts must be greater than 0. Total amount must be greater or equal to invoices payment amount sum. diff --git a/advancedbilling/controllers/offers_controller.py b/advancedbilling/controllers/offers_controller.py index 642fae1a..b8fb8750 100644 --- a/advancedbilling/controllers/offers_controller.py +++ b/advancedbilling/controllers/offers_controller.py @@ -45,17 +45,15 @@ def create_offer(self, body=None): """Perform a POST request to /offers.json. - 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-Overv - iew). + For more information, see + [Offers](https://maxio.zendesk.com/hc/en-us/articles/24261295098637-Offers-Ove + rview) 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/advancedbilling/controllers/payment_profiles_controller.py b/advancedbilling/controllers/payment_profiles_controller.py index c3ce7801..eea8b34d 100644 --- a/advancedbilling/controllers/payment_profiles_controller.py +++ b/advancedbilling/controllers/payment_profiles_controller.py @@ -171,8 +171,7 @@ def list_payment_profiles(self, """Perform a GET request to /payment_profiles.json. Lists 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. + site. If no payment profiles are found, this endpoint returns an empty array. Args: options (dict, optional): Key-value pairs for any of the parameters to @@ -396,8 +395,8 @@ def delete_unused_payment_profile(self, /payment_profiles/{payment_profile_id}.json. 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. Args: payment_profile_id (int): The Chargify id of the payment profile @@ -430,14 +429,14 @@ def delete_subscriptions_payment_profile(self, /subscriptions/{subscription_id}/payment_profiles/{payment_profile_id}.json. 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 - 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 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). Args: subscription_id (int): The Chargify id of the subscription. diff --git a/advancedbilling/controllers/product_families_controller.py b/advancedbilling/controllers/product_families_controller.py index 8022f103..b0c09016 100644 --- a/advancedbilling/controllers/product_families_controller.py +++ b/advancedbilling/controllers/product_families_controller.py @@ -167,8 +167,8 @@ def create_product_family(self, body=None): """Perform a POST request to /product_families.json. - 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-Fami diff --git a/advancedbilling/controllers/products_controller.py b/advancedbilling/controllers/products_controller.py index 17ffb659..b2e4f89d 100644 --- a/advancedbilling/controllers/products_controller.py +++ b/advancedbilling/controllers/products_controller.py @@ -44,16 +44,16 @@ def create_product(self, """Perform a POST request to /product_families/{product_family_id}/products.json. - Creates a product in your Advanced Billing site. + Creates a product in your site. 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. - See the following product documentation for more information: + For more information, see: + [Products - Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Prod - ucts-Overview) + 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-Ch anges-and-Migrations) diff --git a/advancedbilling/controllers/proforma_invoices_controller.py b/advancedbilling/controllers/proforma_invoices_controller.py index cd2ef5b0..a615c789 100644 --- a/advancedbilling/controllers/proforma_invoices_controller.py +++ b/advancedbilling/controllers/proforma_invoices_controller.py @@ -55,11 +55,10 @@ def create_consolidated_proforma_invoice(self, """Perform a POST request to /subscription_groups/{uid}/proforma_invoices.json. - 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 diff --git a/advancedbilling/controllers/reason_codes_controller.py b/advancedbilling/controllers/reason_codes_controller.py index 0992f239..f9700b55 100644 --- a/advancedbilling/controllers/reason_codes_controller.py +++ b/advancedbilling/controllers/reason_codes_controller.py @@ -46,21 +46,14 @@ def create_reason_code(self, """Perform a POST request to /reason_codes.json. 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-Reason - -Codes) - ## Create Reason Code - This method gives a merchant the option to create reason codes for a given - site. + -Codes). Args: body (CreateReasonCodeRequest, optional): The request body parameter. diff --git a/advancedbilling/controllers/referral_codes_controller.py b/advancedbilling/controllers/referral_codes_controller.py index fed9ac13..a7a8c9be 100644 --- a/advancedbilling/controllers/referral_codes_controller.py +++ b/advancedbilling/controllers/referral_codes_controller.py @@ -42,14 +42,9 @@ def validate_referral_code(self, 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-Understandi + ng-Referrals) in the product documentation. Args: code (str): The referral code you are trying to validate diff --git a/advancedbilling/controllers/sites_controller.py b/advancedbilling/controllers/sites_controller.py index 42eeab9c..dec58e4f 100644 --- a/advancedbilling/controllers/sites_controller.py +++ b/advancedbilling/controllers/sites_controller.py @@ -39,18 +39,20 @@ def read_site(self): """Perform a GET request to /site.json. 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. + -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-Customer -Hierarchies-WhoPays). diff --git a/advancedbilling/controllers/subscription_components_controller.py b/advancedbilling/controllers/subscription_components_controller.py index dfb3f5ad..438935bc 100644 --- a/advancedbilling/controllers/subscription_components_controller.py +++ b/advancedbilling/controllers/subscription_components_controller.py @@ -1014,18 +1014,18 @@ def activate_event_based_component(self, activate.json. 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-Based- - 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-Your-C + atalog?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. Args: subscription_id (int): The Advanced Billing id of the subscription @@ -1112,21 +1112,17 @@ def record_event(self, """Perform a POST request to /events/{api_handle}.json. 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. - *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-Your-C + atalog?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 ``` @@ -1177,9 +1173,8 @@ def bulk_record_events(self, """Perform a POST request to /events/{api_handle}/bulk.json. 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. diff --git a/advancedbilling/controllers/subscription_groups_controller.py b/advancedbilling/controllers/subscription_groups_controller.py index bbc248b4..ccc172ba 100644 --- a/advancedbilling/controllers/subscription_groups_controller.py +++ b/advancedbilling/controllers/subscription_groups_controller.py @@ -376,7 +376,7 @@ def find_subscription_group(self, """Perform a GET request to /subscription_groups/lookup.json. 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. Args: subscription_id (str): The Advanced Billing id of the subscription diff --git a/advancedbilling/controllers/subscription_notes_controller.py b/advancedbilling/controllers/subscription_notes_controller.py index 5108d88c..1da57040 100644 --- a/advancedbilling/controllers/subscription_notes_controller.py +++ b/advancedbilling/controllers/subscription_notes_controller.py @@ -42,15 +42,14 @@ def create_subscription_note(self, /subscriptions/{subscription_id}/notes.json. 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-Subscription - -Summary-Overview). + [Metadata]($e/Custom%20Fields/createMetadata) instead. + For more information, see [Adding + Notes](https://docs.maxio.com/hc/en-us/articles/24251654953997-Understanding-t + he-Subscription-Summary-Page#billing-portal-status:~:text=documentation%20for% + 20more.-,Adding%20Notes,-Notes%20are%20optional) in the product documentation. Args: subscription_id (int): The Chargify id of the subscription. diff --git a/advancedbilling/controllers/subscription_products_controller.py b/advancedbilling/controllers/subscription_products_controller.py index 78e286a4..6d1f69f4 100644 --- a/advancedbilling/controllers/subscription_products_controller.py +++ b/advancedbilling/controllers/subscription_products_controller.py @@ -45,25 +45,22 @@ def migrate_subscription_product(self, /subscriptions/{subscription_id}/migrations.json. 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-Migrati - on-to-Advanced-Billing). + For more information, see [Product Changes and + Migrations](https://docs.maxio.com/hc/en-us/articles/24252069837581-Product-Ch + anges-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/advancedbilling/controllers/subscription_status_controller.py b/advancedbilling/controllers/subscription_status_controller.py index 5fc0e3df..67c71884 100644 --- a/advancedbilling/controllers/subscription_status_controller.py +++ b/advancedbilling/controllers/subscription_status_controller.py @@ -656,32 +656,32 @@ def preview_renewal(self, 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-I - nterface-Overview). + the UI on each Subscriber's Summary. For more information, see [Subscriber + Interface + Overview](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscribe + r-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 + 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 + 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 + ## 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. Args: diff --git a/advancedbilling/controllers/subscriptions_controller.py b/advancedbilling/controllers/subscriptions_controller.py index 5274f6f4..88fd1de1 100644 --- a/advancedbilling/controllers/subscriptions_controller.py +++ b/advancedbilling/controllers/subscriptions_controller.py @@ -694,7 +694,7 @@ def purge_subscription(self, /subscriptions/{subscription_id}/purge.json. Purges an individual subscription for sites in test mode. - Provide the subscription ID in the url. To confirm, supply the customer ID + 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: @@ -811,11 +811,11 @@ def preview_subscription(self, 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-Subscriber-I - nterface-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-Subscribe + r-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- @@ -834,28 +834,26 @@ def preview_subscription(self, 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-Tax - es) + + The subscription payload must contain a full billing or shipping address 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. + 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. Args: @@ -967,9 +965,9 @@ def remove_coupon_from_subscription(self, 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-Coup + ons-and-Subscriptions#removing-a-coupon). Args: subscription_id (int): The Chargify id of the subscription. @@ -1014,23 +1012,20 @@ def activate_subscription(self, 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 @@ -1055,12 +1050,13 @@ def activate_subscription(self, 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-Sub - scriptions). + For more information about the behavior of trialing subscriptions, see + [Trialing + Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24252155721869-Tria + ling-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 + state remains Trialing; the invoice from activation is voided, and any + prepayments and credits applied to the invoice are returned to the subscription. Args: diff --git a/advancedbilling/models/__init__.py b/advancedbilling/models/__init__.py index fd6621f4..1cfb6aaf 100644 --- a/advancedbilling/models/__init__.py +++ b/advancedbilling/models/__init__.py @@ -550,7 +550,6 @@ "subscription_preview", "subscription_preview_response", "subscription_product_change", - "subscription_product_change_scheduled", "subscription_product_migration", "subscription_product_migration_request", "subscription_purge_type", diff --git a/advancedbilling/models/event.py b/advancedbilling/models/event.py index 259db713..2347ba9d 100644 --- a/advancedbilling/models/event.py +++ b/advancedbilling/models/event.py @@ -21,8 +21,7 @@ class Event(object): subscription_id (int): The model property of type int. customer_id (int): The model property of type int. created_at (datetime): The model property of type datetime. - event_specific_data (SubscriptionProductChange | - SubscriptionProductChangeScheduled | SubscriptionStateChange | + event_specific_data (SubscriptionProductChange | SubscriptionStateChange | PaymentRelatedEvents | RefundSuccess | ComponentAllocationChange | MeteredUsage | PrepaidUsage | DunningStepReached | InvoiceIssued | PendingCancellationChange | PrepaidSubscriptionBalanceChanged | @@ -32,9 +31,8 @@ class Event(object): CustomFieldValueChange | ChjsTokenizationSuccess | ChjsTokenizationFailure | None): The schema varies based on the event key. The key-to-event data mapping is as follows: * - `subscription_product_change` - SubscriptionProductChange * - `subscription_product_change_scheduled` - - SubscriptionProductChangeScheduled * `subscription_state_change` - + `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`, `chargeback_lost`, diff --git a/advancedbilling/models/subscription_product_change.py b/advancedbilling/models/subscription_product_change.py index 49821a4e..86fea54c 100644 --- a/advancedbilling/models/subscription_product_change.py +++ b/advancedbilling/models/subscription_product_change.py @@ -11,9 +11,18 @@ class SubscriptionProductChange(object): """Implementation of the 'Subscription Product Change' 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. + Attributes: previous_product_id (int): The model property of type int. new_product_id (int): The model property of type int. + previous_product_price_point_id (int): The model property of type int. + new_product_price_point_id (int): The model property of type int. + effective_at (datetime): When the scheduled product change takes effect (the + subscription's next renewal). Only sent for + `subscription_product_change_scheduled`. additional_properties (Dict[str, object]): The additional properties for the model. @@ -23,17 +32,44 @@ class SubscriptionProductChange(object): _names = { "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", } + _optionals = [ + "previous_product_price_point_id", + "new_product_price_point_id", + "effective_at", + ] + + _nullables = [ + "previous_product_price_point_id", + "new_product_price_point_id", + "effective_at", + ] + def __init__( self, previous_product_id=None, new_product_id=None, + previous_product_price_point_id=APIHelper.SKIP, + new_product_price_point_id=APIHelper.SKIP, + effective_at=APIHelper.SKIP, additional_properties=None): """Initialize a SubscriptionProductChange instance.""" # Initialize members of the class self.previous_product_id = previous_product_id self.new_product_id = new_product_id + if previous_product_price_point_id is not APIHelper.SKIP: + self.previous_product_price_point_id = previous_product_price_point_id + if new_product_price_point_id is not APIHelper.SKIP: + self.new_product_price_point_id = new_product_price_point_id + if effective_at is not APIHelper.SKIP: + self.effective_at =\ + APIHelper.apply_datetime_converter( + effective_at, APIHelper.RFC3339DateTime)\ + if effective_at else None # Add additional model properties to the instance if additional_properties is None: @@ -66,6 +102,21 @@ def from_dictionary(cls, dictionary.get("new_product_id")\ if dictionary.get("new_product_id")\ else None + previous_product_price_point_id =\ + dictionary.get("previous_product_price_point_id")\ + if "previous_product_price_point_id" in dictionary.keys()\ + else APIHelper.SKIP + new_product_price_point_id =\ + dictionary.get("new_product_price_point_id")\ + if "new_product_price_point_id" in dictionary.keys()\ + else APIHelper.SKIP + if "effective_at" in dictionary.keys(): + effective_at = APIHelper.RFC3339DateTime.from_value( + dictionary.get("effective_at")).datetime\ + if dictionary.get("effective_at") else None + + else: + effective_at = APIHelper.SKIP # Clean out expected properties from dictionary additional_properties =\ @@ -74,6 +125,9 @@ def from_dictionary(cls, # Return an object of this model return cls(previous_product_id, new_product_id, + previous_product_price_point_id, + new_product_price_point_id, + effective_at, additional_properties) @classmethod @@ -127,11 +181,29 @@ def __repr__(self): """Return a unambiguous string representation.""" _previous_product_id=self.previous_product_id _new_product_id=self.new_product_id + _previous_product_price_point_id=( + self.previous_product_price_point_id + if hasattr(self, "previous_product_price_point_id") + else None + ) + _new_product_price_point_id=( + self.new_product_price_point_id + if hasattr(self, "new_product_price_point_id") + else None + ) + _effective_at=( + self.effective_at + if hasattr(self, "effective_at") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" f"previous_product_id={_previous_product_id!r}, " f"new_product_id={_new_product_id!r}, " + f"previous_product_price_point_id={_previous_product_price_point_id!r}, " + f"new_product_price_point_id={_new_product_price_point_id!r}, " + f"effective_at={_effective_at!r}, " f"additional_properties={_additional_properties!r}, " f")" ) @@ -140,11 +212,29 @@ def __str__(self): """Return a human-readable string representation.""" _previous_product_id=self.previous_product_id _new_product_id=self.new_product_id + _previous_product_price_point_id=( + self.previous_product_price_point_id + if hasattr(self, "previous_product_price_point_id") + else None + ) + _new_product_price_point_id=( + self.new_product_price_point_id + if hasattr(self, "new_product_price_point_id") + else None + ) + _effective_at=( + self.effective_at + if hasattr(self, "effective_at") + else None + ) _additional_properties=self.additional_properties return ( f"{self.__class__.__name__}(" f"previous_product_id={_previous_product_id!s}, " f"new_product_id={_new_product_id!s}, " + f"previous_product_price_point_id={_previous_product_price_point_id!s}, " + f"new_product_price_point_id={_new_product_price_point_id!s}, " + f"effective_at={_effective_at!s}, " f"additional_properties={_additional_properties!s}, " f")" ) diff --git a/advancedbilling/models/subscription_product_change_scheduled.py b/advancedbilling/models/subscription_product_change_scheduled.py deleted file mode 100644 index 2a6140c6..00000000 --- a/advancedbilling/models/subscription_product_change_scheduled.py +++ /dev/null @@ -1,235 +0,0 @@ -"""advanced_billing. - -This file was automatically generated for Maxio by APIMATIC v3.0 ( - https://www.apimatic.io ). -""" - -# ruff: noqa: E501 -from advancedbilling.api_helper import APIHelper - - -class SubscriptionProductChangeScheduled(object): - """Implementation of the 'Subscription Product Change Scheduled' model. - - Attributes: - previous_product_id (int): The model property of type int. - new_product_id (int): The model property of type int. - previous_product_price_point_id (int): The model property of type int. - new_product_price_point_id (int): The model property of type int. - effective_at (datetime): When the scheduled product change takes effect (the - subscription's next renewal). - additional_properties (Dict[str, object]): The additional properties for the - model. - - """ - - # Create a mapping from Model property names to API property names - _names = { - "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", - } - - _optionals = [ - "previous_product_price_point_id", - "new_product_price_point_id", - "effective_at", - ] - - _nullables = [ - "previous_product_price_point_id", - "new_product_price_point_id", - "effective_at", - ] - - def __init__( - self, - previous_product_id=None, - new_product_id=None, - previous_product_price_point_id=APIHelper.SKIP, - new_product_price_point_id=APIHelper.SKIP, - effective_at=APIHelper.SKIP, - additional_properties=None): - """Initialize a SubscriptionProductChangeScheduled instance.""" - # Initialize members of the class - self.previous_product_id = previous_product_id - self.new_product_id = new_product_id - if previous_product_price_point_id is not APIHelper.SKIP: - self.previous_product_price_point_id = previous_product_price_point_id - if new_product_price_point_id is not APIHelper.SKIP: - self.new_product_price_point_id = new_product_price_point_id - if effective_at is not APIHelper.SKIP: - self.effective_at =\ - APIHelper.apply_datetime_converter( - effective_at, APIHelper.RFC3339DateTime)\ - if effective_at else None - - # Add additional model properties to the instance - if additional_properties is None: - additional_properties = {} - self.additional_properties = additional_properties - - @classmethod - def from_dictionary(cls, - dictionary): - """Create an instance of this model from a dictionary - - Args: - dictionary (dictionary): A dictionary representation of the object - as obtained from the deserialization of the server's response. The - keys MUST match property names in the API description. - - Returns: - object: An instance of this structure class. - - """ - if not isinstance(dictionary, dict) or dictionary is None: - return None - - # Extract variables from the dictionary - previous_product_id =\ - dictionary.get("previous_product_id")\ - if dictionary.get("previous_product_id")\ - else None - new_product_id =\ - dictionary.get("new_product_id")\ - if dictionary.get("new_product_id")\ - else None - previous_product_price_point_id =\ - dictionary.get("previous_product_price_point_id")\ - if "previous_product_price_point_id" in dictionary.keys()\ - else APIHelper.SKIP - new_product_price_point_id =\ - dictionary.get("new_product_price_point_id")\ - if "new_product_price_point_id" in dictionary.keys()\ - else APIHelper.SKIP - if "effective_at" in dictionary.keys(): - effective_at = APIHelper.RFC3339DateTime.from_value( - dictionary.get("effective_at")).datetime\ - if dictionary.get("effective_at") else None - - else: - effective_at = APIHelper.SKIP - - # Clean out expected properties from dictionary - additional_properties =\ - {k: v for k, v in dictionary.items() if k not in cls._names.values()} - - # Return an object of this model - return cls(previous_product_id, - new_product_id, - previous_product_price_point_id, - new_product_price_point_id, - effective_at, - additional_properties) - - @classmethod - def validate(cls, dictionary): - """Validate dictionary against class required properties - - Args: - dictionary (dictionary): A dictionary representation of the object - as obtained from the deserialization of the server's response. The - keys MUST match property names in the API description. - - Returns: - boolean : if dictionary is valid contains required properties. - - """ - if isinstance(dictionary, cls): - return APIHelper.is_valid_type( - value=dictionary.previous_product_id, - type_callable=lambda value: - isinstance( - value, - int, - )) \ - and APIHelper.is_valid_type( - value=dictionary.new_product_id, - type_callable=lambda value: - isinstance( - value, - int, - )) - - if not isinstance(dictionary, dict): - return False - - return APIHelper.is_valid_type( - value=dictionary.get("previous_product_id"), - type_callable=lambda value: - isinstance( - value, - int, - )) \ - and APIHelper.is_valid_type( - value=dictionary.get("new_product_id"), - type_callable=lambda value: - isinstance( - value, - int, - )) - - def __repr__(self): - """Return a unambiguous string representation.""" - _previous_product_id=self.previous_product_id - _new_product_id=self.new_product_id - _previous_product_price_point_id=( - self.previous_product_price_point_id - if hasattr(self, "previous_product_price_point_id") - else None - ) - _new_product_price_point_id=( - self.new_product_price_point_id - if hasattr(self, "new_product_price_point_id") - else None - ) - _effective_at=( - self.effective_at - if hasattr(self, "effective_at") - else None - ) - _additional_properties=self.additional_properties - return ( - f"{self.__class__.__name__}(" - f"previous_product_id={_previous_product_id!r}, " - f"new_product_id={_new_product_id!r}, " - f"previous_product_price_point_id={_previous_product_price_point_id!r}, " - f"new_product_price_point_id={_new_product_price_point_id!r}, " - f"effective_at={_effective_at!r}, " - f"additional_properties={_additional_properties!r}, " - f")" - ) - - def __str__(self): - """Return a human-readable string representation.""" - _previous_product_id=self.previous_product_id - _new_product_id=self.new_product_id - _previous_product_price_point_id=( - self.previous_product_price_point_id - if hasattr(self, "previous_product_price_point_id") - else None - ) - _new_product_price_point_id=( - self.new_product_price_point_id - if hasattr(self, "new_product_price_point_id") - else None - ) - _effective_at=( - self.effective_at - if hasattr(self, "effective_at") - else None - ) - _additional_properties=self.additional_properties - return ( - f"{self.__class__.__name__}(" - f"previous_product_id={_previous_product_id!s}, " - f"new_product_id={_new_product_id!s}, " - f"previous_product_price_point_id={_previous_product_price_point_id!s}, " - f"new_product_price_point_id={_new_product_price_point_id!s}, " - f"effective_at={_effective_at!s}, " - f"additional_properties={_additional_properties!s}, " - f")" - ) diff --git a/advancedbilling/utilities/union_type_lookup.py b/advancedbilling/utilities/union_type_lookup.py index 1655d566..c3434d10 100644 --- a/advancedbilling/utilities/union_type_lookup.py +++ b/advancedbilling/utilities/union_type_lookup.py @@ -189,9 +189,6 @@ from advancedbilling.models.subscription_product_change import ( SubscriptionProductChange, ) -from advancedbilling.models.subscription_product_change_scheduled import ( - SubscriptionProductChangeScheduled, -) from advancedbilling.models.subscription_state_change import ( SubscriptionStateChange, ) @@ -807,7 +804,6 @@ class UnionTypeLookUp: "EventEventSpecificData": lambda: OneOf( [ LeafType(SubscriptionProductChange), - LeafType(SubscriptionProductChangeScheduled), LeafType(SubscriptionStateChange), LeafType(PaymentRelatedEvents), LeafType(RefundSuccess), diff --git a/doc/controllers/advance-invoice.md b/doc/controllers/advance-invoice.md index aa84108d..915187b6 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 -Issues 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. ```python def issue_advance_invoice(self, @@ -113,7 +116,10 @@ print(result) # Void Advance Invoice 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](../../doc/models/invoice.md). + +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). ```python def void_advance_invoice(self, diff --git a/doc/controllers/api-exports.md b/doc/controllers/api-exports.md index 2ac10bb3..b83a8cef 100644 --- a/doc/controllers/api-exports.md +++ b/doc/controllers/api-exports.md @@ -167,9 +167,7 @@ print(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. ```python def export_proforma_invoices(self) @@ -267,7 +265,7 @@ print(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. ```python def read_proforma_invoices_export(self, diff --git a/doc/controllers/billing-portal.md b/doc/controllers/billing-portal.md index d44ae9ec..42314cda 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). ```python def enable_billing_portal_for_customer(self, @@ -79,13 +73,13 @@ print(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`). ```python def read_billing_portal_link(self, diff --git a/doc/controllers/components.md b/doc/controllers/components.md index 2e8d1235..74f21059 100644 --- a/doc/controllers/components.md +++ b/doc/controllers/components.md @@ -152,7 +152,7 @@ print(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 @@ -164,6 +164,8 @@ 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. @@ -389,11 +391,11 @@ print(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 `"tax_code": ""` returns `422`. +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. ```python def create_prepaid_usage_component(self, @@ -535,9 +537,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 `"tax_code": ""` returns `422`. +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. ```python def create_event_based_component(self, diff --git a/doc/controllers/coupons.md b/doc/controllers/coupons.md index 0c5e4705..792ae719 100644 --- a/doc/controllers/coupons.md +++ b/doc/controllers/coupons.md @@ -251,9 +251,9 @@ print(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`. ```python def find_coupon(self, @@ -294,10 +294,11 @@ print(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. -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 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 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. ```python def read_coupon(self, @@ -731,23 +732,17 @@ print(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= @@ -886,8 +881,6 @@ print(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: @@ -902,21 +895,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 @@ -927,6 +908,8 @@ This request allows you to create specific subcodes underneath an existing coupo 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). + ```python def create_coupon_subcodes(self, coupon_id, diff --git a/doc/controllers/customers.md b/doc/controllers/customers.md index b925397a..6abcffdc 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). ```python def create_customer(self, diff --git a/doc/controllers/events-based-billing-segments.md b/doc/controllers/events-based-billing-segments.md index ef643a51..7c993c00 100644 --- a/doc/controllers/events-based-billing-segments.md +++ b/doc/controllers/events-based-billing-segments.md @@ -150,9 +150,9 @@ print(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. ```python def update_segment(self, diff --git a/doc/controllers/events.md b/doc/controllers/events.md index 7e19c2c8..ba3438f8 100644 --- a/doc/controllers/events.md +++ b/doc/controllers/events.md @@ -19,29 +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". See the [Site Activity](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Activity) article in the product documentation for details on how to record view Events / Site Activty in the Advanced Billing UI. - -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” - -## 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 @@ -56,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 @@ -102,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” + ```python def list_events(self, options=dict()) @@ -219,7 +217,15 @@ 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 + +Different event types may include additional data in `event_specific_data` property. +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. @@ -235,12 +241,6 @@ Message updates: - “Failed payment for allocation changes to Product on Subscription” - “Plan changed on Subscription from previous plan to new plan” -## Event Specific Data - -Different event types may include additional data in `event_specific_data` property. -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). - ```python def list_subscription_events(self, options=dict()) diff --git a/doc/controllers/invoices.md b/doc/controllers/invoices.md index f8a97c48..1be9f2d5 100644 --- a/doc/controllers/invoices.md +++ b/doc/controllers/invoices.md @@ -1062,7 +1062,7 @@ print(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. ```python def record_payment_for_invoice(self, @@ -1121,27 +1121,6 @@ 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. ```python diff --git a/doc/controllers/offers.md b/doc/controllers/offers.md index 0bdefd24..a2e35fad 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 ae6adbbf..4e7b34e2 100644 --- a/doc/controllers/payment-profiles.md +++ b/doc/controllers/payment-profiles.md @@ -136,7 +136,7 @@ print(result) # List Payment Profiles -Lists 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. ```python def list_payment_profiles(self, @@ -462,7 +462,7 @@ print(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. ```python def delete_unused_payment_profile(self, @@ -505,9 +505,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). ```python def delete_subscriptions_payment_profile(self, diff --git a/doc/controllers/product-families.md b/doc/controllers/product-families.md index 068643e2..af0fe4f1 100644 --- a/doc/controllers/product-families.md +++ b/doc/controllers/product-families.md @@ -180,7 +180,7 @@ print(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). diff --git a/doc/controllers/products.md b/doc/controllers/products.md index eef246b9..a9d7706b 100644 --- a/doc/controllers/products.md +++ b/doc/controllers/products.md @@ -20,13 +20,13 @@ products_controller = client.products # Create Product -Creates a product in your Advanced Billing site. +Creates a product in your site. 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. -See the following product documentation for more information: +For more information, see: -+ [Products Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Products-Overview) ++ [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) ```python diff --git a/doc/controllers/proforma-invoices.md b/doc/controllers/proforma-invoices.md index 5981aa21..3575c6ab 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. diff --git a/doc/controllers/reason-codes.md b/doc/controllers/reason-codes.md index e17c9b23..c1223bae 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). ```python def create_reason_code(self, diff --git a/doc/controllers/referral-codes.md b/doc/controllers/referral-codes.md index fe69bef8..24c94dfb 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. ```python def validate_referral_code(self, diff --git a/doc/controllers/sites.md b/doc/controllers/sites.md index 1af79049..708eb40e 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). ```python def read_site(self) diff --git a/doc/controllers/subscription-components.md b/doc/controllers/subscription-components.md index bc60b30f..f31c4130 100644 --- a/doc/controllers/subscription-components.md +++ b/doc/controllers/subscription-components.md @@ -1323,13 +1323,13 @@ print(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. ```python def activate_event_based_component(self, @@ -1436,21 +1436,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 @@ -1504,7 +1498,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. diff --git a/doc/controllers/subscription-groups.md b/doc/controllers/subscription-groups.md index 705b5385..2169dd94 100644 --- a/doc/controllers/subscription-groups.md +++ b/doc/controllers/subscription-groups.md @@ -317,9 +317,9 @@ print(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": { @@ -473,7 +473,7 @@ print(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. ```python def find_subscription_group(self, @@ -524,9 +524,9 @@ print(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": { diff --git a/doc/controllers/subscription-notes.md b/doc/controllers/subscription-notes.md index afc3d8ca..474407bf 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. ```python def create_subscription_note(self, diff --git a/doc/controllers/subscription-products.md b/doc/controllers/subscription-products.md index 626ab985..c4bf7627 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-status.md b/doc/controllers/subscription-status.md index 6fcb2505..ec13da92 100644 --- a/doc/controllers/subscription-status.md +++ b/doc/controllers/subscription-status.md @@ -1353,26 +1353,26 @@ print(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. ```python def preview_renewal(self, diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md index a7b16ebc..3ae880a8 100644 --- a/doc/controllers/subscriptions.md +++ b/doc/controllers/subscriptions.md @@ -882,7 +882,7 @@ print(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. @@ -1017,9 +1017,9 @@ 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 @@ -1039,21 +1039,21 @@ This functionality is supported in the API, but is not currently supported in SD ## 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. ```python def preview_subscription(self, @@ -1429,7 +1429,7 @@ print(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). ```python def remove_coupon_from_subscription(self, @@ -1478,16 +1478,14 @@ print(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 @@ -1519,8 +1517,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. ```python def activate_subscription(self, diff --git a/doc/models/containers/event-event-specific-data.md b/doc/models/containers/event-event-specific-data.md index c4686347..f6b117fc 100644 --- a/doc/models/containers/event-event-specific-data.md +++ b/doc/models/containers/event-event-specific-data.md @@ -3,14 +3,13 @@ ## Data Type -`SubscriptionProductChange | SubscriptionProductChangeScheduled | SubscriptionStateChange | PaymentRelatedEvents | RefundSuccess | ComponentAllocationChange | MeteredUsage | PrepaidUsage | DunningStepReached | InvoiceIssued | PendingCancellationChange | PrepaidSubscriptionBalanceChanged | ProformaInvoiceIssued | SubscriptionGroupSignupEventData | CreditAccountBalanceChanged | PrepaymentAccountBalanceChanged | PaymentCollectionMethodChanged | ItemPricePointChanged | CustomFieldValueChange | ChjsTokenizationSuccess | ChjsTokenizationFailure` +`SubscriptionProductChange | SubscriptionStateChange | PaymentRelatedEvents | RefundSuccess | ComponentAllocationChange | MeteredUsage | PrepaidUsage | DunningStepReached | InvoiceIssued | PendingCancellationChange | PrepaidSubscriptionBalanceChanged | ProformaInvoiceIssued | SubscriptionGroupSignupEventData | CreditAccountBalanceChanged | PrepaymentAccountBalanceChanged | PaymentCollectionMethodChanged | ItemPricePointChanged | CustomFieldValueChange | ChjsTokenizationSuccess | ChjsTokenizationFailure` ## Cases | Type | | --- | | [`SubscriptionProductChange`](../../../doc/models/subscription-product-change.md) | -| [`SubscriptionProductChangeScheduled`](../../../doc/models/subscription-product-change-scheduled.md) | | [`SubscriptionStateChange`](../../../doc/models/subscription-state-change.md) | | [`PaymentRelatedEvents`](../../../doc/models/payment-related-events.md) | | [`RefundSuccess`](../../../doc/models/refund-success.md) | @@ -44,19 +43,6 @@ value = SubscriptionProductChange( ) ``` -## SubscriptionProductChangeScheduled - -### Initialization Code - -#### Example - -```python -value = SubscriptionProductChangeScheduled( - previous_product_id=62, - new_product_id=52 -) -``` - ## SubscriptionStateChange ### Initialization Code diff --git a/doc/models/event-response.md b/doc/models/event-response.md index d8ce2036..df40941e 100644 --- a/doc/models/event-response.md +++ b/doc/models/event-response.md @@ -31,7 +31,10 @@ event_response = EventResponse( created_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), event_specific_data=SubscriptionProductChange( previous_product_id=126, - new_product_id=12 + new_product_id=12, + previous_product_price_point_id=250, + new_product_price_point_id=244, + effective_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') ) ) ) diff --git a/doc/models/event.md b/doc/models/event.md index bb49a68e..6c68af50 100644 --- a/doc/models/event.md +++ b/doc/models/event.md @@ -15,7 +15,7 @@ | `subscription_id` | `int` | Required | - | | `customer_id` | `int` | Required | - | | `created_at` | `datetime` | Required | - | -| `event_specific_data` | [Subscription Product Change](../../doc/models/subscription-product-change.md) \| [Subscription Product Change Scheduled](../../doc/models/subscription-product-change-scheduled.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) \| None | Required | This is a container for one-of cases. | +| `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) \| None | Required | This is a container for one-of cases. | ## Example @@ -35,7 +35,10 @@ event = Event( created_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z'), event_specific_data=SubscriptionProductChange( previous_product_id=126, - new_product_id=12 + new_product_id=12, + previous_product_price_point_id=250, + new_product_price_point_id=244, + effective_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') ) ) ``` diff --git a/doc/models/subscription-product-change-scheduled.md b/doc/models/subscription-product-change-scheduled.md deleted file mode 100644 index 32746959..00000000 --- a/doc/models/subscription-product-change-scheduled.md +++ /dev/null @@ -1,33 +0,0 @@ - -# Subscription Product Change Scheduled - -## Structure - -`SubscriptionProductChangeScheduled` - -## Fields - -| Name | Type | Tags | Description | -| --- | --- | --- | --- | -| `previous_product_id` | `int` | Required | - | -| `new_product_id` | `int` | Required | - | -| `previous_product_price_point_id` | `int` | Optional | - | -| `new_product_price_point_id` | `int` | Optional | - | -| `effective_at` | `datetime` | Optional | When the scheduled product change takes effect (the subscription's next renewal). | - -## Example - -```python -import dateutil.parser - -from advancedbilling.models.subscription_product_change_scheduled import SubscriptionProductChangeScheduled - -subscription_product_change_scheduled = SubscriptionProductChangeScheduled( - previous_product_id=50, - new_product_id=64, - previous_product_price_point_id=174, - new_product_price_point_id=168, - effective_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') -) -``` - diff --git a/doc/models/subscription-product-change.md b/doc/models/subscription-product-change.md index 6d8dd3e2..bb877b79 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,15 +13,23 @@ | --- | --- | --- | --- | | `previous_product_id` | `int` | Required | - | | `new_product_id` | `int` | Required | - | +| `previous_product_price_point_id` | `int` | Optional | - | +| `new_product_price_point_id` | `int` | 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 ```python +import dateutil.parser + from advancedbilling.models.subscription_product_change import SubscriptionProductChange subscription_product_change = SubscriptionProductChange( previous_product_id=250, - new_product_id=120 + new_product_id=120, + previous_product_price_point_id=118, + new_product_price_point_id=112, + effective_at=dateutil.parser.parse('2016-03-13T12:52:32.123Z') ) ``` From b8bf686c59e834608dab8a0e76ac99281e092189 Mon Sep 17 00:00:00 2001 From: lucassus Date: Thu, 13 Aug 2026 14:21:52 +0000 Subject: [PATCH 4/4] Automated commit message --- advancedbilling/models/q_scope.py | 3 --- advancedbilling/models/subscription_list_include.py | 3 --- doc/models/q-scope.md | 3 +-- doc/models/subscription-list-include.md | 3 +-- 4 files changed, 2 insertions(+), 10 deletions(-) diff --git a/advancedbilling/models/q_scope.py b/advancedbilling/models/q_scope.py index 227597aa..0d0e9894 100644 --- a/advancedbilling/models/q_scope.py +++ b/advancedbilling/models/q_scope.py @@ -16,7 +16,6 @@ class QScope(object): ORGANIZATION: The enum member of type str. CUSTOMER_REFERENCE: The enum member of type str. SUBSCRIPTION_REFERENCE: The enum member of type str. - LAST_FOUR: The enum member of type str. additional_properties (Dict[str, object]): The additional properties for the model. @@ -34,8 +33,6 @@ class QScope(object): SUBSCRIPTION_REFERENCE = "subscription_reference" - LAST_FOUR = "last_four" - @classmethod def from_value(cls, value, default=None): """Return the matching enum value for the given input.""" diff --git a/advancedbilling/models/subscription_list_include.py b/advancedbilling/models/subscription_list_include.py index b179a958..8d92b01e 100644 --- a/advancedbilling/models/subscription_list_include.py +++ b/advancedbilling/models/subscription_list_include.py @@ -13,7 +13,6 @@ class SubscriptionListInclude(object): SELF_SERVICE_PAGE_TOKEN: The enum member of type str. CURRENT_ACCOUNT_BALANCE_IN_CENTS: The enum member of type str. CURRENT_BILLING_AMOUNT: The enum member of type str. - THREE_DS_ACTION_LINK: The enum member of type str. COUPONS: The enum member of type str. additional_properties (Dict[str, object]): The additional properties for the model. @@ -26,8 +25,6 @@ class SubscriptionListInclude(object): CURRENT_BILLING_AMOUNT = "current_billing_amount" - THREE_DS_ACTION_LINK = "three_ds_action_link" - COUPONS = "coupons" @classmethod diff --git a/doc/models/q-scope.md b/doc/models/q-scope.md index 9a9faa19..2f8facd6 100644 --- a/doc/models/q-scope.md +++ b/doc/models/q-scope.md @@ -15,13 +15,12 @@ | `ORGANIZATION` | | `CUSTOMER_REFERENCE` | | `SUBSCRIPTION_REFERENCE` | -| `LAST_FOUR` | ## Example ```python from advancedbilling.models.q_scope import QScope -q_scope = QScope.SUBSCRIPTION_REFERENCE +q_scope = QScope.LAST_NAME ``` diff --git a/doc/models/subscription-list-include.md b/doc/models/subscription-list-include.md index ba2da5c9..349ef3ac 100644 --- a/doc/models/subscription-list-include.md +++ b/doc/models/subscription-list-include.md @@ -12,7 +12,6 @@ | `SELF_SERVICE_PAGE_TOKEN` | | `CURRENT_ACCOUNT_BALANCE_IN_CENTS` | | `CURRENT_BILLING_AMOUNT` | -| `THREE_DS_ACTION_LINK` | | `COUPONS` | ## Example @@ -20,6 +19,6 @@ ```python from advancedbilling.models.subscription_list_include import SubscriptionListInclude -subscription_list_include = SubscriptionListInclude.THREE_DS_ACTION_LINK +subscription_list_include = SubscriptionListInclude.SELF_SERVICE_PAGE_TOKEN ```